diff --git a/Jakefile.js b/Jakefile.js index 288472a697b..b62cbed3279 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -108,17 +108,6 @@ var serverCoreSources = [ return path.join(serverDirectory, f); }); -var scriptSources = [ - "tslint/booleanTriviaRule.ts", - "tslint/nextLineRule.ts", - "tslint/noNullRule.ts", - "tslint/preferConstRule.ts", - "tslint/typeOperatorSpacingRule.ts", - "tslint/noInOperatorRule.ts" -].map(function (f) { - return path.join(scriptsDirectory, f); -}); - var serverSources = serverCoreSources.concat(servicesSources); var languageServiceLibrarySources = [ @@ -878,7 +867,8 @@ var tslintRules = ([ "preferConstRule", "booleanTriviaRule", "typeOperatorSpacingRule", - "noInOperatorRule" + "noInOperatorRule", + "noIncrementDecrementRule" ]); var tslintRulesFiles = tslintRules.map(function(p) { return path.join(tslintRuleDir, p + ".ts"); @@ -921,11 +911,20 @@ function lintFileAsync(options, path, cb) { }); } +var servicesLintTargets = [ + "navigateTo.ts", + "outliningElementsCollector.ts", + "patternMatcher.ts", + "services.ts", + "shims.ts", +].map(function (s) { + return path.join(servicesDirectory, s); +}); var lintTargets = compilerSources .concat(harnessCoreSources) .concat(serverCoreSources) - .concat(scriptSources) - .concat([path.join(servicesDirectory, "services.ts")]); + .concat(tslintRulesFiles) + .concat(servicesLintTargets); desc("Runs tslint on the compiler sources"); task("lint", ["build-rules"], function() { diff --git a/doc/TypeScript Language Specification (Change Markup).docx b/doc/TypeScript Language Specification (Change Markup).docx index 24e7d1b623a..1db9f4e5908 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).docx and b/doc/TypeScript Language Specification (Change Markup).docx differ diff --git a/doc/TypeScript Language Specification (Change Markup).pdf b/doc/TypeScript Language Specification (Change Markup).pdf index 1b4faab62e1..3403ba90217 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).pdf and b/doc/TypeScript Language Specification (Change Markup).pdf differ diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx index 4eb94908b57..78c86917551 100644 Binary files a/doc/TypeScript Language Specification.docx and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/TypeScript Language Specification.pdf b/doc/TypeScript Language Specification.pdf index 277fcecf2de..07069f6d3a0 100644 Binary files a/doc/TypeScript Language Specification.pdf and b/doc/TypeScript Language Specification.pdf differ diff --git a/doc/images/image1.png b/doc/images/image1.png new file mode 100644 index 00000000000..e1db88fa4f8 Binary files /dev/null and b/doc/images/image1.png differ diff --git a/doc/images/image2.png b/doc/images/image2.png new file mode 100644 index 00000000000..c0321038057 Binary files /dev/null and b/doc/images/image2.png differ diff --git a/doc/images/image3.png b/doc/images/image3.png new file mode 100644 index 00000000000..5fe2ecb8f3e Binary files /dev/null and b/doc/images/image3.png differ diff --git a/doc/images/image4.png b/doc/images/image4.png new file mode 100644 index 00000000000..13a6d8fcfb6 Binary files /dev/null and b/doc/images/image4.png differ diff --git a/doc/spec.md b/doc/spec.md index a7947b19926..30de2c5a6b6 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -1,8 +1,8 @@ # TypeScript Language Specification -Version 1.6 +Version 1.8 -August, 2015 +January, 2016
@@ -58,8 +58,8 @@ TypeScript is a trademark of Microsoft Corporation. * [3.6 Type Parameters](#3.6) * [3.6.1 Type Parameter Lists](#3.6.1) * [3.6.2 Type Argument Lists](#3.6.2) + * [3.6.3 This-types](#3.6.3) * [3.7 Named Types](#3.7) - * [3.7.1 Instance Types](#3.7.1) * [3.8 Specifying Types](#3.8) * [3.8.1 Predefined Types](#3.8.1) * [3.8.2 Type References](#3.8.2) @@ -71,6 +71,7 @@ TypeScript is a trademark of Microsoft Corporation. * [3.8.8 Function Type Literals](#3.8.8) * [3.8.9 Constructor Type Literals](#3.8.9) * [3.8.10 Type Queries](#3.8.10) + * [3.8.11 This-Type References](#3.8.11) * [3.9 Specifying Members](#3.9) * [3.9.1 Property Signatures](#3.9.1) * [3.9.2 Call Signatures](#3.9.2) @@ -158,7 +159,8 @@ TypeScript is a trademark of Microsoft Corporation. * [6.5 Generic Functions](#6.5) * [6.6 Code Generation](#6.6) * [6.7 Generator Functions](#6.7) - * [6.8 Type Guard Functions](#6.8) + * [6.8 Asynchronous Functions](#6.8) + * [6.9 Type Guard Functions](#6.9) * [7 Interfaces](#7) * [7.1 Interface Declarations](#7.1) * [7.2 Declaration Merging](#7.2) @@ -184,9 +186,10 @@ TypeScript is a trademark of Microsoft Corporation. * [8.4.3 Member Accessor Declarations](#8.4.3) * [8.4.4 Dynamic Property Declarations](#8.4.4) * [8.5 Index Member Declarations](#8.5) - * [8.6 Code Generation](#8.6) - * [8.6.1 Classes Without Extends Clauses](#8.6.1) - * [8.6.2 Classes With Extends Clauses](#8.6.2) + * [8.6 Decorators](#8.6) + * [8.7 Code Generation](#8.7) + * [8.7.1 Classes Without Extends Clauses](#8.7.1) + * [8.7.2 Classes With Extends Clauses](#8.7.2) * [9 Enums](#9) * [9.1 Enum Declarations](#9.1) * [9.2 Enum Members](#9.2) @@ -238,9 +241,9 @@ TypeScript is a trademark of Microsoft Corporation. JavaScript applications such as web e-mail, maps, document editing, and collaboration tools are becoming an increasingly important part of the everyday computing. We designed TypeScript to meet the needs of the JavaScript programming teams that build and maintain large JavaScript programs. TypeScript helps programming teams to define interfaces between software components and to gain insight into the behavior of existing JavaScript libraries. TypeScript also enables teams to reduce naming conflicts by organizing their code into dynamically-loadable modules. TypeScript's optional type system enables JavaScript programmers to use highly-productive development tools and practices: static checking, symbol-based navigation, statement completion, and code re-factoring. -TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of ECMAScript 6 (ES6) syntax. Every JavaScript program is also a TypeScript program. The TypeScript compiler performs only file-local transformations on TypeScript programs and does not re-order variables declared in TypeScript. This leads to JavaScript output that closely matches the TypeScript input. TypeScript does not transform variable names, making tractable the direct debugging of emitted JavaScript. TypeScript optionally provides source maps, enabling source-level debugging. TypeScript tools typically emit JavaScript upon file save, preserving the test, edit, refresh cycle commonly used in JavaScript development. +TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of ECMAScript 2015 (ES2015) syntax. Every JavaScript program is also a TypeScript program. The TypeScript compiler performs only file-local transformations on TypeScript programs and does not re-order variables declared in TypeScript. This leads to JavaScript output that closely matches the TypeScript input. TypeScript does not transform variable names, making tractable the direct debugging of emitted JavaScript. TypeScript optionally provides source maps, enabling source-level debugging. TypeScript tools typically emit JavaScript upon file save, preserving the test, edit, refresh cycle commonly used in JavaScript development. -TypeScript syntax includes all features of ECMAScript 6 (ES6), including classes and modules, and provides the ability to translate these features into ECMAScript 3 or 5 compliant code. +TypeScript syntax includes all features of ECMAScript 2015, including classes and modules, and provides the ability to translate these features into ECMAScript 3 or 5 compliant code. Classes enable programmers to express common object-oriented patterns in a standard way, making features like inheritance more readable and interoperable. Modules enable programmers to organize their code into components while avoiding naming conflicts. The TypeScript compiler provides module code generation options that support either static or dynamic loading of module contents. @@ -262,7 +265,7 @@ function f() { To benefit from this inference, a programmer can use the TypeScript language service. For example, a code editor can incorporate the TypeScript language service and use the service to find the members of a string object as in the following screen shot. -/ +  ![](images/image1.png) In this example, the programmer benefits from type inference without providing type annotations. Some beneficial tools, however, do require the programmer to provide type annotations. In TypeScript, we can express a parameter requirement as in the following code fragment. @@ -410,7 +413,7 @@ This signature denotes that a function may be passed as the parameter of the '$' A typical client would not need to add any additional typing but could just use a community-supplied typing to discover (through statement completion with documentation tips) and verify (through static checking) correct use of the library, as in the following screen shot. -/ +  ![](images/image2.png) Section [3.3](#3.3) provides additional information about object types. @@ -474,7 +477,7 @@ Section [4.23](#4.23) provides additional information about contextually typed e ## 1.6 Classes -JavaScript practice has two very common design patterns: the module pattern and the class pattern. Roughly speaking, the module pattern uses closures to hide names and to encapsulate private data, while the class pattern uses prototype chains to implement many variations on object-oriented inheritance mechanisms. Libraries such as 'prototype.js' are typical of this practice. TypeScript's namespaces are a formalization of the module pattern. (The term "module pattern" is somewhat unfortunate now that ECMAScript 6 formally supports modules in a manner different from what the module pattern prescribes. For this reason, TypeScript uses the term "namespace" for its formalization of the module pattern.) +JavaScript practice has two very common design patterns: the module pattern and the class pattern. Roughly speaking, the module pattern uses closures to hide names and to encapsulate private data, while the class pattern uses prototype chains to implement many variations on object-oriented inheritance mechanisms. Libraries such as 'prototype.js' are typical of this practice. TypeScript's namespaces are a formalization of the module pattern. (The term "module pattern" is somewhat unfortunate now that ECMAScript 2015 formally supports modules in a manner different from what the module pattern prescribes. For this reason, TypeScript uses the term "namespace" for its formalization of the module pattern.) This section and the namespace section below will show how TypeScript emits consistent, idiomatic JavaScript when emitting ECMAScript 3 or 5 compliant code for classes and namespaces. The goal of TypeScript's translation is to emit exactly what a programmer would type when implementing a class or namespace unaided by a tool. This section will also describe how TypeScript infers a type for each class declaration. We'll start with a simple BankAccount class. @@ -627,7 +630,7 @@ An important goal of TypeScript is to provide accurate and straightforward types JavaScript programming interfaces often include functions whose behavior is discriminated by a string constant passed to the function. The Document Object Model makes heavy use of this pattern. For example, the following screen shot shows that the 'createElement' method of the 'document' object has multiple signatures, some of which identify the types returned when specific strings are passed into the method. -/ +  ![](images/image3.png) The following code fragment uses this feature. Because the 'span' variable is inferred to have the type 'HTMLSpanElement', the code can reference without static error the 'isMultiline' property of 'span'. @@ -638,7 +641,7 @@ span.isMultiLine = false; // OK: HTMLSpanElement has isMultiline property In the following screen shot, a programming tool combines information from overloading on string parameters with contextual typing to infer that the type of the variable 'e' is 'MouseEvent' and that therefore 'e' has a 'clientX' property. -/ +  ![](images/image4.png) Section [3.9.2.4](#3.9.2.4) provides details on how to use string literals in function signatures. @@ -773,13 +776,13 @@ In this case, the compiler assumes that the namespace object resides in global v ## 1.11 Modules -TypeScript also supports ECMAScript 6 modules, which are files that contain top-level *export* and *import* directives. For this type of module the TypeScript compiler can emit both ECMAScript 6 compliant code and down-level ECMAScript 3 or 5 compliant code for a variety of module loading systems, including CommonJS, Asynchronous Module Definition (AMD), and Universal Module Definition (UMD). +TypeScript also supports ECMAScript 2015 modules, which are files that contain top-level *export* and *import* directives. For this type of module the TypeScript compiler can emit both ECMAScript 2015 compliant code and down-level ECMAScript 3 or 5 compliant code for a variety of module loading systems, including CommonJS, Asynchronous Module Definition (AMD), and Universal Module Definition (UMD).
#
2 Basic Concepts -The remainder of this document is the formal specification of the TypeScript programming language and is intended to be read as an adjunct to the [ECMAScript Language Specification](http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) (specifically, the ECMA-262 Standard, 6th Edition). This document describes the syntactic grammar added by TypeScript along with the compile-time processing and type checking performed by the TypeScript compiler, but it only minimally discusses the run-time behavior of programs since that is covered by the ECMAScript specification. +The remainder of this document is the formal specification of the TypeScript programming language and is intended to be read as an adjunct to the [ECMAScript 2015 Language Specification](http://www.ecma-international.org/ecma-262/6.0/) (specifically, the ECMA-262 Standard, 6th Edition). This document describes the syntactic grammar added by TypeScript along with the compile-time processing and type checking performed by the TypeScript compiler, but it only minimally discusses the run-time behavior of programs since that is covered by the ECMAScript specification. ## 2.1 Grammar Conventions @@ -866,7 +869,7 @@ A property name can be any identifier (including a reserved word), a string lite ### 2.2.3 Computed Property Names -ECMAScript 6 permits object literals and classes to declare members with computed property names. A computed property name specifies an expression that computes the actual property name at run-time. Because the final property name isn't known at compile-time, TypeScript can only perform limited checks for entities declared with computed property names. However, a subset of computed property names known as ***well-known symbols*** can be used anywhere a *PropertyName* is expected, including property names within types. A computed property name is a well-known symbol if it is of the form +ECMAScript 2015 permits object literals and classes to declare members with computed property names. A computed property name specifies an expression that computes the actual property name at run-time. Because the final property name isn't known at compile-time, TypeScript can only perform limited checks for entities declared with computed property names. However, a subset of computed property names known as ***well-known symbols*** can be used anywhere a *PropertyName* is expected, including property names within types. A computed property name is a well-known symbol if it is of the form ```TypeScript [ Symbol . xxx ] @@ -884,6 +887,8 @@ interface Iterable { } ``` +*TODO: Update to reflect treatment of [computed property names with literal expressions](https://github.com/Microsoft/TypeScript/pull/5535)*. + ## 2.3 Declarations Declarations introduce names in their associated ***declaration spaces***. A name must be unique in its declaration space and can denote a ***value***, a ***type***, or a ***namespace***, or some combination thereof. Effectively, a single name can have as many as three distinct meanings. For example: @@ -913,7 +918,7 @@ Declarations introduce the following meanings for the name they declare: * A variable, parameter, function, generator, member variable, member function, member accessor, or enum member declaration introduces a value meaning. * An interface, type alias, or type parameter declaration introduces a type meaning. -* A class declaration introduces a value meaning (the constructor function) and a type meaning (the class instance type). +* A class declaration introduces a value meaning (the constructor function) and a type meaning (the class type). * An enum declaration introduces a value meaning (the enum instance) and a type meaning (the enum type). * A namespace declaration introduces a namespace meaning (the type and namespace container) and, if the namespace is instantiated (section [10.1](#10.1)), a value meaning (the namespace instance). * An import or export declaration introduces the meaning(s) of the imported or exported entity. @@ -996,7 +1001,9 @@ When an identifier is resolved as a *TypeName* (section [3.8.2](#3.8.2)), only n When an identifier is resolved as a *NamespaceName* (section [3.8.2](#3.8.2)), only names in scope with a namespace meaning are considered and other names are ignored. -Note that class members are never directly in scope—they can only be accessed by applying the dot ('.') operator to a class instance. This even includes members of the current instance in a constructor or member function, which are accessed by applying the dot operator to `this`. +*TODO: [Include specific rules for alias resolution](https://github.com/Microsoft/TypeScript/issues/3158)*. + +Note that class and interface members are never directly in scope—they can only be accessed by applying the dot ('.') operator to a class or interface instance. This even includes members of the current instance in a constructor or member function, which are accessed by applying the dot operator to `this`. As the rules above imply, locally declared entities in a namespace are closer in scope than exported entities declared in other namespace declarations for the same namespace. For example: @@ -1121,7 +1128,7 @@ var c = abc.charAt(2); // Property of String interface The Symbol primitive type corresponds to the similarly named JavaScript primitive type and represents unique tokens that may be used as keys for object properties. -The `symbol` keyword references the Symbol primitive type. Symbol values are obtained using the global object 'Symbol' which has a number of methods and properties and can be invoked as a function. In particular, the global object 'Symbol' defines a number of well-known symbols ([2.2.3](#2.2.3)) that can be used in a manner similar to identifiers. Note that the 'Symbol' object is available only in ECMAScript 6 environments. +The `symbol` keyword references the Symbol primitive type. Symbol values are obtained using the global object 'Symbol' which has a number of methods and properties and can be invoked as a function. In particular, the global object 'Symbol' defines a number of well-known symbols ([2.2.3](#2.2.3)) that can be used in a manner similar to identifiers. Note that the 'Symbol' object is available only in ECMAScript 2015 environments. For purposes of determining type relationships (section [3.11](#3.11)) and accessing properties (section [4.13](#4.13)), the Symbol primitive type behaves as an object type with the same properties as the global interface type 'Symbol'. @@ -1186,6 +1193,8 @@ Specialized signatures (section [3.9.2.4](#3.9.2.4)) permit string literals to b All string literal types are subtypes of the String primitive type. +*TODO: Update to reflect [expanded support for string literal types](https://github.com/Microsoft/TypeScript/pull/5185)*. + ## 3.3 Object Types Object types are composed from properties, call signatures, construct signatures, and index signatures, collectively called members. @@ -1352,7 +1361,7 @@ var b = x.b; // b has type number var c = x.c; // Error, no property c in union type ``` -Note that 'x.a' has a union type because the type of 'a' is different in 'A' and 'B', whereas 'x.b' simply has type number because that is the type of 'b' in both 'A' and 'B'. Also note that there is no property 'x.c' because only 'A' has a property 'c'. +Note that 'x.a' has a union type because the type of 'a' is different in 'A' and 'B', whereas 'x.b' simply has type number because that is the type of 'b' in both 'A' and 'B'. Also note that there is no property 'x.c' because only 'B' has a property 'c'. When used as a contextual type (section [4.23](#4.23)), a union type has those members that are present in any of its constituent types, with types that are unions of the respective members in the constituent types. Specifically, a union type used as a contextual type has the apparent members defined in section [3.11.1](#3.11.1), except that a particular member need only be present in one or more constituent types instead of all constituent types. @@ -1437,7 +1446,7 @@ Type parameter names must be unique. A compile-time error occurs if two or more The scope of a type parameter extends over the entire declaration with which the type parameter list is associated, with the exception of static member declarations in classes. -Each type parameter has an associated type parameter ***constraint*** that establishes an upper bound for type arguments. Omitting a constraint or specifying type `any` as the constraint corresponds to specifying the empty object type `{}`. Type parameters declared in a particular type parameter list may not be referenced in constraints in that type parameter list. +A type parameter may have an associated type parameter ***constraint*** that establishes an upper bound for type arguments. Type parameters may be referenced in type parameter constraints within the same type parameter list, including even constraint declarations that occur to the left of the type parameter. The ***base constraint*** of a type parameter *T* is defined as follows: @@ -1448,15 +1457,21 @@ The ***base constraint*** of a type parameter *T* is defined as follows: In the example ```TypeScript -interface G { - f(x: V): V; -} +interface G { } ``` -the base constraint of 'T' is the empty object type, and the base constraint of 'U' and 'V' is 'Function'. +the base constraint of 'T' is the empty object type and the base constraint of 'U' and 'V' is 'Function'. For purposes of determining type relationships (section [3.11](#3.11)), type parameters appear to be subtypes of their base constraint. Likewise, in property accesses (section [4.13](#4.13)), `new` operations (section [4.14](#4.14)), and function calls (section [4.15](#4.15)), type parameters appear to have the members of their base constraint, but no other members. +It is an error for a type parameter to directly or indirectly be a constraint for itself. For example, both of the following declarations are invalid: + +```TypeScript +interface A { } + +interface B { } +``` + ### 3.6.2 Type Argument Lists A type reference (section [3.8.2](#3.8.2)) to a generic type must include a list of type arguments enclosed in angle brackets and separated by commas. Similarly, a call (section [4.15](#4.15)) to a generic function may explicitly include a type argument list instead of relying on type inference. @@ -1471,7 +1486,7 @@ A type reference (section [3.8.2](#3.8.2)) to a generic type must include a list   *TypeArgument:*    *Type* -Type arguments correspond one-to-one with type parameters of the generic type or function being referenced. A type argument list is required to specify exactly one type argument for each corresponding type parameter, and each type argument is required to ***satisfy*** the constraint of its corresponding type parameter. A type argument satisfies a type parameter constraint if the type argument is assignable to (section [3.11.4](#3.11.4)) the constraint type once type arguments are substituted for type parameters. +Type arguments correspond one-to-one with type parameters of the generic type or function being referenced. A type argument list is required to specify exactly one type argument for each corresponding type parameter, and each type argument for a constrained type parameter is required to ***satisfy*** the constraint of that type parameter. A type argument satisfies a type parameter constraint if the type argument is assignable to (section [3.11.4](#3.11.4)) the constraint type once type arguments are substituted for type parameters. Given the declaration @@ -1483,6 +1498,33 @@ a type reference of the form 'G<A, B>' places no requirements on 'A' but requ The process of substituting type arguments for type parameters in a generic type or generic signature is known as ***instantiating*** the generic type or signature. Instantiation of a generic type or signature can fail if the supplied type arguments do not satisfy the constraints of their corresponding type parameters. +### 3.6.3 This-types + +Every class and interface has a ***this-type*** that represents the actual type of instances of the class or interface within the declaration of the class or interface. The this-type is referenced using the keyword `this` in a type position. Within instance methods and constructors of a class, the type of the expression `this` (section [4.2](#4.2)) is the this-type of the class. + +Classes and interfaces support inheritance and therefore the instance represented by `this` in a method isn't necessarily an instance of the containing class—it may in fact be an instance of a derived class or interface. To model this relationship, the this-type of a class or interface is classified as a type parameter. Unlike other type parameters, it is not possible to explicitly pass a type argument for a this-type. Instead, in a type reference to a class or interface type, the type reference *itself* is implicitly passed as a type argument for the this-type. For example: + +```TypeScript +class A { + foo() { + return this; + } +} + +class B extends A { + bar() { + return this; + } +} + +let b: B; +let x = b.foo().bar(); // Fluent pattern works, type of x is B +``` + +In the declaration of `b` above, the type reference `B` is itself passed as a type argument for B's this-type. Thus, the referenced type is an instantiation of class `B` where all occurrences of the type `this` are replaced with `B`, and for that reason the `foo` method of `B` actually returns `B` (as opposed to `A`). + +The this-type of a given class or interface type *C* implicitly has a constraint consisting of a type reference to *C* with *C*'s own type parameters passed as type arguments and with that type reference passed as the type argument for the this-type. + ## 3.7 Named Types Classes, interfaces, enums, and type aliases are ***named types*** that are introduced through class declarations (section [8.1](#8.1)), interface declarations (section [7.1](#7.1)), enum declarations ([9.1](#9.1)), and type alias declarations (section [3.10](#3.10)). Classes, interfaces, and type aliases may have type parameters and are then called ***generic types***. Conversely, named types without type parameters are called ***non-generic types***. @@ -1511,21 +1553,6 @@ is indistinguishable from the type { first: string; second: Entity; } ``` -### 3.7.1 Instance Types - -Each class and interface has an associated actual type known as the ***instance type***. For a non-generic class or interface, the instance type is simply a type reference to the class or interface. For a generic class or interface, the instance type is an instantiation of the generic type where each of the type arguments is the corresponding type parameter. Since the instance type uses the type parameters it can be used only where the type parameters are in scope—that is, inside the declaration of the class or interface. Within the constructor and instance member functions of a class, the type of `this` is the instance type of the class. - -The following example illustrates the concept of an instance type: - -```TypeScript -class G { // Introduce type parameter T - self: G; // Use T as type argument to form instance type - f() { - this.self = this; // self and this are both of type G - } -} -``` - ## 3.8 Specifying Types Types are specified either by referencing their keyword or name, or by writing object type literals, array type literals, tuple type literals, function type literals, constructor type literals, or type queries. @@ -1550,7 +1577,8 @@ Types are specified either by referencing their keyword or name, or by writing o    *ObjectType*    *ArrayType*    *TupleType* -   *TypeQuery* +   *TypeQuery* +   *ThisType*   *ParenthesizedType:*    `(` *Type* `)` @@ -1711,7 +1739,7 @@ A union type literal is written as a sequence of types separated by vertical bar   *UnionType:*    *UnionOrIntersectionOrPrimaryType* `|` *IntersectionOrPrimaryType* -A union typle literal references a union type (section [3.4](#3.4)). +A union type literal references a union type (section [3.4](#3.4)). ### 3.8.7 Intersection Type Literals @@ -1720,7 +1748,7 @@ An intersection type literal is written as a sequence of types separated by ampe   *IntersectionType:*    *IntersectionOrPrimaryType* `&` *PrimaryType* -An intersection typle literal references an intersection type (section [3.5](#3.5)). +An intersection type literal references an intersection type (section [3.5](#3.5)). ### 3.8.8 Function Type Literals @@ -1804,6 +1832,41 @@ var h: () => typeof h; Here, 'g' and 'g.x' have the same recursive type, and likewise 'h' and 'h()' have the same recursive type. +### 3.8.11 This-Type References + +The `this` keyword is used to reference the this-type (section [3.6.3](#3.6.3)) of a class or interface. + +  *ThisType:* +   `this` + +The meaning of a *ThisType* depends on the closest enclosing *FunctionDeclaration*, *FunctionExpression*, *PropertyDefinition*, *ClassElement*, or *TypeMember*, known as the root declaration of the *ThisType*, as follows: + +* When the root declaration is an instance member or constructor of a class, the *ThisType* references the this-type of that class. +* When the root declaration is a member of an interface type, the *ThisType* references the this-type of that interface. +* Otherwise, the *ThisType* is an error. + +Note that in order to avoid ambiguities it is not possible to reference the this-type of a class or interface in a nested object type literal. In the example + +```TypeScript +interface ListItem { + getHead(): this; + getTail(): this; + getHeadAndTail(): { head: this, tail: this }; // Error +} +``` + +the `this` references on the last line are in error because their root declarations are not members of a class or interface. The recommended way to reference the this-type of an outer class or interface in an object type literal is to declare an intermediate generic type and pass `this` as a type argument. For example: + +```TypeScript +type HeadAndTail = { head: T, tail: T }; + +interface ListItem { + getHead(): this; + getTail(): this; + getHeadAndTail(): HeadAndTail; +} +``` + ## 3.9 Specifying Members The members of an object type literal (section [3.8.3](#3.8.3)) are specified as a combination of property, call, construct, index, and method signatures. @@ -1931,6 +1994,8 @@ A parameter can be marked optional by following its name or binding pattern with *TODO: Update to reflect [binding parameter cannot be optional in implementation signature](https://github.com/Microsoft/TypeScript/issues/2797)*. +*TODO: Update to reflect [required parameters support initializers](https://github.com/Microsoft/TypeScript/pull/4022)*. + #### 3.9.2.3 Return Type If present, a call signature's return type annotation specifies the type of the value computed and returned by a call operation. A `void` return type annotation is used to indicate that a function has no return value. @@ -2122,8 +2187,9 @@ Types in TypeScript have identity, subtype, supertype, and assignment compatibil The ***apparent members*** of a type are the members observed in subtype, supertype, and assignment compatibility relationships, as well as in the type checking of property accesses (section [4.13](#4.13)), `new` operations (section [4.14](#4.14)), and function calls (section [4.15](#4.15)). The apparent members of a type are determined as follows: -* The apparent members of the primitive types Number, Boolean, and String are the apparent members of the global interface types 'Number', 'Boolean', and 'String' respectively. -* The apparent members of an enum type are the apparent members of the global interface type 'Number'. +* The apparent members of the primitive type Number and all enum types are the apparent members of the global interface type 'Number'. +* The apparent members of the primitive type Boolean are the apparent members of the global interface type 'Boolean'. +* The apparent members of the primitive type String and all string literal types are the apparent members of the global interface type 'String'. * The apparent members of a type parameter are the apparent members of the constraint (section [3.6.1](#3.6.1)) of that type parameter. * The apparent members of an object type *T* are the combination of the following: * The declared and/or inherited members of *T*. @@ -2239,7 +2305,7 @@ Types are required to be assignment compatible in certain circumstances, such as * *S* or *T* is the Any type. * *S* is the Undefined type. * *S* is the Null type and *T* is not the Undefined type. -* *S* or *T* is an enum type and* *the other is the primitive type Number. +* *S* or *T* is an enum type and the other is the primitive type Number. * *S* is a string literal type and *T* is the primitive type String. * *S* is a union type and each constituent type of *S* is assignable to *T*. * *S* is an intersection type and at least one constituent type of *S* is assignable to *T*. @@ -2258,8 +2324,8 @@ Types are required to be assignment compatible in certain circumstances, such as * *M* has a rest parameter or the number of non-optional parameters in *N* is less than or equal to the total number of parameters in *M*, * for parameter positions that are present in both signatures, each parameter type in *N* is assignable to or from the corresponding parameter type in *M*, and * the result type of *M* is Void, or the result type of *N* is assignable to that of *M*. - * *M* is a string index signature of type *U* and *S* has an apparent string index signature of a type that is assignable to *U*. - * *M* is a numeric index signature of type *U* and *S* has an apparent string or numeric index signature of a type that is assignable to *U*. + * *M* is a string index signature of type *U*, and *U* is the Any type or *S* has an apparent string index signature of a type that is assignable to *U*. + * *M* is a numeric index signature of type *U*, and *U* is the Any type or *S* has an apparent string or numeric index signature of a type that is assignable to *U*. When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. @@ -2366,6 +2432,8 @@ In certain contexts, inferences for a given set of type parameters are made *fro When comparing call or construct signatures, signatures in *S* correspond to signatures of the same kind in *T* pairwise in declaration order. If *S* and *T* have different numbers of a given kind of signature, the excess *first* signatures in declaration order of the longer list are ignored. +*TODO: Update to reflect [improved union and intersection type inference](https://github.com/Microsoft/TypeScript/pull/5738)*. + ### 3.11.8 Recursive Types Classes and interfaces can reference themselves in their internal structure, in effect creating recursive types with infinite nesting. For example, the type @@ -2443,7 +2511,7 @@ Expressions are classified as ***values*** or ***references***. References are t The type of `this` in an expression depends on the location in which the reference takes place: -* In a constructor, instance member function, instance member accessor, or instance member variable initializer, `this` is of the class instance type of the containing class. +* In a constructor, instance member function, instance member accessor, or instance member variable initializer, `this` is of the this-type (section [3.6.3](#3.6.3)) of the containing class. * In a static member function or static member accessor, the type of `this` is the constructor function type of the containing class. * In a function declaration or a function expression, `this` is of type Any. * In the global namespace, `this` is of type Any. @@ -2569,6 +2637,8 @@ The resulting type an array literal expression is determined as follows: A spread element must specify an expression of an array-like type (section [3.3.2](#3.3.2)), or otherwise an error occurs. +*TODO: The compiler currently doesn't support applying the spread operator to a string (to spread the individual characters of a string into a string array). This will eventually be allowed, but only when the code generation target is ECMAScript 2015 or later*. + *TODO: Document spreading an [iterator](https://github.com/Microsoft/TypeScript/pull/2498) into an array literal*. The rules above mean that an array literal is always of an array type, unless it is contextually typed by a tuple-like type. For example @@ -2619,7 +2689,7 @@ A super call invokes the constructor of the base class on the instance reference The type of a super call expression is Void. -The JavaScript code generated for a super call is specified in section [8.6.2](#8.6.2). +The JavaScript code generated for a super call is specified in section [8.7.2](#8.7.2). ### 4.9.2 Super Property Access @@ -2632,7 +2702,7 @@ Super property accesses are not permitted in other contexts, and it is not possi Super property accesses are typically used to access overridden base class member functions from derived class member functions. For an example of this, see section [8.4.2](#8.4.2). -The JavaScript code generated for a super property access is specified in section [8.6.2](#8.6.2). +The JavaScript code generated for a super property access is specified in section [8.7.2](#8.7.2). *TODO: Update section to include [bracket notation in super property access](https://github.com/Microsoft/TypeScript/issues/3970)*. @@ -2777,7 +2847,7 @@ object . name where *object* is an expression and *name* is an identifier (including, possibly, a reserved word), is used to access the property with the given name on the given object. A dot notation property access is processed as follows at compile-time: * If *object* is of type Any, any *name* is permitted and the property access is of type Any. -* Otherwise, if *name* denotes an accessible apparent property (section [3.11.1](#3.11.1)) in the type of *object*, the property access is of the type of that property. Public members are always accessible, but private and protected members of a class have restricted accessibility, as described in [8.2.2](#8.2.2). +* Otherwise, if *name* denotes an accessible apparent property (section [3.11.1](#3.11.1)) in the widened type (section [3.12](#3.12)) of *object*, the property access is of the type of that property. Public members are always accessible, but private and protected members of a class have restricted accessibility, as described in [8.2.2](#8.2.2). * Otherwise, the property access is invalid and a compile-time error occurs. A bracket notation property access of the form @@ -2892,7 +2962,7 @@ Given a signature < *T1* , *T2* , … , *Tn* Type argument inference produces a set of candidate types for each type parameter. Given a type parameter *T* and set of candidate types, the actual inferred type argument is determined as follows: * If the set of candidate argument types is empty, the inferred type argument for *T* is *T*'s constraint. -* Otherwise, if at least one of the candidate types is a supertype of all of the other candidate types, let *C* denote the first such candidate type. If *C* satisfies *T*'s constraint, the inferred type argument for *T* is *C*. Otherwise, the inferred type argument for *T* is *T*'s constraint. +* Otherwise, if at least one of the candidate types is a supertype of all of the other candidate types, let *C* denote the widened form (section [3.12](#3.12)) of the first such candidate type. If *C* satisfies *T*'s constraint, the inferred type argument for *T* is *C*. Otherwise, the inferred type argument for *T* is *T*'s constraint. * Otherwise, if no candidate type is a supertype of all of the other candidate types, type inference has fails and no type argument is inferred for *T*. In order to compute candidate types, the argument list is processed as follows: @@ -3030,6 +3100,8 @@ if (shape instanceof Circle) { } ``` +*TODO: Document [as operator](https://github.com/Microsoft/TypeScript/pull/3564)*. + ## 4.17 JSX Expressions *TODO: Document [JSX expressions](https://github.com/Microsoft/TypeScript/issues/3203)*. @@ -3106,6 +3178,8 @@ These operators require their operands to be of type Any, the Number primitive t |String|||||| |Other|||||| +*TODO: Document the [exponentation operator](https://github.com/Microsoft/TypeScript/issues/4812)*. + ### 4.19.2 The + operator The binary + operator requires both operands to be of the Number primitive type or an enum type, or at least one of the operands to be of type Any or the String primitive type. Operands of an enum type are treated as having the primitive type Number. If one operand is the `null` or `undefined` value, it is treated as having the type of the other operand. If both operands are of the Number primitive type, the result is of the Number primitive type. If one or both operands are of the String primitive type, the result is of the String primitive type. Otherwise, the result is of type Any. @@ -3218,7 +3292,7 @@ is subject to the same requirements, and produces a value of the same type, as t ### 4.21.1 Destructuring Assignment -A ***destructuring assignment*** is an assignment operation in which the left hand operand is a destructuring assignment pattern as defined by the *AssignmentPattern* production in the ECMAScript 6 specification. +A ***destructuring assignment*** is an assignment operation in which the left hand operand is a destructuring assignment pattern as defined by the *AssignmentPattern* production in the ECMAScript 2015 specification. In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. An expression of type *S* is considered assignable to an assignment target *V* if one of the following is true: @@ -3233,9 +3307,11 @@ In a destructuring assignment expression, the type of the expression on the righ * *S* is a tuple-like type (section [3.3.3](#3.3.3)) with a property named *N* of a type that is assignable to the target given in *E*, where *N* is the numeric index of *E* in the array assignment pattern, or * *S* is not a tuple-like type and the numeric index signature type of *S* is assignable to the target given in *E*. +*TODO: [Update to specify behavior when assignment element E is a rest element](https://github.com/Microsoft/TypeScript/issues/2713)*. + In an assignment property or element that includes a default value, the type of the default value must be assignable to the target given in the assignment property or element. -When the output target is ECMAScript 6 or higher, destructuring variable assignments remain unchanged in the emitted JavaScript code. When the output target is ECMAScript 3 or 5, destructuring variable assignments are rewritten to series of simple assignments. For example, the destructuring assignment +When the output target is ECMAScript 2015 or higher, destructuring variable assignments remain unchanged in the emitted JavaScript code. When the output target is ECMAScript 3 or 5, destructuring variable assignments are rewritten to series of simple assignments. For example, the destructuring assignment ```TypeScript var x = 1; @@ -3360,6 +3436,8 @@ In the rules above, when a narrowing operation would remove all constituent type Note that type guards affect types of variables and parameters only and have no effect on members of objects such as properties. Also note that it is possible to defeat a type guard by calling a function that changes the type of the guarded variable. +*TODO: Document [user defined type guard functions](https://github.com/Microsoft/TypeScript/issues/1007)*. + In the example ```TypeScript @@ -3432,7 +3510,7 @@ This chapter describes the static type checking TypeScript provides for JavaScri ## 5.1 Blocks -Blocks are extended to include local interface, type alias, and enum declarations (classes are already included by the ECMAScript 6 grammar). +Blocks are extended to include local interface, type alias, and enum declarations (classes are already included by the ECMAScript 2015 grammar).   *Declaration:* *( Modified )*    … @@ -3549,7 +3627,9 @@ The type *T* associated with a binding element is determined as follows: When a destructuring variable declaration, binding property, or binding element specifies an initializer expression, the type of the initializer expression is required to be assignable to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -When the output target is ECMAScript 6 or higher, except for removing the optional type annotation, destructuring variable declarations remain unchanged in the emitted JavaScript code. +*TODO: Update rules to reflect [improved checking of destructuring with literal initializers](https://github.com/Microsoft/TypeScript/pull/4598)*. + +When the output target is ECMAScript 2015 or higher, except for removing the optional type annotation, destructuring variable declarations remain unchanged in the emitted JavaScript code. When the output target is ECMAScript 3 or 5, destructuring variable declarations are rewritten to simple variable declarations. For example, an object destructuring declaration of the form @@ -3855,7 +3935,7 @@ The type of local introduced in a destructuring parameter declaration is determi * Otherwise, if the parameter is a rest parameter, *T* is `any[]`. * Otherwise, *T* is `any`. -When the output target is ECMAScript 6 or higher, except for removing the optional type annotation, destructuring parameter declarations remain unchanged in the emitted JavaScript code. When the output target is ECMAScript 3 or 5, destructuring parameter declarations are rewritten to local variable declarations. +When the output target is ECMAScript 2015 or higher, except for removing the optional type annotation, destructuring parameter declarations remain unchanged in the emitted JavaScript code. When the output target is ECMAScript 3 or 5, destructuring parameter declarations are rewritten to local variable declarations. The example @@ -3965,9 +4045,13 @@ where *Parameter* is the parameter name and *Default* is the default value expre *TODO: Document [generator functions](https://github.com/Microsoft/TypeScript/issues/2873)*. -## 6.8 Type Guard Functions +## 6.8 Asynchronous Functions -*TODO: Document [type guard functions](https://github.com/Microsoft/TypeScript/issues/1007)*. +*TODO: Document [asynchronous functions](https://github.com/Microsoft/TypeScript/issues/1664)*. + +## 6.9 Type Guard Functions + +*TODO: Document [type guard functions](https://github.com/Microsoft/TypeScript/issues/1007), including [this type predicates](https://github.com/Microsoft/TypeScript/pull/5906)*.
@@ -4016,7 +4100,7 @@ The following constraints must be satisfied by an interface declaration or other * An interface cannot declare a property with the same name as an inherited private or protected property. * Inherited properties with the same name must be identical (section [3.11.2](#3.11.2)). * All properties of the interface must satisfy the constraints implied by the index signatures of the interface as specified in section [3.9.4](#3.9.4). -* The instance type (section [3.7.1](#3.7.1)) of the declared interface must be assignable (section [3.11.4](#3.11.4)) to each of the base type references. +* The this-type (section [3.6.3](#3.6.3)) of the declared interface must be assignable (section [3.11.4](#3.11.4)) to each of the base type references. An interface is permitted to inherit identical members from multiple base types and will in that case only contain one occurrence of each particular member. @@ -4090,6 +4174,8 @@ interface Document { Note that the members of the last interface declaration appear first in the merged declaration. Also note that the relative order of members declared in the same interface body is preserved. +*TODO: Document [class and interface declaration merging](https://github.com/Microsoft/TypeScript/pull/3333)*. + ##
7.3 Interfaces Extending Classes When an interface type extends a class type it inherits the members of the class but not their implementations. It is as if the interface had declared all of the members of the class without providing an implementation. Interfaces inherit even the private and protected members of a base class. When a class containing private or protected members is the base type of an interface type, that interface type can only be implemented by that class or a descendant class. For example: @@ -4193,13 +4279,13 @@ var Point: { }; ``` -The context in which a class is referenced distinguishes between the class instance type and the constructor function. For example, in the assignment statement +The context in which a class is referenced distinguishes between the class type and the constructor function. For example, in the assignment statement ```TypeScript var p: Point = new Point(10, 20); ``` -the identifier 'Point' in the type annotation refers to the class instance type, whereas the identifier 'Point' in the `new` expression refers to the constructor function object. +the identifier 'Point' in the type annotation refers to the class type, whereas the identifier 'Point' in the `new` expression refers to the constructor function object. ### 8.1.1 Class Heritage Specification @@ -4225,7 +4311,7 @@ The following constraints must be satisfied by the class heritage specification * If present, the type reference specified in the `extends` clause must denote a class type. Furthermore, the *TypeName* part of the type reference is required to be a reference to the class constructor function when evaluated as an expression. * A class declaration may not, directly or indirectly, specify a base class that originates in the same declaration. In other words a class cannot, directly or indirectly, be a base class of itself, regardless of type arguments. -* The instance type (section [3.7.1](#3.7.1)) of the declared class must be assignable (section [3.11.4](#3.11.4)) to the base type reference and each of the type references listed in the `implements` clause. +* The this-type (section [3.6.3](#3.6.3)) of the declared class must be assignable (section [3.11.4](#3.11.4)) to the base type reference and each of the type references listed in the `implements` clause. * The constructor function type created by the class declaration must be assignable to the base class constructor function type, ignoring construct signatures. The following example illustrates a situation in which the first rule above would be violated: @@ -4266,7 +4352,7 @@ The members of a class consist of the members introduced through member declarat Members are either ***instance members*** or ***static members***. -Instance members are members of the class type (section [8.2.4](#8.2.4)) and its associated instance type. Within constructors, instance member functions, and instance member accessors, the type of `this` is the instance type (section [3.7.1](#3.7.1)) of the class. +Instance members are members of the class type (section [8.2.4](#8.2.4)) and its associated this-type. Within constructors, instance member functions, and instance member accessors, the type of `this` is the this-type (section [3.6.3](#3.6.3)) of the class. Static members are declared using the `static` modifier and are members of the constructor function type (section [8.2.5](#8.2.5)). Within static member functions and static member accessors, the type of `this` is the constructor function type. @@ -4280,7 +4366,7 @@ Public property members can be accessed everywhere without restrictions. Private property members can be accessed only within their declaring class. Specifically, a private member *M* declared in a class *C* can be accessed only within the class body of *C*. -Protected property members can be accessed only within their declaring class and classes derived from their declaring class, and a protected instance property member must be accessed *through* an instance of the enclosing class. Specifically, a protected member *M* declared in a class *C* can be accessed only within the class body of *C* or the class body of a class derived from *C*. Furthermore, when a protected instance member *M* is accessed in a property access *E*`.`*M* within the body of a class *D*, the type of *E* is required to be *D* or a type that directly or indirectly has *D* as a base type, regardless of type arguments. +Protected property members can be accessed only within their declaring class and classes derived from their declaring class, and a protected instance property member must be accessed *through* an instance of the enclosing class or a subclass thereof. Specifically, a protected member *M* declared in a class *C* can be accessed only within the class body of *C* or the class body of a class derived from *C*. Furthermore, when a protected instance member *M* is accessed in a property access *E*`.`*M* within the body of a class *D*, the type of *E* is required to be *D* or a type that directly or indirectly has *D* as a base type, regardless of type arguments. Private and protected accessibility is enforced only at compile-time and serves as no more than an *indication of intent*. Since JavaScript provides no mechanism to create private and protected properties on an object, it is not possible to enforce the private and protected modifiers in dynamic code at run-time. For example, private and protected accessibility can be defeated by changing an object's static type to Any and accessing the member dynamically. @@ -4326,14 +4412,14 @@ An index member in a derived class is said to override an index member in a base ### 8.2.4 Class Types -A class declaration declares a new named type (section [3.7](#3.7)) called a class type. Within the constructor and member functions of a class, the type of `this` is the instance type (section [3.7.1](#3.7.1)) of this class type. The class type has the following members: +A class declaration declares a new named type (section [3.7](#3.7)) called a class type. Within the constructor and instance member functions of a class, the type of `this` is the this-type (section [3.6.3](#3.6.3)) of that class type. The class type has the following members: * A property for each instance member variable declaration in the class body. * A property of a function type for each instance member function declaration in the class body. * A property for each uniquely named instance member accessor declaration in the class body. * A property for each constructor parameter declared with a `public`, `private`, or `protected` modifier. * An index signature for each instance index member declaration in the class body. -* All base class instance type property or index members that are not overridden in the class. +* All base class instance property or index members that are not overridden in the class. All instance property members (including those that are private or protected) of a class must satisfy the constraints implied by the index members of the class as specified in section [3.9.4](#3.9.4). @@ -4353,7 +4439,7 @@ class B extends A { } ``` -the instance type of 'A' is +the class type of 'A' is equivalent to ```TypeScript interface A { @@ -4363,7 +4449,7 @@ interface A { } ``` -and the instance type of 'B' is +and the class type of 'B' is equivalent to ```TypeScript interface B { @@ -4374,16 +4460,16 @@ interface B { } ``` -Note that static declarations in a class do not contribute to the class type and its instance type—rather, static declarations introduce properties on the constructor function object. Also note that the declaration of 'g' in 'B' overrides the member inherited from 'A'. +Note that static declarations in a class do not contribute to the class type—rather, static declarations introduce properties on the constructor function object. Also note that the declaration of 'g' in 'B' overrides the member inherited from 'A'. ### 8.2.5 Constructor Function Types The type of the constructor function introduced by a class declaration is called the constructor function type. The constructor function type has the following members: -* If the class contains no constructor declaration and has no base class, a single construct signature with no parameters, having the same type parameters as the class and returning the instance type of the class. -* If the class contains no constructor declaration and has a base class, a set of construct signatures with the same parameters as those of the base class constructor function type following substitution of type parameters with the type arguments specified in the base class type reference, all having the same type parameters as the class and returning the instance type of the class. -* If the class contains a constructor declaration with no overloads, a construct signature with the parameter list of the constructor implementation, having the same type parameters as the class and returning the instance type of the class. -* If the class contains a constructor declaration with overloads, a set of construct signatures with the parameter lists of the overloads, all having the same type parameters as the class and returning the instance type of the class. +* If the class contains no constructor declaration and has no base class, a single construct signature with no parameters, having the same type parameters as the class (if any) and returning an instantiation of the class type with those type parameters passed as type arguments. +* If the class contains no constructor declaration and has a base class, a set of construct signatures with the same parameters as those of the base class constructor function type following substitution of type parameters with the type arguments specified in the base class type reference, all having the same type parameters as the class (if any) and returning an instantiation of the class type with those type parameters passed as type arguments. +* If the class contains a constructor declaration with no overloads, a construct signature with the parameter list of the constructor implementation, having the same type parameters as the class (if any) and returning an instantiation of the class type with those type parameters passed as type arguments. +* If the class contains a constructor declaration with overloads, a set of construct signatures with the parameter lists of the overloads, all having the same type parameters as the class (if any) and returning an instantiation of the class type with those type parameters passed as type arguments. * A property for each static member variable declaration in the class body. * A property of a function type for each static member function declaration in the class body. * A property for each uniquely named static member accessor declaration in the class body. @@ -4428,7 +4514,7 @@ var TwoArrays: { } ``` -Note that the construct signatures in the constructor function types have the same type parameters as their class and return the instance type of their class. Also note that when a derived class doesn't declare a constructor, type arguments from the base class reference are substituted before construct signatures are propagated from the base constructor function type to the derived constructor function type. +Note that each construct signature in the constructor function types has the same type parameters as its class and returns an instantiation of its class with those type parameters passed as type arguments. Also note that when a derived class doesn't declare a constructor, type arguments from the base class reference are substituted before construct signatures are propagated from the base constructor function type to the derived constructor function type. ## 8.3 Constructor Declarations @@ -4446,7 +4532,7 @@ When a class has constructor overloads, the overloads determine the construct si When a class has both constructor overloads and a constructor implementation, the overloads must precede the implementation and all of the declarations must be consecutive with no intervening grammatical elements. -The function body of a constructor is permitted to contain return statements. If return statements specify expressions, those expressions must be of types that are assignable to the instance type of the class. +The function body of a constructor is permitted to contain return statements. If return statements specify expressions, those expressions must be of types that are assignable to the this-type (section [3.6.3](#3.6.3)) of the class. The type parameters of a generic class are in scope and accessible in a constructor declaration. @@ -4478,6 +4564,8 @@ class Point { } ``` +A parameter property declaration may declare an optional parameter (by including a question mark or a default value), but the property introduced by such a declaration is always considered a required property (section [3.3.6](#3.3.6)). + ### 8.3.2 Super Calls Super calls (section [4.9.1](#4.9.1)) are used to call the constructor of the base class. A super call consists of the keyword `super` followed by an argument list enclosed in parentheses. For example: @@ -4524,7 +4612,7 @@ Property member declarations can be member variable declarations, member functio    *MemberFunctionDeclaration*    *MemberAccessorDeclaration* -Member declarations without a `static` modifier are called instance member declarations. Instance property member declarations declare properties in the class instance type (section [8.2.4](#8.2.4)), and must specify names that are unique among all instance property member and parameter property declarations in the containing class, with the exception that instance get and set accessor declarations may pairwise specify the same name. +Member declarations without a `static` modifier are called instance member declarations. Instance property member declarations declare properties in the class type (section [8.2.4](#8.2.4)), and must specify names that are unique among all instance property member and parameter property declarations in the containing class, with the exception that instance get and set accessor declarations may pairwise specify the same name. Member declarations with a `static` modifier are called static member declarations. Static property member declarations declare properties in the constructor function type (section [8.2.5](#8.2.5)), and must specify names that are unique among all static property member declarations in the containing class, with the exception that static get and set accessor declarations may pairwise specify the same name. @@ -4549,7 +4637,7 @@ class Point { } ``` -The class instance type 'Point' has the members: +The class type 'Point' has the members: ```TypeScript interface Point { @@ -4578,7 +4666,7 @@ A member variable declaration declares an instance member variable or a static m The type associated with a member variable declaration is determined in the same manner as an ordinary variable declaration (see section [5.2](#5.2)). -An instance member variable declaration introduces a member in the class instance type and optionally initializes a property on instances of the class. Initializers in instance member variable declarations are executed once for every new instance of the class and are equivalent to assignments to properties of `this` in the constructor. In an initializer expression for an instance member variable, `this` is of the class instance type. +An instance member variable declaration introduces a member in the class type and optionally initializes a property on instances of the class. Initializers in instance member variable declarations are executed once for every new instance of the class and are equivalent to assignments to properties of `this` in the constructor. In an initializer expression for an instance member variable, `this` is of the this-type (section [3.6.3](#3.6.3)) of the class. A static member variable declaration introduces a property in the constructor function type and optionally initializes a property on the constructor function object. Initializers in static member variable declarations are executed once when the containing script or module is loaded. @@ -4625,7 +4713,7 @@ A member function declaration is processed in the same manner as an ordinary fun All declarations for the same member function must specify the same accessibility (public, private, or protected) and kind (instance or static). -An instance member function declaration declares a property in the class instance type and assigns a function object to a property on the prototype object of the class. In the body of an instance member function declaration, `this` is of the class instance type. +An instance member function declaration declares a property in the class type and assigns a function object to a property on the prototype object of the class. In the body of an instance member function declaration, `this` is of the this-type (section [3.6.3](#3.6.3)) of the class. A static member function declaration declares a property in the constructor function type and assigns a function object to a property on the constructor function object. In the body of a static member function declaration, the type of `this` is the constructor function type. @@ -4691,23 +4779,23 @@ Get and set accessors are processed in the same manner as in an object literal ( Accessors for the same member name must specify the same accessibility. -An instance member accessor declaration declares a property in the class instance type and defines a property on the prototype object of the class with a get or set accessor. In the body of an instance member accessor declaration, `this` is of the class instance type. +An instance member accessor declaration declares a property in the class type and defines a property on the prototype object of the class with a get or set accessor. In the body of an instance member accessor declaration, `this` is of the this-type (section [3.6.3](#3.6.3)) of the class. A static member accessor declaration declares a property in the constructor function type and defines a property on the constructor function object of the class with a get or set accessor. In the body of a static member accessor declaration, the type of `this` is the constructor function type. -Get and set accessors are emitted as calls to 'Object.defineProperty' in the generated JavaScript, as described in section [8.6.1](#8.6.1). +Get and set accessors are emitted as calls to 'Object.defineProperty' in the generated JavaScript, as described in section [8.7.1](#8.7.1). ### 8.4.4 Dynamic Property Declarations If the *PropertyName* of a property member declaration is a computed property name that doesn't denote a well-known symbol ([2.2.3](#2.2.3)), the construct is considered a ***dynamic property declaration***. The following rules apply to dynamic property declarations: -* A dynamic property declaration does not introduce a property in the class instance type or constructor function type. +* A dynamic property declaration does not introduce a property in the class type or constructor function type. * The property name expression of a dynamic property assignment must be of type Any or the String, Number, or Symbol primitive type. * The name associated with a dynamic property declarations is considered to be a numeric property name if the property name expression is of type Any or the Number primitive type. ## 8.5 Index Member Declarations -An index member declaration introduces an index signature (section [3.9.4](#3.9.4)) in the class instance type. +An index member declaration introduces an index signature (section [3.9.4](#3.9.4)) in the class type.   *IndexMemberDeclaration:*    *IndexSignature* `;` @@ -4720,11 +4808,15 @@ It is not possible to declare index members for the static side of a class. Note that it is seldom meaningful to include a string index signature in a class because it constrains all instance properties of the class. However, numeric index signatures can be useful to control the element type when a class is used in an array-like manner. -## 8.6 Code Generation +## 8.6 Decorators -When the output target is ECMAScript 6 or higher, type parameters, implements clauses, accessibility modifiers, and member variable declarations are removed in the emitted code, but otherwise class declarations are emitted as written. When the output target is ECMAScript 3 or 5, more comprehensive rewrites are performed, as described in this section. +*TODO: Document [decorators](https://github.com/Microsoft/TypeScript/issues/2249)*. -### 8.6.1 Classes Without Extends Clauses +## 8.7 Code Generation + +When the output target is ECMAScript 2015 or higher, type parameters, implements clauses, accessibility modifiers, and member variable declarations are removed in the emitted code, but otherwise class declarations are emitted as written. When the output target is ECMAScript 3 or 5, more comprehensive rewrites are performed, as described in this section. + +### 8.7.1 Classes Without Extends Clauses A class with no `extends` clause generates JavaScript equivalent to the following: @@ -4828,7 +4920,7 @@ where *MemberName* is the name of the member accessor, *GetAccessorStatements* i where *MemberName* is the name of the static variable, and *InitializerExpression* is the code generated for the initializer expression. -### 8.6.2 Classes With Extends Clauses +### 8.7.2 Classes With Extends Clauses A class with an `extends` clause generates JavaScript equivalent to the following: @@ -5396,7 +5488,7 @@ This copies a reference to the entity into a property on the namespace instance. # 11 Scripts and Modules -TypeScript implements support for ECMAScript 6 modules and supports down-level code generation targeting CommonJS, AMD, and other module systems. +TypeScript implements support for ECMAScript 2015 modules and supports down-level code generation targeting CommonJS, AMD, and other module systems. ## 11.1 Programs and Source Files @@ -5424,7 +5516,7 @@ When a TypeScript program is compiled, all of the program's source files are pro The TypeScript compiler automatically determines a source file's dependencies and includes those dependencies in the program being compiled. The determination is made from "reference comments" and module import declarations as follows: -* A comment of the form /// <reference path="…"/> adds a dependency on the source file specified in the path argument. The path is resolved relative to the directory of the containing source file. +* A comment of the form /// <reference path="…"/> that occurs before the first token in a source file adds a dependency on the source file specified in the path argument. The path is resolved relative to the directory of the containing source file. * A module import declaration that specifies a relative module name (section [11.3.1](#11.3.1)) resolves the name relative to the directory of the containing source file. If a source file with the resulting path and file extension '.ts' exists, that file is added as a dependency. Otherwise, if a source file with the resulting path and file extension '.d.ts' exists, that file is added as a dependency. * A module import declaration that specifies a top-level module name (section [11.3.1](#11.3.1)) resolves the name in a host dependent manner (typically by resolving the name relative to a module name space root or searching for the name in a series of directories). If a source file with extension '.ts' or '.d.ts' corresponding to the reference is located, that file is added as a dependency. @@ -5539,7 +5631,7 @@ TypeScript supports multiple patterns of JavaScript code generation for modules: * CommonJS. This format is used by server frameworks such as node.js. * AMD (Asynchronous Module Definition). This format is used by asynchronous module loaders such as RequireJS. * UMD (Universal Module Definition). A variation of the AMD format that allows modules to also be loaded by CommonJS loaders. -* System. This format is used to represent ECMAScript 6 semantics with high fidelity in down-level environments. +* System. This format is used to represent ECMAScript 2015 semantics with high fidelity in down-level environments. The desired module code generation pattern is selected through a compiler option and does not affect the TypeScript source code. Indeed, it is possible to author modules that can be compiled for use both on the server side (e.g. using node.js) and on the client side (using an AMD compliant loader) with no changes to the TypeScript source code. @@ -5620,7 +5712,7 @@ An import require declaration of the form import m = require("mod"); ``` -is equivalent to the ECMAScript 6 import declaration +is equivalent to the ECMAScript 2015 import declaration ```TypeScript import * as m from "mod"; @@ -5828,16 +5920,17 @@ The 'main' and 'log' example from section [11.3](#11.3) above generates the foll File main.js: ```TypeScript -var log = require("./log"); -log.message("hello"); +var log_1 = require("./log"); +log_1.message("hello"); ``` File log.js: ```TypeScript -exports.message = function(s) { +function message(s) { console.log(s); -} +} +exports.message = message; ``` A module import declaration is represented in the generated JavaScript as a variable initialized by a call to the 'require' function provided by the module system host. A variable declaration and 'require' call is emitted for a particular imported module only if the imported module, or a local alias (section [10.3](#10.3)) that references the imported module, is referenced as a *PrimaryExpression* somewhere in the body of the importing module. If an imported module is referenced only as a *NamespaceName* or *TypeQueryExpression*, nothing is emitted. @@ -5850,15 +5943,15 @@ File geometry.ts: export interface Point { x: number; y: number }; export function point(x: number, y: number): Point { - return { x: x, y: y }; + return { x, y }; } ``` File game.ts: ```TypeScript -import g = require("./geometry"); -var p = g.point(10, 20); +import * as g from "./geometry"; +let p = g.point(10, 20); ``` The 'game' module references the imported 'geometry' module in an expression (through its alias 'g') and a 'require' call is therefore included in the emitted JavaScript: @@ -5871,8 +5964,8 @@ var p = g.point(10, 20); Had the 'game' module instead been written to only reference 'geometry' in a type position ```TypeScript -import g = require("./geometry"); -var p: g.Point = { x: 10, y: 20 }; +import * as g from "./geometry"; +let p: g.Point = { x: 10, y: 20 }; ``` the emitted JavaScript would have no dependency on the 'geometry' module and would simply be @@ -5890,8 +5983,8 @@ The "main" and "log" example from above generates the following JavaScript code File main.js: ```TypeScript -define(["require", "exports", "./log"], function(require, exports, log) { - log.message("hello"); +define(["require", "exports", "./log"], function(require, exports, log_1) { + log_1.message("hello"); } ``` @@ -5899,9 +5992,10 @@ File log.js: ```TypeScript define(["require", "exports"], function(require, exports) { - exports.message = function(s) { + function message(s) { console.log(s); } + exports.message = message; } ``` @@ -5957,7 +6051,7 @@ Ambient function declarations cannot specify a function bodies and do not permit ### 12.1.3 Ambient Class Declarations -An ambient class declaration declares a class instance type and a constructor function in the containing declaration space. +An ambient class declaration declares a class type and a constructor function in the containing declaration space.   *AmbientClassDeclaration:*    `class` *BindingIdentifier* *TypeParametersopt* *ClassHeritage* `{` *AmbientClassBody* `}` @@ -6057,7 +6151,7 @@ declare module "io" { # A Grammar -This appendix contains a summary of the grammar found in the main document. As described in section [2.1](#2.1), the TypeScript grammar is a superset of the grammar defined in the [ECMAScript Language Specification](http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) (specifically, the ECMA-262 Standard, 6th Edition) and this appendix lists only productions that are new or modified from the ECMAScript grammar. +This appendix contains a summary of the grammar found in the main document. As described in section [2.1](#2.1), the TypeScript grammar is a superset of the grammar defined in the [ECMAScript 2015 Language Specification](http://www.ecma-international.org/ecma-262/6.0/) (specifically, the ECMA-262 Standard, 6th Edition) and this appendix lists only productions that are new or modified from the ECMAScript grammar. ## A.1 Types @@ -6104,7 +6198,8 @@ This appendix contains a summary of the grammar found in the main document. As d    *ObjectType*    *ArrayType*    *TupleType* -   *TypeQuery* +   *TypeQuery* +   *ThisType*   *ParenthesizedType:*    `(` *Type* `)` @@ -6179,6 +6274,9 @@ This appendix contains a summary of the grammar found in the main document. As d    *IdentifierReference*    *TypeQueryExpression* `.` *IdentifierName* +  *ThisType:* +   `this` +   *PropertySignature:*    *PropertyName* `?`*opt* *TypeAnnotationopt* diff --git a/lib/lib.core.es6.d.ts b/lib/lib.core.es6.d.ts index 857f5957a45..0470c4827cd 100644 --- a/lib/lib.core.es6.d.ts +++ b/lib/lib.core.es6.d.ts @@ -3847,7 +3847,7 @@ interface Symbol { /** Returns the primitive value of the specified object. */ valueOf(): Object; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Symbol"; } interface SymbolConstructor { @@ -4405,7 +4405,7 @@ interface IterableIterator extends Iterator { } interface GeneratorFunction extends Function { - + [Symbol.toStringTag]: "GeneratorFunction"; } interface GeneratorFunctionConstructor { @@ -4530,7 +4530,7 @@ interface Math { */ cbrt(x: number): number; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Math"; } interface Date { @@ -4647,7 +4647,7 @@ interface Map { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Map"; } interface MapConstructor { @@ -4664,7 +4664,7 @@ interface WeakMap { get(key: K): V; has(key: K): boolean; set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakMap"; } interface WeakMapConstructor { @@ -4686,7 +4686,7 @@ interface Set { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Set"; } interface SetConstructor { @@ -4702,7 +4702,7 @@ interface WeakSet { clear(): void; delete(value: T): boolean; has(value: T): boolean; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakSet"; } interface WeakSetConstructor { @@ -4714,7 +4714,7 @@ interface WeakSetConstructor { declare var WeakSet: WeakSetConstructor; interface JSON { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "JSON"; } /** @@ -4724,11 +4724,11 @@ interface JSON { * buffer as needed. */ interface ArrayBuffer { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "ArrayBuffer"; } interface DataView { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "DataView"; } /** @@ -4749,6 +4749,7 @@ interface Int8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int8Array"; } interface Int8ArrayConstructor { @@ -4781,6 +4782,7 @@ interface Uint8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "UInt8Array"; } interface Uint8ArrayConstructor { @@ -4816,6 +4818,7 @@ interface Uint8ClampedArray { values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint8ClampedArray"; } interface Uint8ClampedArrayConstructor { @@ -4853,6 +4856,7 @@ interface Int16Array { [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int16Array"; } interface Int16ArrayConstructor { @@ -4885,6 +4889,7 @@ interface Uint16Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint16Array"; } interface Uint16ArrayConstructor { @@ -4917,6 +4922,7 @@ interface Int32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int32Array"; } interface Int32ArrayConstructor { @@ -4949,6 +4955,7 @@ interface Uint32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint32Array"; } interface Uint32ArrayConstructor { @@ -4981,6 +4988,7 @@ interface Float32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float32Array"; } interface Float32ArrayConstructor { @@ -5013,6 +5021,7 @@ interface Float64Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float64Array"; } interface Float64ArrayConstructor { @@ -5064,7 +5073,7 @@ declare namespace Reflect { function isExtensible(target: any): boolean; function ownKeys(target: any): Array; function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; } @@ -5089,7 +5098,7 @@ interface Promise { catch(onrejected?: (reason: any) => T | PromiseLike): Promise; catch(onrejected?: (reason: any) => void): Promise; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Promise"; } interface PromiseConstructor { @@ -5112,7 +5121,16 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved diff --git a/lib/lib.d.ts b/lib/lib.d.ts index fd4c05da220..155d864619e 100644 --- a/lib/lib.d.ts +++ b/lib/lib.d.ts @@ -4362,6 +4362,7 @@ interface AudioContext extends EventTarget { destination: AudioDestinationNode; listener: AudioListener; sampleRate: number; + state: string; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; @@ -6099,6 +6100,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; + currentScript: HTMLScriptElement; adoptNode(source: Node): Node; captureEvents(): void; clear(): void; @@ -6814,6 +6816,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec tagName: string; id: string; className: string; + innerHTML: string; getAttribute(name?: string): string; getAttributeNS(namespaceURI: string, localName: string): string; getAttributeNode(name: string): Attr; @@ -7009,7 +7012,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec removeAttributeNode(oldAttr: Attr): Attr; requestFullscreen(): void; requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; + setAttribute(name: string, value: string): void; setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; setAttributeNode(newAttr: Attr): Attr; setAttributeNodeNS(newAttr: Attr): Attr; @@ -7018,6 +7021,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullScreen(): void; webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -8002,7 +8006,6 @@ interface HTMLElement extends Element { title: string; blur(): void; click(): void; - contains(child: HTMLElement): boolean; dragDrop(): boolean; focus(): void; insertAdjacentElement(position: string, insertedElement: Element): Element; @@ -9552,7 +9555,7 @@ interface HTMLMediaElement extends HTMLElement { * Gets or sets the current playback position, in seconds. */ preload: string; - readyState: any; + readyState: number; /** * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */ @@ -10176,7 +10179,7 @@ interface HTMLSelectElement extends HTMLElement { * Sets or retrieves the name of the object. */ name: string; - options: HTMLSelectElement; + options: HTMLCollection; /** * When present, marks an element that can't be submitted without a value. */ @@ -10209,6 +10212,7 @@ interface HTMLSelectElement extends HTMLElement { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; + selectedOptions: HTMLCollection; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. @@ -10462,19 +10466,19 @@ interface HTMLTableElement extends HTMLElement { /** * Creates an empty caption element in the table. */ - createCaption(): HTMLElement; + createCaption(): HTMLTableCaptionElement; /** * Creates an empty tBody element in the table. */ - createTBody(): HTMLElement; + createTBody(): HTMLTableSectionElement; /** * Creates an empty tFoot element in the table. */ - createTFoot(): HTMLElement; + createTFoot(): HTMLTableSectionElement; /** * Returns the tHead element object if successful, or null otherwise. */ - createTHead(): HTMLElement; + createTHead(): HTMLTableSectionElement; /** * Deletes the caption element and its contents from the table. */ @@ -10496,7 +10500,7 @@ interface HTMLTableElement extends HTMLElement { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; } declare var HTMLTableElement: { @@ -10547,7 +10551,7 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { * Creates a new cell in the table row, and adds the cell to the cells collection. * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ - insertCell(index?: number): HTMLElement; + insertCell(index?: number): HTMLTableCellElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -10574,7 +10578,7 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -10963,7 +10967,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -10988,10 +10992,11 @@ declare var IDBFactory: { } interface IDBIndex { - keyPath: string; + keyPath: string | string[]; name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -11028,7 +11033,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -11112,7 +11117,7 @@ declare var IDBVersionChangeEvent: { } interface ImageData { - data: number[]; + data: Uint8ClampedArray; height: number; width: number; } @@ -11910,6 +11915,7 @@ interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorConte getGamepads(): Gamepad[]; javaEnabled(): boolean; msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + vibrate(pattern: number | number[]): boolean; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -11950,6 +11956,7 @@ interface Node extends EventTarget { normalize(): void; removeChild(oldChild: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; + contains(node: Node): boolean; ATTRIBUTE_NODE: number; CDATA_SECTION_NODE: number; COMMENT_NODE: number; @@ -16613,6 +16620,16 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface NodeListOf extends NodeList { length: number; item(index: number): TNode; @@ -16648,6 +16665,15 @@ interface ProgressEventInit extends EventInit { total?: number; } +interface HTMLTemplateElement extends HTMLElement { + content: DocumentFragment; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index 69014415c15..b2ad2c73df6 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -538,6 +538,7 @@ interface AudioContext extends EventTarget { destination: AudioDestinationNode; listener: AudioListener; sampleRate: number; + state: string; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; @@ -2275,6 +2276,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; + currentScript: HTMLScriptElement; adoptNode(source: Node): Node; captureEvents(): void; clear(): void; @@ -2990,6 +2992,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec tagName: string; id: string; className: string; + innerHTML: string; getAttribute(name?: string): string; getAttributeNS(namespaceURI: string, localName: string): string; getAttributeNode(name: string): Attr; @@ -3185,7 +3188,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec removeAttributeNode(oldAttr: Attr): Attr; requestFullscreen(): void; requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; + setAttribute(name: string, value: string): void; setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; setAttributeNode(newAttr: Attr): Attr; setAttributeNodeNS(newAttr: Attr): Attr; @@ -3194,6 +3197,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullScreen(): void; webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -4178,7 +4182,6 @@ interface HTMLElement extends Element { title: string; blur(): void; click(): void; - contains(child: HTMLElement): boolean; dragDrop(): boolean; focus(): void; insertAdjacentElement(position: string, insertedElement: Element): Element; @@ -5728,7 +5731,7 @@ interface HTMLMediaElement extends HTMLElement { * Gets or sets the current playback position, in seconds. */ preload: string; - readyState: any; + readyState: number; /** * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */ @@ -6352,7 +6355,7 @@ interface HTMLSelectElement extends HTMLElement { * Sets or retrieves the name of the object. */ name: string; - options: HTMLSelectElement; + options: HTMLCollection; /** * When present, marks an element that can't be submitted without a value. */ @@ -6385,6 +6388,7 @@ interface HTMLSelectElement extends HTMLElement { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; + selectedOptions: HTMLCollection; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. @@ -6638,19 +6642,19 @@ interface HTMLTableElement extends HTMLElement { /** * Creates an empty caption element in the table. */ - createCaption(): HTMLElement; + createCaption(): HTMLTableCaptionElement; /** * Creates an empty tBody element in the table. */ - createTBody(): HTMLElement; + createTBody(): HTMLTableSectionElement; /** * Creates an empty tFoot element in the table. */ - createTFoot(): HTMLElement; + createTFoot(): HTMLTableSectionElement; /** * Returns the tHead element object if successful, or null otherwise. */ - createTHead(): HTMLElement; + createTHead(): HTMLTableSectionElement; /** * Deletes the caption element and its contents from the table. */ @@ -6672,7 +6676,7 @@ interface HTMLTableElement extends HTMLElement { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; } declare var HTMLTableElement: { @@ -6723,7 +6727,7 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { * Creates a new cell in the table row, and adds the cell to the cells collection. * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ - insertCell(index?: number): HTMLElement; + insertCell(index?: number): HTMLTableCellElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -6750,7 +6754,7 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -7139,7 +7143,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -7164,10 +7168,11 @@ declare var IDBFactory: { } interface IDBIndex { - keyPath: string; + keyPath: string | string[]; name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -7204,7 +7209,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -7288,7 +7293,7 @@ declare var IDBVersionChangeEvent: { } interface ImageData { - data: number[]; + data: Uint8ClampedArray; height: number; width: number; } @@ -8086,6 +8091,7 @@ interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorConte getGamepads(): Gamepad[]; javaEnabled(): boolean; msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + vibrate(pattern: number | number[]): boolean; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -8126,6 +8132,7 @@ interface Node extends EventTarget { normalize(): void; removeChild(oldChild: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; + contains(node: Node): boolean; ATTRIBUTE_NODE: number; CDATA_SECTION_NODE: number; COMMENT_NODE: number; @@ -12789,6 +12796,16 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface NodeListOf extends NodeList { length: number; item(index: number): TNode; @@ -12824,6 +12841,15 @@ interface ProgressEventInit extends EventInit { total?: number; } +interface HTMLTemplateElement extends HTMLElement { + content: DocumentFragment; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index 564c302031d..ef3399ba804 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -22,7 +22,7 @@ interface Symbol { /** Returns the primitive value of the specified object. */ valueOf(): Object; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Symbol"; } interface SymbolConstructor { @@ -580,7 +580,7 @@ interface IterableIterator extends Iterator { } interface GeneratorFunction extends Function { - + [Symbol.toStringTag]: "GeneratorFunction"; } interface GeneratorFunctionConstructor { @@ -705,7 +705,7 @@ interface Math { */ cbrt(x: number): number; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Math"; } interface Date { @@ -822,7 +822,7 @@ interface Map { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Map"; } interface MapConstructor { @@ -839,7 +839,7 @@ interface WeakMap { get(key: K): V; has(key: K): boolean; set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakMap"; } interface WeakMapConstructor { @@ -861,7 +861,7 @@ interface Set { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Set"; } interface SetConstructor { @@ -877,7 +877,7 @@ interface WeakSet { clear(): void; delete(value: T): boolean; has(value: T): boolean; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakSet"; } interface WeakSetConstructor { @@ -889,7 +889,7 @@ interface WeakSetConstructor { declare var WeakSet: WeakSetConstructor; interface JSON { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "JSON"; } /** @@ -899,11 +899,11 @@ interface JSON { * buffer as needed. */ interface ArrayBuffer { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "ArrayBuffer"; } interface DataView { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "DataView"; } /** @@ -924,6 +924,7 @@ interface Int8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int8Array"; } interface Int8ArrayConstructor { @@ -956,6 +957,7 @@ interface Uint8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "UInt8Array"; } interface Uint8ArrayConstructor { @@ -991,6 +993,7 @@ interface Uint8ClampedArray { values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint8ClampedArray"; } interface Uint8ClampedArrayConstructor { @@ -1028,6 +1031,7 @@ interface Int16Array { [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int16Array"; } interface Int16ArrayConstructor { @@ -1060,6 +1064,7 @@ interface Uint16Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint16Array"; } interface Uint16ArrayConstructor { @@ -1092,6 +1097,7 @@ interface Int32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int32Array"; } interface Int32ArrayConstructor { @@ -1124,6 +1130,7 @@ interface Uint32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint32Array"; } interface Uint32ArrayConstructor { @@ -1156,6 +1163,7 @@ interface Float32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float32Array"; } interface Float32ArrayConstructor { @@ -1188,6 +1196,7 @@ interface Float64Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float64Array"; } interface Float64ArrayConstructor { @@ -1239,7 +1248,7 @@ declare namespace Reflect { function isExtensible(target: any): boolean; function ownKeys(target: any): Array; function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; } @@ -1264,7 +1273,7 @@ interface Promise { catch(onrejected?: (reason: any) => T | PromiseLike): Promise; catch(onrejected?: (reason: any) => void): Promise; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Promise"; } interface PromiseConstructor { @@ -1287,7 +1296,16 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -5677,6 +5695,7 @@ interface AudioContext extends EventTarget { destination: AudioDestinationNode; listener: AudioListener; sampleRate: number; + state: string; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; @@ -7414,6 +7433,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; + currentScript: HTMLScriptElement; adoptNode(source: Node): Node; captureEvents(): void; clear(): void; @@ -8129,6 +8149,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec tagName: string; id: string; className: string; + innerHTML: string; getAttribute(name?: string): string; getAttributeNS(namespaceURI: string, localName: string): string; getAttributeNode(name: string): Attr; @@ -8324,7 +8345,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec removeAttributeNode(oldAttr: Attr): Attr; requestFullscreen(): void; requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; + setAttribute(name: string, value: string): void; setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; setAttributeNode(newAttr: Attr): Attr; setAttributeNodeNS(newAttr: Attr): Attr; @@ -8333,6 +8354,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullScreen(): void; webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; + matches(selector: string): boolean; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -9317,7 +9339,6 @@ interface HTMLElement extends Element { title: string; blur(): void; click(): void; - contains(child: HTMLElement): boolean; dragDrop(): boolean; focus(): void; insertAdjacentElement(position: string, insertedElement: Element): Element; @@ -10867,7 +10888,7 @@ interface HTMLMediaElement extends HTMLElement { * Gets or sets the current playback position, in seconds. */ preload: string; - readyState: any; + readyState: number; /** * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */ @@ -11491,7 +11512,7 @@ interface HTMLSelectElement extends HTMLElement { * Sets or retrieves the name of the object. */ name: string; - options: HTMLSelectElement; + options: HTMLCollection; /** * When present, marks an element that can't be submitted without a value. */ @@ -11524,6 +11545,7 @@ interface HTMLSelectElement extends HTMLElement { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; + selectedOptions: HTMLCollection; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. @@ -11777,19 +11799,19 @@ interface HTMLTableElement extends HTMLElement { /** * Creates an empty caption element in the table. */ - createCaption(): HTMLElement; + createCaption(): HTMLTableCaptionElement; /** * Creates an empty tBody element in the table. */ - createTBody(): HTMLElement; + createTBody(): HTMLTableSectionElement; /** * Creates an empty tFoot element in the table. */ - createTFoot(): HTMLElement; + createTFoot(): HTMLTableSectionElement; /** * Returns the tHead element object if successful, or null otherwise. */ - createTHead(): HTMLElement; + createTHead(): HTMLTableSectionElement; /** * Deletes the caption element and its contents from the table. */ @@ -11811,7 +11833,7 @@ interface HTMLTableElement extends HTMLElement { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; } declare var HTMLTableElement: { @@ -11862,7 +11884,7 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { * Creates a new cell in the table row, and adds the cell to the cells collection. * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ - insertCell(index?: number): HTMLElement; + insertCell(index?: number): HTMLTableCellElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -11889,7 +11911,7 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ - insertRow(index?: number): HTMLElement; + insertRow(index?: number): HTMLTableRowElement; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -12278,7 +12300,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -12303,10 +12325,11 @@ declare var IDBFactory: { } interface IDBIndex { - keyPath: string; + keyPath: string | string[]; name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -12343,7 +12366,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -12427,7 +12450,7 @@ declare var IDBVersionChangeEvent: { } interface ImageData { - data: number[]; + data: Uint8ClampedArray; height: number; width: number; } @@ -13225,6 +13248,7 @@ interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorConte getGamepads(): Gamepad[]; javaEnabled(): boolean; msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + vibrate(pattern: number | number[]): boolean; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -13265,6 +13289,7 @@ interface Node extends EventTarget { normalize(): void; removeChild(oldChild: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; + contains(node: Node): boolean; ATTRIBUTE_NODE: number; CDATA_SECTION_NODE: number; COMMENT_NODE: number; @@ -17928,6 +17953,16 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface NodeListOf extends NodeList { length: number; item(index: number): TNode; @@ -17963,6 +17998,15 @@ interface ProgressEventInit extends EventInit { total?: number; } +interface HTMLTemplateElement extends HTMLElement { + content: DocumentFragment; +} + +declare var HTMLTemplateElement: { + prototype: HTMLTemplateElement; + new(): HTMLTemplateElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts index 7ce06a6b4ac..1138538a1b8 100644 --- a/lib/lib.webworker.d.ts +++ b/lib/lib.webworker.d.ts @@ -528,7 +528,7 @@ interface IDBDatabase extends EventTarget { onerror: (ev: Event) => any; version: string; close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; transaction(storeNames: any, mode?: string): IDBTransaction; addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void; @@ -553,10 +553,11 @@ declare var IDBFactory: { } interface IDBIndex { - keyPath: string; + keyPath: string | string[]; name: string; objectStore: IDBObjectStore; unique: boolean; + multiEntry: boolean; count(key?: any): IDBRequest; get(key: any): IDBRequest; getKey(key: any): IDBRequest; @@ -593,7 +594,7 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -677,7 +678,7 @@ declare var IDBVersionChangeEvent: { } interface ImageData { - data: number[]; + data: Uint8ClampedArray; height: number; width: number; } @@ -1109,6 +1110,16 @@ interface WorkerUtils extends Object, WindowBase64 { setTimeout(handler: any, timeout?: any, ...args: any[]): number; } +interface IDBObjectStoreParameters { + keyPath?: string | string[]; + autoIncrement?: boolean; +} + +interface IDBIndexParameters { + unique?: boolean; + multiEntry?: boolean; +} + interface BlobPropertyBag { type?: string; endings?: string; diff --git a/lib/tsc.js b/lib/tsc.js index 87a413af729..543deadb433 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -247,9 +247,11 @@ var ts; var count = array.length; if (count > 0) { var pos = 0; - var result = arguments.length <= 2 ? array[pos++] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos++; while (pos < count) { - result = f(result, array[pos++]); + result = f(result, array[pos]); + pos++; } return result; } @@ -261,9 +263,11 @@ var ts; if (array) { var pos = array.length - 1; if (pos >= 0) { - var result = arguments.length <= 2 ? array[pos--] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos--; while (pos >= 0) { - result = f(result, array[pos--]); + result = f(result, array[pos]); + pos--; } return result; } @@ -346,6 +350,22 @@ var ts; return result; } ts.arrayToMap = arrayToMap; + function reduceProperties(map, callback, initial) { + var result = initial; + if (map) { + for (var key in map) { + if (hasProperty(map, key)) { + result = callback(result, map[key], String(key)); + } + } + } + return result; + } + ts.reduceProperties = reduceProperties; + function isArray(value) { + return Array.isArray ? Array.isArray(value) : value instanceof Array; + } + ts.isArray = isArray; function memoize(callback) { var value; return function () { @@ -639,7 +659,7 @@ var ts; } ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; function getBaseFileName(path) { - if (!path) { + if (path === undefined) { return undefined; } var i = path.lastIndexOf(ts.directorySeparator); @@ -664,14 +684,19 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); - function isSupportedSourceFileName(fileName) { + ts.supportedTypeScriptExtensions = [".ts", ".tsx", ".d.ts"]; + ts.supportedJavascriptExtensions = [".js", ".jsx"]; + var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); + function getSupportedExtensions(options) { + return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + ts.getSupportedExtensions = getSupportedExtensions; + function isSupportedSourceFileName(fileName, compilerOptions) { if (!fileName) { return false; } - for (var _i = 0, supportedExtensions_1 = ts.supportedExtensions; _i < supportedExtensions_1.length; _i++) { - var extension = supportedExtensions_1[_i]; + for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; } @@ -690,22 +715,6 @@ var ts; return path; } ts.removeFileExtension = removeFileExtension; - var backslashOrDoubleQuote = /[\"\\]/g; - var escapedCharsRegExp = /[\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" - }; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -902,7 +911,6 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _tty = require("tty"); function createWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } @@ -970,9 +978,6 @@ var ts; }; } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } var platform = _os.platform(); var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { @@ -1055,9 +1060,6 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - if (isNode4OrLater()) { - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } @@ -1103,12 +1105,40 @@ var ts; } }; } + function getChakraSystem() { + return { + newLine: ChakraHost.newLine || "\r\n", + args: ChakraHost.args, + useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames, + write: ChakraHost.echo, + readFile: function (path, encoding) { + return ChakraHost.readFile(path); + }, + writeFile: function (path, data, writeByteOrderMark) { + if (writeByteOrderMark) { + data = "\uFEFF" + data; + } + ChakraHost.writeFile(path, data); + }, + resolvePath: ChakraHost.resolvePath, + fileExists: ChakraHost.fileExists, + directoryExists: ChakraHost.directoryExists, + createDirectory: ChakraHost.createDirectory, + getExecutingFilePath: function () { return ChakraHost.executingFile; }, + getCurrentDirectory: function () { return ChakraHost.currentDirectory; }, + readDirectory: ChakraHost.readDirectory, + exit: ChakraHost.quit + }; + } if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { return getNodeSystem(); } + else if (typeof ChakraHost !== "undefined") { + return getChakraSystem(); + } else { return undefined; } @@ -1226,7 +1256,7 @@ var ts; Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers_not_permitted_on_index_signature_members_1145", message: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, - Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_1148", message: "Cannot compile modules unless the '--module' flag is provided." }, + Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_optio_1148", message: "Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, @@ -1313,6 +1343,10 @@ var ts; _0_modifier_cannot_be_used_with_1_modifier: { code: 1243, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_be_used_with_1_modifier_1243", message: "'{0}' modifier cannot be used with '{1}' modifier." }, Abstract_methods_can_only_appear_within_an_abstract_class: { code: 1244, category: ts.DiagnosticCategory.Error, key: "Abstract_methods_can_only_appear_within_an_abstract_class_1244", message: "Abstract methods can only appear within an abstract class." }, Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { code: 1245, category: ts.DiagnosticCategory.Error, key: "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", message: "Method '{0}' cannot have an implementation because it is marked abstract." }, + An_interface_property_cannot_have_an_initializer: { code: 1246, category: ts.DiagnosticCategory.Error, key: "An_interface_property_cannot_have_an_initializer_1246", message: "An interface property cannot have an initializer." }, + A_type_literal_property_cannot_have_an_initializer: { code: 1247, category: ts.DiagnosticCategory.Error, key: "A_type_literal_property_cannot_have_an_initializer_1247", message: "A type literal property cannot have an initializer." }, + A_class_member_cannot_have_the_0_keyword: { code: 1248, category: ts.DiagnosticCategory.Error, key: "A_class_member_cannot_have_the_0_keyword_1248", message: "A class member cannot have the '{0}' keyword." }, + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: { code: 1249, category: ts.DiagnosticCategory.Error, key: "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", message: "A decorator can only decorate a method implementation, not an overload." }, with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_an_async_function_block_1300", message: "'with' statements are not allowed in an async function block." }, await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: ts.DiagnosticCategory.Error, key: "await_expression_is_only_allowed_within_an_async_function_1308", message: "'await' expression is only allowed within an async function." }, Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: ts.DiagnosticCategory.Error, key: "Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher_1311", message: "Async functions are only available when targeting ECMAScript 6 and higher." }, @@ -1326,11 +1360,12 @@ var ts; Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module_0_has_no_exported_member_1_2305", message: "Module '{0}' has no exported member '{1}'." }, File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File_0_is_not_a_module_2306", message: "File '{0}' is not a module." }, Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot_find_module_0_2307", message: "Cannot find module '{0}'." }, + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: { code: 2308, category: ts.DiagnosticCategory.Error, key: "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", message: "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", message: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type_0_recursively_references_itself_as_a_base_type_2310", message: "Type '{0}' recursively references itself as a base type." }, A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A_class_may_only_extend_another_class_2311", message: "A class may only extend another class." }, An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An_interface_may_only_extend_a_class_or_another_interface_2312", message: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list_2313", message: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Type_parameter_0_has_a_circular_constraint: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_has_a_circular_constraint_2313", message: "Type parameter '{0}' has a circular constraint." }, Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_1_type_argument_s_2314", message: "Generic type '{0}' requires {1} type argument(s)." }, Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_generic_2315", message: "Type '{0}' is not generic." }, Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global_type_0_must_be_a_class_or_interface_type_2316", message: "Global type '{0}' must be a class or interface type." }, @@ -1340,6 +1375,7 @@ var ts; Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", message: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive_stack_depth_comparing_types_0_and_1_2321", message: "Excessive stack depth comparing types '{0}' and '{1}'." }, Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_2322", message: "Type '{0}' is not assignable to type '{1}'." }, + Cannot_redeclare_exported_variable_0: { code: 2323, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_exported_variable_0_2323", message: "Cannot redeclare exported variable '{0}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property_0_is_missing_in_type_1_2324", message: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_in_type_1_but_not_in_type_2_2325", message: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types_of_property_0_are_incompatible_2326", message: "Types of property '{0}' are incompatible." }, @@ -1410,6 +1446,7 @@ var ts; Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload_signature_is_not_compatible_with_function_implementation_2394", message: "Overload signature is not compatible with function implementation." }, Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", message: "Individual declarations in merged declaration '{0}' must be all exported or all local." }, Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", message: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Declaration_name_conflicts_with_built_in_global_identifier_0: { code: 2397, category: ts.DiagnosticCategory.Error, key: "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", message: "Declaration name conflicts with built-in global identifier '{0}'." }, Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", message: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", message: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401", message: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, @@ -1523,6 +1560,8 @@ var ts; Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", message: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." }, All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -1532,7 +1571,7 @@ var ts; A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: { code: 2526, category: ts.DiagnosticCategory.Error, key: "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", message: "A 'this' type is available only in a non-static member of a class or interface." }, The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: { code: 2527, category: ts.DiagnosticCategory.Error, key: "The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary_2527", message: "The inferred type of '{0}' references an inaccessible 'this' type. A type annotation is necessary." }, A_module_cannot_have_multiple_default_exports: { code: 2528, category: ts.DiagnosticCategory.Error, key: "A_module_cannot_have_multiple_default_exports_2528", message: "A module cannot have multiple default exports." }, - JSX_element_attributes_type_0_must_be_an_object_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_must_be_an_object_type_2600", message: "JSX element attributes type '{0}' must be an object type." }, + JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, @@ -1548,6 +1587,9 @@ var ts; Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "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: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -1632,6 +1674,11 @@ var ts; Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_without_specifying_option_1_5052", message: "Option '{0}' cannot be specified without specifying option '{1}'." }, Option_0_cannot_be_specified_with_option_1: { code: 5053, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_with_option_1_5053", message: "Option '{0}' cannot be specified with option '{1}'." }, A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, + Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalide value for '--reactNamespace'. '{0}' is not a valid identifier." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003", message: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -1642,6 +1689,7 @@ var ts; Do_not_emit_outputs_if_any_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_if_any_errors_were_reported_6008", message: "Do not emit outputs if any errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)" }, Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, @@ -1697,6 +1745,8 @@ var ts; Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, + Allow_javascript_files_to_be_compiled: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6083", message: "Allow javascript files to be compiled." }, + Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -1744,7 +1794,8 @@ var ts; Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." } + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." } }; })(ts || (ts = {})); var ts; @@ -1934,7 +1985,8 @@ var ts; var pos = 0; var lineStart = 0; while (pos < text.length) { - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 13: if (text.charCodeAt(pos) === 10) { @@ -2037,6 +2089,9 @@ var ts; } ts.couldStartTrivia = couldStartTrivia; function skipTrivia(text, pos, stopAfterLineBreak) { + if (!(pos >= 0)) { + return pos; + } while (true) { var ch = text.charCodeAt(pos); switch (ch) { @@ -2254,6 +2309,18 @@ var ts; ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; + function isIdentifier(name, languageVersion) { + if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { + return false; + } + for (var i = 1, n = name.length; i < n; i++) { + if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { + return false; + } + } + return true; + } + ts.isIdentifier = isIdentifier; function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) { if (languageVariant === void 0) { languageVariant = 0; } var pos; @@ -2363,7 +2430,8 @@ var ts; return value; } function scanString() { - var quote = text.charCodeAt(pos++); + var quote = text.charCodeAt(pos); + pos++; var result = ""; var start = pos; while (true) { @@ -2450,7 +2518,8 @@ var ts; error(ts.Diagnostics.Unexpected_end_of_text); return ""; } - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 48: return "\0"; @@ -2659,7 +2728,8 @@ var ts; } return pos += 2, token = 31; } - return pos++, token = 49; + pos++; + return token = 49; case 34: case 39: tokenValue = scanString(); @@ -2670,7 +2740,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 62; } - return pos++, token = 40; + pos++; + return token = 40; case 38: if (text.charCodeAt(pos + 1) === 38) { return pos += 2, token = 51; @@ -2678,11 +2749,14 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 66; } - return pos++, token = 46; + pos++; + return token = 46; case 40: - return pos++, token = 17; + pos++; + return token = 17; case 41: - return pos++, token = 18; + pos++; + return token = 18; case 42: if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 59; @@ -2693,7 +2767,8 @@ var ts; } return pos += 2, token = 38; } - return pos++, token = 37; + pos++; + return token = 37; case 43: if (text.charCodeAt(pos + 1) === 43) { return pos += 2, token = 41; @@ -2701,9 +2776,11 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 57; } - return pos++, token = 35; + pos++; + return token = 35; case 44: - return pos++, token = 24; + pos++; + return token = 24; case 45: if (text.charCodeAt(pos + 1) === 45) { return pos += 2, token = 42; @@ -2711,7 +2788,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 58; } - return pos++, token = 36; + pos++; + return token = 36; case 46: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); @@ -2720,7 +2798,8 @@ var ts; if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { return pos += 3, token = 22; } - return pos++, token = 21; + pos++; + return token = 21; case 47: if (text.charCodeAt(pos + 1) === 47) { pos += 2; @@ -2766,7 +2845,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 61; } - return pos++, token = 39; + pos++; + return token = 39; case 48: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; @@ -2814,9 +2894,11 @@ var ts; tokenValue = scanNumber(); return token = 8; case 58: - return pos++, token = 54; + pos++; + return token = 54; case 59: - return pos++, token = 23; + pos++; + return token = 23; case 60: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2841,7 +2923,8 @@ var ts; text.charCodeAt(pos + 2) !== 42) { return pos += 2, token = 26; } - return pos++, token = 25; + pos++; + return token = 25; case 61: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2861,7 +2944,8 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 34; } - return pos++, token = 56; + pos++; + return token = 56; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2872,20 +2956,26 @@ var ts; return token = 7; } } - return pos++, token = 27; + pos++; + return token = 27; case 63: - return pos++, token = 53; + pos++; + return token = 53; case 91: - return pos++, token = 19; + pos++; + return token = 19; case 93: - return pos++, token = 20; + pos++; + return token = 20; case 94: if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 68; } - return pos++, token = 48; + pos++; + return token = 48; case 123: - return pos++, token = 15; + pos++; + return token = 15; case 124: if (text.charCodeAt(pos + 1) === 124) { return pos += 2, token = 52; @@ -2893,13 +2983,17 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 67; } - return pos++, token = 47; + pos++; + return token = 47; case 125: - return pos++, token = 16; + pos++; + return token = 16; case 126: - return pos++, token = 50; + pos++; + return token = 50; case 64: - return pos++, token = 55; + pos++; + return token = 55; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -2908,7 +3002,8 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + pos++; + return token = 0; default: if (isIdentifierStart(ch, languageVersion)) { pos++; @@ -2930,7 +3025,8 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + pos++; + return token = 0; } } } @@ -2946,10 +3042,12 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 64; } - return pos++, token = 44; + pos++; + return token = 44; } if (text.charCodeAt(pos) === 61) { - return pos++, token = 29; + pos++; + return token = 29; } } return token; @@ -3032,7 +3130,7 @@ var ts; break; } } - return token = 236; + return token = 238; } function scanJsxIdentifier() { if (tokenIsIdentifierOrKeyword(token)) { @@ -3158,7 +3256,7 @@ var ts; if (array1.length !== array2.length) { return false; } - for (var i = 0; i < array1.length; ++i) { + for (var i = 0; i < array1.length; i++) { var equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i]; if (!equals) { return false; @@ -3198,7 +3296,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 248) { + while (node && node.kind !== 250) { node = node.parent; } return node; @@ -3289,15 +3387,15 @@ var ts; return current; } switch (current.kind) { - case 248: + case 250: + case 222: + case 246: case 220: - case 244: - case 218: - case 199: - case 200: case 201: + case 202: + case 203: return current; - case 192: + case 194: if (!isFunctionLike(current.parent)) { return current; } @@ -3308,9 +3406,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 211 && + declaration.kind === 213 && declaration.parent && - declaration.parent.kind === 244; + declaration.parent.kind === 246; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3346,22 +3444,23 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 248: + case 250: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 211: - case 163: - case 214: - case 186: - case 215: - case 218: - case 217: - case 247: case 213: - case 173: + case 165: + case 216: + case 188: + case 217: + case 220: + case 219: + case 249: + case 215: + case 175: + case 143: errorNode = node.name; break; } @@ -3387,11 +3486,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 217 && isConst(node); + return node.kind === 219 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 163 || isBindingPattern(node))) { + while (node && (node.kind === 165 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3399,14 +3498,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 211) { + if (node.kind === 213) { node = node.parent; } - if (node && node.kind === 212) { + if (node && node.kind === 214) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 193) { + if (node && node.kind === 195) { flags |= node.flags; } return flags; @@ -3421,7 +3520,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 195 && node.expression.kind === 9; + return node.kind === 197 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -3451,7 +3550,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (151 <= node.kind && node.kind <= 160) { + if (150 <= node.kind && node.kind <= 162) { return true; } switch (node.kind) { @@ -3462,42 +3561,40 @@ var ts; case 131: return true; case 103: - return node.parent.kind !== 177; - case 9: - return node.parent.kind === 138; - case 188: + return node.parent.kind !== 179; + case 190: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 69: if (node.parent.kind === 135 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 166 && node.parent.name === node) { + else if (node.parent.kind === 168 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 166, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 168, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); case 135: - case 166: + case 168: case 97: var parent_1 = node.parent; if (parent_1.kind === 154) { return false; } - if (151 <= parent_1.kind && parent_1.kind <= 160) { + if (150 <= parent_1.kind && parent_1.kind <= 162) { return true; } switch (parent_1.kind) { - case 188: + case 190: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); case 137: return node === parent_1.constraint; case 141: case 140: case 138: - case 211: - return node === parent_1.type; case 213: - case 173: - case 174: + return node === parent_1.type; + case 215: + case 175: + case 176: case 144: case 143: case 142: @@ -3508,12 +3605,12 @@ var ts; case 148: case 149: return node === parent_1.type; - case 171: + case 173: return node === parent_1.type; - case 168: - case 169: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 170: + case 171: + return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; + case 172: return false; } } @@ -3524,23 +3621,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 204: + case 206: return visitor(node); - case 220: - case 192: - case 196: - case 197: + case 222: + case 194: case 198: case 199: case 200: case 201: - case 205: - case 206: - case 241: - case 242: + case 202: + case 203: case 207: - case 209: + case 208: + case 243: case 244: + case 209: + case 211: + case 246: return ts.forEachChild(node, traverse); } } @@ -3550,18 +3647,18 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 184: + case 186: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } + case 219: case 217: - case 215: + case 220: case 218: case 216: - case 214: - case 186: + case 188: return; default: if (isFunctionLike(node)) { @@ -3581,14 +3678,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 163: - case 247: + case 165: + case 249: case 138: - case 245: + case 247: case 141: case 140: - case 246: - case 211: + case 248: + case 213: return true; } } @@ -3600,7 +3697,7 @@ var ts; } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 214 || node.kind === 186); + return node && (node.kind === 216 || node.kind === 188); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -3610,9 +3707,9 @@ var ts; function isFunctionLikeKind(kind) { switch (kind) { case 144: - case 173: - case 213: - case 174: + case 175: + case 215: + case 176: case 143: case 142: case 145: @@ -3633,8 +3730,8 @@ var ts; case 144: case 145: case 146: - case 213: - case 173: + case 215: + case 175: return true; } return false; @@ -3642,26 +3739,30 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { + case 201: + case 202: + case 203: case 199: case 200: - case 201: - case 197: - case 198: return true; - case 207: + case 209: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 192 && isFunctionLike(node.parent); + return node && node.kind === 194 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 && node.parent.kind === 165; + return node && node.kind === 143 && node.parent.kind === 167; } ts.isObjectLiteralMethod = isObjectLiteralMethod; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1; + } + ts.isIdentifierTypePredicate = isIdentifierTypePredicate; function getContainingFunction(node) { while (true) { node = node.parent; @@ -3701,13 +3802,13 @@ var ts; node = node.parent; } break; - case 174: + case 176: if (!includeArrowFunctions) { continue; } - case 213: - case 173: - case 218: + case 215: + case 175: + case 220: case 141: case 140: case 143: @@ -3718,37 +3819,27 @@ var ts; case 147: case 148: case 149: - case 217: - case 248: + case 219: + case 250: return node; } } } ts.getThisContainer = getThisContainer; - function getSuperContainer(node, includeFunctions) { + function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; - if (!node) + if (!node) { return node; + } switch (node.kind) { case 136: - if (isClassLike(node.parent.parent)) { - return node; - } node = node.parent; break; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - case 213: - case 173: - case 174: - if (!includeFunctions) { + case 215: + case 175: + case 176: + if (!stopOnFunctions) { continue; } case 141: @@ -3759,6 +3850,14 @@ var ts; case 145: case 146: return node; + case 139: + if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; } } } @@ -3768,7 +3867,7 @@ var ts; switch (node.kind) { case 151: return node.typeName; - case 188: + case 190: return node.expression; case 69: case 135: @@ -3779,7 +3878,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 170) { + if (node.kind === 172) { return node.tag; } return node.expression; @@ -3787,23 +3886,23 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 214: + case 216: return true; case 141: - return node.parent.kind === 214; + return node.parent.kind === 216; case 138: - return node.parent.body && node.parent.parent.kind === 214; + return node.parent.body && node.parent.parent.kind === 216; case 145: case 146: case 143: - return node.body && node.parent.kind === 214; + return node.body && node.parent.kind === 216; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 214: + case 216: if (node.decorators) { return true; } @@ -3829,27 +3928,12 @@ var ts; return false; } ts.nodeIsDecorated = nodeIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 214: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 143: - case 146: - return ts.forEach(node.parameters, nodeIsDecorated); - } - return false; - } - ts.childIsDecorated = childIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 166; + return node.kind === 168; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 167; + return node.kind === 169; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -3859,34 +3943,34 @@ var ts; case 99: case 84: case 10: - case 164: - case 165: case 166: case 167: case 168: case 169: case 170: - case 189: case 171: case 172: + case 191: case 173: - case 186: case 174: - case 177: case 175: + case 188: case 176: case 179: - case 180: + case 177: + case 178: case 181: case 182: - case 185: case 183: - case 11: - case 187: - case 233: - case 234: case 184: - case 178: + case 187: + case 185: + case 11: + case 189: + case 235: + case 236: + case 186: + case 180: return true; case 135: while (node.parent.kind === 135) { @@ -3902,47 +3986,47 @@ var ts; case 97: var parent_2 = node.parent; switch (parent_2.kind) { - case 211: + case 213: case 138: case 141: case 140: + case 249: case 247: - case 245: - case 163: + case 165: return parent_2.initializer === node; - case 195: - case 196: case 197: case 198: - case 204: - case 205: - case 206: - case 241: - case 208: - case 206: - return parent_2.expression === node; case 199: + case 200: + case 206: + case 207: + case 208: + case 243: + case 210: + case 208: + return parent_2.expression === node; + case 201: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 212) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 214) || forStatement.condition === node || forStatement.incrementor === node; - case 200: - case 201: + case 202: + case 203: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 212) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214) || forInStatement.expression === node; - case 171: - case 189: + case 173: + case 191: return node === parent_2.expression; - case 190: + case 192: return node === parent_2.expression; case 136: return node === parent_2.expression; case 139: - case 240: - case 239: + case 242: + case 241: return true; - case 188: + case 190: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -3964,7 +4048,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 && node.moduleReference.kind === 232; + return node.kind === 223 && node.moduleReference.kind === 234; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3973,7 +4057,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 && node.moduleReference.kind !== 232; + return node.kind === 223 && node.moduleReference.kind !== 234; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -3985,43 +4069,54 @@ var ts; } ts.isInJavaScriptFile = isInJavaScriptFile; function isRequireCall(expression) { - return expression.kind === 168 && + return expression.kind === 170 && expression.expression.kind === 69 && expression.expression.text === "require" && expression.arguments.length === 1 && expression.arguments[0].kind === 9; } ts.isRequireCall = isRequireCall; - function isExportsPropertyAssignment(expression) { - return isInJavaScriptFile(expression) && - (expression.kind === 181) && - (expression.operatorToken.kind === 56) && - (expression.left.kind === 166) && - (expression.left.expression.kind === 69) && - ((expression.left.expression).text === "exports"); + function getSpecialPropertyAssignmentKind(expression) { + if (expression.kind !== 183) { + return 0; + } + var expr = expression; + if (expr.operatorToken.kind !== 56 || expr.left.kind !== 168) { + return 0; + } + var lhs = expr.left; + if (lhs.expression.kind === 69) { + var lhsId = lhs.expression; + if (lhsId.text === "exports") { + return 1; + } + else if (lhsId.text === "module" && lhs.name.text === "exports") { + return 2; + } + } + else if (lhs.expression.kind === 97) { + return 4; + } + else if (lhs.expression.kind === 168) { + var innerPropertyAccess = lhs.expression; + if (innerPropertyAccess.expression.kind === 69 && innerPropertyAccess.name.text === "prototype") { + return 3; + } + } + return 0; } - ts.isExportsPropertyAssignment = isExportsPropertyAssignment; - function isModuleExportsAssignment(expression) { - return isInJavaScriptFile(expression) && - (expression.kind === 181) && - (expression.operatorToken.kind === 56) && - (expression.left.kind === 166) && - (expression.left.expression.kind === 69) && - ((expression.left.expression).text === "module") && - (expression.left.name.text === "exports"); - } - ts.isModuleExportsAssignment = isModuleExportsAssignment; + ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 222) { + if (node.kind === 224) { return node.moduleSpecifier; } - if (node.kind === 221) { + if (node.kind === 223) { var reference = node.moduleReference; - if (reference.kind === 232) { + if (reference.kind === 234) { return reference.expression; } } - if (node.kind === 228) { + if (node.kind === 230) { return node.moduleSpecifier; } } @@ -4032,8 +4127,8 @@ var ts; case 138: case 143: case 142: - case 246: - case 245: + case 248: + case 247: case 141: case 140: return node.questionToken !== undefined; @@ -4043,9 +4138,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 261 && + return node.kind === 263 && node.parameters.length > 0 && - node.parameters[0].type.kind === 263; + node.parameters[0].type.kind === 265; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -4059,15 +4154,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 269); + return getJSDocTag(node, 271); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 268); + return getJSDocTag(node, 270); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 270); + return getJSDocTag(node, 272); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -4076,7 +4171,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 267) { + if (t.kind === 269) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -4095,12 +4190,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32) { - if (node.type && node.type.kind === 262) { + if (node.type && node.type.kind === 264) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 262; + return paramTag.typeExpression.type.kind === 264; } } return node.dotDotDotToken !== undefined; @@ -4121,7 +4216,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 162 || node.kind === 161); + return !!node && (node.kind === 164 || node.kind === 163); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -4145,34 +4240,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 174: - case 163: - case 214: - case 186: + case 176: + case 165: + case 216: + case 188: case 144: - case 217: - case 247: - case 230: - case 213: - case 173: - case 145: - case 223: - case 221: - case 226: + case 219: + case 249: + case 232: case 215: + case 175: + case 145: + case 225: + case 223: + case 228: + case 217: case 143: case 142: - case 218: - case 224: + case 220: + case 226: case 138: - case 245: + case 247: case 141: case 140: case 146: - case 246: - case 216: + case 248: + case 218: case 137: - case 211: + case 213: return true; } return false; @@ -4180,25 +4275,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 203: - case 202: - case 210: - case 197: - case 195: - case 194: - case 200: - case 201: - case 199: - case 196: - case 207: + case 205: case 204: + case 212: + case 199: + case 197: + case 196: + case 202: + case 203: + case 201: + case 198: + case 209: case 206: case 208: - case 209: - case 193: - case 198: - case 205: - case 227: + case 210: + case 211: + case 195: + case 200: + case 207: + case 229: return true; default: return false; @@ -4225,7 +4320,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 226 || parent.kind === 230) { + if (parent.kind === 228 || parent.kind === 232) { if (parent.propertyName) { return true; } @@ -4245,9 +4340,9 @@ var ts; case 142: case 145: case 146: + case 249: case 247: - case 245: - case 166: + case 168: return parent.name === node; case 135: if (parent.right === node) { @@ -4257,22 +4352,22 @@ var ts; return parent.kind === 154; } return false; - case 163: - case 226: + case 165: + case 228: return parent.propertyName === node; - case 230: + case 232: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 221 || - node.kind === 223 && !!node.name || - node.kind === 224 || + return node.kind === 223 || + node.kind === 225 && !!node.name || node.kind === 226 || - node.kind === 230 || - node.kind === 227 && node.expression.kind === 69; + node.kind === 228 || + node.kind === 232 || + node.kind === 229 && node.expression.kind === 69; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -4405,7 +4500,7 @@ var ts; return node.kind === 69 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isModifier(token) { + function isModifierKind(token) { switch (token) { case 115: case 118: @@ -4421,39 +4516,56 @@ var ts; } return false; } - ts.isModifier = isModifier; + ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); return root.kind === 138; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 163) { + while (node.kind === 165) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 218 || n.kind === 248; + return isFunctionLike(n) || n.kind === 220 || n.kind === 250; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function cloneEntityName(node) { - if (node.kind === 69) { - var clone_1 = createSynthesizedNode(69); - clone_1.text = node.text; - return clone_1; + function cloneNode(node, location, flags, parent) { + var clone = location !== undefined + ? ts.createNode(node.kind, location.pos, location.end) + : createSynthesizedNode(node.kind); + for (var key in node) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { + continue; + } + clone[key] = node[key]; } - else { - var clone_2 = createSynthesizedNode(135); - clone_2.left = cloneEntityName(node.left); - clone_2.left.parent = clone_2; - clone_2.right = cloneEntityName(node.right); - clone_2.right.parent = clone_2; - return clone_2; + if (flags !== undefined) { + clone.flags = flags; } + if (parent !== undefined) { + clone.parent = parent; + } + return clone; + } + ts.cloneNode = cloneNode; + function cloneEntityName(node, parent) { + var clone = cloneNode(node, node, node.flags, parent); + if (isQualifiedName(clone)) { + var left = clone.left, right = clone.right; + clone.left = cloneEntityName(left, clone); + clone.right = cloneNode(right, right, right.flags, parent); + } + return clone; } ts.cloneEntityName = cloneEntityName; + function isQualifiedName(node) { + return node.kind === 135; + } + ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { return node.pos === -1; } @@ -4656,8 +4768,8 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, + increaseIndent: function () { indent++; }, + decreaseIndent: function () { indent--; }, getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, @@ -4668,8 +4780,10 @@ var ts; } ts.createTextWriter = createTextWriter; function getExternalModuleNameFromPath(host, fileName) { - var dir = host.getCurrentDirectory(); - var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, false); + var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; + var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, false); return ts.removeFileExtension(relativePath); } ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; @@ -4685,6 +4799,61 @@ var ts; return emitOutputFilePathWithoutExtension + extension; } ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getEmitScriptTarget(compilerOptions) { + return compilerOptions.target || 0; + } + ts.getEmitScriptTarget = getEmitScriptTarget; + function getEmitModuleKind(compilerOptions) { + return compilerOptions.module ? + compilerOptions.module : + getEmitScriptTarget(compilerOptions) === 2 ? 5 : 0; + } + ts.getEmitModuleKind = getEmitModuleKind; + function forEachExpectedEmitFile(host, action, targetSourceFile) { + var options = host.getCompilerOptions(); + if (options.outFile || options.out) { + onBundledEmit(host); + } + else { + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + if (!isDeclarationFile(sourceFile)) { + onSingleFileEmit(host, sourceFile); + } + } + } + function onSingleFileEmit(host, sourceFile) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, sourceFile.languageVariant === 1 && options.jsx === 1 ? ".jsx" : ".js"); + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: !isSourceFileJavaScript(sourceFile) ? getDeclarationEmitFilePath(jsFilePath, options) : undefined + }; + action(emitFileNames, [sourceFile], false); + } + function onBundledEmit(host) { + var bundledSources = ts.filter(host.getSourceFiles(), function (sourceFile) { return !isDeclarationFile(sourceFile) && + (!isExternalModule(sourceFile) || + (getEmitModuleKind(options) && isExternalModule(sourceFile))); }); + if (bundledSources.length) { + var jsFilePath = options.outFile || options.out; + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: getDeclarationEmitFilePath(jsFilePath, options) + }; + action(emitFileNames, bundledSources, true); + } + } + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + function getDeclarationEmitFilePath(jsFilePath, options) { + return options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; + } + } + ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); @@ -4693,7 +4862,7 @@ var ts; ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }); } ts.writeFile = writeFile; @@ -4717,16 +4886,6 @@ var ts; return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) { - return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; function getAllAccessorDeclarations(declarations, accessor) { var firstAccessor; var secondAccessor; @@ -4926,24 +5085,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 166: - case 167: - case 169: case 168: - case 233: - case 234: + case 169: + case 171: case 170: - case 164: + case 235: + case 236: case 172: - case 165: - case 186: - case 173: + case 166: + case 174: + case 167: + case 188: + case 175: case 69: case 10: case 8: case 9: case 11: - case 183: + case 185: case 84: case 93: case 97: @@ -4960,7 +5119,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 188 && + return node.kind === 190 && node.parent.token === 83 && isClassLike(node.parent.parent); } @@ -4982,15 +5141,15 @@ var ts; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { return (node.parent.kind === 135 && node.parent.right === node) || - (node.parent.kind === 166 && node.parent.name === node); + (node.parent.kind === 168 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 165) { + if (kind === 167) { return expression.properties.length === 0; } - if (kind === 164) { + if (kind === 166) { return expression.elements.length === 0; } return false; @@ -5001,13 +5160,9 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; function hasJavaScriptFileExtension(fileName) { - return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); + return ts.forEach(ts.supportedJavascriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; - function allowsJsxExpressions(fileName) { - return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); - } - ts.allowsJsxExpressions = allowsJsxExpressions; function getExpandedCharCodes(input) { var output = []; var length = input.length; @@ -5037,6 +5192,39 @@ var ts; } return output; } + ts.stringify = typeof JSON !== "undefined" && JSON.stringify + ? JSON.stringify + : stringifyFallback; + function stringifyFallback(value) { + return value === undefined ? undefined : stringifyValue(value); + } + function stringifyValue(value) { + return typeof value === "string" ? "\"" + escapeString(value) + "\"" + : typeof value === "number" ? isFinite(value) ? String(value) : "null" + : typeof value === "boolean" ? value ? "true" : "false" + : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) + : "null"; + } + function cycleCheck(cb, value) { + ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); + value.__cycle = true; + var result = cb(value); + delete value.__cycle; + return result; + } + function stringifyArray(value) { + return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; + } + function stringifyElement(memo, value) { + return (memo ? memo + "," : memo) + stringifyValue(value); + } + function stringifyObject(value) { + return "{" + ts.reduceProperties(value, stringifyProperty, "") + "}"; + } + function stringifyProperty(memo, value, key) { + return value === undefined || typeof value === "function" || key === "__cycle" ? memo + : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); + } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function convertToBase64(input) { var result = ""; @@ -5207,13 +5395,17 @@ var ts; function getTypeParameterOwner(d) { if (d && d.kind === 137) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 215) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217) { return current; } } } } ts.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node) { + return node.flags & 56 && node.parent.kind === 144 && ts.isClassLike(node.parent.parent); + } + ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); var ts; (function (ts) { @@ -5221,7 +5413,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 248) { + if (kind === 250) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -5264,7 +5456,7 @@ var ts; return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 246: + case 248: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -5274,9 +5466,9 @@ var ts; case 138: case 141: case 140: - case 245: - case 211: - case 163: + case 247: + case 213: + case 165: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5300,9 +5492,9 @@ var ts; case 144: case 145: case 146: - case 173: - case 213: - case 174: + case 175: + case 215: + case 176: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5332,271 +5524,271 @@ var ts; return visitNodes(cbNodes, node.types); case 160: return visitNode(cbNode, node.type); - case 161: - case 162: - return visitNodes(cbNodes, node.elements); + case 163: case 164: return visitNodes(cbNodes, node.elements); - case 165: - return visitNodes(cbNodes, node.properties); case 166: + return visitNodes(cbNodes, node.elements); + case 167: + return visitNodes(cbNodes, node.properties); + case 168: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 167: + case 169: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 168: - case 169: + case 170: + case 171: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 170: + case 172: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 171: + case 173: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 172: - return visitNode(cbNode, node.expression); - case 175: - return visitNode(cbNode, node.expression); - case 176: + case 174: return visitNode(cbNode, node.expression); case 177: return visitNode(cbNode, node.expression); - case 179: - return visitNode(cbNode, node.operand); - case 184: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 178: return visitNode(cbNode, node.expression); - case 180: - return visitNode(cbNode, node.operand); + case 179: + return visitNode(cbNode, node.expression); case 181: + return visitNode(cbNode, node.operand); + case 186: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 180: + return visitNode(cbNode, node.expression); + case 182: + return visitNode(cbNode, node.operand); + case 183: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 189: + case 191: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 182: + case 184: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 185: + case 187: return visitNode(cbNode, node.expression); - case 192: - case 219: + case 194: + case 221: return visitNodes(cbNodes, node.statements); - case 248: + case 250: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 193: + case 195: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 212: + case 214: return visitNodes(cbNodes, node.declarations); - case 195: + case 197: return visitNode(cbNode, node.expression); - case 196: + case 198: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 197: + case 199: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 198: + case 200: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 199: + case 201: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 200: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 201: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 202: - case 203: - return visitNode(cbNode, node.label); - case 204: - return visitNode(cbNode, node.expression); - case 205: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 203: + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 204: + case 205: + return visitNode(cbNode, node.label); case 206: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 220: - return visitNodes(cbNodes, node.clauses); - case 241: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 242: - return visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression); case 207: - return visitNode(cbNode, node.label) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 208: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.caseBlock); + case 222: + return visitNodes(cbNodes, node.clauses); + case 243: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.statements); + case 244: + return visitNodes(cbNodes, node.statements); case 209: + return visitNode(cbNode, node.label) || + visitNode(cbNode, node.statement); + case 210: + return visitNode(cbNode, node.expression); + case 211: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 244: + case 246: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 139: return visitNode(cbNode, node.expression); - case 214: - case 186: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 215: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 216: + case 188: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 217: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 247: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 218: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 219: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 249: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 220: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 221: + case 223: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 222: + case 224: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 223: + case 225: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 224: + case 226: return visitNode(cbNode, node.name); - case 225: - case 229: + case 227: + case 231: return visitNodes(cbNodes, node.elements); - case 228: + case 230: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 226: - case 230: + case 228: + case 232: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 227: + case 229: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 183: + case 185: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 190: + case 192: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 136: return visitNode(cbNode, node.expression); - case 243: + case 245: return visitNodes(cbNodes, node.types); - case 188: + case 190: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 232: + case 234: return visitNode(cbNode, node.expression); - case 231: - return visitNodes(cbNodes, node.decorators); case 233: + return visitNodes(cbNodes, node.decorators); + case 235: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 234: - case 235: + case 236: + case 237: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 238: + case 240: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 241: + return visitNode(cbNode, node.expression); + case 242: + return visitNode(cbNode, node.expression); case 239: - return visitNode(cbNode, node.expression); - case 240: - return visitNode(cbNode, node.expression); - case 237: return visitNode(cbNode, node.tagName); - case 249: - return visitNode(cbNode, node.type); - case 253: - return visitNodes(cbNodes, node.types); - case 254: - return visitNodes(cbNodes, node.types); - case 252: - return visitNode(cbNode, node.elementType); - case 256: + case 251: return visitNode(cbNode, node.type); case 255: + return visitNodes(cbNodes, node.types); + case 256: + return visitNodes(cbNodes, node.types); + case 254: + return visitNode(cbNode, node.elementType); + case 258: return visitNode(cbNode, node.type); case 257: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.type); case 259: + return visitNodes(cbNodes, node.members); + case 261: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 260: - return visitNode(cbNode, node.type); - case 261: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 262: return visitNode(cbNode, node.type); case 263: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.parameters) || + visitNode(cbNode, node.type); case 264: return visitNode(cbNode, node.type); - case 258: + case 265: + return visitNode(cbNode, node.type); + case 266: + return visitNode(cbNode, node.type); + case 260: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 265: - return visitNodes(cbNodes, node.tags); case 267: + return visitNodes(cbNodes, node.tags); + case 269: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 268: - return visitNode(cbNode, node.typeExpression); - case 269: - return visitNode(cbNode, node.typeExpression); case 270: + return visitNode(cbNode, node.typeExpression); + case 271: + return visitNode(cbNode, node.typeExpression); + case 272: return visitNodes(cbNodes, node.typeParameters); } } @@ -5646,6 +5838,9 @@ var ts; return result; } Parser.parseSourceFile = parseSourceFile; + function getLanguageVariant(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx") ? 1 : 0; + } function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { NodeConstructor = ts.objectAllocator.getNodeConstructor(); SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); @@ -5661,7 +5856,7 @@ var ts; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 : 0); + scanner.setLanguageVariant(getLanguageVariant(fileName)); } function clearState() { scanner.setText(""); @@ -5700,8 +5895,8 @@ var ts; return; function visit(node) { switch (node.kind) { - case 193: - case 213: + case 195: + case 215: case 138: addJSDocComment(node); } @@ -5736,14 +5931,14 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = new SourceFileConstructor(248, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(250, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 : 0; - sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 : 0; + sourceFile.languageVariant = getLanguageVariant(sourceFile.fileName); return sourceFile; } function setContextFlag(val, flag) { @@ -5795,9 +5990,6 @@ var ts; function doInYieldContext(func) { return doInsideOfContext(2, func); } - function doOutsideOfYieldContext(func) { - return doOutsideOfContext(2, func); - } function doInDecoratorContext(func) { return doInsideOfContext(4, func); } @@ -5810,9 +6002,6 @@ var ts; function doInYieldAndAwaitContext(func) { return doInsideOfContext(2 | 8, func); } - function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(2 | 8, func); - } function inContext(flags) { return (contextFlags & flags) !== 0; } @@ -5853,9 +6042,6 @@ var ts; function nextToken() { return token = scanner.scan(); } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } function reScanGreaterToken() { return token = scanner.reScanGreaterToken(); } @@ -6045,6 +6231,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(nextTokenCanFollowModifier); } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } function nextTokenCanFollowModifier() { if (token === 74) { return nextToken() === 81; @@ -6063,14 +6256,10 @@ var ts; nextToken(); return canFollowModifier(); } - nextToken(); - if (scanner.hasPrecedingLineBreak()) { - return false; - } - return canFollowModifier(); + return nextTokenIsOnSameLineAndCanFollowModifier(); } function parseAnyContextualModifier() { - return ts.isModifier(token) && tryParse(nextTokenCanFollowModifier); + return ts.isModifierKind(token) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier() { return token === 19 @@ -6337,7 +6526,7 @@ var ts; case 145: case 146: case 141: - case 191: + case 193: return true; case 143: var methodDeclaration = node; @@ -6351,8 +6540,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 241: - case 242: + case 243: + case 244: return true; } } @@ -6361,42 +6550,42 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 213: - case 193: - case 192: - case 196: + case 215: case 195: - case 208: - case 204: - case 206: - case 203: - case 202: - case 200: - case 201: - case 199: - case 198: - case 205: case 194: - case 209: - case 207: + case 198: case 197: case 210: - case 222: - case 221: - case 228: - case 227: - case 218: - case 214: - case 215: - case 217: + case 206: + case 208: + case 205: + case 204: + case 202: + case 203: + case 201: + case 200: + case 207: + case 196: + case 211: + case 209: + case 199: + case 212: + case 224: + case 223: + case 230: + case 229: + case 220: case 216: + case 217: + case 219: + case 218: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 247; + return node.kind === 249; } function isReusableTypeMember(node) { if (node) { @@ -6412,7 +6601,7 @@ var ts; return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 211) { + if (node.kind !== 213) { return false; } var variableDeclarator = node; @@ -6536,8 +6725,8 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(183); - template.head = parseLiteralNode(); + var template = createNode(185); + template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); @@ -6549,12 +6738,12 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(190); + var span = createNode(192); span.expression = allowInAnd(parseExpression); var literal; if (token === 16) { reScanTemplateToken(); - literal = parseLiteralNode(); + literal = parseTemplateLiteralFragment(); } else { literal = parseExpectedToken(14, false, ts.Diagnostics._0_expected, ts.tokenToString(16)); @@ -6562,8 +6751,17 @@ var ts; span.literal = literal; return finishNode(span); } + function parseStringLiteralTypeNode() { + return parseLiteralLikeNode(162, true); + } function parseLiteralNode(internName) { - var node = createNode(token); + return parseLiteralLikeNode(token, internName); + } + function parseTemplateLiteralFragment() { + return parseLiteralLikeNode(token, false); + } + function parseLiteralLikeNode(kind, internName) { + var node = createNode(kind); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; if (scanner.hasExtendedUnicodeEscape()) { @@ -6585,11 +6783,7 @@ var ts; function parseTypeReferenceOrTypePredicate() { var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (typeName.kind === 69 && token === 124 && !scanner.hasPrecedingLineBreak()) { - nextToken(); - var node_1 = createNode(150, typeName.pos); - node_1.parameterName = typeName; - node_1.type = parseType(); - return finishNode(node_1); + return parseTypePredicate(typeName); } var node = createNode(151, typeName.pos); node.typeName = typeName; @@ -6598,6 +6792,18 @@ var ts; } return finishNode(node); } + function parseTypePredicate(lhs) { + nextToken(); + var node = createNode(150, lhs.pos); + node.parameterName = lhs; + node.type = parseType(); + return finishNode(node); + } + function parseThisTypeNode() { + var node = createNode(161); + nextToken(); + return finishNode(node); + } function parseTypeQuery() { var node = createNode(154); parseExpected(101); @@ -6629,7 +6835,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 22 || isIdentifierOrPattern() || ts.isModifier(token) || token === 55; + return token === 22 || isIdentifierOrPattern() || ts.isModifierKind(token) || token === 55; } function setModifiers(node, modifiers) { if (modifiers) { @@ -6643,7 +6849,7 @@ var ts; setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); - if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifierKind(token)) { nextToken(); } node.questionToken = parseOptionalToken(53); @@ -6711,7 +6917,7 @@ var ts; if (token === 22 || token === 20) { return true; } - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { nextToken(); if (isIdentifier()) { return true; @@ -6758,6 +6964,9 @@ var ts; property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); + if (token === 56) { + property.initializer = parseNonParameterInitializer(); + } parseTypeMemberSemicolon(); return finishNode(property); } @@ -6769,7 +6978,7 @@ var ts; case 19: return true; default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = lookAhead(isStartOfIndexSignatureDeclaration); if (result) { return result; @@ -6779,7 +6988,7 @@ var ts; } } function isStartOfIndexSignatureDeclaration() { - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { nextToken(); } return isIndexSignature(); @@ -6809,7 +7018,7 @@ var ts; case 8: return parsePropertyOrMethodSignature(); default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { return result; @@ -6882,10 +7091,18 @@ var ts; var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); case 9: - return parseLiteralNode(true); + return parseStringLiteralTypeNode(); case 103: - case 97: return parseTokenNode(); + case 97: { + var thisKeyword = parseThisTypeNode(); + if (token === 124 && !scanner.hasPrecedingLineBreak()) { + return parseTypePredicate(thisKeyword); + } + else { + return thisKeyword; + } + } case 101: return parseTypeQuery(); case 15: @@ -6966,11 +7183,11 @@ var ts; if (token === 18 || token === 22) { return true; } - if (isIdentifier() || ts.isModifier(token)) { + if (isIdentifier() || ts.isModifierKind(token)) { nextToken(); if (token === 54 || token === 24 || token === 53 || token === 56 || - isIdentifier() || ts.isModifier(token)) { + isIdentifier() || ts.isModifierKind(token)) { return true; } if (token === 18) { @@ -7054,9 +7271,6 @@ var ts; token !== 55 && isStartOfExpression(); } - function allowInAndParseExpression() { - return allowInAnd(parseExpression); - } function parseExpression() { var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { @@ -7112,7 +7326,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(184); + var node = createNode(186); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 37 || isStartOfExpression())) { @@ -7126,7 +7340,7 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(174, identifier.pos); + var node = createNode(176, identifier.pos); var parameter = createNode(138, identifier.pos); parameter.name = identifier; finishNode(parameter); @@ -7238,7 +7452,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(174); + var node = createNode(176); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256); fillSignature(54, false, isAsync, !allowAmbiguity, node); @@ -7270,7 +7484,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(182, leftOperand.pos); + var node = createNode(184, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -7361,39 +7575,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(181, left.pos); + var node = createNode(183, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(189, left.pos); + var node = createNode(191, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(179); + var node = createNode(181); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(175); + var node = createNode(177); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(176); + var node = createNode(178); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(177); + var node = createNode(179); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -7408,7 +7622,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(178); + var node = createNode(180); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -7427,7 +7641,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 171) { + if (simpleUnaryExpression.kind === 173) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -7475,7 +7689,7 @@ var ts; } function parseIncrementExpression() { if (token === 41 || token === 42) { - var node = createNode(179); + var node = createNode(181); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -7487,7 +7701,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 || token === 42) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(180, expression.pos); + var node = createNode(182, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -7510,31 +7724,44 @@ var ts; if (token === 17 || token === 21 || token === 19) { return expression; } - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 69) { + return lhs.text === rhs.text; + } + return lhs.right.text === rhs.right.text && + tagNamesAreEquivalent(lhs.left, rhs.left); + } function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 235) { - var node = createNode(233, opening.pos); + if (opening.kind === 237) { + var node = createNode(235, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); + if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { + parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName)); + } result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 234); + ts.Debug.assert(opening.kind === 236); result = opening; } if (inExpressionContext && token === 25) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(181, result.pos); + var badNode = createNode(183, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -7546,13 +7773,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(236, scanner.getStartPos()); + var node = createNode(238, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 236: + case 238: return parseJsxText(); case 15: return parseJsxExpression(false); @@ -7572,7 +7799,7 @@ var ts; break; } else if (token === 1) { - parseErrorAtCurrentToken(ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); + parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } result.push(parseJsxChild()); @@ -7588,7 +7815,7 @@ var ts; var attributes = parseList(13, parseJsxAttribute); var node; if (token === 27) { - node = createNode(235, fullStart); + node = createNode(237, fullStart); scanJsxText(); } else { @@ -7600,7 +7827,7 @@ var ts; parseExpected(27, undefined, false); scanJsxText(); } - node = createNode(234, fullStart); + node = createNode(236, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -7619,10 +7846,10 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(240); + var node = createNode(242); parseExpected(15); if (token !== 16) { - node.expression = parseExpression(); + node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { parseExpected(16); @@ -7638,7 +7865,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(238); + var node = createNode(240); node.name = parseIdentifierName(); if (parseOptional(56)) { switch (token) { @@ -7653,7 +7880,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(239); + var node = createNode(241); parseExpected(15); parseExpected(22); node.expression = parseExpression(); @@ -7661,7 +7888,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(237); + var node = createNode(239); parseExpected(26); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -7674,7 +7901,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(171); + var node = createNode(173); parseExpected(25); node.type = parseType(); parseExpected(27); @@ -7685,7 +7912,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21); if (dotToken) { - var propertyAccess = createNode(166, expression.pos); + var propertyAccess = createNode(168, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -7693,7 +7920,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(19)) { - var indexedAccess = createNode(167, expression.pos); + var indexedAccess = createNode(169, expression.pos); indexedAccess.expression = expression; if (token !== 20) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -7707,7 +7934,7 @@ var ts; continue; } if (token === 11 || token === 12) { - var tagExpression = createNode(170, expression.pos); + var tagExpression = createNode(172, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 ? parseLiteralNode() @@ -7726,7 +7953,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(168, expression.pos); + var callExpr = createNode(170, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -7734,7 +7961,7 @@ var ts; continue; } else if (token === 17) { - var callExpr = createNode(168, expression.pos); + var callExpr = createNode(170, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -7829,28 +8056,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(172); + var node = createNode(174); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); return finishNode(node); } function parseSpreadElement() { - var node = createNode(185); + var node = createNode(187); parseExpected(22); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 ? parseSpreadElement() : - token === 24 ? createNode(187) : + token === 24 ? createNode(189) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(164); + var node = createNode(166); parseExpected(19); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024; @@ -7877,7 +8104,6 @@ var ts; } var asteriskToken = parseOptionalToken(37); var tokenIsIdentifier = isIdentifier(); - var nameToken = token; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(53); if (asteriskToken || token === 17 || token === 25) { @@ -7885,7 +8111,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 || token === 16 || token === 56); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(246, fullStart); + var shorthandDeclaration = createNode(248, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56); @@ -7896,7 +8122,8 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(245, fullStart); + var propertyAssignment = createNode(247, fullStart); + propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(54); @@ -7905,7 +8132,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(165); + var node = createNode(167); parseExpected(15); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024; @@ -7919,7 +8146,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(173); + var node = createNode(175); setModifiers(node, parseModifiers()); parseExpected(87); node.asteriskToken = parseOptionalToken(37); @@ -7941,7 +8168,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(169); + var node = createNode(171); parseExpected(92); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -7951,7 +8178,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(192); + var node = createNode(194); if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -7979,12 +8206,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(194); + var node = createNode(196); parseExpected(23); return finishNode(node); } function parseIfStatement() { - var node = createNode(196); + var node = createNode(198); parseExpected(88); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -7994,7 +8221,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(197); + var node = createNode(199); parseExpected(79); node.statement = parseStatement(); parseExpected(104); @@ -8005,7 +8232,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(198); + var node = createNode(200); parseExpected(104); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8028,21 +8255,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90)) { - var forInStatement = createNode(200, pos); + var forInStatement = createNode(202, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18); forOrForInOrForOfStatement = forInStatement; } else if (parseOptional(134)) { - var forOfStatement = createNode(201, pos); + var forOfStatement = createNode(203, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(199, pos); + var forStatement = createNode(201, pos); forStatement.initializer = initializer; parseExpected(23); if (token !== 23 && token !== 18) { @@ -8060,7 +8287,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 203 ? 70 : 75); + parseExpected(kind === 205 ? 70 : 75); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8068,7 +8295,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(204); + var node = createNode(206); parseExpected(94); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8077,7 +8304,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(205); + var node = createNode(207); parseExpected(105); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8086,7 +8313,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(241); + var node = createNode(243); parseExpected(71); node.expression = allowInAnd(parseExpression); parseExpected(54); @@ -8094,7 +8321,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(242); + var node = createNode(244); parseExpected(77); parseExpected(54); node.statements = parseList(3, parseStatement); @@ -8104,12 +8331,12 @@ var ts; return token === 71 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(206); + var node = createNode(208); parseExpected(96); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); - var caseBlock = createNode(220, scanner.getStartPos()); + var caseBlock = createNode(222, scanner.getStartPos()); parseExpected(15); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(16); @@ -8117,14 +8344,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(208); + var node = createNode(210); parseExpected(98); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(209); + var node = createNode(211); parseExpected(100); node.tryBlock = parseBlock(false); node.catchClause = token === 72 ? parseCatchClause() : undefined; @@ -8135,7 +8362,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(244); + var result = createNode(246); parseExpected(72); if (parseExpected(17)) { result.variableDeclaration = parseVariableDeclaration(); @@ -8145,7 +8372,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(210); + var node = createNode(212); parseExpected(76); parseSemicolon(); return finishNode(node); @@ -8154,13 +8381,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 && parseOptional(54)) { - var labeledStatement = createNode(207, fullStart); + var labeledStatement = createNode(209, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(195, fullStart); + var expressionStatement = createNode(197, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -8305,9 +8532,9 @@ var ts; case 86: return parseForOrForInOrForOfStatement(); case 75: - return parseBreakOrContinueStatement(202); + return parseBreakOrContinueStatement(204); case 70: - return parseBreakOrContinueStatement(203); + return parseBreakOrContinueStatement(205); case 94: return parseReturnStatement(); case 105: @@ -8377,7 +8604,7 @@ var ts; parseExportDeclaration(fullStart, decorators, modifiers); default: if (decorators || modifiers) { - var node = createMissingNode(231, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(233, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8398,16 +8625,16 @@ var ts; } function parseArrayBindingElement() { if (token === 24) { - return createNode(187); + return createNode(189); } - var node = createNode(163); + var node = createNode(165); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(163); + var node = createNode(165); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54) { @@ -8422,14 +8649,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(161); + var node = createNode(163); parseExpected(15); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(16); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(162); + var node = createNode(164); parseExpected(19); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(20); @@ -8448,7 +8675,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(211); + var node = createNode(213); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -8457,7 +8684,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(212); + var node = createNode(214); switch (token) { case 102: break; @@ -8486,7 +8713,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(193, fullStart); + var node = createNode(195, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -8494,7 +8721,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(213, fullStart); + var node = createNode(215, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87); @@ -8580,7 +8807,7 @@ var ts; if (token === 55) { return true; } - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { idToken = token; if (isClassMemberModifier(idToken)) { return true; @@ -8623,7 +8850,7 @@ var ts; } if (!decorators) { decorators = []; - decorators.pos = scanner.getStartPos(); + decorators.pos = decoratorStart; } var decorator = createNode(139, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); @@ -8634,14 +8861,21 @@ var ts; } return decorators; } - function parseModifiers() { + function parseModifiers(permitInvalidConstAsModifier) { var flags = 0; var modifiers; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token; - if (!parseAnyContextualModifier()) { - break; + if (token === 74 && permitInvalidConstAsModifier) { + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + break; + } + } + else { + if (!parseAnyContextualModifier()) { + break; + } } if (!modifiers) { modifiers = []; @@ -8674,13 +8908,13 @@ var ts; } function parseClassElement() { if (token === 23) { - var result = createNode(191); + var result = createNode(193); nextToken(); return finishNode(result); } var fullStart = getNodePos(); var decorators = parseDecorators(); - var modifiers = parseModifiers(); + var modifiers = parseModifiers(true); var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; @@ -8705,10 +8939,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 186); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 188); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 214); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -8741,12 +8975,9 @@ var ts; } return undefined; } - function parseHeritageClausesWorker() { - return parseList(20, parseHeritageClause); - } function parseHeritageClause() { if (token === 83 || token === 106) { - var node = createNode(243); + var node = createNode(245); node.token = token; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -8755,7 +8986,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(188); + var node = createNode(190); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -8769,7 +9000,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(217, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107); @@ -8780,7 +9011,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(216, fullStart); + var node = createNode(218, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132); @@ -8792,13 +9023,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(247, scanner.getStartPos()); + var node = createNode(249, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217, fullStart); + var node = createNode(219, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81); @@ -8813,7 +9044,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(221, scanner.getStartPos()); if (parseExpected(15)) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -8824,7 +9055,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(218, fullStart); + var node = createNode(220, fullStart); var namespaceFlag = flags & 65536; node.decorators = decorators; setModifiers(node, modifiers); @@ -8836,7 +9067,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218, fullStart); + var node = createNode(220, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -8866,11 +9097,6 @@ var ts; function nextTokenIsSlash() { return nextToken() === 39; } - function nextTokenIsCommaOrFromKeyword() { - nextToken(); - return token === 24 || - token === 133; - } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(89); var afterImportPos = scanner.getStartPos(); @@ -8878,7 +9104,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 24 && token !== 133) { - var importEqualsDeclaration = createNode(221, fullStart); + var importEqualsDeclaration = createNode(223, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -8888,7 +9114,7 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(222, fullStart); + var importDeclaration = createNode(224, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || @@ -8902,13 +9128,13 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(223, fullStart); + var importClause = createNode(225, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(24)) { - importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(225); + importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(227); } return finishNode(importClause); } @@ -8918,7 +9144,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(232); + var node = createNode(234); parseExpected(127); parseExpected(17); node.expression = parseModuleSpecifier(); @@ -8926,14 +9152,17 @@ var ts; return finishNode(node); } function parseModuleSpecifier() { - var result = parseExpression(); - if (result.kind === 9) { + if (token === 9) { + var result = parseLiteralNode(); internIdentifier(result.text); + return result; + } + else { + return parseExpression(); } - return result; } function parseNamespaceImport() { - var namespaceImport = createNode(224); + var namespaceImport = createNode(226); parseExpected(37); parseExpected(116); namespaceImport.name = parseIdentifier(); @@ -8941,14 +9170,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(21, kind === 225 ? parseImportSpecifier : parseExportSpecifier, 15, 16); + node.elements = parseBracketedList(21, kind === 227 ? parseImportSpecifier : parseExportSpecifier, 15, 16); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(230); + return parseImportOrExportSpecifier(232); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(226); + return parseImportOrExportSpecifier(228); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -8967,13 +9196,13 @@ var ts; else { node.name = identifierName; } - if (kind === 226 && checkIdentifierIsKeyword) { + if (kind === 228 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37)) { @@ -8981,7 +9210,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(229); + node.exportClause = parseNamedImportsOrExports(231); if (token === 133 || (token === 9 && !scanner.hasPrecedingLineBreak())) { parseExpected(133); node.moduleSpecifier = parseModuleSpecifier(); @@ -8991,7 +9220,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(227, fullStart); + var node = createNode(229, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56)) { @@ -9011,11 +9240,13 @@ var ts; var amdModuleName; while (true) { var kind = triviaScanner.scan(); - if (kind === 5 || kind === 4 || kind === 3) { - continue; - } if (kind !== 2) { - break; + if (ts.isTrivia(kind)) { + continue; + } + else { + break; + } } var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); @@ -9061,10 +9292,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 - || node.kind === 221 && node.moduleReference.kind === 232 - || node.kind === 222 - || node.kind === 227 - || node.kind === 228 + || node.kind === 223 && node.moduleReference.kind === 234 + || node.kind === 224 + || node.kind === 229 + || node.kind === 230 ? node : undefined; }); @@ -9099,7 +9330,7 @@ var ts; function parseJSDocTypeExpression(start, length) { scanner.setText(sourceText, start, length); token = nextToken(); - var result = createNode(249); + var result = createNode(251); parseExpected(15); result.type = parseJSDocTopLevelType(); parseExpected(16); @@ -9110,12 +9341,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47) { - var unionType = createNode(253, type.pos); + var unionType = createNode(255, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56) { - var optionalType = createNode(260, type.pos); + var optionalType = createNode(262, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -9126,20 +9357,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19) { - var arrayType = createNode(252, type.pos); + var arrayType = createNode(254, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20); type = finishNode(arrayType); } else if (token === 53) { - var nullableType = createNode(255, type.pos); + var nullableType = createNode(257, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49) { - var nonNullableType = createNode(256, type.pos); + var nonNullableType = createNode(258, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -9183,27 +9414,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(264); + var result = createNode(266); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(263); + var result = createNode(265); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(262); + var result = createNode(264); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(261); + var result = createNode(263); nextToken(); parseExpected(17); result.parameters = parseDelimitedList(22, parseJSDocParameter); @@ -9220,14 +9451,8 @@ var ts; parameter.type = parseJSDocType(); return finishNode(parameter); } - function parseJSDocOptionalType(type) { - var result = createNode(260, type.pos); - nextToken(); - result.type = type; - return finishNode(result); - } function parseJSDocTypeReference() { - var result = createNode(259); + var result = createNode(261); result.name = parseSimplePropertyName(); while (parseOptional(21)) { if (token === 25) { @@ -9262,7 +9487,7 @@ var ts; return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(257); + var result = createNode(259); nextToken(); result.members = parseDelimitedList(24, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -9270,7 +9495,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(258); + var result = createNode(260); result.name = parseSimplePropertyName(); if (token === 54) { nextToken(); @@ -9279,13 +9504,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(256); + var result = createNode(258); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(254); + var result = createNode(256); nextToken(); result.types = parseDelimitedList(25, parseJSDocType); checkForTrailingComma(result.types); @@ -9299,7 +9524,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(253); + var result = createNode(255); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18); @@ -9317,7 +9542,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(250); + var result = createNode(252); nextToken(); return finishNode(result); } @@ -9330,11 +9555,11 @@ var ts; token === 27 || token === 56 || token === 47) { - var result = createNode(251, pos); + var result = createNode(253, pos); return finishNode(result); } else { - var result = createNode(255, pos); + var result = createNode(257, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -9405,7 +9630,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(265, start); + var result = createNode(267, start); result.tags = tags; return finishNode(result, end); } @@ -9442,7 +9667,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(266, atToken.pos); + var result = createNode(268, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -9493,7 +9718,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(267, atToken.pos); + var result = createNode(269, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -9503,27 +9728,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 268; })) { + if (ts.forEach(tags, function (t) { return t.kind === 270; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(268, atToken.pos); + var result = createNode(270, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 269; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(269, atToken.pos); + var result = createNode(271, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -9547,7 +9772,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(270, atToken.pos); + var result = createNode(272, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -9869,16 +10094,16 @@ var ts; : 4; } function getModuleInstanceState(node) { - if (node.kind === 215 || node.kind === 216) { + if (node.kind === 217 || node.kind === 218) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 222 || node.kind === 221) && !(node.flags & 2)) { + else if ((node.kind === 224 || node.kind === 223) && !(node.flags & 2)) { return 0; } - else if (node.kind === 219) { + else if (node.kind === 221) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -9894,7 +10119,7 @@ var ts; }); return state; } - else if (node.kind === 218) { + else if (node.kind === 220) { return getModuleInstanceState(node.body); } else { @@ -9937,6 +10162,8 @@ var ts; file.symbolCount = symbolCount; file.classifiableNames = classifiableNames; } + file = undefined; + options = undefined; parent = undefined; container = undefined; blockScopeContainer = undefined; @@ -9965,13 +10192,17 @@ var ts; if (symbolFlags & 6240 && !symbol.members) { symbol.members = {}; } - if (symbolFlags & 107455 && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; + if (symbolFlags & 107455) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220)) { + symbol.valueDeclaration = node; + } } } function getDeclarationName(node) { if (node.name) { - if (node.kind === 218 && node.name.kind === 9) { + if (node.kind === 220 && node.name.kind === 9) { return "\"" + node.name.text + "\""; } if (node.name.kind === 136) { @@ -9995,14 +10226,24 @@ var ts; return "__new"; case 149: return "__index"; - case 228: + case 230: return "__export"; - case 227: + case 229: return node.isExportEquals ? "export=" : "default"; - case 181: - return "export="; - case 213: - case 214: + case 183: + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 2: + return "export="; + case 1: + case 4: + return node.left.name.text; + case 3: + return node.left.expression.name.text; + } + ts.Debug.fail("Unknown binary declaration kind"); + break; + case 215: + case 216: return node.flags & 512 ? "default" : undefined; } } @@ -10050,7 +10291,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; if (symbolFlags & 8388608) { - if (node.kind === 230 || (node.kind === 221 && hasExportModifier)) { + if (node.kind === 232 || (node.kind === 223 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -10097,10 +10338,10 @@ var ts; var kind = node.kind; var flags = node.flags; flags &= ~1572864; - if (kind === 215) { + if (kind === 217) { seenThisKeyword = false; } - var saveState = kind === 248 || kind === 219 || ts.isFunctionLikeKind(kind); + var saveState = kind === 250 || kind === 221 || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -10118,7 +10359,7 @@ var ts; flags |= 1048576; } } - if (kind === 215) { + if (kind === 217) { flags = seenThisKeyword ? flags | 262144 : flags & ~262144; } node.flags = flags; @@ -10139,40 +10380,40 @@ var ts; return; } switch (node.kind) { - case 198: + case 200: bindWhileStatement(node); break; - case 197: + case 199: bindDoStatement(node); break; - case 199: + case 201: bindForStatement(node); break; - case 200: - case 201: + case 202: + case 203: bindForInOrForOfStatement(node); break; - case 196: + case 198: bindIfStatement(node); break; - case 204: - case 208: + case 206: + case 210: bindReturnOrThrow(node); break; - case 203: - case 202: + case 205: + case 204: bindBreakOrContinueStatement(node); break; - case 209: + case 211: bindTryStatement(node); break; - case 206: + case 208: bindSwitchStatement(node); break; - case 220: + case 222: bindCaseBlock(node); break; - case 207: + case 209: bindLabeledStatement(node); break; default: @@ -10234,14 +10475,14 @@ var ts; } function bindReturnOrThrow(n) { bind(n.expression); - if (n.kind === 204) { + if (n.kind === 206) { hasExplicitReturn = true; } currentReachabilityState = 4; } function bindBreakOrContinueStatement(n) { bind(n.label); - var isValidJump = jumpToLabel(n.label, n.kind === 203 ? currentReachabilityState : 4); + var isValidJump = jumpToLabel(n.label, n.kind === 205 ? currentReachabilityState : 4); if (isValidJump) { currentReachabilityState = 4; } @@ -10262,7 +10503,7 @@ var ts; var postSwitchLabel = pushImplicitLabel(); bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244; }); var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); } @@ -10287,37 +10528,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 186: - case 214: - case 215: + case 188: + case 216: case 217: + case 219: case 155: - case 165: + case 167: return 1; case 147: case 148: case 149: case 143: case 142: - case 213: + case 215: case 144: case 145: case 146: case 152: case 153: - case 173: - case 174: - case 218: - case 248: - case 216: - return 5; - case 244: - case 199: - case 200: - case 201: + case 175: + case 176: case 220: + case 250: + case 218: + return 5; + case 246: + case 201: + case 202: + case 203: + case 222: return 2; - case 192: + case 194: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -10333,18 +10574,18 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 218: + case 220: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248: + case 250: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186: - case 214: + case 188: + case 216: return declareClassMember(node, symbolFlags, symbolExcludes); - case 217: + case 219: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); case 155: - case 165: - case 215: + case 167: + case 217: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); case 152: case 153: @@ -10356,10 +10597,10 @@ var ts; case 144: case 145: case 146: - case 213: - case 173: - case 174: - case 216: + case 215: + case 175: + case 176: + case 218: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -10374,11 +10615,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 248 ? node : node.body; - if (body.kind === 248 || body.kind === 219) { + var body = node.kind === 250 ? node : node.body; + if (body.kind === 250 || body.kind === 221) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 228 || stat.kind === 227) { + if (stat.kind === 230 || stat.kind === 229) { return true; } } @@ -10437,7 +10678,7 @@ var ts; continue; } var identifier = prop.name; - var currentKind = prop.kind === 245 || prop.kind === 246 || prop.kind === 143 + var currentKind = prop.kind === 247 || prop.kind === 248 || prop.kind === 143 ? 1 : 2; var existingKind = seen[identifier.text]; @@ -10459,10 +10700,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 218: + case 220: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 248: + case 250: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -10584,17 +10825,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 248: - case 219: + case 250: + case 221: updateStrictModeStatementList(node.statements); return; - case 192: + case 194: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 214: - case 186: + case 216: + case 188: inStrictMode = true; return; } @@ -10619,45 +10860,60 @@ var ts; switch (node.kind) { case 69: return checkStrictModeIdentifier(node); - case 181: + case 183: if (ts.isInJavaScriptFile(node)) { - if (ts.isExportsPropertyAssignment(node)) { - bindExportsPropertyAssignment(node); - } - else if (ts.isModuleExportsAssignment(node)) { - bindModuleExportsAssignment(node); + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 0: + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } } return checkStrictModeBinaryExpression(node); - case 244: + case 246: return checkStrictModeCatchClause(node); - case 175: + case 177: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 180: + case 182: return checkStrictModePostfixUnaryExpression(node); - case 179: + case 181: return checkStrictModePrefixUnaryExpression(node); - case 205: + case 207: return checkStrictModeWithStatement(node); - case 97: + case 161: seenThisKeyword = true; return; + case 150: + return checkTypePredicate(node); case 137: return declareSymbolAndAddToSymbolTable(node, 262144, 530912); case 138: return bindParameter(node); - case 211: - case 163: + case 213: + case 165: return bindVariableDeclarationOrBindingElement(node); case 141: case 140: return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); - case 245: - case 246: - return bindPropertyOrMethodOrAccessor(node, 4, 107455); case 247: + case 248: + return bindPropertyOrMethodOrAccessor(node, 4, 107455); + case 249: return bindPropertyOrMethodOrAccessor(node, 8, 107455); case 147: case 148: @@ -10666,7 +10922,7 @@ var ts; case 143: case 142: return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); - case 213: + case 215: checkStrictModeFunctionName(node); return declareSymbolAndAddToSymbolTable(node, 16, 106927); case 144: @@ -10680,44 +10936,54 @@ var ts; return bindFunctionOrConstructorType(node); case 155: return bindAnonymousDeclaration(node, 2048, "__type"); - case 165: + case 167: return bindObjectLiteralExpression(node); - case 173: - case 174: + case 175: + case 176: checkStrictModeFunctionName(node); var bindingName = node.name ? node.name.text : "__function"; return bindAnonymousDeclaration(node, 16, bindingName); - case 168: + case 170: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 186: - case 214: - return bindClassLikeDeclaration(node); - case 215: - return bindBlockScopedDeclaration(node, 64, 792960); + case 188: case 216: - return bindBlockScopedDeclaration(node, 524288, 793056); + return bindClassLikeDeclaration(node); case 217: - return bindEnumDeclaration(node); + return bindBlockScopedDeclaration(node, 64, 792960); case 218: + return bindBlockScopedDeclaration(node, 524288, 793056); + case 219: + return bindEnumDeclaration(node); + case 220: return bindModuleDeclaration(node); - case 221: - case 224: - case 226: - case 230: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); case 223: - return bindImportClause(node); + case 226: case 228: + case 232: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 225: + return bindImportClause(node); + case 230: return bindExportDeclaration(node); - case 227: + case 229: return bindExportAssignment(node); - case 248: + case 250: return bindSourceFileIfExternalModule(); } } + function checkTypePredicate(node) { + var parameterName = node.parameterName, type = node.type; + if (parameterName && parameterName.kind === 69) { + checkStrictModeIdentifier(parameterName); + } + if (parameterName && parameterName.kind === 161) { + seenThisKeyword = true; + } + bind(type); + } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -10728,7 +10994,7 @@ var ts; bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 227 ? node.expression : node.right; + var boundExpression = node.kind === 229 ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } @@ -10766,13 +11032,30 @@ var ts; setCommonJsModuleIndicator(node); bindExportAssignment(node); } + function bindThisPropertyAssignment(node) { + if (container.kind === 175 || container.kind === 215) { + container.symbol.members = container.symbol.members || {}; + declareSymbol(container.symbol.members, container.symbol, node, 4, 107455); + } + } + function bindPrototypePropertyAssignment(node) { + var classId = node.left.expression.expression; + var funcSymbol = container.locals[classId.text]; + if (!funcSymbol || !(funcSymbol.flags & 16)) { + return; + } + if (!funcSymbol.members) { + funcSymbol.members = {}; + } + declareSymbol(funcSymbol.members, funcSymbol, node.left, 4, 107455); + } function bindCallExpression(node) { if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { setCommonJsModuleIndicator(node); } } function bindClassLikeDeclaration(node) { - if (node.kind === 214) { + if (node.kind === 216) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -10824,9 +11107,7 @@ var ts; else { declareSymbolAndAddToSymbolTable(node, 1, 107455); } - if (node.flags & 56 && - node.parent.kind === 144 && - ts.isClassLike(node.parent.parent)) { + if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -10891,15 +11172,15 @@ var ts; function checkUnreachable(node) { switch (currentReachabilityState) { case 4: - var reportError = (ts.isStatement(node) && node.kind !== 194) || - node.kind === 214 || - (node.kind === 218 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 217 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatement(node) && node.kind !== 196) || + node.kind === 216 || + (node.kind === 220 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 219 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 193 || + (node.kind !== 195 || ts.getCombinedNodeFlags(node.declarationList) & 24576 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -10933,15 +11214,18 @@ var ts; var nextNodeId = 1; var nextMergeId = 1; function getNodeId(node) { - if (!node.id) - node.id = nextNodeId++; + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } return node.id; } ts.getNodeId = getNodeId; ts.checkTime = 0; function getSymbolId(symbol) { if (!symbol.id) { - symbol.id = nextSymbolId++; + symbol.id = nextSymbolId; + nextSymbolId++; } return symbol.id; } @@ -10958,8 +11242,10 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 ? 5 : 0; + var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === 4; var emitResolver = createResolver(); var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + undefinedSymbol.declarations = []; var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, @@ -10971,6 +11257,7 @@ var ts; getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -10987,7 +11274,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getApparentTypeOfContextualType, + getContextualType: getContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -11012,15 +11299,15 @@ var ts; var undefinedType = createIntrinsicType(32 | 2097152, "undefined"); var nullType = createIntrinsicType(64 | 2097152, "null"); var unknownType = createIntrinsicType(1, "unknown"); - var circularType = createIntrinsicType(1, "__circular__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var emptyUnionType = emptyObjectType; var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); emptyGenericType.instantiations = {}; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); anyFunctionType.flags |= 8388608; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); + var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; var globalESSymbolConstructorSymbol; var getGlobalPromiseConstructorSymbol; @@ -11033,8 +11320,6 @@ var ts; var globalRegExpType; var globalTemplateStringsArrayType; var globalESSymbolType; - var jsxElementType; - var jsxIntrinsicElementsType; var globalIterableType; var globalIteratorType; var globalIterableIteratorType; @@ -11051,6 +11336,7 @@ var ts; var getGlobalPromiseConstructorLikeType; var getGlobalThenableType; var jsxElementClassType; + var deferredNodes; var tupleTypes = {}; var unionTypes = {}; var intersectionTypes = {}; @@ -11085,19 +11371,31 @@ var ts; "symbol": { type: esSymbolType, flags: 16777216 + }, + "undefined": { + type: undefinedType, + flags: 2097152 } }; + var jsxElementType; + var jsxTypes = {}; var JsxNames = { JSX: "JSX", IntrinsicElements: "IntrinsicElements", ElementClass: "ElementClass", ElementAttributesPropertyNameContainer: "ElementAttributesProperty", - Element: "Element" + Element: "Element", + IntrinsicAttributes: "IntrinsicAttributes", + IntrinsicClassAttributes: "IntrinsicClassAttributes" }; var subtypeRelation = {}; var assignableRelation = {}; var identityRelation = {}; var _displayBuilder; + var builtinGlobals = (_a = {}, + _a[undefinedSymbol.name] = undefinedSymbol, + _a + ); initializeTypeChecker(); return checker; function getEmitResolver(sourceFile, cancellationToken) { @@ -11151,8 +11449,10 @@ var ts; return result; } function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { @@ -11176,8 +11476,11 @@ var ts; target.constEnumOnlyModule = false; } target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) + if (source.valueDeclaration && + (!target.valueDeclaration || + (target.valueDeclaration.kind === 220 && source.valueDeclaration.kind !== 220))) { target.valueDeclaration = source.valueDeclaration; + } ts.forEach(source.declarations, function (node) { target.declarations.push(node); }); @@ -11229,6 +11532,21 @@ var ts; } } } + function addToSymbolTable(target, source, message) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (ts.hasProperty(target, id)) { + ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + } + else { + target[id] = source[id]; + } + } + } + function addDeclarationDiagnostic(id, message) { + return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; + } + } function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; @@ -11240,10 +11558,16 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 248); + return ts.getAncestor(node, 250); } function isGlobalSourceFile(node) { - return node.kind === 248 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 250 && !ts.isExternalOrCommonJsModule(node); + } + function isPrimitiveApparentType(type) { + return type === globalStringType || + type === globalNumberType || + type === globalBooleanType || + type === globalESSymbolType; } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -11260,6 +11584,16 @@ var ts; } } } + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + var constructoDeclaration = parameter.parent; + var classDeclaration = parameter.parent.parent; + var parameterSymbol = getSymbol(constructoDeclaration.locals, parameterName, 107455); + var propertySymbol = getSymbol(classDeclaration.symbol.members, parameterName, 107455); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { var declarationFile = ts.getSourceFileOfNode(declaration); var useFile = ts.getSourceFileOfNode(usage); @@ -11271,18 +11605,18 @@ var ts; return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 211 || + return declaration.kind !== 213 || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 193 || - declaration.parent.parent.kind === 199) { + if (declaration.parent.parent.kind === 195 || + declaration.parent.parent.kind === 201) { return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 201 || - declaration.parent.parent.kind === 200) { + else if (declaration.parent.parent.kind === 203 || + declaration.parent.parent.kind === 202) { var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); } @@ -11318,23 +11652,38 @@ var ts; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - if (!(meaning & 793056) || - !(result.flags & (793056 & ~262144)) || - !ts.isFunctionLike(location) || - lastLocation === location.body) { + var useResult = true; + if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { + if (meaning & result.flags & 793056) { + useResult = result.flags & 262144 + ? lastLocation === location.type || + lastLocation.kind === 138 || + lastLocation.kind === 137 + : false; + } + if (meaning & 107455 && result.flags & 1) { + useResult = + lastLocation.kind === 138 || + (lastLocation === location.type && + result.valueDeclaration.kind === 138); + } + } + if (useResult) { break loop; } - result = undefined; + else { + result = undefined; + } } } switch (location.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location)) break; - case 218: + case 220: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 248 || - (location.kind === 218 && location.name.kind === 9)) { + if (location.kind === 250 || + (location.kind === 220 && location.name.kind === 9)) { if (result = moduleExports["default"]) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { @@ -11344,7 +11693,7 @@ var ts; } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 230)) { + ts.getDeclarationOfKind(moduleExports[name], 232)) { break; } } @@ -11352,7 +11701,7 @@ var ts; break loop; } break; - case 217: + case 219: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } @@ -11368,9 +11717,9 @@ var ts; } } break; - case 214: - case 186: - case 215: + case 216: + case 188: + case 217: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 64) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -11378,7 +11727,7 @@ var ts; } break loop; } - if (location.kind === 186 && meaning & 32) { + if (location.kind === 188 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -11388,7 +11737,7 @@ var ts; break; case 136: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 215) { + if (ts.isClassLike(grandparent) || grandparent.kind === 217) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; @@ -11400,14 +11749,14 @@ var ts; case 144: case 145: case 146: - case 213: - case 174: + case 215: + case 176: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 173: + case 175: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -11460,7 +11809,7 @@ var ts; ts.Debug.assert((result.flags & 2) !== 0); var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 211), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -11477,10 +11826,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 221) { + if (node.kind === 223) { return node; } - while (node && node.kind !== 222) { + while (node && node.kind !== 224) { node = node.parent; } return node; @@ -11490,7 +11839,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 232) { + if (node.moduleReference.kind === 234) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -11499,9 +11848,12 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); - if (!exportDefaultSymbol) { + if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } + else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + return resolveSymbol(moduleSymbol.exports["export="]) || resolveSymbol(moduleSymbol); + } return exportDefaultSymbol; } } @@ -11509,14 +11861,6 @@ var ts; var moduleSpecifier = node.parent.parent.moduleSpecifier; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } - function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3) { - var typeAnnotation = moduleSymbol.valueDeclaration.type; - if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); - } - } - } function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { if (valueSymbol.flags & (793056 | 1536)) { return valueSymbol; @@ -11579,17 +11923,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 221: - return getTargetOfImportEqualsDeclaration(node); case 223: + return getTargetOfImportEqualsDeclaration(node); + case 225: return getTargetOfImportClause(node); - case 224: - return getTargetOfNamespaceImport(node); case 226: + return getTargetOfNamespaceImport(node); + case 228: return getTargetOfImportSpecifier(node); - case 230: + case 232: return getTargetOfExportSpecifier(node); - case 227: + case 229: return getTargetOfExportAssignment(node); } } @@ -11631,10 +11975,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 227) { + if (node.kind === 229) { checkExpressionCached(node.expression); } - else if (node.kind === 230) { + else if (node.kind === 232) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -11644,7 +11988,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 221); + importDeclaration = ts.getAncestor(entityName, 223); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -11654,7 +11998,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 221); + ts.Debug.assert(entityName.parent.kind === 223); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -11673,7 +12017,7 @@ var ts; return undefined; } } - else if (name.kind === 135 || name.kind === 166) { + else if (name.kind === 135 || name.kind === 168) { var left = name.kind === 135 ? name.left : name.expression; var right = name.kind === 135 ? name.right : name.name; var namespace = resolveEntityName(left, 1536, ignoreErrors); @@ -11699,14 +12043,10 @@ var ts; return; } var moduleReferenceLiteral = moduleReferenceExpression; - var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (moduleName === undefined) { return; } - if (moduleName.indexOf("!") >= 0) { - moduleName = moduleName.substr(0, moduleName.indexOf("!")); - } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); @@ -11749,35 +12089,58 @@ var ts; var links = getSymbolLinks(moduleSymbol); return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } - function extendExportSymbols(target, source) { + function extendExportSymbols(target, source, lookupTable, exportNode) { for (var id in source) { if (id !== "default" && !ts.hasProperty(target, id)) { target[id] = source[id]; + if (lookupTable && exportNode) { + lookupTable[id] = { + specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) + }; + } + } + else if (lookupTable && exportNode && id !== "default" && ts.hasProperty(target, id) && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { + if (!lookupTable[id].exportsWithDuplicate) { + lookupTable[id].exportsWithDuplicate = [exportNode]; + } + else { + lookupTable[id].exportsWithDuplicate.push(exportNode); + } } } } function getExportsForModule(moduleSymbol) { - var result; var visitedSymbols = []; - visit(moduleSymbol); - return result || moduleSymbol.exports; + return visit(moduleSymbol) || moduleSymbol.exports; function visit(symbol) { - if (symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { - visitedSymbols.push(symbol); - if (symbol !== moduleSymbol) { - if (!result) { - result = cloneSymbolTable(moduleSymbol.exports); - } - extendExportSymbols(result, symbol.exports); - } - var exportStars = symbol.exports["__export"]; - if (exportStars) { - for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - visit(resolveExternalModuleName(node, node.moduleSpecifier)); - } - } + if (!(symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol))) { + return; } + visitedSymbols.push(symbol); + var symbols = cloneSymbolTable(symbol.exports); + var exportStars = symbol.exports["__export"]; + if (exportStars) { + var nestedSymbols = {}; + var lookupTable = {}; + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + var exportedSymbols = visit(resolvedModule); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + } + for (var id in lookupTable) { + var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || ts.hasProperty(symbols, id)) { + continue; + } + for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { + var node = exportsWithDuplicate_1[_b]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + } + } + extendExportSymbols(symbols, nestedSymbols); + } + return symbols; } } function getMergedSymbol(symbol) { @@ -11818,7 +12181,8 @@ var ts; } function createType(flags) { var result = new Type(checker, flags); - result.id = typeCount++; + result.id = typeCount; + typeCount++; return result; } function createIntrinsicType(kind, intrinsicName) { @@ -11876,17 +12240,17 @@ var ts; } } switch (location_1.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 218: + case 220: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 214: - case 215: + case 216: + case 217: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -11919,7 +12283,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -11948,7 +12312,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -12003,8 +12367,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 218 && declaration.name.kind === 9) || - (declaration.kind === 248 && ts.isExternalOrCommonJsModule(declaration)); + return (declaration.kind === 220 && declaration.name.kind === 9) || + (declaration.kind === 250 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12039,8 +12403,8 @@ var ts; if (entityName.parent.kind === 154) { meaning = 107455 | 1048576; } - else if (entityName.kind === 135 || entityName.kind === 166 || - entityName.parent.kind === 221) { + else if (entityName.kind === 135 || entityName.kind === 168 || + entityName.parent.kind === 223) { meaning = 1536; } else { @@ -12070,9 +12434,9 @@ var ts; ts.releaseStringWriter(writer); return result; } - function signatureToString(signature, enclosingDeclaration, flags) { + function signatureToString(signature, enclosingDeclaration, flags, kind) { var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); var result = writer.string(); ts.releaseStringWriter(writer); return result; @@ -12094,7 +12458,7 @@ var ts; while (node.kind === 160) { node = node.parent; } - if (node.kind === 216) { + if (node.kind === 218) { return getSymbolOfNode(node); } } @@ -12108,10 +12472,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 186: + case 188: return "(Anonymous class)"; - case 173: - case 174: + case 175: + case 176: return "(Anonymous function)"; } } @@ -12176,9 +12540,15 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 16777343) { - writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) - ? "any" - : type.intrinsicName); + if (type.flags & 134217728) { + buildTypePredicateDisplay(writer, type.predicate); + buildTypeDisplay(type.predicate.type, writer, enclosingDeclaration, flags, symbolStack); + } + else { + writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) + ? "any" + : type.intrinsicName); + } } else if (type.flags & 33554432) { if (inObjectTypeLiteral) { @@ -12230,11 +12600,13 @@ var ts; } if (pos < end) { writePunctuation(writer, 25); - writeType(typeArguments[pos++], 0); + writeType(typeArguments[pos], 0); + pos++; while (pos < end) { writePunctuation(writer, 24); writeSpace(writer); - writeType(typeArguments[pos++], 0); + writeType(typeArguments[pos], 0); + pos++; } writePunctuation(writer, 27); } @@ -12317,7 +12689,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 248 || declaration.parent.kind === 219; + return declaration.parent.kind === 250 || declaration.parent.kind === 221; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -12350,7 +12722,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 17); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, symbolStack); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack); if (flags & 64) { writePunctuation(writer, 18); } @@ -12362,7 +12734,7 @@ var ts; } writeKeyword(writer, 92); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, symbolStack); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack); if (flags & 64) { writePunctuation(writer, 18); } @@ -12376,15 +12748,13 @@ var ts; writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 92); - writeSpace(writer); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } @@ -12425,7 +12795,7 @@ var ts; if (p.flags & 536870912) { writePunctuation(writer, 53); } - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } @@ -12513,6 +12883,17 @@ var ts; } writePunctuation(writer, 18); } + function buildTypePredicateDisplay(writer, predicate) { + if (ts.isIdentifierTypePredicate(predicate)) { + writer.writeParameter(predicate.parameterName); + } + else { + writeKeyword(writer, 97); + } + writeSpace(writer); + writeKeyword(writer, 124); + writeSpace(writer); + } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { if (flags & 8) { writeSpace(writer); @@ -12522,20 +12903,14 @@ var ts; writePunctuation(writer, 54); } writeSpace(writer); - var returnType; - if (signature.typePredicate) { - writer.writeParameter(signature.typePredicate.parameterName); - writeSpace(writer); - writeKeyword(writer, 124); - writeSpace(writer); - returnType = signature.typePredicate.type; - } - else { - returnType = getReturnTypeOfSignature(signature); - } + var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { + if (kind === 1) { + writeKeyword(writer, 92); + writeSpace(writer); + } if (signature.target && (flags & 32)) { buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); } @@ -12558,73 +12933,33 @@ var ts; }); } function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 218) { - if (node.name.kind === 9) { - return node; - } - } - else if (node.kind === 248) { - return ts.isExternalOrCommonJsModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - var externalModule = getContainingExternalModule(node); - var exportAssignmentSymbol; - var resolvedExportSymbol; - if (externalModule) { - var externalModuleSymbol = getSymbolOfNode(externalModule); - exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - if (symbolOfNode.flags & 8388608) { - return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); - } - } - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608)) { - resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - return ts.forEach(resolvedExportSymbol.declarations, function (current) { - while (current) { - if (current === node) { - return true; - } - current = current.parent; - } - }); - } + if (node) { + var links = getNodeLinks(node); + if (links.isVisible === undefined) { + links.isVisible = !!determineIfDeclarationIsVisible(); } + return links.isVisible; } + return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 163: + case 165: return isDeclarationVisible(node.parent.parent); - case 211: + case 213: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 218: - case 214: - case 215: + case 220: case 216: - case 213: case 217: - case 221: + case 218: + case 215: + case 219: + case 223: var parent_4 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 2) && - !(node.kind !== 221 && parent_4.kind !== 248 && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 223 && parent_4.kind !== 250 && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } return isDeclarationVisible(parent_4); @@ -12642,7 +12977,7 @@ var ts; case 147: case 149: case 138: - case 219: + case 221: case 152: case 153: case 155: @@ -12653,33 +12988,26 @@ var ts; case 159: case 160: return isDeclarationVisible(node.parent); - case 223: - case 224: + case 225: case 226: + case 228: return false; case 137: - case 248: + case 250: return true; - case 227: + case 229: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 227) { + if (node.parent && node.parent.kind === 229) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 232) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -12754,7 +13082,7 @@ var ts; } function getDeclarationContainer(node) { node = ts.getRootDeclaration(node); - return node.kind === 211 ? node.parent.parent.parent : node.parent; + return node.kind === 213 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -12801,7 +13129,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 161) { + if (pattern.kind === 163) { var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { return anyType; @@ -12839,10 +13167,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 200) { + if (declaration.parent.parent.kind === 202) { return anyType; } - if (declaration.parent.parent.kind === 201) { + if (declaration.parent.parent.kind === 203) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -12867,7 +13195,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 246) { + if (declaration.kind === 248) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -12914,7 +13242,7 @@ var ts; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } - var elementTypes = ts.map(elements, function (e) { return e.kind === 187 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 189 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -12923,7 +13251,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 161 + return pattern.kind === 163 ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -12933,7 +13261,13 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 245 ? getWidenedType(type) : type; + if (declaration.kind === 247) { + return type; + } + if (type.flags & 134217728 && (declaration.kind === 141 || declaration.kind === 140)) { + return type; + } + return getWidenedType(type); } type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { @@ -12951,17 +13285,19 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 244) { + if (declaration.parent.kind === 246) { return links.type = anyType; } - if (declaration.kind === 227) { + if (declaration.kind === 229) { return links.type = checkExpression(declaration.expression); } - if (declaration.kind === 181) { + if (declaration.kind === 183) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 166) { - return checkExpressionCached(declaration.parent.right); + if (declaration.kind === 168) { + if (declaration.parent.kind === 183) { + return links.type = checkExpressionCached(declaration.parent.right); + } } if (!pushTypeResolution(symbol, 0)) { return unknownType; @@ -13117,9 +13453,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 214 || node.kind === 186 || - node.kind === 213 || node.kind === 173 || - node.kind === 143 || node.kind === 174) { + if (node.kind === 216 || node.kind === 188 || + node.kind === 215 || node.kind === 175 || + node.kind === 143 || node.kind === 176) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -13128,15 +13464,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 215); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 215 || node.kind === 214 || - node.kind === 186 || node.kind === 216) { + if (node.kind === 217 || node.kind === 216 || + node.kind === 188 || node.kind === 218) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -13191,9 +13527,6 @@ var ts; } return type.resolvedBaseConstructorType; } - function hasClassBaseType(type) { - return !!ts.forEach(getBaseTypes(type), function (t) { return !!(t.symbol.flags & 32); }); - } function getBaseTypes(type) { var isClass = type.symbol.flags & 32; var isInterface = type.symbol.flags & 64; @@ -13262,7 +13595,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 217 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -13291,7 +13624,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215) { + if (declaration.kind === 217) { if (declaration.flags & 262144) { return false; } @@ -13340,7 +13673,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 216); + var declaration = ts.getDeclarationOfKind(symbol, 218); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -13423,7 +13756,7 @@ var ts; case 120: case 131: case 103: - case 9: + case 162: return true; case 156: return isIndependentType(node.elementType); @@ -13488,14 +13821,6 @@ var ts; } } } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { - var signature = baseSignatures_1[_i]; - signatures.push(signature); - } - } - } function resolveDeclaredMembers(type) { if (!type.declaredProperties) { var symbol = type.symbol; @@ -13556,33 +13881,32 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasStringLiterals) { + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasStringLiterals = hasStringLiterals; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (!hasClassBaseType(classType)) { - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1); + if (baseSignatures.length === 0) { + return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, 0, false, false)]; + } var baseTypeNode = getBaseTypeNodeOfClass(classType); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); var typeArgCount = typeArguments ? typeArguments.length : 0; var result = []; - for (var _i = 0, baseSignatures_2 = baseSignatures; _i < baseSignatures_2.length; _i++) { - var baseSig = baseSignatures_2[_i]; + for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { + var baseSig = baseSignatures_1[_i]; var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; if (typeParamCount === typeArgCount) { var sig = typeParamCount ? getSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); @@ -13612,7 +13936,7 @@ var ts; function findMatchingSignature(signatureList, signature, partialMatch, ignoreReturnTypes) { for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) { var s = signatureList_1[_i]; - if (compareSignatures(s, signature, partialMatch, ignoreReturnTypes, compareTypes)) { + if (compareSignaturesIdentical(s, signature, partialMatch, ignoreReturnTypes, compareTypesIdentical)) { return s; } } @@ -13701,35 +14025,28 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - var members; - var callSignatures; - var constructSignatures; - var stringIndexType; - var numberIndexType; if (type.target) { - members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false); - callSignatures = instantiateList(getSignaturesOfType(type.target, 0), type.mapper, instantiateSignature); - constructSignatures = instantiateList(getSignaturesOfType(type.target, 1), type.mapper, instantiateSignature); - stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0), type.mapper); - numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1), type.mapper); + var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false); + var callSignatures = instantiateList(getSignaturesOfType(type.target, 0), type.mapper, instantiateSignature); + var constructSignatures = instantiateList(getSignaturesOfType(type.target, 1), type.mapper, instantiateSignature); + var stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0), type.mapper); + var numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1), type.mapper); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else if (symbol.flags & 2048) { - members = symbol.members; - callSignatures = getSignaturesOfSymbol(members["__call"]); - constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0); - numberIndexType = getIndexTypeOfSymbol(symbol, 1); + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else { - members = emptySymbols; - callSignatures = emptyArray; - constructSignatures = emptyArray; + var members = emptySymbols; + var constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 | 8192)) { - callSignatures = getSignaturesOfSymbol(symbol); - } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); @@ -13742,10 +14059,12 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); } } - stringIndexType = undefined; - numberIndexType = (symbol.flags & 384) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + setObjectTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexType); + if (symbol.flags & (16 | 8192)) { + type.callSignatures = getSignaturesOfSymbol(symbol); + } } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -13835,12 +14154,14 @@ var ts; function createUnionOrIntersectionProperty(containingType, name) { var types = containingType.types; var props; + var commonFlags = (containingType.flags & 32768) ? 536870912 : 0; for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { var current = types_2[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (prop && !(getDeclarationFlagsFromSymbol(prop) & (16 | 32))) { + commonFlags &= prop.flags; if (!props) { props = [prop]; } @@ -13868,7 +14189,10 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 | 67108864 | 268435456, name); + var result = createSymbol(4 | + 67108864 | + 268435456 | + commonFlags, name); result.containingType = containingType; result.declarations = declarations; result.type = containingType.flags & 16384 ? getUnionType(propTypes) : getIntersectionType(propTypes); @@ -13918,22 +14242,6 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfStructuredType(getApparentType(type), kind); } - function typeHasConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & (80896 | 16384)) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.constructSignatures.length > 0; - } - return false; - } - function typeHasCallOrConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & 130048) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.callSignatures.length > 0 || resolved.constructSignatures.length > 0; - } - return false; - } function getIndexTypeOfStructuredType(type, kind) { if (type.flags & 130048) { var resolved = resolveStructuredTypeMembers(type); @@ -13975,6 +14283,23 @@ var ts; } return false; } + function createTypePredicateFromTypePredicateNode(node) { + if (node.parameterName.kind === 69) { + var parameterName = node.parameterName; + return { + kind: 1, + parameterName: parameterName ? parameterName.text : undefined, + parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, + type: getTypeFromTypeNode(node.type) + }; + } + else { + return { + kind: 0, + type: getTypeFromTypeNode(node.type) + }; + } + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -13988,8 +14313,13 @@ var ts; var minArgumentCount = -1; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 9) { + var paramSymbol = param.symbol; + if (paramSymbol && !!(paramSymbol.flags & 4) && !ts.isBindingPattern(param.name)) { + var resolvedSymbol = resolveName(param, paramSymbol.name, 107455, undefined, undefined); + paramSymbol = resolvedSymbol; + } + parameters.push(paramSymbol); + if (param.type && param.type.kind === 162) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -14005,20 +14335,11 @@ var ts; minArgumentCount = declaration.parameters.length; } var returnType; - var typePredicate; if (classType) { returnType = classType; } else if (declaration.type) { returnType = getTypeFromTypeNode(declaration.type); - if (declaration.type.kind === 150) { - var typePredicateNode = declaration.type; - typePredicate = { - parameterName: typePredicateNode.parameterName ? typePredicateNode.parameterName.text : undefined, - parameterIndex: typePredicateNode.parameterName ? getTypePredicateParameterIndex(declaration.parameters, typePredicateNode.parameterName) : undefined, - type: getTypeFromTypeNode(typePredicateNode.type) - }; - } } else { if (declaration.kind === 145 && !ts.hasDynamicName(declaration)) { @@ -14029,7 +14350,7 @@ var ts; returnType = anyType; } } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); } return links.resolvedSignature; } @@ -14042,7 +14363,7 @@ var ts; switch (node.kind) { case 152: case 153: - case 213: + case 215: case 143: case 142: case 144: @@ -14051,8 +14372,8 @@ var ts; case 149: case 145: case 146: - case 173: - case 174: + case 175: + case 176: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -14168,17 +14489,38 @@ var ts; ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + function getConstraintDeclaration(type) { + return ts.getDeclarationOfKind(type.symbol, 137).constraint; + } + function hasConstraintReferenceTo(type, target) { + var checked; + while (type && type.flags & 512 && !ts.contains(checked, type)) { + if (type === target) { + return true; + } + (checked || (checked = [])).push(type); + var constraintDeclaration = getConstraintDeclaration(type); + type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); + } + return false; + } + function getConstraintOfTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 137).constraint); + var constraintDeclaration = getConstraintDeclaration(typeParameter); + var constraint = getTypeFromTypeNode(constraintDeclaration); + if (hasConstraintReferenceTo(constraint, typeParameter)) { + error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + constraint = unknownType; + } + typeParameter.constraint = constraint; } } - return type.constraint === noConstraintType ? undefined : type.constraint; + return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137).parent); @@ -14222,40 +14564,6 @@ var ts; } return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 137; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 151 && n.typeName.kind === 69) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); - if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent === typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = type.localTypeParameters; @@ -14292,9 +14600,6 @@ var ts; return type; } function getTypeFromNonGenericTypeReference(node, symbol) { - if (symbol.flags & 262144 && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - return unknownType; - } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -14330,9 +14635,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 214: - case 215: + case 216: case 217: + case 219: return declaration; } } @@ -14364,10 +14669,6 @@ var ts; if (arity === void 0) { arity = 0; } return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); } - function tryGetGlobalType(name, arity) { - if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalSymbol(name, 793056, undefined), arity); - } function getExportedTypeFromNamespace(namespace, name) { var namespaceSymbol = getGlobalSymbol(namespace, 1536, undefined); var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793056); @@ -14468,7 +14769,7 @@ var ts; } function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { - return emptyObjectType; + return emptyUnionType; } var typeSet = []; addTypesToSet(typeSet, types, 16384); @@ -14534,8 +14835,7 @@ var ts; } return links.resolvedType; } - function getStringLiteralType(node) { - var text = node.text; + function getStringLiteralTypeForText(text) { if (ts.hasProperty(stringLiteralTypes, text)) { return stringLiteralTypes[text]; } @@ -14543,17 +14843,17 @@ var ts; type.text = text; return type; } - function getTypeFromStringLiteral(node) { + function getTypeFromStringLiteralTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); + links.resolvedType = getStringLiteralTypeForText(node.text); } return links.resolvedType; } function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 215)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 217)) { if (!(container.flags & 64) && (container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -14569,6 +14869,22 @@ var ts; } return links.resolvedType; } + function getPredicateType(node) { + return createPredicateType(getSymbolOfNode(node), createTypePredicateFromTypePredicateNode(node)); + } + function createPredicateType(symbol, predicate) { + var type = createType(8 | 134217728); + type.symbol = symbol; + type.predicate = predicate; + return type; + } + function getTypeFromPredicateTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getPredicateType(node); + } + return links.resolvedType; + } function getTypeFromTypeNode(node) { switch (node.kind) { case 117: @@ -14583,15 +14899,15 @@ var ts; return esSymbolType; case 103: return voidType; - case 97: + case 161: return getTypeFromThisTypeNode(node); - case 9: - return getTypeFromStringLiteral(node); + case 162: + return getTypeFromStringLiteralTypeNode(node); case 151: return getTypeFromTypeReference(node); case 150: - return booleanType; - case 188: + return getTypeFromPredicateTypeNode(node); + case 190: return getTypeFromTypeReference(node); case 154: return getTypeFromTypeQueryNode(node); @@ -14669,18 +14985,22 @@ var ts; return t; }; } - function createInferenceMapper(context) { - var mapper = function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); + function getInferenceMapper(context) { + if (!context.mapper) { + var mapper = function (t) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + context.inferences[i].isFixed = true; + return getInferredType(context, i); + } } - } - return t; - }; - mapper.context = context; - return mapper; + return t; + }; + mapper.context = context; + context.mapper = mapper; + } + return context.mapper; } function identityMapper(type) { return type; @@ -14688,33 +15008,39 @@ var ts; function combineTypeMappers(mapper1, mapper2) { return function (t) { return instantiateType(mapper1(t), mapper2); }; } - function instantiateTypeParameter(typeParameter, mapper) { + function cloneTypeParameter(typeParameter) { var result = createType(512); result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); + result.target = typeParameter; + return result; + } + function cloneTypePredicate(predicate, mapper) { + if (ts.isIdentifierTypePredicate(predicate)) { + return { + kind: 1, + parameterName: predicate.parameterName, + parameterIndex: predicate.parameterIndex, + type: instantiateType(predicate.type, mapper) + }; } else { - result.target = typeParameter; - result.mapper = mapper; + return { + kind: 0, + type: instantiateType(predicate.type, mapper) + }; } - return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) { + var tp = freshTypeParameters_1[_i]; + tp.mapper = mapper; + } } - if (signature.typePredicate) { - freshTypePredicate = { - parameterName: signature.typePredicate.parameterName, - parameterIndex: signature.typePredicate.parameterIndex, - type: instantiateType(signature.typePredicate.type, mapper) - }; - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); result.target = signature; result.mapper = mapper; return result; @@ -14772,31 +15098,35 @@ var ts; if (type.flags & 32768) { return getIntersectionType(instantiateList(type.types, mapper, instantiateType)); } + if (type.flags & 134217728) { + var predicate = type.predicate; + return createPredicateType(type.symbol, cloneTypePredicate(predicate, mapper)); + } } return type; } function isContextSensitive(node) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 173: - case 174: + case 175: + case 176: return isContextSensitiveFunctionLikeDeclaration(node); - case 165: + case 167: return ts.forEach(node.properties, isContextSensitive); - case 164: + case 166: return ts.forEach(node.elements, isContextSensitive); - case 182: + case 184: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 181: + case 183: return node.operatorToken.kind === 52 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 245: + case 247: return isContextSensitive(node.initializer); case 143: case 142: return isContextSensitiveFunctionLikeDeclaration(node); - case 172: + case 174: return isContextSensitive(node.expression); } return false; @@ -14821,7 +15151,7 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined); } - function compareTypes(source, target) { + function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; } function isTypeSubtypeOf(source, target) { @@ -14836,10 +15166,73 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + var sourceMax = getNumNonRestParameters(source); + var targetMax = getNumNonRestParameters(target); + var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + if (!related) { + return false; + } + } + if (!ignoreReturnTypes) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return true; + } + var sourceReturnType = getReturnTypeOfSignature(source); + if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { + if (!(sourceReturnType.flags & 134217728)) { + return false; + } + } + return isTypeAssignableTo(sourceReturnType, targetReturnType); + } + return true; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + var erasedSource = getErasedSignature(implementation); + var erasedTarget = getErasedSignature(overload); + var sourceReturnType = getReturnTypeOfSignature(erasedSource); + var targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType + || checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, undefined) + || checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, undefined)) { + return isSignatureAssignableTo(erasedSource, erasedTarget, true); + } + return false; + } + function getNumNonRestParameters(signature) { + var numParams = signature.parameters.length; + return signature.hasRestParameter ? + numParams - 1 : + numParams; + } + function getNumParametersToCheckForSignatureRelatability(source, sourceNonRestParamCount, target, targetNonRestParamCount) { + if (source.hasRestParameter === target.hasRestParameter) { + if (source.hasRestParameter) { + return Math.max(sourceNonRestParamCount, targetNonRestParamCount) + 1; + } + else { + return Math.min(sourceNonRestParamCount, targetNonRestParamCount); + } + } + else { + return source.hasRestParameter ? + targetNonRestParamCount : + sourceNonRestParamCount; + } } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; @@ -14894,6 +15287,11 @@ var ts; return -1; if (source.flags & 128 && target === numberType) return -1; + if (source.flags & 128 && target.flags & 128) { + if (result = enumRelatedTo(source, target)) { + return result; + } + } if (source.flags & 256 && target === stringType) return -1; if (relation === assignableRelation) { @@ -14902,6 +15300,36 @@ var ts; if (source === numberType && target.flags & 128) return -1; } + if (source.flags & 8 && target.flags & 8) { + if (source.flags & 134217728 && target.flags & 134217728) { + var sourcePredicate = source; + var targetPredicate = target; + if (sourcePredicate.predicate.kind !== targetPredicate.predicate.kind) { + if (reportErrors) { + reportError(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0; + } + if (sourcePredicate.predicate.kind === 1) { + var sourceIdentifierPredicate = sourcePredicate.predicate; + var targetIdentifierPredicate = targetPredicate.predicate; + if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + if (reportErrors) { + reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0; + } + } + var related = isRelatedTo(sourcePredicate.predicate.type, targetPredicate.predicate.type, reportErrors, headMessage); + if (related === 0 && reportErrors) { + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return related; + } + return -1; + } if (source.flags & 1048576) { if (hasExcessProperties(source, target, reportErrors)) { if (reportErrors) { @@ -14977,9 +15405,6 @@ var ts; } return objectTypeRelatedTo(source, source, target, false); } - if (source.flags & 512 && target.flags & 512) { - return typeParameterIdenticalTo(source, target); - } if (source.flags & 16384 && target.flags & 16384 || source.flags & 32768 && target.flags & 32768) { if (result = eachTypeRelatedToSomeType(source, target)) { @@ -15088,8 +15513,9 @@ var ts; if (sources.length !== targets.length && relation === identityRelation) { return 0; } + var length = sources.length <= targets.length ? sources.length : targets.length; var result = -1; - for (var i = 0; i < targets.length; i++) { + for (var i = 0; i < length; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; @@ -15098,23 +15524,17 @@ var ts; } return result; } - function typeParameterIdenticalTo(source, target) { - if (source.constraint === target.constraint) { - return -1; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0; - } - return isIdenticalTo(source.constraint, target.constraint); - } - function objectTypeRelatedTo(apparentSource, originalSource, target, reportErrors) { + function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0; } - var id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id; + var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (!elaborateErrors || (related === 3)) { + if (elaborateErrors && related === 2) { + relation[id] = 3; + } + else { return related === 1 ? -1 : 0; } } @@ -15135,13 +15555,13 @@ var ts; maybeStack = []; expandingFlags = 0; } - sourceStack[depth] = apparentSource; + sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; maybeStack[depth][id] = 1; depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2; @@ -15150,15 +15570,15 @@ var ts; result = 1; } else { - result = propertiesRelatedTo(apparentSource, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 0, reportErrors); + result &= signaturesRelatedTo(source, target, 0, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 1, reportErrors); + result &= signaturesRelatedTo(source, target, 1, reportErrors); if (result) { - result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= stringIndexTypesRelatedTo(source, originalSource, target, reportErrors); if (result) { - result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= numberIndexTypesRelatedTo(source, originalSource, target, reportErrors); } } } @@ -15280,61 +15700,38 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + if (kind === 1 && sourceSignatures.length && targetSignatures.length && + isAbstractConstructorType(source) && !isAbstractConstructorType(target)) { + if (reportErrors) { + reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0; + } var result = -1; var saveErrorInfo = errorInfo; - if (kind === 1) { - var sourceSig = sourceSignatures[0]; - var targetSig = targetSignatures[0]; - result &= abstractSignatureRelatedTo(source, sourceSig, target, targetSig); - if (result !== -1) { - return result; - } - } outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; if (!t.hasStringLiterals || target.flags & 262144) { - var localErrors = reportErrors; - var checkedAbstractAssignability = false; + var shouldElaborateErrors = reportErrors; for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { var s = sourceSignatures_1[_a]; if (!s.hasStringLiterals || source.flags & 262144) { - var related = signatureRelatedTo(s, t, localErrors); + var related = signatureRelatedTo(s, t, shouldElaborateErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } - localErrors = false; + shouldElaborateErrors = false; } } + if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, undefined, undefined, kind)); + } return 0; } } return result; - function abstractSignatureRelatedTo(source, sourceSig, target, targetSig) { - if (sourceSig && targetSig) { - var sourceDecl = source.symbol && getClassLikeDeclarationOfSymbol(source.symbol); - var targetDecl = target.symbol && getClassLikeDeclarationOfSymbol(target.symbol); - if (!sourceDecl) { - return -1; - } - var sourceErasedSignature = getErasedSignature(sourceSig); - var targetErasedSignature = getErasedSignature(targetSig); - var sourceReturnType = sourceErasedSignature && getReturnTypeOfSignature(sourceErasedSignature); - var targetReturnType = targetErasedSignature && getReturnTypeOfSignature(targetErasedSignature); - var sourceReturnDecl = sourceReturnType && sourceReturnType.symbol && getClassLikeDeclarationOfSymbol(sourceReturnType.symbol); - var targetReturnDecl = targetReturnType && targetReturnType.symbol && getClassLikeDeclarationOfSymbol(targetReturnType.symbol); - var sourceIsAbstract = sourceReturnDecl && sourceReturnDecl.flags & 128; - var targetIsAbstract = targetReturnDecl && targetReturnDecl.flags & 128; - if (sourceIsAbstract && !(targetIsAbstract && targetDecl)) { - if (reportErrors) { - reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); - } - return 0; - } - } - return -1; - } } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -15382,37 +15779,19 @@ var ts; } result &= related; } - if (source.typePredicate && target.typePredicate) { - var hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex; - var hasDifferentTypes; - if (hasDifferentParameterIndex || - (hasDifferentTypes = !isTypeIdenticalTo(source.typePredicate.type, target.typePredicate.type))) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return result; + } + var sourceReturnType = getReturnTypeOfSignature(source); + if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { + if (!(sourceReturnType.flags & 134217728)) { if (reportErrors) { - var sourceParamText = source.typePredicate.parameterName; - var targetParamText = target.typePredicate.parameterName; - var sourceTypeText = typeToString(source.typePredicate.type); - var targetTypeText = typeToString(target.typePredicate.type); - if (hasDifferentParameterIndex) { - reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceParamText, targetParamText); - } - else if (hasDifferentTypes) { - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, sourceTypeText, targetTypeText); - } - reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, sourceParamText + " is " + sourceTypeText, targetParamText + " is " + targetTypeText); + reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); } return 0; } } - else if (!source.typePredicate && target.typePredicate) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) - return result; - var sourceReturnType = getReturnTypeOfSignature(source); return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); } function signaturesIdenticalTo(source, target, kind) { @@ -15422,8 +15801,8 @@ var ts; return 0; } var result = -1; - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - var related = compareSignatures(sourceSignatures[i], targetSignatures[i], false, false, isRelatedTo); + for (var i = 0, len = sourceSignatures.length; i < len; i++) { + var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], false, false, isRelatedTo); if (!related) { return 0; } @@ -15503,6 +15882,37 @@ var ts; } return 0; } + function enumRelatedTo(source, target) { + if (source.symbol.name !== target.symbol.name || + source.symbol.flags & 128 || + target.symbol.flags & 128) { + return 0; + } + var targetEnumType = getTypeOfSymbol(target.symbol); + for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { + var property = _a[_i]; + if (property.flags & 8) { + var targetProperty = getPropertyOfType(targetEnumType, property.name); + if (!targetProperty || !(targetProperty.flags & 8)) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); + return 0; + } + } + } + return -1; + } + } + function isAbstractConstructorType(type) { + if (type.flags & 65536) { + var symbol = type.symbol; + if (symbol && symbol.flags & 32) { + var declaration = getClassLikeDeclarationOfSymbol(symbol); + if (declaration && declaration.flags & 128) { + return true; + } + } + } + return false; } function isDeeplyNestedGeneric(type, stack, depth) { if (type.flags & (4096 | 131072) && depth >= 5) { @@ -15520,7 +15930,7 @@ var ts; return false; } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0; + return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0; } function compareProperties(sourceProp, targetProp, compareTypes) { if (sourceProp === targetProp) { @@ -15555,31 +15965,19 @@ var ts; } return false; } - function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + function compareSignaturesIdentical(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1; } if (!(isMatchingSignature(source, target, partialMatch))) { return 0; } - var result = -1; - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return 0; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); - if (!related) { - return 0; - } - result &= related; - } - } - else if (source.typeParameters || target.typeParameters) { + if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { return 0; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1; var targetLen = target.parameters.length; for (var i = 0; i < targetLen; i++) { var s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); @@ -15696,10 +16094,13 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 6291456) { + if (type.flags & 140509184) { if (type.flags & (32 | 64)) { return anyType; } + if (type.flags & 134217728) { + return booleanType; + } if (type.flags & 524288) { return getWidenedTypeOfObjectLiteral(type); } @@ -15763,13 +16164,13 @@ var ts; ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 213: + case 215: case 143: case 142: case 145: case 146: - case 173: - case 174: + case 175: + case 176: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -15815,13 +16216,7 @@ var ts; } } function createInferenceContext(typeParameters, inferUnionTypes) { - var inferences = []; - for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { - var unused = typeParameters_1[_i]; - inferences.push({ - primary: undefined, secondary: undefined, isFixed: false - }); - } + var inferences = ts.map(typeParameters, createTypeInferencesObject); return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -15829,6 +16224,13 @@ var ts; inferredTypes: new Array(typeParameters.length) }; } + function createTypeInferencesObject() { + return { + primary: undefined, + secondary: undefined, + isFixed: false + }; + } function inferTypes(context, source, target) { var sourceStack; var targetStack; @@ -15844,6 +16246,21 @@ var ts; return false; } function inferFromTypes(source, target) { + if (source.flags & 16384 && target.flags & 16384 || + source.flags & 32768 && target.flags & 32768) { + var matchingTypes; + for (var _i = 0, _a = target.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (typeIdenticalToSomeType(t, source.types)) { + (matchingTypes || (matchingTypes = [])).push(t); + inferFromTypes(t, t); + } + } + if (matchingTypes) { + source = removeTypesFromUnionOrIntersection(source, matchingTypes); + target = removeTypesFromUnionOrIntersection(target, matchingTypes); + } + } if (target.flags & 512) { if (source.flags & 8388608) { return; @@ -15872,6 +16289,11 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } + else if (source.flags & 134217728 && target.flags & 134217728) { + if (source.predicate.kind === target.predicate.kind) { + inferFromTypes(source.predicate.type, target.predicate.type); + } + } else if (source.flags & 8192 && target.flags & 8192 && source.elementTypes.length === target.elementTypes.length) { var sourceTypes = source.elementTypes; var targetTypes = target.elementTypes; @@ -15883,8 +16305,8 @@ var ts; var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { - var t = targetTypes_2[_i]; + for (var _b = 0, targetTypes_2 = targetTypes; _b < targetTypes_2.length; _b++) { + var t = targetTypes_2[_b]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -15901,15 +16323,16 @@ var ts; } else if (source.flags & 49152) { var sourceTypes = source.types; - for (var _a = 0, sourceTypes_3 = sourceTypes; _a < sourceTypes_3.length; _a++) { - var sourceType = sourceTypes_3[_a]; + for (var _c = 0, sourceTypes_3 = sourceTypes; _c < sourceTypes_3.length; _c++) { + var sourceType = sourceTypes_3[_c]; inferFromTypes(sourceType, target); } } else { source = getApparentType(source); - if (source.flags & 80896 && (target.flags & (4096 | 8192) || - (target.flags & 65536) && target.symbol && target.symbol.flags & (8192 | 2048 | 32))) { + if (source.flags & 80896 && (target.flags & 4096 && target.typeArguments || + target.flags & 8192 || + target.flags & 65536 && target.symbol && target.symbol.flags & (8192 | 2048 | 32))) { if (isInProcess(source, target)) { return; } @@ -15955,14 +16378,7 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromTypes); - if (source.typePredicate && target.typePredicate) { - if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); - } - } - else { - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } function inferFromIndexTypes(source, target, sourceKind, targetKind) { var targetIndexType = getIndexTypeOfType(target, targetKind); @@ -15974,6 +16390,25 @@ var ts; } } } + function typeIdenticalToSomeType(type, types) { + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; + if (isTypeIdenticalTo(t, type)) { + return true; + } + } + return false; + } + function removeTypesFromUnionOrIntersection(type, typesToRemove) { + var reducedTypes = []; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (!typeIdenticalToSomeType(t, typesToRemove)) { + reducedTypes.push(t); + } + } + return type.flags & 16384 ? getUnionType(reducedTypes, true) : getIntersectionType(reducedTypes); + } function getInferenceCandidates(context, index) { var inferences = context.inferences[index]; return inferences.primary || inferences.secondary || emptyArray; @@ -15992,14 +16427,19 @@ var ts; inferredType = emptyObjectType; inferenceSucceeded = true; } + context.inferredTypes[index] = inferredType; if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + if (constraint) { + var instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); + if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + context.inferredTypes[index] = inferredType = instantiatedConstraint; + } + } } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { context.failedTypeParameterIndex = index; } - context.inferredTypes[index] = inferredType; } return inferredType; } @@ -16009,9 +16449,6 @@ var ts; } return context.inferredTypes; } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { @@ -16034,21 +16471,6 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384) { - var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - return getUnionType(emptyArray); - } - return type; - } function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } @@ -16066,10 +16488,7 @@ var ts; return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 56 && node.operatorToken.kind <= 68) { - var n = node.left; - while (n.kind === 172) { - n = n.expression; - } + var n = skipParenthesizedNodes(node.left); if (n.kind === 69 && getResolvedSymbol(n) === symbol) { return true; } @@ -16084,55 +16503,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 181: + case 183: return isAssignedInBinaryExpression(node); - case 211: - case 163: - return isAssignedInVariableDeclaration(node); - case 161: - case 162: - case 164: + case 213: case 165: + return isAssignedInVariableDeclaration(node); + case 163: + case 164: case 166: case 167: case 168: case 169: + case 170: case 171: - case 189: - case 172: - case 179: - case 175: - case 178: - case 176: + case 173: + case 191: + case 174: + case 181: case 177: case 180: - case 184: + case 178: + case 179: case 182: - case 185: - case 192: - case 193: + case 186: + case 184: + case 187: + case 194: case 195: - case 196: case 197: case 198: case 199: case 200: case 201: - case 204: - case 205: + case 202: + case 203: case 206: - case 241: - case 242: case 207: case 208: - case 209: + case 243: case 244: - case 233: - case 234: - case 238: - case 239: + case 209: + case 210: + case 211: + case 246: case 235: + case 236: case 240: + case 241: + case 237: + case 242: return ts.forEachChild(node, isAssignedIn); } return false; @@ -16142,53 +16561,66 @@ var ts; var type = getTypeOfSymbol(symbol); if (node && symbol.flags & 3) { if (isTypeAny(type) || type.flags & (80896 | 16384 | 512)) { + var declaration = ts.getDeclarationOfKind(symbol, 213); + var top_1 = declaration && getDeclarationContainer(declaration); + var originalType = type; + var nodeStack = []; loop: while (node.parent) { var child = node; node = node.parent; - var narrowedType = type; switch (node.kind) { - case 196: - if (child !== node.expression) { - narrowedType = narrowType(type, node.expression, child === node.thenStatement); - } + case 198: + case 184: + case 183: + nodeStack.push({ node: node, child: child }); break; - case 182: - if (child !== node.condition) { - narrowedType = narrowType(type, node.condition, child === node.whenTrue); - } - break; - case 181: - if (child === node.right) { - if (node.operatorToken.kind === 51) { - narrowedType = narrowType(type, node.left, true); - } - else if (node.operatorToken.kind === 52) { - narrowedType = narrowType(type, node.left, false); - } - } - break; - case 248: - case 218: - case 213: - case 143: - case 142: - case 145: - case 146: - case 144: + case 250: + case 220: break loop; } - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; + if (node === top_1) { + break; } } + var nodes; + while (nodes = nodeStack.pop()) { + var node_1 = nodes.node, child = nodes.child; + switch (node_1.kind) { + case 198: + if (child !== node_1.expression) { + type = narrowType(type, node_1.expression, child === node_1.thenStatement); + } + break; + case 184: + if (child !== node_1.condition) { + type = narrowType(type, node_1.condition, child === node_1.whenTrue); + } + break; + case 183: + if (child === node_1.right) { + if (node_1.operatorToken.kind === 51) { + type = narrowType(type, node_1.left, true); + } + else if (node_1.operatorToken.kind === 52) { + type = narrowType(type, node_1.left, false); + } + } + break; + default: + ts.Debug.fail("Unreachable!"); + } + if (type !== originalType && isVariableAssignedWithin(symbol, node_1)) { + type = originalType; + } + } + if (type === emptyUnionType) { + type = originalType; + } } } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 176 || expr.right.kind !== 9) { + if (expr.left.kind !== 178 || expr.right.kind !== 9) { return type; } var left = expr.left; @@ -16196,24 +16628,30 @@ var ts; if (left.expression.kind !== 69 || getResolvedSymbol(left.expression) !== symbol) { return type; } - var typeInfo = primitiveTypeInfo[right.text]; if (expr.operatorToken.kind === 33) { assumeTrue = !assumeTrue; } - if (assumeTrue) { - if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 16777216, true, false); - } - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - return removeTypesFromUnionType(type, typeInfo.flags, false, false); + var typeInfo = primitiveTypeInfo[right.text]; + if (typeInfo && typeInfo.type === undefinedType) { + return type; + } + if (!!(type.flags & 1) && typeInfo && assumeTrue) { + return typeInfo.type; + } + var flags; + if (typeInfo) { + flags = typeInfo.flags; } else { - if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true, false); - } - return type; + assumeTrue = !assumeTrue; + flags = 132 | 258 | 16777216 | 8; + } + if (!(type.flags & 16384)) { + return filterUnion(type) ? type : emptyUnionType; + } + return getUnionType(ts.filter(type.types, filterUnion), true); + function filterUnion(type) { + return assumeTrue === !!(type.flags & flags); } } function narrowTypeByAnd(type, expr, assumeTrue) { @@ -16223,7 +16661,7 @@ var ts; else { return getUnionType([ narrowType(type, expr.left, false), - narrowType(narrowType(type, expr.left, true), expr.right, false) + narrowType(type, expr.right, false) ]); } } @@ -16231,7 +16669,7 @@ var ts; if (assumeTrue) { return getUnionType([ narrowType(type, expr.left, true), - narrowType(narrowType(type, expr.left, false), expr.right, true) + narrowType(type, expr.right, true) ]); } else { @@ -16267,17 +16705,17 @@ var ts; } } if (targetType) { - if (!assumeTrue) { - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); - } - return type; - } - return getNarrowedType(type, targetType); + return getNarrowedType(type, targetType, assumeTrue); } return type; } - function getNarrowedType(originalType, narrowedTypeCandidate) { + function getNarrowedType(originalType, narrowedTypeCandidate, assumeTrue) { + if (!assumeTrue) { + if (originalType.flags & 16384) { + return getUnionType(ts.filter(originalType.types, function (t) { return !isTypeSubtypeOf(t, narrowedTypeCandidate); })); + } + return originalType; + } if (originalType.flags & 16384) { var assignableConstituents = ts.filter(originalType.types, function (t) { return isTypeAssignableTo(t, narrowedTypeCandidate); }); if (assignableConstituents.length) { @@ -16294,26 +16732,60 @@ var ts; return type; } var signature = getResolvedSignature(expr); - if (signature.typePredicate && - expr.arguments[signature.typePredicate.parameterIndex] && - getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { - if (!assumeTrue) { - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, signature.typePredicate.type); })); - } - return type; + var predicateType = getReturnTypeOfSignature(signature); + if (!predicateType || !(predicateType.flags & 134217728)) { + return type; + } + var predicate = predicateType.predicate; + if (ts.isIdentifierTypePredicate(predicate)) { + var callExpression = expr; + if (callExpression.arguments[predicate.parameterIndex] && + getSymbolAtTypePredicatePosition(callExpression.arguments[predicate.parameterIndex]) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); } - return getNarrowedType(type, signature.typePredicate.type); + } + else { + var expression = skipParenthesizedNodes(expr.expression); + return narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue); } return type; } + function narrowTypeByTypePredicateMember(type, expr, assumeTrue) { + if (type.flags & 1) { + return type; + } + var memberType = getTypeOfExpression(expr); + if (!(memberType.flags & 134217728)) { + return type; + } + return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); + } + function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { + if (expression.kind === 169 || expression.kind === 168) { + var accessExpression = expression; + var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); + if (possibleIdentifier.kind === 69 && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); + } + } + return type; + } + function getSymbolAtTypePredicatePosition(expr) { + expr = skipParenthesizedNodes(expr); + switch (expr.kind) { + case 69: + case 168: + case 135: + return getSymbolOfEntityNameOrPropertyAccessExpression(expr); + } + } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 168: + case 170: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 172: + case 174: return narrowType(type, expr.expression, assumeTrue); - case 181: + case 183: var operator = expr.operatorToken.kind; if (operator === 32 || operator === 33) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -16328,20 +16800,29 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 179: + case 181: if (expr.operator === 49) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 169: + case 168: + return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } + function skipParenthesizedNodes(expression) { + while (expression.kind === 174) { + expression = expression.expression; + } + return expression; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 174) { + if (container.kind === 176) { if (languageVersion < 2) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -16372,7 +16853,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 244) { + symbol.valueDeclaration.parent.kind === 246) { return; } var container; @@ -16381,11 +16862,11 @@ var ts; } else { container = symbol.valueDeclaration; - while (container.kind !== 212) { + while (container.kind !== 214) { container = container.parent; } container = container.parent; - if (container.kind === 193) { + if (container.kind === 195) { container = container.parent; } } @@ -16415,15 +16896,15 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 174) { + if (container.kind === 176) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 218: + case 220: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 217: + case 219: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; case 144: @@ -16448,6 +16929,18 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } + if (ts.isInJavaScriptFile(node) && container.kind === 175) { + if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { + var className = container.parent + .left + .expression + .expression; + var classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && (classSymbol.flags & 16)) { + return getInferredClassType(classSymbol); + } + } + } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { @@ -16459,50 +16952,64 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 168 && node.parent.expression === node; - var classDeclaration = ts.getContainingClass(node); - var classType = classDeclaration && getDeclaredTypeOfSymbol(getSymbolOfNode(classDeclaration)); - var baseClassType = classType && getBaseTypes(classType)[0]; + var isCallExpression = node.parent.kind === 170 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 174) { + while (container && container.kind === 176) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } } var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; - if (canUseSuperExpression) { - if ((container.flags & 64) || isCallExpression) { - nodeCheckFlag = 512; - } - else { - nodeCheckFlag = 256; - } - getNodeLinks(node).flags |= nodeCheckFlag; - if (needToCaptureLexicalThis) { - captureLexicalThis(node.parent, container); - } - } - if (!baseClassType) { - if (!classDeclaration || !ts.getClassExtendsHeritageClauseElement(classDeclaration)) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - } - return unknownType; - } if (!canUseSuperExpression) { - if (container && container.kind === 136) { + var current = node; + while (current && current !== container && current.kind !== 136) { + current = current.parent; + } + if (current && current.kind === 136) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return unknownType; } + if ((container.flags & 64) || isCallExpression) { + nodeCheckFlag = 512; + } + else { + nodeCheckFlag = 256; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 167) { + if (languageVersion < 2) { + error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return unknownType; + } + else { + return anyType; + } + } + var classLikeDeclaration = container.parent; + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration)); + var baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + } + return unknownType; + } if (container.kind === 144 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -16518,7 +17025,7 @@ var ts; return container.kind === 144; } else { - if (container && ts.isClassLike(container.parent)) { + if (ts.isClassLike(container.parent) || container.parent.kind === 167) { if (container.flags & 64) { return container.kind === 143 || container.kind === 142 || @@ -16629,7 +17136,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 170) { + if (template.parent.kind === 172) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -16649,6 +17156,11 @@ var ts; } return type; } + else if (operator === 51 || operator === 24) { + if (node === binaryExpression.right) { + return getContextualType(binaryExpression); + } + } return undefined; } function applyToContextualType(type, mapper) { @@ -16658,8 +17170,8 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var current = types_7[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var current = types_8[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -16731,21 +17243,20 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForJsxExpression(expr) { - if (expr.parent.kind === 238) { - var attrib = expr.parent; - var attrsType = getJsxElementAttributesType(attrib.parent); + function getContextualTypeForJsxAttribute(attribute) { + var kind = attribute.kind; + var jsxElement = attribute.parent; + var attrsType = getJsxElementAttributesType(jsxElement); + if (attribute.kind === 240) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } - else { - return getTypeOfPropertyOfType(attrsType, attrib.name.text); - } + return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - if (expr.kind === 239) { - return getJsxElementAttributesType(expr.parent); + else if (attribute.kind === 241) { + return attrsType; } - return undefined; + ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } function getApparentTypeOfContextualType(node) { var type = getContextualType(node); @@ -16760,39 +17271,41 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 211: + case 213: case 138: case 141: case 140: - case 163: + case 165: return getContextualTypeForInitializerExpression(node); - case 174: - case 204: + case 176: + case 206: return getContextualTypeForReturnExpression(node); - case 184: + case 186: return getContextualTypeForYieldOperand(parent); - case 168: - case 169: - return getContextualTypeForArgument(parent, node); + case 170: case 171: - case 189: + return getContextualTypeForArgument(parent, node); + case 173: + case 191: return getTypeFromTypeNode(parent.type); - case 181: + case 183: return getContextualTypeForBinaryOperand(node); - case 245: + case 247: return getContextualTypeForObjectLiteralElement(parent); - case 164: + case 166: return getContextualTypeForElementExpression(node); - case 182: + case 184: return getContextualTypeForConditionalOperand(node); - case 190: - ts.Debug.assert(parent.parent.kind === 183); + case 192: + ts.Debug.assert(parent.parent.kind === 185); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 172: + case 174: + return getContextualType(parent); + case 242: return getContextualType(parent); case 240: - case 239: - return getContextualTypeForJsxExpression(parent); + case 241: + return getContextualTypeForJsxAttribute(parent); } return undefined; } @@ -16806,7 +17319,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 173 || node.kind === 174; + return node.kind === 175 || node.kind === 176; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -16826,14 +17339,14 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var current = types_8[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var current = types_9[_i]; var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { signatureList = [signature]; } - else if (!compareSignatures(signatureList[0], signature, false, true, compareTypes)) { + else if (!compareSignaturesIdentical(signatureList[0], signature, false, true, compareTypesIdentical)) { return undefined; } else { @@ -16854,13 +17367,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 181 && parent.operatorToken.kind === 56 && parent.left === node) { + if (parent.kind === 183 && parent.operatorToken.kind === 56 && parent.left === node) { return true; } - if (parent.kind === 245) { + if (parent.kind === 247) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 164) { + if (parent.kind === 166) { return isAssignmentTarget(parent); } return false; @@ -16870,8 +17383,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function hasDefaultValue(node) { - return (node.kind === 163 && !!node.initializer) || - (node.kind === 181 && node.operatorToken.kind === 56); + return (node.kind === 165 && !!node.initializer) || + (node.kind === 183 && node.operatorToken.kind === 56); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -16880,7 +17393,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 185) { + if (inDestructuringPattern && e.kind === 187) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); @@ -16892,7 +17405,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 185; + hasSpreadElement = hasSpreadElement || e.kind === 187; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -16903,7 +17416,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 162 || pattern.kind === 164)) { + if (pattern && (pattern.kind === 164 || pattern.kind === 166)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -16911,7 +17424,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 187) { + if (patternElement.kind !== 189) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -16957,31 +17470,31 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 161 || contextualType.pattern.kind === 165); + (contextualType.pattern.kind === 163 || contextualType.pattern.kind === 167); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 245 || - memberDecl.kind === 246 || + if (memberDecl.kind === 247 || + memberDecl.kind === 248 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 245) { + if (memberDecl.kind === 247) { type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 143) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 246); + ts.Debug.assert(memberDecl.kind === 248); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 245 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 246 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 247 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 248 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912; } @@ -17060,34 +17573,19 @@ var ts; checkJsxOpeningLikeElement(node); return jsxElementType || anyType; } - function tagNamesAreEquivalent(lhs, rhs) { - if (lhs.kind !== rhs.kind) { - return false; - } - if (lhs.kind === 69) { - return lhs.text === rhs.text; - } - return lhs.right.text === rhs.right.text && - tagNamesAreEquivalent(lhs.left, rhs.left); - } function checkJsxElement(node) { checkJsxOpeningLikeElement(node.openingElement); - if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { - error(node.closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNode(node.openingElement.tagName)); - } - else { - getJsxElementTagSymbol(node.closingElement); - } + getJsxElementTagSymbol(node.closingElement); for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 240: + case 242: checkJsxExpression(child); break; - case 233: + case 235: checkJsxElement(child); break; - case 234: + case 236: checkJsxSelfClosingElement(child); break; } @@ -17155,14 +17653,13 @@ var ts; } return type; } - function getJsxIntrinsicElementsType() { - if (!jsxIntrinsicElementsType) { - jsxIntrinsicElementsType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.IntrinsicElements) || unknownType; + function getJsxType(name) { + if (jsxTypes[name] === undefined) { + return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; } - return jsxIntrinsicElementsType; + return jsxTypes[name]; } function getJsxElementTagSymbol(node) { - var flags = 8; var links = getNodeLinks(node); if (!links.resolvedSymbol) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -17174,7 +17671,7 @@ var ts; } return links.resolvedSymbol; function lookupIntrinsicTag(node) { - var intrinsicElementsType = getJsxIntrinsicElementsType(); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.text); if (intrinsicProp) { @@ -17234,12 +17731,7 @@ var ts; return unknownType; } } - var returnType = getUnionType(signatures.map(getReturnTypeOfSignature)); - var elemClassType = getJsxGlobalElementClassType(); - if (elemClassType) { - checkTypeRelatedTo(returnType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); - } - return returnType; + return getUnionType(signatures.map(getReturnTypeOfSignature)); } function getJsxElementPropertiesName() { var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1536, undefined); @@ -17268,6 +17760,20 @@ var ts; var sym = getJsxElementTagSymbol(node); if (links.jsxFlags & 4) { var elemInstanceType = getJsxElementInstanceType(node); + var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + var elemClassType = getJsxGlobalElementClassType(); + if (elemClassType) { + checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + } if (isTypeAny(elemInstanceType)) { return links.resolvedJsxType = elemInstanceType; } @@ -17286,12 +17792,29 @@ var ts; else if (isTypeAny(attributesType) || (attributesType === unknownType)) { return links.resolvedJsxType = attributesType; } - else if (!(attributesType.flags & 80896)) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_must_be_an_object_type, typeToString(attributesType)); + else if (attributesType.flags & 16384) { + error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); return links.resolvedJsxType = anyType; } else { - return links.resolvedJsxType = attributesType; + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + if (typeParams) { + if (typeParams.length === 1) { + apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); + } + } + else { + apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); + } + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return links.resolvedJsxType = apparentAttributesType; } } } @@ -17319,7 +17842,7 @@ var ts; return jsxElementClassType; } function getJsxIntrinsicTagNames() { - var intrinsics = getJsxIntrinsicElementsType(); + var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; } function checkJsxPreconditions(errorNode) { @@ -17335,21 +17858,21 @@ var ts; function checkJsxOpeningLikeElement(node) { checkGrammarJsxElement(node); checkJsxPreconditions(node); - if (compilerOptions.jsx === 2) { - var reactSym = resolveName(node.tagName, "React", 107455, ts.Diagnostics.Cannot_find_name_0, "React"); - if (reactSym) { - getSymbolLinks(reactSym).referenced = true; - } + var reactRefErr = compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; + var reactSym = resolveName(node.tagName, reactNamespace, 107455, reactRefErr, reactNamespace); + if (reactSym) { + getSymbolLinks(reactSym).referenced = true; } var targetAttributesType = getJsxElementAttributesType(node); var nameTable = {}; var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 238) { + if (node.attributes[i].kind === 240) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 239); + ts.Debug.assert(node.attributes[i].kind === 241); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -17384,10 +17907,10 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95) { - var errorNode = node.kind === 166 ? + var errorNode = node.kind === 168 ? node.name : node.right; - if (getDeclarationKindFromSymbol(prop) !== 143) { + if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 143) { error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); return false; } @@ -17456,7 +17979,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 166 + var left = node.kind === 168 ? node.expression : node.left; var type = checkExpression(left); @@ -17471,7 +17994,7 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 169 && node.parent.expression === node) { + if (node.parent.kind === 171 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -17530,7 +18053,7 @@ var ts; if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 167 || indexArgumentExpression.kind === 166) { + if (indexArgumentExpression.kind === 169 || indexArgumentExpression.kind === 168) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -17573,7 +18096,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 170) { + if (node.kind === 172) { checkExpression(node.template); } else if (node.kind !== 139) { @@ -17627,7 +18150,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 185) { + if (arg && arg.kind === 187) { return i; } } @@ -17639,11 +18162,11 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 170) { + if (node.kind === 172) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 183) { + if (tagExpression.template.kind === 185) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -17663,7 +18186,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 169); + ts.Debug.assert(callExpression.kind === 171); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -17704,7 +18227,7 @@ var ts; } function inferTypeArguments(node, signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var inferenceMapper = createInferenceMapper(context); + var inferenceMapper = getInferenceMapper(context); for (var i = 0; i < typeParameters.length; i++) { if (!context.inferences[i].isFixed) { context.inferredTypes[i] = undefined; @@ -17716,7 +18239,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 187) { + if (arg === undefined || arg.kind !== 189) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -17737,13 +18260,11 @@ var ts; } getInferredTypes(context); } - function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors, headMessage) { + function checkTypeArguments(signature, typeArgumentNodes, typeArgumentTypes, reportErrors, headMessage) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; + var mapper; for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -17753,7 +18274,11 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); typeArgumentHeadMessage = headMessage; } - typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, typeArgumentHeadMessage, errorInfo); + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + var typeArgument = typeArgumentTypes[i]; + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo); } } } @@ -17763,12 +18288,12 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 187) { + if (arg === undefined || arg.kind !== 189) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { argType = arg.kind === 9 && !reportErrors - ? getStringLiteralType(arg) + ? getStringLiteralTypeForText(arg.text) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); } var errorNode = reportErrors ? getEffectiveArgumentErrorNode(node, i, arg) : undefined; @@ -17782,10 +18307,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 170) { + if (node.kind === 172) { var template = node.template; args = [undefined]; - if (template.kind === 183) { + if (template.kind === 185) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -17802,8 +18327,8 @@ var ts; function getEffectiveArgumentCount(node, args, signature) { if (node.kind === 139) { switch (node.parent.kind) { - case 214: - case 186: + case 216: + case 188: return 1; case 141: return 2; @@ -17823,7 +18348,7 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } @@ -17844,7 +18369,7 @@ var ts; return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } @@ -17863,7 +18388,7 @@ var ts; case 69: case 8: case 9: - return getStringLiteralType(element.name); + return getStringLiteralTypeForText(element.name.text); case 136: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216)) { @@ -17881,7 +18406,7 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } @@ -17918,14 +18443,14 @@ var ts; if (node.kind === 139) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 170) { + else if (argIndex === 0 && node.kind === 172) { return globalTemplateStringsArrayType; } return undefined; } function getEffectiveArgument(node, args, argIndex) { if (node.kind === 139 || - (argIndex === 0 && node.kind === 170)) { + (argIndex === 0 && node.kind === 172)) { return undefined; } return args[argIndex]; @@ -17934,7 +18459,7 @@ var ts; if (node.kind === 139) { return node.expression; } - else if (argIndex === 0 && node.kind === 170) { + else if (argIndex === 0 && node.kind === 172) { return node.template; } else { @@ -17942,7 +18467,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 170; + var isTaggedTemplate = node.kind === 172; var isDecorator = node.kind === 139; var typeArguments; if (!isTaggedTemplate && !isDecorator) { @@ -17990,7 +18515,8 @@ var ts; } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true, headMessage); + var typeArguments_1 = node.typeArguments; + checkTypeArguments(candidateForTypeArgumentError, typeArguments_1, ts.map(typeArguments_1, getTypeFromTypeNode), true, headMessage); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -18042,7 +18568,7 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { @@ -18174,8 +18700,8 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 214: - case 186: + case 216: + case 188: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; case 138: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; @@ -18211,13 +18737,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 168) { + if (node.kind === 170) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 169) { + else if (node.kind === 171) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 170) { + else if (node.kind === 172) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else if (node.kind === 139) { @@ -18229,19 +18755,30 @@ var ts; } return links.resolvedSignature; } + function getInferredClassType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.inferredClassType) { + links.inferredClassType = createAnonymousType(undefined, symbol.members, emptyArray, emptyArray, undefined, undefined); + } + return links.inferredClassType; + } function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 95) { return voidType; } - if (node.kind === 169) { + if (node.kind === 171) { var declaration = signature.declaration; if (declaration && declaration.kind !== 144 && declaration.kind !== 148 && declaration.kind !== 153) { - if (compilerOptions.noImplicitAny) { + var funcSymbol = checkExpression(node.expression).symbol; + if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16)) { + return getInferredClassType(funcSymbol); + } + else if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -18290,7 +18827,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { if (element.name.kind === 69) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -18324,7 +18861,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 192) { + if (func.body.kind !== 194) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -18429,22 +18966,29 @@ var ts; if (returnType === voidType || isTypeAny(returnType)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 192 || !(func.flags & 524288)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 || !(func.flags & 524288)) { return; } - if (func.flags & 1048576) { - if (compilerOptions.noImplicitReturns) { - error(func.type, ts.Diagnostics.Not_all_code_paths_return_a_value); - } - } - else { + var hasExplicitReturn = func.flags & 1048576; + if (returnType && !hasExplicitReturn) { error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } + else if (compilerOptions.noImplicitReturns) { + if (!returnType) { + var inferredReturnType = hasExplicitReturn + ? getReturnTypeOfSignature(getSignatureFromDeclaration(func)) + : voidType; + if (inferredReturnType === voidType || isTypeAny(inferredReturnType)) { + return; + } + } + error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); + } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 173) { + if (!hasGrammarError && node.kind === 175) { checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -18477,6 +19021,7 @@ var ts; } if (!contextChecked) { checkSignatureDeclaration(node); + checkNodeDeferred(node); } } } @@ -18486,39 +19031,34 @@ var ts; } return type; } - function checkFunctionExpressionOrObjectLiteralMethodBody(node) { + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); if (isAsync) { emitAwaiter = true; } - var returnType = node.type && getTypeFromTypeNode(node.type); - var promisedType; - if (returnType && isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - if (returnType && !node.asteriskToken) { - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if (!node.asteriskToken) { + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 192) { + if (node.body.kind === 194) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); - if (returnType) { + if (returnOrPromisedType) { if (isAsync) { var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); - checkTypeAssignableTo(awaitedType, promisedType, node.body); + checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { - checkTypeAssignableTo(exprType, returnType, node.body); + checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } - checkFunctionAndClassExpressionBodies(node.body); } } } @@ -18540,13 +19080,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 166: { + case 168: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 167: + case 169: return true; - case 172: + case 174: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -18555,11 +19095,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69: - case 166: { + case 168: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384) !== 0; } - case 167: { + case 169: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9) { @@ -18569,7 +19109,7 @@ var ts; } return false; } - case 172: + case 174: return isConstVariableReference(n.expression); default: return false; @@ -18645,8 +19185,8 @@ var ts; } if (type.flags & 49152) { var types = type.types; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var current = types_9[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var current = types_10[_i]; if (current.flags & kind) { return true; } @@ -18661,8 +19201,8 @@ var ts; } if (type.flags & 49152) { var types = type.types; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var current = types_10[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var current = types_11[_i]; if (!(current.flags & kind)) { return false; } @@ -18699,7 +19239,7 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 245 || p.kind === 246) { + if (p.kind === 247 || p.kind === 248) { var name_13 = p.name; if (name_13.kind === 136) { checkComputedPropertyName(name_13); @@ -18714,7 +19254,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - if (p.kind === 246) { + if (p.kind === 248) { checkDestructuringAssignment(p, type); } else { @@ -18736,8 +19276,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187) { - if (e.kind !== 185) { + if (e.kind !== 189) { + if (e.kind !== 187) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -18762,7 +19302,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 181 && restExpression.operatorToken.kind === 56) { + if (restExpression.kind === 183 && restExpression.operatorToken.kind === 56) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -18776,7 +19316,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 246) { + if (exprOrAssignment.kind === 248) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -18786,14 +19326,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 181 && target.operatorToken.kind === 56) { + if (target.kind === 183 && target.operatorToken.kind === 56) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 165) { + if (target.kind === 167) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 164) { + if (target.kind === 166) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -18810,7 +19350,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 && (left.kind === 165 || left.kind === 164)) { + if (operator === 56 && (left.kind === 167 || left.kind === 166)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -19009,7 +19549,7 @@ var ts; function checkStringLiteralExpression(node) { var contextualType = getContextualType(node); if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { - return getStringLiteralType(node); + return getStringLiteralTypeForText(node.text); } return stringType; } @@ -19072,8 +19612,8 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 166 && node.parent.expression === node) || - (node.parent.kind === 167 && node.parent.expression === node) || + var ok = (node.parent.kind === 168 && node.parent.expression === node) || + (node.parent.kind === 169 && node.parent.expression === node) || ((node.kind === 69 || node.kind === 135) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); @@ -19100,7 +19640,7 @@ var ts; return booleanType; case 8: return checkNumericLiteral(node); - case 183: + case 185: return checkTemplateExpression(node); case 9: return checkStringLiteralExpression(node); @@ -19108,58 +19648,58 @@ var ts; return stringType; case 10: return globalRegExpType; - case 164: - return checkArrayLiteral(node, contextualMapper); - case 165: - return checkObjectLiteral(node, contextualMapper); case 166: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 167: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 168: + return checkPropertyAccessExpression(node); case 169: - return checkCallExpression(node); + return checkIndexedAccess(node); case 170: - return checkTaggedTemplateExpression(node); - case 172: - return checkExpression(node.expression, contextualMapper); - case 186: - return checkClassExpression(node); - case 173: - case 174: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 176: - return checkTypeOfExpression(node); case 171: - case 189: - return checkAssertion(node); + return checkCallExpression(node); + case 172: + return checkTaggedTemplateExpression(node); + case 174: + return checkExpression(node.expression, contextualMapper); + case 188: + return checkClassExpression(node); case 175: - return checkDeleteExpression(node); - case 177: - return checkVoidExpression(node); + case 176: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 178: - return checkAwaitExpression(node); + return checkTypeOfExpression(node); + case 173: + case 191: + return checkAssertion(node); + case 177: + return checkDeleteExpression(node); case 179: - return checkPrefixUnaryExpression(node); + return checkVoidExpression(node); case 180: - return checkPostfixUnaryExpression(node); + return checkAwaitExpression(node); case 181: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 182: - return checkConditionalExpression(node, contextualMapper); - case 185: - return checkSpreadElementExpression(node, contextualMapper); - case 187: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 183: + return checkBinaryExpression(node, contextualMapper); case 184: + return checkConditionalExpression(node, contextualMapper); + case 187: + return checkSpreadElementExpression(node, contextualMapper); + case 189: + return undefinedType; + case 186: return checkYieldExpression(node); - case 240: + case 242: return checkJsxExpression(node); - case 233: - return checkJsxElement(node); - case 234: - return checkJsxSelfClosingElement(node); case 235: + return checkJsxElement(node); + case 236: + return checkJsxSelfClosingElement(node); + case 237: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -19169,8 +19709,8 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); + getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } } @@ -19196,8 +19736,8 @@ var ts; return false; } return node.kind === 143 || - node.kind === 213 || - node.kind === 173; + node.kind === 215 || + node.kind === 175; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -19211,12 +19751,12 @@ var ts; } return -1; } - function isInLegalTypePredicatePosition(node) { + function isInLegalParameterTypePredicatePosition(node) { switch (node.parent.kind) { - case 174: + case 176: case 147: - case 213: - case 173: + case 215: + case 175: case 152: case 143: case 142: @@ -19224,11 +19764,23 @@ var ts; } return false; } + function isInLegalThisTypePredicatePosition(node) { + if (isInLegalParameterTypePredicatePosition(node)) { + return true; + } + switch (node.parent.kind) { + case 141: + case 140: + case 145: + return node === node.parent.type; + } + return false; + } function checkSignatureDeclaration(node) { if (node.kind === 149) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 || node.kind === 213 || node.kind === 153 || + else if (node.kind === 152 || node.kind === 215 || node.kind === 153 || node.kind === 147 || node.kind === 144 || node.kind === 148) { checkGrammarFunctionLikeDeclaration(node); @@ -19237,9 +19789,14 @@ var ts; ts.forEach(node.parameters, checkParameter); if (node.type) { if (node.type.kind === 150) { - var typePredicate = getSignatureFromDeclaration(node).typePredicate; + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + if (!returnType || !(returnType.flags & 134217728)) { + return; + } + var typePredicate = returnType.predicate; var typePredicateNode = node.type; - if (isInLegalTypePredicatePosition(typePredicateNode)) { + checkSourceElement(typePredicateNode); + if (ts.isIdentifierTypePredicate(typePredicate)) { if (typePredicate.parameterIndex >= 0) { if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); @@ -19255,8 +19812,8 @@ var ts; if (hasReportedError) { break; } - if (param.name.kind === 161 || - param.name.kind === 162) { + if (param.name.kind === 163 || + param.name.kind === 164) { (function checkBindingPattern(pattern) { for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -19266,8 +19823,8 @@ var ts; hasReportedError = true; break; } - else if (element.name.kind === 162 || - element.name.kind === 161) { + else if (element.name.kind === 164 || + element.name.kind === 163) { checkBindingPattern(element.name); } } @@ -19279,9 +19836,6 @@ var ts; } } } - else { - error(typePredicateNode, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } } else { checkSourceElement(node.type); @@ -19316,7 +19870,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 215) { + if (node.kind === 217) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -19358,7 +19912,7 @@ var ts; } function checkMethodDeclaration(node) { checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); - checkFunctionLikeDeclaration(node); + checkFunctionOrMethodDeclaration(node); if (node.flags & 128 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } @@ -19379,7 +19933,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 168 && n.expression.kind === 95; + return n.kind === 170 && n.expression.kind === 95; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -19400,7 +19954,7 @@ var ts; if (n.kind === 97) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 173 && n.kind !== 213) { + else if (n.kind !== 175 && n.kind !== 215) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -19425,7 +19979,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 195 && isSuperCallExpression(statement.expression)) { + if (statement.kind === 197 && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -19449,6 +20003,8 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); if (node.kind === 145) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288)) { if (node.flags & 1048576) { @@ -19461,6 +20017,9 @@ var ts; } } } + if (node.name.kind === 136) { + checkComputedPropertyName(node.name); + } if (!ts.hasDynamicName(node)) { var otherKind = node.kind === 145 ? 146 : 145; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); @@ -19479,18 +20038,32 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - checkFunctionLikeDeclaration(node); + if (node.parent.kind !== 167) { + checkSourceElement(node.body); + } + else { + checkNodeDeferred(node); + } + } + function checkAccessorDeferred(node) { + checkSourceElement(node.body); } function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArguments) { + function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var typeArguments; + var mapper; var result = true; for (var i = 0; i < typeParameters.length; i++) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { + if (!typeArguments) { + typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + mapper = createTypeMapper(typeParameters, typeArguments); + } var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; @@ -19547,7 +20120,7 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 215) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217) { ts.Debug.assert(signatureDeclarationNode.kind === 147 || signatureDeclarationNode.kind === 148); var signatureKind = signatureDeclarationNode.kind === 147 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -19559,7 +20132,7 @@ var ts; } for (var _i = 0, signaturesToCheck_1 = signaturesToCheck; _i < signaturesToCheck_1.length; _i++) { var otherSignature = signaturesToCheck_1[_i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature, false)) { return; } } @@ -19567,9 +20140,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 215 && - n.parent.kind !== 214 && - n.parent.kind !== 186 && + if (n.parent.kind !== 217 && + n.parent.kind !== 216 && + n.parent.kind !== 188 && ts.isInAmbientContext(n)) { if (!(flags & 4)) { flags |= 2; @@ -19642,14 +20215,16 @@ var ts; seen = c === node; } }); - if (subsequentNode) { + if (subsequentNode && subsequentNode.pos === node.end) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 143 || node.kind === 142); - ts.Debug.assert((node.flags & 64) !== (subsequentNode.flags & 64)); - var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode_1, diagnostic); + var reportError = (node.kind === 143 || node.kind === 142) && + (node.flags & 64) !== (subsequentNode.flags & 64); + if (reportError) { + var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + error(errorNode_1, diagnostic); + } return; } else if (ts.nodeIsPresent(subsequentNode.body)) { @@ -19678,11 +20253,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 215 || node.parent.kind === 155 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 217 || node.parent.kind === 155 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 213 || node.kind === 143 || node.kind === 142 || node.kind === 144) { + if (node.kind === 215 || node.kind === 143 || node.kind === 142 || node.kind === 144) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -19736,7 +20311,7 @@ var ts; if (!bodySignature.hasStringLiterals) { for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { var signature = signatures_3[_a]; - if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + if (!signature.hasStringLiterals && !isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } @@ -19795,16 +20370,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 215: + case 217: return 2097152; - case 218: + case 220: return d.name.kind === 9 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 214: - case 217: + case 216: + case 219: return 2097152 | 1048576; - case 221: + case 223: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -19911,15 +20486,16 @@ var ts; error(node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName); return unknownType; } + checkReturnTypeAnnotationAsExpression(node); var promiseConstructorType = getTypeOfSymbol(promiseConstructor); if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) { return unknownType; } var promiseName = ts.getEntityNameFromTypeNode(node.type); - var root = getFirstIdentifier(promiseName); - var rootSymbol = getSymbol(node.locals, root.text, 107455); + var promiseNameOrNamespaceRoot = getFirstIdentifier(promiseName); + var rootSymbol = getSymbol(node.locals, promiseNameOrNamespaceRoot.text, 107455); if (rootSymbol) { - error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, root.text, getFullyQualifiedName(promiseConstructor)); + error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, promiseNameOrNamespaceRoot.text, getFullyQualifiedName(promiseConstructor)); return unknownType; } return checkAwaitedType(promiseType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); @@ -19934,7 +20510,7 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 214: + case 216: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); @@ -19971,23 +20547,10 @@ var ts; } } function checkTypeAnnotationAsExpression(node) { - switch (node.kind) { - case 141: - checkTypeNodeAsExpression(node.type); - break; - case 138: - checkTypeNodeAsExpression(node.type); - break; - case 143: - checkTypeNodeAsExpression(node.type); - break; - case 145: - checkTypeNodeAsExpression(node.type); - break; - case 146: - checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node)); - break; - } + checkTypeNodeAsExpression(node.type); + } + function checkReturnTypeAnnotationAsExpression(node) { + checkTypeNodeAsExpression(node.type); } function checkParameterTypeAnnotationsAsExpressions(node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -20007,16 +20570,18 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 214: + case 216: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; case 143: - checkParameterTypeAnnotationsAsExpressions(node); - case 146: case 145: + case 146: + checkParameterTypeAnnotationsAsExpressions(node); + checkReturnTypeAnnotationAsExpression(node); + break; case 141: case 138: checkTypeAnnotationAsExpression(node); @@ -20031,13 +20596,13 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || checkGrammarForGenerator(node); + checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); } } - function checkFunctionLikeDeclaration(node) { + function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); @@ -20050,7 +20615,8 @@ var ts; if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration : undefined; }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } @@ -20061,13 +20627,9 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { - var returnType = getTypeFromTypeNode(node.type); - var promisedType; - if (isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + if (!node.asteriskToken) { + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { @@ -20079,13 +20641,10 @@ var ts; } } function checkBlock(node) { - if (node.kind === 192) { + if (node.kind === 194) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 219) { - checkFunctionAndClassExpressionBodies(node); - } } function checkCollisionWithArgumentsInGeneratedCode(node) { if (!ts.hasRestParameter(node) || ts.isInAmbientContext(node) || ts.nodeIsMissing(node.body)) { @@ -20161,11 +20720,11 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 218 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 220 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 248 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 250 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -20173,7 +20732,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 24576) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 211 && !node.initializer) { + if (node.kind === 213 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -20183,15 +20742,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 212); - var container = varDeclList.parent.kind === 193 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214); + var container = varDeclList.parent.kind === 195 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 192 && ts.isFunctionLike(container.parent) || - container.kind === 219 || - container.kind === 218 || - container.kind === 248); + (container.kind === 194 && ts.isFunctionLike(container.parent) || + container.kind === 221 || + container.kind === 220 || + container.kind === 250); if (!namesShareScope) { var name_14 = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); @@ -20236,7 +20795,7 @@ var ts; checkExpressionCached(node.initializer); } } - if (node.kind === 163) { + if (node.kind === 165) { if (node.propertyName && node.propertyName.kind === 136) { checkComputedPropertyName(node.propertyName); } @@ -20274,7 +20833,7 @@ var ts; } if (node.kind !== 141 && node.kind !== 140) { checkExportsOnMergedDeclarations(node); - if (node.kind === 211 || node.kind === 163) { + if (node.kind === 213 || node.kind === 165) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -20295,7 +20854,7 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 165) { + if (node.modifiers && node.parent.kind === 167) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -20314,7 +20873,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 194) { + if (node.thenStatement.kind === 196) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -20331,12 +20890,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 212) { + if (node.initializer && node.initializer.kind === 214) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -20351,13 +20910,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 164 || varExpr.kind === 165) { + if (varExpr.kind === 166 || varExpr.kind === 167) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -20372,7 +20931,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -20382,7 +20941,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 164 || varExpr.kind === 165) { + if (varExpr.kind === 166 || varExpr.kind === 167) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258)) { @@ -20510,7 +21069,13 @@ var ts; } function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { ts.Debug.assert(languageVersion < 2); - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var arrayType = arrayOrStringType; + if (arrayOrStringType.flags & 16384) { + arrayType = getUnionType(ts.filter(arrayOrStringType.types, function (t) { return !(t.flags & 258); })); + } + else if (arrayOrStringType.flags & 258) { + arrayType = emptyUnionType; + } var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { @@ -20570,7 +21135,7 @@ var ts; error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } - else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || signature.typePredicate) { + else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || returnType.flags & 134217728) { if (ts.isAsyncFunctionLike(func)) { var promisedType = getPromisedType(returnType); var awaitedType = checkAwaitedType(exprType, node.expression, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -20601,7 +21166,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 242 && !hasDuplicateDefaultClause) { + if (clause.kind === 244 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -20613,13 +21178,12 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 241) { + if (produceDiagnostics && clause.kind === 243) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); - if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) { - return; - } - if (!isTypeAssignableTo(expressionType, caseType)) { + var expressionTypeIsAssignableToCaseType = (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) || + isTypeAssignableTo(expressionType, caseType); + if (!expressionTypeIsAssignableToCaseType) { checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } } @@ -20633,7 +21197,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 207 && current.label.text === node.label.text) { + if (current.kind === 209 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -20773,8 +21337,12 @@ var ts; } function checkClassExpression(node) { checkClassLikeDeclaration(node); + checkNodeDeferred(node); return getTypeOfSymbol(getSymbolOfNode(node)); } + function checkClassExpressionDeferred(node) { + ts.forEach(node.members, checkSourceElement); + } function checkClassDeclaration(node) { if (!node.name && !(node.flags & 512)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); @@ -20872,7 +21440,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(derivedClassDecl.flags & 128))) { - if (derivedClassDecl.kind === 186) { + if (derivedClassDecl.kind === 188) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -20982,7 +21550,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 215); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -21047,7 +21615,8 @@ var ts; error(member.name, ts.Diagnostics.Enum_member_must_have_initializer); } if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; + getNodeLinks(member).enumMemberValue = autoValue; + autoValue++; } } nodeLinks.flags |= 8192; @@ -21079,7 +21648,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 179: + case 181: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -21090,7 +21659,7 @@ var ts; case 50: return ~value_1; } return undefined; - case 181: + case 183: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -21115,11 +21684,11 @@ var ts; return undefined; case 8: return +e.text; - case 172: + case 174: return evalConstant(e.expression); case 69: - case 167: - case 166: + case 169: + case 168: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -21130,7 +21699,7 @@ var ts; } else { var expression; - if (e.kind === 167) { + if (e.kind === 169) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -21147,7 +21716,7 @@ var ts; if (current.kind === 69) { break; } - else if (current.kind === 166) { + else if (current.kind === 168) { current = current.expression; } else { @@ -21206,7 +21775,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 217) { + if (declaration.kind !== 219) { return false; } var enumDeclaration = declaration; @@ -21229,8 +21798,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 214 || - (declaration.kind === 213 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 216 || + (declaration.kind === 215 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -21281,7 +21850,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 214); + var mergedClass = ts.getDeclarationOfKind(symbol, 216); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -21303,7 +21872,7 @@ var ts; if (node.kind === 135) { node = node.left; } - else if (node.kind === 166) { + else if (node.kind === 168) { node = node.expression; } else { @@ -21319,9 +21888,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 219 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 248 && !inAmbientExternalModule) { - error(moduleName, node.kind === 228 ? + var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; + if (node.parent.kind !== 250 && !inAmbientExternalModule) { + error(moduleName, node.kind === 230 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -21340,7 +21909,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 230 ? + var message = node.kind === 232 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -21366,7 +21935,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224) { + if (importClause.namedBindings.kind === 226) { checkImportBinding(importClause.namedBindings); } else { @@ -21417,8 +21986,8 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 219 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 248 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; + if (node.parent.kind !== 250 && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -21431,7 +22000,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 248 && node.parent.kind !== 219 && node.parent.kind !== 218) { + if (node.parent.kind !== 250 && node.parent.kind !== 221 && node.parent.kind !== 220) { return grammarErrorOnFirstToken(node, errorMessage); } } @@ -21445,8 +22014,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 248 ? node.parent : node.parent.parent; - if (container.kind === 218 && container.name.kind === 69) { + var container = node.parent.kind === 250 ? node.parent : node.parent.parent; + if (container.kind === 220 && container.name.kind === 69) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -21469,15 +22038,6 @@ var ts; } } } - function getModuleStatements(node) { - if (node.kind === 248) { - return node.statements; - } - if (node.kind === 218 && node.body.kind === 219) { - return node.body.statements; - } - return emptyArray; - } function hasExportedMembers(moduleSymbol) { for (var id in moduleSymbol.exports) { if (id !== "export=") { @@ -21495,13 +22055,41 @@ var ts; var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } + var exports = getExportsOfModule(moduleSymbol); + for (var id in exports) { + if (id === "__export") { + continue; + } + var _a = exports[id], declarations = _a.declarations, flags = _a.flags; + if (!(flags & (1536 | 64 | 384)) && (flags & 524288 ? declarations.length - 1 : declarations.length) > 1) { + var exportedDeclarations = ts.filter(declarations, isNotOverload); + if (exportedDeclarations.length > 1) { + for (var _i = 0, exportedDeclarations_1 = exportedDeclarations; _i < exportedDeclarations_1.length; _i++) { + var declaration = exportedDeclarations_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); + } + } + } + } links.exportsChecked = true; } + function isNotOverload(declaration) { + return declaration.kind !== 215 || !!declaration.body; + } } function checkTypePredicate(node) { - if (!isInLegalTypePredicatePosition(node)) { + var parameterName = node.parameterName; + if (parameterName.kind === 69 && !isInLegalParameterTypePredicatePosition(node)) { error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); } + else if (parameterName.kind === 161) { + if (!isInLegalThisTypePredicatePosition(node)) { + error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); + } + else { + getTypeFromThisTypeNode(parameterName); + } + } } function checkSourceElement(node) { if (!node) { @@ -21510,10 +22098,10 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 218: - case 214: + case 220: + case 216: + case 217: case 215: - case 213: cancellationToken.throwIfCancellationRequested(); } } @@ -21557,170 +22145,97 @@ var ts; return checkUnionOrIntersectionType(node); case 160: return checkSourceElement(node.type); - case 213: - return checkFunctionDeclaration(node); - case 192: - case 219: - return checkBlock(node); - case 193: - return checkVariableStatement(node); - case 195: - return checkExpressionStatement(node); - case 196: - return checkIfStatement(node); - case 197: - return checkDoStatement(node); - case 198: - return checkWhileStatement(node); - case 199: - return checkForStatement(node); - case 200: - return checkForInStatement(node); - case 201: - return checkForOfStatement(node); - case 202: - case 203: - return checkBreakOrContinueStatement(node); - case 204: - return checkReturnStatement(node); - case 205: - return checkWithStatement(node); - case 206: - return checkSwitchStatement(node); - case 207: - return checkLabeledStatement(node); - case 208: - return checkThrowStatement(node); - case 209: - return checkTryStatement(node); - case 211: - return checkVariableDeclaration(node); - case 163: - return checkBindingElement(node); - case 214: - return checkClassDeclaration(node); case 215: - return checkInterfaceDeclaration(node); - case 216: - return checkTypeAliasDeclaration(node); - case 217: - return checkEnumDeclaration(node); - case 218: - return checkModuleDeclaration(node); - case 222: - return checkImportDeclaration(node); - case 221: - return checkImportEqualsDeclaration(node); - case 228: - return checkExportDeclaration(node); - case 227: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); case 194: - checkGrammarStatementInAmbientContext(node); - return; + case 221: + return checkBlock(node); + case 195: + return checkVariableStatement(node); + case 197: + return checkExpressionStatement(node); + case 198: + return checkIfStatement(node); + case 199: + return checkDoStatement(node); + case 200: + return checkWhileStatement(node); + case 201: + return checkForStatement(node); + case 202: + return checkForInStatement(node); + case 203: + return checkForOfStatement(node); + case 204: + case 205: + return checkBreakOrContinueStatement(node); + case 206: + return checkReturnStatement(node); + case 207: + return checkWithStatement(node); + case 208: + return checkSwitchStatement(node); + case 209: + return checkLabeledStatement(node); case 210: + return checkThrowStatement(node); + case 211: + return checkTryStatement(node); + case 213: + return checkVariableDeclaration(node); + case 165: + return checkBindingElement(node); + case 216: + return checkClassDeclaration(node); + case 217: + return checkInterfaceDeclaration(node); + case 218: + return checkTypeAliasDeclaration(node); + case 219: + return checkEnumDeclaration(node); + case 220: + return checkModuleDeclaration(node); + case 224: + return checkImportDeclaration(node); + case 223: + return checkImportEqualsDeclaration(node); + case 230: + return checkExportDeclaration(node); + case 229: + return checkExportAssignment(node); + case 196: checkGrammarStatementInAmbientContext(node); return; - case 231: + case 212: + checkGrammarStatementInAmbientContext(node); + return; + case 233: return checkMissingDeclaration(node); } } - function checkFunctionAndClassExpressionBodies(node) { - switch (node.kind) { - case 173: - case 174: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - checkFunctionExpressionOrObjectLiteralMethodBody(node); - break; - case 186: - ts.forEach(node.members, checkSourceElement); - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; - case 143: - case 142: - ts.forEach(node.decorators, checkFunctionAndClassExpressionBodies); - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - if (ts.isObjectLiteralMethod(node)) { - checkFunctionExpressionOrObjectLiteralMethodBody(node); - } - break; - case 144: - case 145: - case 146: - case 213: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - break; - case 205: - checkFunctionAndClassExpressionBodies(node.expression); - break; - case 139: - case 138: - case 141: - case 140: - case 161: - case 162: - case 163: - case 164: - case 165: - case 245: - case 166: - case 167: - case 168: - case 169: - case 170: - case 183: - case 190: - case 171: - case 189: - case 172: - case 176: - case 177: - case 178: - case 175: - case 179: - case 180: - case 181: - case 182: - case 185: - case 184: - case 192: - case 219: - case 193: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 201: - case 202: - case 203: - case 204: - case 206: - case 220: - case 241: - case 242: - case 207: - case 208: - case 209: - case 244: - case 211: - case 212: - case 214: - case 243: - case 188: - case 217: - case 247: - case 227: - case 248: - case 240: - case 233: - case 234: - case 238: - case 239: - case 235: - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; + function checkNodeDeferred(node) { + if (deferredNodes) { + deferredNodes.push(node); + } + } + function checkDeferredNodes() { + for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { + var node = deferredNodes_1[_i]; + switch (node.kind) { + case 175: + case 176: + case 143: + case 142: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 145: + case 146: + checkAccessorDeferred(node); + break; + case 188: + checkClassExpressionDeferred(node); + break; + } } } function checkSourceFile(node) { @@ -21740,9 +22255,12 @@ var ts; emitExtends = false; emitDecorate = false; emitParam = false; + emitAwaiter = false; potentialThisCollisions.length = 0; + deferredNodes = []; ts.forEach(node.statements, checkSourceElement); - checkFunctionAndClassExpressionBodies(node); + checkDeferredNodes(); + deferredNodes = undefined; if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -21798,7 +22316,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 205 && node.parent.statement === node) { + if (node.parent.kind === 207 && node.parent.statement === node) { return true; } node = node.parent; @@ -21820,28 +22338,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 218: + case 220: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 217: + case 219: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 186: + case 188: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 214: - case 215: + case 216: + case 217: if (!(memberFlags & 64)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 173: + case 175: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -21881,10 +22399,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 137: - case 214: - case 215: case 216: case 217: + case 218: + case 219: return true; } } @@ -21897,19 +22415,19 @@ var ts; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 166) { + while (node.parent && node.parent.kind === 168) { node = node.parent; } - return node.parent && node.parent.kind === 188; + return node.parent && node.parent.kind === 190; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { while (nodeOnRightSide.parent.kind === 135) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 221) { + if (nodeOnRightSide.parent.kind === 223) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 227) { + if (nodeOnRightSide.parent.kind === 229) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -21921,10 +22439,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 227) { + if (entityName.parent.kind === 229) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 166) { + if (entityName.kind !== 168) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -21934,7 +22452,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 188) { + if (entityName.parent.kind === 190) { meaning = 793056; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -21946,9 +22464,9 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 235) || - (entityName.parent.kind === 234) || - (entityName.parent.kind === 237)) { + else if ((entityName.parent.kind === 237) || + (entityName.parent.kind === 236) || + (entityName.parent.kind === 239)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -21959,7 +22477,7 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 166) { + else if (entityName.kind === 168) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); @@ -21979,7 +22497,7 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 238) { + else if (entityName.parent.kind === 240) { return getJsxAttributePropertySymbol(entityName.parent); } if (entityName.parent.kind === 150) { @@ -21996,12 +22514,12 @@ var ts; } if (node.kind === 69) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 227 + return node.parent.kind === 229 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 163 && - node.parent.parent.kind === 161 && + else if (node.parent.kind === 165 && + node.parent.parent.kind === 163 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -22012,13 +22530,15 @@ var ts; } switch (node.kind) { case 69: - case 166: + case 168: case 135: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97: case 95: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; + case 161: + return getTypeFromTypeNode(node).symbol; case 121: var constructorDeclaration = node.parent; if (constructorDeclaration && constructorDeclaration.kind === 144) { @@ -22028,12 +22548,12 @@ var ts; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 222 || node.parent.kind === 228) && + ((node.parent.kind === 224 || node.parent.kind === 230) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 167 && node.parent.argumentExpression === node) { + if (node.parent.kind === 169 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -22047,7 +22567,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 246) { + if (location && location.kind === 248) { return resolveEntityName(location.name, 107455); } return undefined; @@ -22138,6 +22658,25 @@ var ts; function isArgumentsLocalBinding(node) { return getReferencedValueSymbol(node) === argumentsSymbol; } + function moduleExportsSomeValue(moduleReferenceExpression) { + var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol) { + return true; + } + var hasExportAssignment = getExportAssignmentSymbol(moduleSymbol) !== undefined; + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + var symbolLinks = getSymbolLinks(moduleSymbol); + if (symbolLinks.exportsSomeValue === undefined) { + symbolLinks.exportsSomeValue = hasExportAssignment + ? !!(moduleSymbol.flags & 107455) + : ts.forEachValue(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks.exportsSomeValue; + function isValue(s) { + s = resolveSymbol(s); + return s && !!(s.flags & 107455); + } + } function getReferencedExportContainer(node) { var symbol = getReferencedValueSymbol(node); if (symbol) { @@ -22150,11 +22689,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 248) { + if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 250) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 218 || n.kind === 217) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 220 || n.kind === 219) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -22167,11 +22706,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 192: - case 220: - case 199: - case 200: + case 194: + case 222: case 201: + case 202: + case 203: return true; } return false; @@ -22197,22 +22736,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 221: case 223: - case 224: + case 225: case 226: - case 230: - return isAliasResolvedToValue(getSymbolOfNode(node)); case 228: + case 232: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 230: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 227: + case 229: return node.expression && node.expression.kind === 69 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 248 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 250 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -22260,7 +22799,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 247) { + if (node.kind === 249) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -22346,17 +22885,6 @@ var ts; var symbol = getReferencedValueSymbol(reference); return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; } - function instantiateSingleCallFunctionType(functionType, typeArguments) { - if (functionType === unknownType) { - return unknownType; - } - var signature = getSingleCallSignature(functionType); - if (!signature) { - return unknownType; - } - var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); - return getOrCreateTypeFromSignature(instantiatedSignature); - } function createResolver() { return { getReferencedExportContainer: getReferencedExportContainer, @@ -22380,6 +22908,7 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, + moduleExportsSomeValue: moduleExportsSomeValue, isArgumentsLocalBinding: isArgumentsLocalBinding, getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; @@ -22390,7 +22919,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 248); + return ts.getDeclarationOfKind(moduleSymbol, 250); } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { @@ -22401,10 +22930,10 @@ var ts; mergeSymbolTable(globals, file.locals); } }); + addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; globalArrayType = getGlobalType("Array", 1); globalObjectType = getGlobalType("Object"); globalFunctionType = getGlobalType("Function"); @@ -22465,7 +22994,12 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + if (node.kind === 143 && !ts.nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } + else { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + } } else if (node.kind === 145 || node.kind === 146) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); @@ -22485,30 +23019,30 @@ var ts; case 143: case 142: case 149: - case 218: - case 222: - case 221: - case 228: - case 227: + case 220: + case 224: + case 223: + case 230: + case 229: case 138: break; - case 213: - if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && - node.parent.kind !== 219 && node.parent.kind !== 248) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - break; - case 214: case 215: - case 193: - case 216: - if (node.modifiers && node.parent.kind !== 219 && node.parent.kind !== 248) { + if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && + node.parent.kind !== 221 && node.parent.kind !== 250) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; + case 216: case 217: + case 195: + case 218: + if (node.modifiers && node.parent.kind !== 221 && node.parent.kind !== 250) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + break; + case 219: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74) && - node.parent.kind !== 219 && node.parent.kind !== 248) { + node.parent.kind !== 221 && node.parent.kind !== 250) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -22523,6 +23057,11 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 74: + if (node.kind !== 219 && node.parent.kind === 216) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74)); + } + break; case 112: case 111: case 110: @@ -22547,7 +23086,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 219 || node.parent.kind === 248) { + else if (node.parent.kind === 221 || node.parent.kind === 250) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128) { @@ -22567,7 +23106,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 219 || node.parent.kind === 248) { + else if (node.parent.kind === 221 || node.parent.kind === 250) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 138) { @@ -22592,7 +23131,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } else if (node.kind === 138) { @@ -22607,13 +23146,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } else if (node.kind === 138) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 219) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4; @@ -22623,11 +23162,11 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 214) { + if (node.kind !== 216) { if (node.kind !== 143) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 214 && node.parent.flags & 128)) { + if (!(node.parent.kind === 216 && node.parent.flags & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64) { @@ -22672,7 +23211,7 @@ var ts; } return; } - else if ((node.kind === 222 || node.kind === 221) && flags & 4) { + else if ((node.kind === 224 || node.kind === 223) && flags & 4) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 138 && (flags & 56) && ts.isBindingPattern(node.name)) { @@ -22688,9 +23227,9 @@ var ts; } switch (node.kind) { case 143: - case 213: - case 173: - case 174: + case 215: + case 175: + case 176: if (!node.asteriskToken) { return false; } @@ -22755,7 +23294,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 174) { + if (node.kind === 176) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -22822,7 +23361,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 187) { + if (arg.kind === 189) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -22897,14 +23436,14 @@ var ts; return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 181 && computedPropertyName.expression.operatorToken.kind === 24) { + if (computedPropertyName.expression.kind === 183 && computedPropertyName.expression.operatorToken.kind === 24) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 213 || - node.kind === 173 || + ts.Debug.assert(node.kind === 215 || + node.kind === 175 || node.kind === 143); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -22928,19 +23467,23 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; + var _loop_1 = function(prop) { var name_16 = prop.name; - if (prop.kind === 187 || + if (prop.kind === 189 || name_16.kind === 136) { checkGrammarComputedPropertyName(name_16); - continue; + return "continue"; } - if (prop.kind === 246 && !inDestructuring && prop.objectAssignmentInitializer) { - return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); + if (prop.kind === 248 && !inDestructuring && prop.objectAssignmentInitializer) { + return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } + ts.forEach(prop.modifiers, function (mod) { + if (mod.kind !== 118 || prop.kind !== 143) { + grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); + } + }); var currentKind = void 0; - if (prop.kind === 245 || prop.kind === 246) { + if (prop.kind === 247 || prop.kind === 248) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_16.kind === 8) { checkGrammarNumericLiteral(name_16); @@ -22965,27 +23508,33 @@ var ts; else { var existingKind = seen[name_16.text]; if (currentKind === Property && existingKind === Property) { - continue; + return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { seen[name_16.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } + }; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + var state_1 = _loop_1(prop); + if (typeof state_1 === "object") return state_1.value + if (state_1 === "continue") continue; } } function checkGrammarJsxElement(node) { var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 239) { + if (attr.kind === 241) { continue; } var jsxAttr = attr; @@ -22997,7 +23546,7 @@ var ts; return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 240 && !initializer.expression) { + if (initializer && initializer.kind === 242 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -23006,24 +23555,28 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 212) { + if (forInOrOfStatement.initializer.kind === 214) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 200 + var declarations = variableList.declarations; + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } - var firstDeclaration = variableList.declarations[0]; + var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 200 + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 200 + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -23084,7 +23637,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 165) { + if (node.parent.kind === 167) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -23103,7 +23656,7 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 215) { + else if (node.parent.kind === 217) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } else if (node.parent.kind === 155) { @@ -23117,9 +23670,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 207: + case 209: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 202 + var isMisplacedContinueLabel = node.kind === 204 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -23127,8 +23680,8 @@ var ts; return false; } break; - case 206: - if (node.kind === 203 && !node.label) { + case 208: + if (node.kind === 205 && !node.label) { return false; } break; @@ -23141,13 +23694,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 203 + var message = node.kind === 205 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 203 + var message = node.kind === 205 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -23159,7 +23712,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 162 || node.name.kind === 161) { + if (node.name.kind === 164 || node.name.kind === 163) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -23168,7 +23721,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 200 && node.parent.parent.kind !== 201) { + if (node.parent.parent.kind !== 202 && node.parent.parent.kind !== 203) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -23184,12 +23737,12 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 69) { - if (name.text === "let") { + if (name.originalKeywordKind === 108) { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } @@ -23197,7 +23750,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -23214,15 +23767,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 196: - case 197: case 198: - case 205: case 199: case 200: - case 201: - return false; case 207: + case 201: + case 202: + case 203: + return false; + case 209: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -23237,18 +23790,6 @@ var ts; } } } - function isIntegerLiteral(expression) { - if (expression.kind === 179) { - var unaryExpression = expression; - if (unaryExpression.operator === 35 || unaryExpression.operator === 36) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 8) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); - } - return false; - } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -23273,10 +23814,6 @@ var ts; return true; } } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 && - (node.text === "eval" || node.text === "arguments"); - } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -23294,27 +23831,33 @@ var ts; return true; } } - else if (node.parent.kind === 215) { + else if (node.parent.kind === 217) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); + } } else if (node.parent.kind === 155) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } } if (ts.isInAmbientContext(node) && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 215 || - node.kind === 216 || - node.kind === 222 || - node.kind === 221 || - node.kind === 228 || - node.kind === 227 || + if (node.kind === 217 || + node.kind === 218 || + node.kind === 224 || + node.kind === 223 || + node.kind === 230 || + node.kind === 229 || (node.flags & 4) || (node.flags & (2 | 512))) { return false; @@ -23324,7 +23867,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 193) { + if (ts.isDeclaration(decl) || decl.kind === 195) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -23343,7 +23886,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 192 || node.parent.kind === 219 || node.parent.kind === 248) { + if (node.parent.kind === 194 || node.parent.kind === 221 || node.parent.kind === 250) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -23366,19 +23909,248 @@ var ts; return true; } } + var _a; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); var ts; +(function (ts) { + var nullSourceMapWriter; + function getNullSourceMapWriter() { + if (nullSourceMapWriter === undefined) { + nullSourceMapWriter = { + getSourceMapData: function () { return undefined; }, + setSourceFile: function (sourceFile) { }, + emitStart: function (range) { }, + emitEnd: function (range) { }, + emitPos: function (pos) { }, + getText: function () { return undefined; }, + getSourceMappingURL: function () { return undefined; }, + initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, + reset: function () { } + }; + } + return nullSourceMapWriter; + } + ts.getNullSourceMapWriter = getNullSourceMapWriter; + function createSourceMapWriter(host, writer) { + var compilerOptions = host.getCompilerOptions(); + var currentSourceFile; + var sourceMapDir; + var sourceMapSourceIndex; + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan; + var lastEncodedNameIndex; + var sourceMapData; + return { + getSourceMapData: function () { return sourceMapData; }, + setSourceFile: setSourceFile, + emitPos: emitPos, + emitStart: emitStart, + emitEnd: emitEnd, + getText: getText, + getSourceMappingURL: getSourceMappingURL, + initialize: initialize, + reset: reset + }; + function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + if (sourceMapData) { + reset(); + } + currentSourceFile = undefined; + sourceMapSourceIndex = -1; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + lastEncodedNameIndex = 0; + sourceMapData = { + sourceMapFilePath: sourceMapFilePath, + jsSourceMappingURL: !compilerOptions.inlineSourceMap ? ts.getBaseFileName(ts.normalizeSlashes(sourceMapFilePath)) : undefined, + sourceMapFile: ts.getBaseFileName(ts.normalizeSlashes(filePath)), + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined, + sourceMapDecodedMappings: [] + }; + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (!isBundledEmit) { + ts.Debug.assert(sourceFiles.length === 1); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(filePath)); + } + } + function reset() { + currentSourceFile = undefined; + sourceMapDir = undefined; + sourceMapSourceIndex = undefined; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = undefined; + lastEncodedNameIndex = undefined; + sourceMapData = undefined; + } + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + } + function emitPos(pos) { + if (pos === -1) { + return; + } + var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + sourceLinePos.line++; + sourceLinePos.character++; + var emittedLine = writer.getLine(); + var emittedColumn = writer.getColumn(); + if (!lastRecordedSourceMapSpan || + lastRecordedSourceMapSpan.emittedLine !== emittedLine || + lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || + (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && + (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || + (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + encodeLastRecordedSourceMapSpan(); + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + sourceIndex: sourceMapSourceIndex + }; + } + else { + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; + } + } + function emitStart(range) { + var rangeHasDecorators = !!range.decorators; + emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + } + function emitEnd(range) { + emitPos(range.end); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; + var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSourceFile.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true); + sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + if (sourceMapSourceIndex === -1) { + sourceMapSourceIndex = sourceMapData.sourceMapSources.length; + sourceMapData.sourceMapSources.push(source); + sourceMapData.inputSourceFileNames.push(sourceFile.fileName); + if (compilerOptions.inlineSources) { + sourceMapData.sourceMapSourcesContent.push(sourceFile.text); + } + } + } + function getText() { + encodeLastRecordedSourceMapSpan(); + return ts.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings, + sourcesContent: sourceMapData.sourceMapSourcesContent + }); + } + function getSourceMappingURL() { + if (compilerOptions.inlineSourceMap) { + var base64SourceMapText = ts.convertToBase64(getText()); + return sourceMapData.jsSourceMappingURL = "data:application/json;base64," + base64SourceMapText; + } + else { + return sourceMapData.jsSourceMappingURL; + } + } + } + ts.createSourceMapWriter = createSourceMapWriter; + var base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + function base64FormatEncode(inValue) { + if (inValue < 64) { + return base64Chars.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + function base64VLQFormatEncode(inValue) { + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + var encodedStr = ""; + do { + var currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } +})(ts || (ts = {})); +var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + var declarationDiagnostics = ts.createDiagnosticCollection(); + ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName); + function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + var declarationFilePath = _a.declarationFilePath; + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit); + } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -23396,93 +24168,67 @@ var ts; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var noDeclare = !root; + var noDeclare; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; - if (root) { + var emittedReferencedFiles = []; + var addedGlobalFileReference = false; + var allSourcesModuleElementDeclarationEmitInfo = []; + ts.forEach(sourceFiles, function (sourceFile) { + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 4096) || - ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + if (referencedFile && !ts.contains(emittedReferencedFiles, referencedFile)) { + if (writeReferencePath(referencedFile, !isBundledEmit && !addedGlobalFileReference)) { addedGlobalFileReference = true; } + emittedReferencedFiles.push(referencedFile); } }); } - emitSourceFile(root); + if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { + noDeclare = false; + emitSourceFile(sourceFile); + } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + } if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222); + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 224); createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 0); + ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + increaseIndent(); + } writeImportDeclaration(aliasEmitInfo.node); aliasEmitInfo.asynchronousOutput = writer.getText(); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + decreaseIndent(); + } } }); setWriter(oldWriter); + allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; } - } - else { - var emittedReferencedFiles = []; - var prevModuleElementDeclarationEmitInfo = []; - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isDeclarationFile(sourceFile)) { - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (ts.isDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - } - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - noDeclare = false; - emitSourceFile(sourceFile); - } - else if (ts.isExternalModule(sourceFile)) { - noDeclare = true; - write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); - writeLine(); - increaseIndent(); - emitSourceFile(sourceFile); - decreaseIndent(); - write("}"); - writeLine(); - if (moduleElementDeclarationEmitInfo.length) { - var oldWriter = writer; - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222); - createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 1); - increaseIndent(); - writeImportDeclaration(aliasEmitInfo.node); - aliasEmitInfo.asynchronousOutput = writer.getText(); - decreaseIndent(); - } - }); - setWriter(oldWriter); - } - prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); - moduleElementDeclarationEmitInfo = []; - } - }); - moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); - } + }); return { reportedDeclarationError: reportedDeclarationError, - moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -23525,10 +24271,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 211) { + if (declaration.kind === 213) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 225 || declaration.kind === 226 || declaration.kind === 223) { + else if (declaration.kind === 227 || declaration.kind === 228 || declaration.kind === 225) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -23539,7 +24285,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 222) { + if (moduleElementEmitInfo.node.kind === 224) { moduleElementEmitInfo.isVisible = true; } else { @@ -23547,12 +24293,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 218) { + if (nodeToCheck.kind === 220) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 218) { + if (nodeToCheck.kind === 220) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -23573,10 +24319,10 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } } } @@ -23586,7 +24332,8 @@ var ts; } function reportInaccessibleThisError() { if (errorNameNode) { - diagnostics.push(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); } } function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { @@ -23654,10 +24401,10 @@ var ts; case 120: case 131: case 103: - case 97: - case 9: + case 161: + case 162: return writeTextOfNode(currentText, type); - case 188: + case 190: return emitExpressionWithTypeArguments(type); case 151: return emitTypeReference(type); @@ -23698,13 +24445,13 @@ var ts; } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 221 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 223 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 166); + ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 168); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -23777,7 +24524,8 @@ var ts; } var count = 0; while (true) { - var name_18 = baseName + "_" + (++count); + count++; + var name_18 = baseName + "_" + count; if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } @@ -23820,10 +24568,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 221 || - (node.parent.kind === 248 && isCurrentFileExternalModule)) { + else if (node.kind === 223 || + (node.parent.kind === 250 && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -23832,7 +24580,7 @@ var ts; }); } else { - if (node.kind === 222) { + if (node.kind === 224) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -23850,37 +24598,37 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 213: - return writeFunctionDeclaration(node); - case 193: - return writeVariableStatement(node); case 215: - return writeInterfaceDeclaration(node); - case 214: - return writeClassDeclaration(node); - case 216: - return writeTypeAliasDeclaration(node); + return writeFunctionDeclaration(node); + case 195: + return writeVariableStatement(node); case 217: - return writeEnumDeclaration(node); + return writeInterfaceDeclaration(node); + case 216: + return writeClassDeclaration(node); case 218: + return writeTypeAliasDeclaration(node); + case 219: + return writeEnumDeclaration(node); + case 220: return writeModuleDeclaration(node); - case 221: + case 223: return writeImportEqualsDeclaration(node); - case 222: + case 224: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 248) { + if (node.parent.kind === 250) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 215 && !noDeclare) { + else if (node.kind !== 217 && !noDeclare) { write("declare "); } } @@ -23913,7 +24661,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + emitExternalModuleSpecifier(node); write(");"); } writer.writeLine(); @@ -23927,7 +24675,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 224) { + if (namedBindings.kind === 226) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -23953,7 +24701,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 224) { + if (node.importClause.namedBindings.kind === 226) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -23965,13 +24713,22 @@ var ts; } write(" from "); } - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); write(";"); writer.writeLine(); } - function emitExternalModuleSpecifier(moduleSpecifier) { - if (moduleSpecifier.kind === 9 && (!root) && (compilerOptions.out || compilerOptions.outFile)) { - var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + function emitExternalModuleSpecifier(parent) { + var moduleSpecifier; + if (parent.kind === 223) { + var node = parent; + moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); + } + else { + var node = parent; + moduleSpecifier = node.moduleSpecifier; + } + if (moduleSpecifier.kind === 9 && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { write("\""); write(moduleName); @@ -24006,7 +24763,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); } write(";"); writer.writeLine(); @@ -24021,7 +24778,7 @@ var ts; write("module "); } writeTextOfNode(currentText, node.name); - while (node.body.kind !== 219) { + while (node.body.kind !== 221) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -24114,10 +24871,10 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 214: + case 216: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 215: + case 217: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 148: @@ -24131,14 +24888,14 @@ var ts; if (node.parent.flags & 64) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214) { + else if (node.parent.parent.kind === 216) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 213: + case 215: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -24171,7 +24928,7 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 214) { + if (node.parent.parent.kind === 216) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -24251,7 +25008,7 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 211 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 213 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -24269,7 +25026,7 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 211) { + if (node.kind === 213) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24284,7 +25041,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24310,7 +25067,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { elements.push(element); } } @@ -24444,13 +25201,13 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 213) { + if (node.kind === 215) { emitModuleElementDeclarationFlags(node); } else if (node.kind === 143) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 213) { + if (node.kind === 215) { write("function "); writeTextOfNode(currentText, node.name); } @@ -24471,6 +25228,8 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; if (node.kind === 148 || node.kind === 153) { write("new "); } @@ -24481,8 +25240,6 @@ var ts; else { write("("); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); if (node.kind === 149) { write("]"); @@ -24532,7 +25289,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -24545,7 +25302,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 213: + case 215: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -24618,7 +25375,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214) { + else if (node.parent.parent.kind === 216) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24630,7 +25387,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 213: + case 215: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24641,12 +25398,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 161) { + if (bindingPattern.kind === 163) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 162) { + else if (bindingPattern.kind === 164) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -24657,18 +25414,10 @@ var ts; } } function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.kind === 187) { + if (bindingElement.kind === 189) { write(" "); } - else if (bindingElement.kind === 163) { + else if (bindingElement.kind === 165) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -24690,19 +25439,19 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 213: - case 218: - case 221: case 215: - case 214: - case 216: + case 220: + case 223: case 217: + case 216: + case 218: + case 219: return emitModuleElement(node, isModuleElementVisible(node)); - case 193: + case 195: return emitModuleElement(node, isVariableStatementVisible(node)); - case 222: + case 224: return emitModuleElement(node, !node.importClause); - case 228: + case 230: return emitExportDeclaration(node); case 144: case 143: @@ -24718,31 +25467,47 @@ var ts; case 141: case 140: return emitPropertyDeclaration(node); - case 247: + case 249: return emitEnumMemberDeclaration(node); - case 227: + case 229: return emitExportAssignment(node); - case 248: + case 250: return emitSourceFile(node); } } - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 4096 - ? referencedFile.fileName - : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) - ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); - referencePathsOutput += "/// " + newLine; + function writeReferencePath(referencedFile, addBundledFileReference) { + var declFileName; + var addedBundledEmitReference = false; + if (ts.isDeclarationFile(referencedFile)) { + declFileName = referencedFile.fileName; + } + else { + ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile); + } + if (declFileName) { + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); + referencePathsOutput += "/// " + newLine; + } + return addedBundledEmitReference; + function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) { + if (isBundledEmit && !addBundledFileReference) { + return; + } + ts.Debug.assert(!!emitFileNames.declarationFilePath || ts.isSourceFileJavaScript(referencedFile), "Declaration file is not present only for javascript files"); + declFileName = emitFileNames.declarationFilePath || emitFileNames.jsFilePath; + addedBundledEmitReference = isBundledEmit; + } } } - function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { + function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit); + var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; + if (!emitSkipped) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM); } + return emitSkipped; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; @@ -24761,10 +25526,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function getResolvedExternalModuleName(host, file) { return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); } @@ -25039,41 +25800,17 @@ var ts; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; - var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 ? 5 : 0; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var modulekind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - var diagnostics = []; + var emitterDiagnostics = ts.createDiagnosticCollection(); + var emitSkipped = false; var newLine = host.getNewLine(); - var jsxDesugaring = host.getCompilerOptions().jsx !== 1; - var shouldEmitJsx = function (s) { return (s.languageVariant === 1 && !jsxDesugaring); }; - var outFile = compilerOptions.outFile || compilerOptions.out; var emitJavaScript = createFileEmitter(); - if (targetSourceFile === undefined) { - if (outFile) { - emitFile(outFile); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - } - } - else { - if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { - emitFile(outFile); - } - } - diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); + ts.forEachExpectedEmitFile(host, emitFile, targetSourceFile); return { - emitSkipped: false, - diagnostics: diagnostics, + emitSkipped: emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), sourceMaps: sourceMapDataList }; function isUniqueLocalName(name, container) { @@ -25120,6 +25857,8 @@ var ts; function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; + var sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? ts.createSourceMapWriter(host, writer) : ts.getNullSourceMapWriter(); + var setSourceFile = sourceMap.setSourceFile, emitStart = sourceMap.emitStart, emitEnd = sourceMap.emitEnd, emitPos = sourceMap.emitPos; var currentSourceFile; var currentText; var currentLineMap; @@ -25136,24 +25875,16 @@ var ts; var decorateEmitted; var paramEmitted; var awaiterEmitted; - var tempFlags; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; var exportEquals; - var hasExportStars; - var writeEmittedFiles = writeJavaScriptFile; + var hasExportStarsToExportValues; var detachedCommentsInfo; - var writeComment = ts.writeCommentRange; - var emit = emitNodeWithCommentsAndWithoutSourcemap; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; - var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; var sourceMapData; - var root; + var isOwnFileEmit; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, @@ -25172,14 +25903,29 @@ var ts; _b ); return doEmit; - function doEmit(jsFilePath, rootFile) { + function doEmit(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + generatedNameSet = {}; + nodeToGeneratedName = []; + isOwnFileEmit = !isBundledEmit; + if (isBundledEmit && modulekind) { + ts.forEach(sourceFiles, emitEmitHelpers); + } + ts.forEach(sourceFiles, emitSourceFile); + writeLine(); + var sourceMappingURL = sourceMap.getSourceMappingURL(); + if (sourceMappingURL) { + write("//# sourceMappingURL=" + sourceMappingURL); + } + writeEmittedFiles(writer.getText(), jsFilePath, sourceMapFilePath, compilerOptions.emitBOM); + sourceMap.reset(); writer.reset(); currentSourceFile = undefined; currentText = undefined; currentLineMap = undefined; exportFunctionForFile = undefined; - generatedNameSet = {}; - nodeToGeneratedName = []; + generatedNameSet = undefined; + nodeToGeneratedName = undefined; computedPropertyNamesToGeneratedNames = undefined; convertedLoopState = undefined; extendsEmitted = false; @@ -25192,31 +25938,12 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = undefined; + hasExportStarsToExportValues = undefined; detachedCommentsInfo = undefined; sourceMapData = undefined; isEs6Module = false; renamedDependencies = undefined; isCurrentFileExternalModule = false; - root = rootFile; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(jsFilePath, root); - } - if (root) { - emitSourceFile(root); - } - else { - if (modulekind) { - ts.forEach(host.getSourceFiles(), emitEmitHelpers); - } - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { - emitSourceFile(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), jsFilePath, compilerOptions.emitBOM); } function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -25227,7 +25954,8 @@ var ts; renamedDependencies = sourceFile.renamedDependencies; currentFileIdentifiers = sourceFile.identifiers; isCurrentFileExternalModule = ts.isExternalModule(sourceFile); - emit(sourceFile); + setSourceFile(sourceFile); + emitNodeWithCommentsAndWithoutSourcemap(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && @@ -25286,17 +26014,17 @@ var ts; switch (node.kind) { case 69: return makeUniqueName(node.text); - case 218: - case 217: + case 220: + case 219: return generateNameForModuleOrEnum(node); - case 222: - case 228: + case 224: + case 230: return generateNameForImportOrExportDeclaration(node); - case 213: - case 214: - case 227: + case 215: + case 216: + case 229: return generateNameForExportDefault(); - case 186: + case 188: return generateNameForClassExpression(); } } @@ -25304,289 +26032,14 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps(jsFilePath, root) { - var sourceMapDir; - var sourceMapSourceIndex = -1; - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; + function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark) { + if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { + ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), false); } - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } + if (sourceMapDataList) { + sourceMapDataList.push(sourceMap.getSourceMapData()); } - function recordSourceMapSpan(pos) { - var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); - sourceLinePos.line++; - sourceLinePos.character++; - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine !== emittedLine || - lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - encodeLastRecordedSourceMapSpan(); - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentText, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - sourceMapData.inputSourceFileNames.push(node.fileName); - if (compilerOptions.inlineSources) { - if (!sourceMapData.sourceMapSourcesContent) { - sourceMapData.sourceMapSourcesContent = []; - } - sourceMapData.sourceMapSourcesContent.push(node.text); - } - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - var name_21 = node.name; - if (!name_21 || name_21.kind !== 136) { - scopeName = "." + scopeName; - } - scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - recordScopeNameStart(scopeName); - } - else if (node.kind === 213 || - node.kind === 173 || - node.kind === 143 || - node.kind === 142 || - node.kind === 145 || - node.kind === 146 || - node.kind === 218 || - node.kind === 214 || - node.kind === 217) { - if (node.name) { - var name_22 = node.name; - scopeName = name_22.kind === 136 - ? ts.getTextOfNode(name_22) - : node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { - if (typeof JSON !== "undefined") { - var map_1 = { - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }; - if (sourcesContent !== undefined) { - map_1.sourcesContent = sourcesContent; - } - return JSON.stringify(map_1); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); - sourceMapDataList.push(sourceMapData); - var sourceMapUrl; - if (compilerOptions.inlineSourceMap) { - var base64SourceMapText = ts.convertToBase64(sourceMapText); - sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; - } - else { - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); - sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; - } - writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); - } - var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapSourcesContent: undefined, - sourceMapDecodedMappings: [] - }; - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithSourceMap(node) { - if (node) { - if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); - } - if (node.kind !== 248) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); - } - } - } - function emitNodeWithCommentsAndWithSourcemap(node) { - emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithCommentsAndWithSourcemap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { - ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, emitterDiagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function createTempVariable(flags) { var result = ts.createSynthesizedNode(69); @@ -25617,7 +26070,9 @@ var ts; write(";"); } } - function emitTokenText(tokenKind, startPos, emitFn) { + function emitToken(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(currentText, startPos); + emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); @@ -25625,7 +26080,9 @@ var ts; else { write(tokenString); } - return startPos + tokenString.length; + var tokenEndPos = tokenStartPos + tokenString.length; + emitPos(tokenEndPos); + return tokenEndPos; } function emitOptional(prefix, node) { if (node) { @@ -25642,11 +26099,6 @@ var ts; write(")"); } } - function emitTrailingCommaIfPresent(nodeList) { - if (nodeList.hasTrailingComma) { - write(","); - } - } function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); @@ -25812,10 +26264,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 183) { + if (node.template.kind === 185) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 181 + var needsParens = templateSpan.expression.kind === 183 && templateSpan.expression.operatorToken.kind === 24; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -25839,7 +26291,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 172 + var needsParens = templateSpan.expression.kind !== 174 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -25859,11 +26311,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 168: - case 169: - return parent.expression === template; case 170: + case 171: + return parent.expression === template; case 172: + case 174: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -25871,7 +26323,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 181: + case 183: switch (expression.operatorToken.kind) { case 37: case 39: @@ -25883,8 +26335,8 @@ var ts; default: return -1; } + case 186: case 184: - case 182: return -1; default: return 1; @@ -25907,13 +26359,13 @@ var ts; } } function emitAttributeName(name) { - if (/[A-Za-z_]+[\w*]/.test(name.text)) { - write("\""); + if (/^[A-Za-z_]\w*$/.test(name.text)) { emit(name); - write("\""); } else { + write("\""); emit(name); + write("\""); } } function emitJsxAttribute(node) { @@ -25928,7 +26380,7 @@ var ts; } function emitJsxElement(openingNode, children) { var syntheticReactRef = ts.createSynthesizedNode(69); - syntheticReactRef.text = "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; emitLeadingComments(openingNode); emitExpressionIdentifier(syntheticReactRef); @@ -25940,12 +26392,12 @@ var ts; } else { var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 239; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 241; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 239) { + if (attrs[i_1].kind === 241) { if (i_1 === 0) { write("{}, "); } @@ -25959,7 +26411,7 @@ var ts; emit(attrs[i_1].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 238); + ts.Debug.assert(attrs[i_1].kind === 240); if (haveOpenedObjectLiteral) { write(", "); } @@ -25990,10 +26442,10 @@ var ts; } if (children) { for (var i = 0; i < children.length; i++) { - if (children[i].kind === 240 && !(children[i].expression)) { + if (children[i].kind === 242 && !(children[i].expression)) { continue; } - if (children[i].kind === 236) { + if (children[i].kind === 238) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -26010,11 +26462,11 @@ var ts; write(")"); emitTrailingComments(openingNode); } - if (node.kind === 233) { + if (node.kind === 235) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 234); + ts.Debug.assert(node.kind === 236); emitJsxElement(node); } } @@ -26036,11 +26488,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 239) { + if (attribs[i].kind === 241) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 238); + ts.Debug.assert(attribs[i].kind === 240); emitJsxAttribute(attribs[i]); } } @@ -26048,11 +26500,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 234)) { + if (node.attributes.length > 0 || (node.kind === 236)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 234) { + if (node.kind === 236) { write("/>"); } else { @@ -26071,16 +26523,16 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 233) { + if (node.kind === 235) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 234); + ts.Debug.assert(node.kind === 236); emitJsxOpeningOrSelfClosingElement(node); } } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 163); + ts.Debug.assert(node.kind !== 165); if (node.kind === 9) { emitLiteral(node); } @@ -26115,59 +26567,60 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 164: - case 189: - case 181: - case 168: - case 241: - case 136: - case 182: - case 139: - case 175: - case 197: - case 167: - case 227: - case 195: - case 188: - case 199: - case 200: - case 201: - case 196: - case 234: - case 235: - case 239: - case 240: - case 169: - case 172: - case 180: - case 179: - case 204: - case 246: - case 185: - case 206: - case 170: - case 190: - case 208: - case 171: - case 176: - case 177: - case 198: - case 205: - case 184: - return true; - case 163: - case 247: - case 138: - case 245: - case 141: - case 211: - return parent.initializer === node; case 166: - return parent.expression === node; + case 191: + case 183: + case 170: + case 243: + case 136: + case 184: + case 139: + case 177: + case 199: + case 169: + case 229: + case 197: + case 190: + case 201: + case 202: + case 203: + case 198: + case 239: + case 236: + case 237: + case 241: + case 242: + case 171: case 174: + case 182: + case 181: + case 206: + case 248: + case 187: + case 208: + case 172: + case 192: + case 210: case 173: + case 178: + case 179: + case 200: + case 207: + case 186: + return true; + case 165: + case 249: + case 138: + case 247: + case 141: + case 213: + return parent.initializer === node; + case 168: + return parent.expression === node; + case 176: + case 175: return parent.body === node; - case 221: + case 223: return parent.moduleReference === node; case 135: return parent.left === node; @@ -26181,7 +26634,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 248) { + if (container.kind === 250) { if (modulekind !== 5 && modulekind !== 4) { write("exports."); } @@ -26195,15 +26648,15 @@ var ts; if (modulekind !== 5) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 223) { + if (declaration.kind === 225) { write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 226) { + else if (declaration.kind === 228) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); + var name_21 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -26234,10 +26687,10 @@ var ts; if (languageVersion < 2) { var parent_6 = node.parent; switch (parent_6.kind) { - case 163: - case 214: - case 217: - case 211: + case 165: + case 216: + case 219: + case 213: return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); } } @@ -26246,8 +26699,8 @@ var ts; function emitIdentifier(node) { if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { - var name_24 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_24); + var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_22); return; } } @@ -26271,6 +26724,9 @@ var ts; if (resolver.getNodeCheckFlags(node) & 2) { write("_this"); } + else if (convertedLoopState) { + write(convertedLoopState.thisName || (convertedLoopState.thisName = makeUniqueName("this"))); + } else { write("this"); } @@ -26344,10 +26800,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 181 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 183 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 182 && node.parent.condition === node) { + else if (node.parent.kind === 184 && node.parent.condition === node) { return true; } return false; @@ -26355,11 +26811,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69: - case 164: case 166: - case 167: case 168: - case 172: + case 169: + case 170: + case 174: return false; } return true; @@ -26376,17 +26832,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 185) { + if (e.kind === 187) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 164) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 185) { + while (i < length && elements[i].kind !== 187) { i++; } write("["); @@ -26409,7 +26865,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 185; + return node.kind === 187; } function emitArrayLiteral(node) { var elements = node.elements; @@ -26521,10 +26977,10 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 245) { + if (property.kind === 247) { emit(property.initializer); } - else if (property.kind === 246) { + else if (property.kind === 248) { emitExpressionIdentifier(property.name); } else if (property.kind === 143) { @@ -26573,35 +27029,35 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(181, startsOnNewLine); + var result = ts.createSynthesizedNode(183, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(168); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(167); + var result = ts.createSynthesizedNode(169); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - while (expr.kind === 171 || expr.kind === 189) { + while (expr.kind === 173 || expr.kind === 191) { expr = expr.expression; } if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 169 && + expr.kind !== 171 && expr.kind !== 8) { return expr; } - var node = ts.createSynthesizedNode(172); + var node = ts.createSynthesizedNode(174); node.expression = expr; return node; } @@ -26628,7 +27084,7 @@ var ts; } function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 248; + return container && container.kind !== 250; } function emitShorthandPropertyAssignment(node) { writeTextOfNode(currentText, node.name); @@ -26646,7 +27102,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 166 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 168 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -26657,7 +27113,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 166 || node.kind === 167 + return node.kind === 168 || node.kind === 169 ? resolver.getConstantValue(node) : undefined; } @@ -26740,6 +27196,9 @@ var ts; case 135: emitQualifiedNameAsExpression(node, useFallback); break; + default: + emitNodeWithoutSourceMap(node); + break; } } function emitIndexedAccess(node) { @@ -26752,10 +27211,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 185; }); + return ts.forEach(elements, function (e) { return e.kind === 187; }); } function skipParentheses(node) { - while (node.kind === 172 || node.kind === 171 || node.kind === 189) { + while (node.kind === 174 || node.kind === 173 || node.kind === 191) { node = node.expression; } return node; @@ -26776,12 +27235,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 166) { + if (expr.kind === 168) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 167) { + else if (expr.kind === 169) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -26822,7 +27281,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 166 && node.expression.expression.kind === 95; + superCall = node.expression.kind === 168 && node.expression.expression.kind === 95; } if (superCall && languageVersion < 2) { write(".call("); @@ -26873,21 +27332,21 @@ var ts; } } function emitParenExpression(node) { - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 174) { - if (node.expression.kind === 171 || node.expression.kind === 189) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176) { + if (node.expression.kind === 173 || node.expression.kind === 191) { var operand = node.expression.expression; - while (operand.kind === 171 || operand.kind === 189) { + while (operand.kind === 173 || operand.kind === 191) { operand = operand.expression; } - if (operand.kind !== 179 && + if (operand.kind !== 181 && + operand.kind !== 179 && + operand.kind !== 178 && operand.kind !== 177 && - operand.kind !== 176 && - operand.kind !== 175 && - operand.kind !== 180 && - operand.kind !== 169 && - !(operand.kind === 168 && node.parent.kind === 169) && - !(operand.kind === 173 && node.parent.kind === 168) && - !(operand.kind === 8 && node.parent.kind === 166)) { + operand.kind !== 182 && + operand.kind !== 171 && + !(operand.kind === 170 && node.parent.kind === 171) && + !(operand.kind === 175 && node.parent.kind === 170) && + !(operand.kind === 8 && node.parent.kind === 168)) { emit(operand); return; } @@ -26916,21 +27375,22 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 211 || node.parent.kind === 163); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 || node.parent.kind === 165); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); } function emitPrefixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + var exportChanged = (node.operator === 41 || node.operator === 42) && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); if (exportChanged) { write(exportFunctionForFile + "(\""); emitNodeWithoutSourceMap(node.operand); write("\", "); } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 179) { + if (node.operand.kind === 181) { var operand = node.operand; if (node.operator === 35 && (operand.operator === 35 || operand.operator === 41)) { write(" "); @@ -26973,10 +27433,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 248) { + if (current.kind === 250) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 219) { + else if (ts.isFunctionLike(current) || current.kind === 221) { return false; } else { @@ -26992,7 +27452,7 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(167, false); + synthesizedLHS = ts.createSynthesizedNode(169, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 && @@ -27009,7 +27469,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(166, false); + synthesizedLHS = ts.createSynthesizedNode(168, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -27037,8 +27497,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 56 && - (node.left.kind === 165 || node.left.kind === 164)) { - emitDestructuring(node, node.parent.kind === 195); + (node.left.kind === 167 || node.left.kind === 166)) { + emitDestructuring(node, node.parent.kind === 197); } else { var exportChanged = node.operatorToken.kind >= 56 && @@ -27090,7 +27550,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 192) { + if (node && node.kind === 194) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -27104,22 +27564,20 @@ var ts; } emitToken(15, node.pos); increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 219) { - ts.Debug.assert(node.parent.kind === 218); + if (node.kind === 221) { + ts.Debug.assert(node.parent.kind === 220); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 219) { + if (node.kind === 221) { emitTempDeclarations(true); } decreaseIndent(); writeLine(); emitToken(16, node.statements.end); - scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 192) { + if (node.kind === 194) { write(" "); emit(node); } @@ -27131,7 +27589,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 174); + emitParenthesizedIf(node.expression, node.expression.kind === 176); write(";"); } function emitIfStatement(node) { @@ -27144,7 +27602,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80, node.thenStatement.end); - if (node.elseStatement.kind === 196) { + if (node.elseStatement.kind === 198) { write(" "); emit(node.elseStatement); } @@ -27164,7 +27622,7 @@ var ts; else { emitNormalLoopBody(node, true); } - if (node.statement.kind === 192) { + if (node.statement.kind === 194) { write(" "); } else { @@ -27255,7 +27713,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 207) { + if (node.parent.kind === 209) { emitLabelAndColon(node.parent); } loopEmitter(node, loop); @@ -27265,10 +27723,10 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 199: - case 200: case 201: - if (node.initializer.kind === 212) { + case 202: + case 203: + if (node.initializer.kind === 214) { loopInitializer = node.initializer; } break; @@ -27281,7 +27739,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 192; + var bodyIsBlock = node.statement.kind === 194; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -27296,6 +27754,9 @@ var ts; if (convertedOuterLoopState.argumentsName) { convertedLoopState.argumentsName = convertedOuterLoopState.argumentsName; } + if (convertedOuterLoopState.thisName) { + convertedLoopState.thisName = convertedOuterLoopState.thisName; + } if (convertedOuterLoopState.hoistedLocalVariables) { convertedLoopState.hoistedLocalVariables = convertedOuterLoopState.hoistedLocalVariables; } @@ -27317,6 +27778,15 @@ var ts; writeLine(); } } + if (convertedLoopState.thisName) { + if (convertedOuterLoopState) { + convertedOuterLoopState.thisName = convertedLoopState.thisName; + } + else { + write("var " + convertedLoopState.thisName + " = this;"); + writeLine(); + } + } if (convertedLoopState.hoistedLocalVariables) { if (convertedOuterLoopState) { convertedOuterLoopState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; @@ -27366,7 +27836,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 192) { + else if (node.statement.kind === 194) { emitLines(node.statement.statements); } else { @@ -27462,7 +27932,7 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer && node.initializer.kind === 212) { + if (node.initializer && node.initializer.kind === 214) { var variableDeclarationList = node.initializer; var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); if (startIsEmitted) { @@ -27488,7 +27958,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 201) { + if (languageVersion < 2 && node.kind === 203) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -27499,7 +27969,7 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); @@ -27509,7 +27979,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 200) { + if (node.kind === 202) { write(" in "); } else { @@ -27524,9 +27994,6 @@ var ts; emitNormalLoopBody(node, true); } } - function emitDownLevelForOfStatement(node) { - emitLoop(node, emitDownLevelForOfStatementWorker); - } function emitDownLevelForOfStatementWorker(node, loop) { var endPos = emitToken(86, node.pos); write(" "); @@ -27565,7 +28032,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -27587,7 +28054,7 @@ var ts; } else { var assignmentExpression = createBinaryExpression(node.initializer, 56, rhsIterationValue, false); - if (node.initializer.kind === 164 || node.initializer.kind === 165) { + if (node.initializer.kind === 166 || node.initializer.kind === 167) { emitDestructuring(assignmentExpression, true, undefined); } else { @@ -27609,12 +28076,12 @@ var ts; } function emitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 203 ? 2 : 4; + var jump = node.kind === 205 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 203) { + if (node.kind === 205) { convertedLoopState.nonLocalJumps |= 2; write("return \"break\";"); } @@ -27625,7 +28092,7 @@ var ts; } else { var labelMarker; - if (node.kind === 203) { + if (node.kind === 205) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -27638,7 +28105,7 @@ var ts; return; } } - emitToken(node.kind === 203 ? 70 : 75, node.pos); + emitToken(node.kind === 205 ? 70 : 75, node.pos); emitOptional(" ", node.label); write(";"); } @@ -27703,7 +28170,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 241) { + if (node.kind === 243) { write("case "); emit(node.expression); write(":"); @@ -27772,7 +28239,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 218); + } while (node && node.kind !== 220); return node; } function emitContainingModuleName(node) { @@ -27797,20 +28264,20 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8); zero.text = "0"; - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(179); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 248) { - ts.Debug.assert(!!(node.flags & 512) || node.kind === 227); + if (node.parent.kind === 250) { + ts.Debug.assert(!!(node.flags & 512) || node.kind === 229); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { if (!isEs6Module) { - if (languageVersion === 1) { + if (languageVersion !== 0) { write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); } - else if (languageVersion === 0) { + else { write("exports.__esModule = true;"); writeLine(); } @@ -27898,7 +28365,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 211 || name.parent.kind === 163); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 || name.parent.kind === 165); if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } @@ -27922,7 +28389,7 @@ var ts; function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var canDefineTempVariablesInPlace = false; - if (root.kind === 211) { + if (root.kind === 213) { var isExported = ts.getCombinedNodeFlags(root) & 2; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; @@ -27930,7 +28397,7 @@ var ts; else if (root.kind === 138) { canDefineTempVariablesInPlace = true; } - if (root.kind === 181) { + if (root.kind === 183) { emitAssignmentExpression(root); } else { @@ -27947,14 +28414,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value, true); - var equals = ts.createSynthesizedNode(181); + var equals = ts.createSynthesizedNode(183); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(182); + var cond = ts.createSynthesizedNode(184); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53); cond.whenTrue = whenTrue; @@ -27982,7 +28449,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(168); + var call = ts.createSynthesizedNode(170); var sliceIdentifier = ts.createSynthesizedNode(69); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -27997,9 +28464,9 @@ var ts; } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 245 || p.kind === 246) { + if (p.kind === 247 || p.kind === 248) { var propName = p.name; - var target_1 = p.kind === 246 ? p : p.initializer || propName; + var target_1 = p.kind === 248 ? p : p.initializer || propName; emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); } } @@ -28011,8 +28478,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187) { - if (e.kind !== 185) { + if (e.kind !== 189) { + if (e.kind !== 187) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -28022,20 +28489,20 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 246) { + if (target.kind === 248) { if (target.objectAssignmentInitializer) { value = createDefaultValueCheck(value, target.objectAssignmentInitializer); } target = target.name; } - else if (target.kind === 181 && target.operatorToken.kind === 56) { + else if (target.kind === 183 && target.operatorToken.kind === 56) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 165) { + if (target.kind === 167) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 164) { + else if (target.kind === 166) { emitArrayLiteralAssignment(target, value); } else { @@ -28053,14 +28520,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 172) { + if (root.parent.kind !== 174) { write("("); } value = ensureIdentifier(value, true); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 172) { + if (root.parent.kind !== 174) { write(")"); } } @@ -28081,11 +28548,11 @@ var ts; } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 161) { + if (pattern.kind === 163) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 187) { + else if (element.kind !== 189) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -28117,8 +28584,8 @@ var ts; var isLetDefinedInLoop = (resolver.getNodeCheckFlags(node) & 16384) && (getCombinedFlagsForIdentifier(node.name) & 8192); if (isLetDefinedInLoop && - node.parent.parent.kind !== 200 && - node.parent.parent.kind !== 201) { + node.parent.parent.kind !== 202 && + node.parent.parent.kind !== 203) { initializer = createVoidZero(); } } @@ -28136,7 +28603,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 187) { + if (node.kind === 189) { return; } var name = node.name; @@ -28148,7 +28615,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 211 && node.parent.kind !== 163)) { + if (!node.parent || (node.parent.kind !== 213 && node.parent.kind !== 165)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -28156,7 +28623,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2) && modulekind === 5 && - node.parent.kind === 248; + node.parent.kind === 250; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -28201,12 +28668,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_25 = createTempVariable(0); + var name_23 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_25); - emit(name_25); + tempParameters.push(name_23); + emit(name_23); } else { emit(node.name); @@ -28310,7 +28777,7 @@ var ts; emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 174 && languageVersion >= 2; + return node.kind === 176 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { @@ -28321,20 +28788,24 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 173) { + if (node.kind === 175) { return !!node.name; } - if (node.kind === 213) { - return !!node.name || languageVersion < 2; + if (node.kind === 215) { + return !!node.name || modulekind !== 5; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { return emitCommentsOnNotEmittedNode(node); } - if (node.kind !== 143 && node.kind !== 142 && - node.parent && node.parent.kind !== 245 && - node.parent.kind !== 168) { + var kind = node.kind, parent = node.parent; + if (kind !== 143 && + kind !== 142 && + parent && + parent.kind !== 247 && + parent.kind !== 170 && + parent.kind !== 166) { emitLeadingComments(node); } emitStart(node); @@ -28355,11 +28826,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 && node.kind === 213 && node.parent === currentSourceFile && node.name) { + if (modulekind !== 5 && kind === 215 && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (node.kind !== 143 && node.kind !== 142) { + if (kind !== 143 && kind !== 142) { emitTrailingComments(node); } } @@ -28391,7 +28862,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 174; + var isArrowFunction = node.kind === 176; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; if (!isArrowFunction) { write(" {"); @@ -28401,17 +28872,16 @@ var ts; } write(" __awaiter(this"); if (hasLexicalArguments) { - write(", arguments"); + write(", arguments, "); } else { - write(", void 0"); + write(", void 0, "); } if (promiseConstructor) { - write(", "); - emitNodeWithoutSourceMap(promiseConstructor); + emitEntityNameAsExpression(promiseConstructor, false); } else { - write(", Promise"); + write("Promise"); } if (hasLexicalArguments) { write(", function* (_arguments)"); @@ -28433,7 +28903,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 192) { + if (node.body.kind === 194) { emitBlockFunctionBody(node, node.body); } else { @@ -28458,7 +28928,7 @@ var ts; emitSignatureParameters(node); } var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync && languageVersion === 2) { + if (isAsync) { emitAsyncFunctionBodyForES6(node); } else { @@ -28485,14 +28955,13 @@ var ts; } write(" "); var current = body; - while (current.kind === 171) { + while (current.kind === 173) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 165); + emitParenthesizedIf(body, current.kind === 167); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); increaseIndent(); var outPos = writer.getTextPos(); emitDetachedCommentsAndUpdateCommentsInfo(node.body); @@ -28513,8 +28982,10 @@ var ts; increaseIndent(); writeLine(); emitLeadingComments(node.body); + emitStart(body); write("return "); emit(body); + emitEnd(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -28524,11 +28995,9 @@ var ts; emitStart(node.body); write("}"); emitEnd(node.body); - scopeEmitEnd(); } function emitBlockFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedCommentsAndUpdateCommentsInfo(body.statements); @@ -28555,14 +29024,13 @@ var ts; decreaseIndent(); } emitToken(16, body.statements.end); - scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 195) { + if (statement && statement.kind === 197) { var expr = statement.expression; - if (expr && expr.kind === 168) { + if (expr && expr.kind === 170) { var func = expr.expression; if (func && func.kind === 95) { return statement; @@ -28645,7 +29113,7 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 191) { + if (member.kind === 193) { writeLine(); write(";"); } @@ -28742,7 +29210,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 191) { + else if (member.kind === 193) { writeLine(); write(";"); } @@ -28803,7 +29271,6 @@ var ts; } var startIndex = 0; write(" {"); - scopeEmitStart(node, "constructor"); increaseIndent(); if (ctor) { startIndex = emitDirectivePrologues(ctor.body.statements, true); @@ -28851,7 +29318,6 @@ var ts; } decreaseIndent(); emitToken(16, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { emitTrailingComments(ctor); @@ -28876,7 +29342,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 214) { + if (node.kind === 216) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 512)) { write("export "); @@ -28893,7 +29359,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 186; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -28903,7 +29369,7 @@ var ts; write(" = "); } write("class"); - if ((node.name || (node.flags & 512 && staticProperties.length > 0)) && !thisNodeIsDecorated) { + if ((node.name || (node.flags & 512 && (staticProperties.length > 0 || modulekind !== 5))) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -28914,14 +29380,12 @@ var ts; } write(" {"); increaseIndent(); - scopeEmitStart(node); writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); if (thisNodeIsDecorated) { write(";"); } @@ -28943,24 +29407,34 @@ var ts; emitPropertyDeclarations(node, staticProperties); emitDecoratorsOfClass(node); } - if (!isES6ExportedDeclaration(node) && (node.flags & 2)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!(node.flags & 2)) { + return; } - else if (isES6ExportedDeclaration(node) && (node.flags & 512) && thisNodeIsDecorated) { - writeLine(); - write("export default "); - emitDeclarationName(node); - write(";"); + if (modulekind !== 5) { + emitExportMemberAssignment(node); + } + else { + if (node.flags & 512) { + if (thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + else if (node.parent.kind !== 250) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 214) { + if (node.kind === 216) { if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); } @@ -28984,7 +29458,6 @@ var ts; tempParameters = undefined; computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); - scopeEmitStart(node); if (baseTypeNode) { writeLine(); emitStart(baseTypeNode); @@ -29015,18 +29488,17 @@ var ts; decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); emitStart(node); - write(")("); + write("("); if (baseTypeNode) { emit(baseTypeNode.expression); } - write(")"); - if (node.kind === 214) { + write("))"); + if (node.kind === 216) { write(";"); } emitEnd(node); - if (node.kind === 214) { + if (node.kind === 216) { emitExportMemberAssignment(node); } } @@ -29044,30 +29516,29 @@ var ts; function emitDecoratorsOfConstructor(node) { var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); - if (!decorators && !hasDecoratedParameters) { + var firstParameterDecorator = constructor && ts.forEach(constructor.parameters, function (parameter) { return parameter.decorators; }); + if (!decorators && !firstParameterDecorator) { return; } writeLine(); - emitStart(node); + emitStart(node.decorators || firstParameterDecorator); emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + } emitSerializedTypeMetadata(node, argumentsWritten >= 0); decreaseIndent(); writeLine(); write("], "); emitDeclarationName(node); - write(");"); - emitEnd(node); + write(")"); + emitEnd(node.decorators || firstParameterDecorator); + write(";"); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { @@ -29079,9 +29550,6 @@ var ts; if (!ts.nodeCanBeDecorated(member)) { continue; } - if (!ts.nodeOrChildIsDecorated(member)) { - continue; - } var decorators = void 0; var functionLikeMember = void 0; if (ts.isAccessor(member)) { @@ -29101,27 +29569,27 @@ var ts; functionLikeMember = member; } } + var firstParameterDecorator = functionLikeMember && ts.forEach(functionLikeMember.parameters, function (parameter) { return parameter.decorators; }); + if (!decorators && !firstParameterDecorator) { + continue; + } writeLine(); - emitStart(member); + emitStart(decorators || firstParameterDecorator); write("__decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + } emitSerializedTypeMetadata(member, argumentsWritten > 0); decreaseIndent(); writeLine(); write("], "); - emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); - emitEnd(member.name); if (languageVersion > 0) { if (member.kind !== 141) { write(", null"); @@ -29130,8 +29598,9 @@ var ts; write(", void 0"); } } - write(");"); - emitEnd(member); + write(")"); + emitEnd(decorators || firstParameterDecorator); + write(";"); writeLine(); } } @@ -29144,15 +29613,13 @@ var ts; if (ts.nodeIsDecorated(parameter)) { var decorators = parameter.decorators; argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { - emitStart(decorator); write("__param(" + parameterIndex + ", "); emit(decorator.expression); write(")"); - emitEnd(decorator); }); leadingComma = true; } - ++parameterIndex; + parameterIndex++; } } return argumentsWritten; @@ -29176,7 +29643,7 @@ var ts; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 214: + case 216: case 143: case 146: return true; @@ -29185,7 +29652,7 @@ var ts; } function emitSerializedTypeOfNode(node) { switch (node.kind) { - case 214: + case 216: write("Function"); return; case 141: @@ -29229,7 +29696,7 @@ var ts; write("Boolean"); return; case 130: - case 9: + case 162: write("String"); return; case 128: @@ -29246,6 +29713,7 @@ var ts; case 158: case 159: case 117: + case 161: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -29259,8 +29727,7 @@ var ts; while (ts.isDeclaration(location) || ts.isTypeNode(location)) { location = location.parent; } - var typeName = ts.cloneEntityName(node.typeName); - typeName.parent = location; + var typeName = ts.cloneEntityName(node.typeName, location); var result = resolver.getTypeReferenceSerializationKind(typeName); switch (result) { case ts.TypeReferenceSerializationKind.Unknown: @@ -29310,7 +29777,7 @@ var ts; function emitSerializedParameterTypesOfNode(node) { if (node) { var valueDeclaration; - if (node.kind === 214) { + if (node.kind === 216) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -29400,9 +29867,10 @@ var ts; return; } if (!shouldHoistDeclarationInSystemJsModule(node)) { - if (!(node.flags & 2) || isES6ExportedDeclaration(node)) { + var isES6ExportedEnum = isES6ExportedDeclaration(node); + if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219))) { emitStart(node); - if (isES6ExportedDeclaration(node)) { + if (isES6ExportedEnum) { write("export "); } write("var "); @@ -29419,12 +29887,10 @@ var ts; emitEnd(node.name); write(") {"); increaseIndent(); - scopeEmitStart(node); emitLines(node.members); decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); write(")("); emitModuleMemberName(node); write(" || ("); @@ -29482,7 +29948,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 218) { + if (moduleDeclaration.body.kind === 220) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -29493,6 +29959,9 @@ var ts; function isModuleMergedWithES6Class(node) { return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 32768); } + function isFirstDeclarationOfKind(node, declarations, kind) { + return !ts.forEach(declarations, function (declaration) { return declaration.kind === kind && declaration.pos < node.pos; }); + } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { @@ -29501,15 +29970,18 @@ var ts; var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + var isES6ExportedNamespace = isES6ExportedDeclaration(node); + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220)) { + emitStart(node); + if (isES6ExportedNamespace) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); } emitStart(node); write("(function ("); @@ -29517,7 +29989,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 219) { + if (node.body.kind === 221) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -29533,7 +30005,6 @@ var ts; else { write("{"); increaseIndent(); - scopeEmitStart(node); emitCaptureThisForNodeIfNecessary(node); writeLine(); emit(node.body); @@ -29541,7 +30012,6 @@ var ts; writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; emitToken(16, moduleBlock.statements.end); - scopeEmitEnd(); } write(")("); if ((node.flags & 2) && !isES6ExportedDeclaration(node)) { @@ -29590,16 +30060,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 221) { + if (node.kind === 223) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 224) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 222 && node.importClause && !!node.importClause.name; + return node.kind === 224 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -29626,7 +30096,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 224) { + if (node.importClause.namedBindings.kind === 226) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -29652,7 +30122,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 221 && (node.flags & 2) !== 0; + var isExportedImport = node.kind === 223 && (node.flags & 2) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2) { emitLeadingComments(node); @@ -29664,7 +30134,7 @@ var ts; write(" = "); } else { - var isNakedImport = 222 && !node.importClause; + var isNakedImport = 224 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -29771,15 +30241,17 @@ var ts; } } else { - writeLine(); - write("__export("); - if (modulekind !== 2) { - emitRequire(ts.getExternalModuleName(node)); + if (hasExportStarsToExportValues && resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + writeLine(); + write("__export("); + if (modulekind !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); } - else { - write(generatedName); - } - write(");"); } emitEnd(node); } @@ -29829,8 +30301,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 213 && - expression.kind !== 214) { + if (expression.kind !== 215 && + expression.kind !== 216) { write(";"); } emitEnd(node); @@ -29863,26 +30335,28 @@ var ts; externalImports = []; exportSpecifiers = {}; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 222: + case 224: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 221: - if (node.moduleReference.kind === 232 && resolver.isReferencedAliasDeclaration(node)) { + case 223: + if (node.moduleReference.kind === 234 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 228: + case 230: if (node.moduleSpecifier) { if (!node.exportClause) { - externalImports.push(node); - hasExportStars = true; + if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } } else if (resolver.isValueAliasDeclaration(node)) { externalImports.push(node); @@ -29891,12 +30365,12 @@ var ts; else { for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_26 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_26] || (exportSpecifiers[name_26] = [])).push(specifier); + var name_24 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); } } break; - case 227: + case 229: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -29905,7 +30379,7 @@ var ts; } } function emitExportStarHelper() { - if (hasExportStars) { + if (hasExportStarsToExportValues) { writeLine(); write("function __export(m) {"); increaseIndent(); @@ -29921,14 +30395,20 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 222 && node.importClause) { + if (node.kind === 224 && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 228 && node.moduleSpecifier) { + if (node.kind === 230 && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } - function getExternalModuleNameText(importNode) { + function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { + if (emitRelativePathAsModuleName) { + var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_25) { + return "\"" + name_25 + "\""; + } + } var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 9) { return tryRenameExternalModule(moduleName) || getLiteralText(moduleName); @@ -29943,8 +30423,8 @@ var ts; var started = false; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; - var skipNode = importNode.kind === 228 || - (importNode.kind === 222 && !importNode.importClause); + var skipNode = importNode.kind === 230 || + (importNode.kind === 224 && !importNode.importClause); if (skipNode) { continue; } @@ -29962,14 +30442,14 @@ var ts; } } function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { - if (!hasExportStars) { + if (!hasExportStarsToExportValues) { return undefined; } if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 228 && externalImport.exportClause) { + if (externalImport.kind === 230 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -29984,7 +30464,7 @@ var ts; increaseIndent(); var started = false; if (exportedDeclarations) { - for (var i = 0; i < exportedDeclarations.length; ++i) { + for (var i = 0; i < exportedDeclarations.length; i++) { writeExportedName(exportedDeclarations[i]); } } @@ -29998,7 +30478,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 228) { + if (externalImport.kind !== 230) { continue; } var exportDecl = externalImport; @@ -30070,13 +30550,13 @@ var ts; writeLine(); write("var "); var seen = {}; - for (var i = 0; i < hoistedVars.length; ++i) { + for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_27 = local.kind === 69 + var name_26 = local.kind === 69 ? local : local.name; - if (name_27) { - var text = ts.unescapeIdentifier(name_27.text); + if (name_26) { + var text = ts.unescapeIdentifier(name_26.text); if (ts.hasProperty(seen, text)) { continue; } @@ -30087,7 +30567,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 214 || local.kind === 218 || local.kind === 217) { + if (local.kind === 216 || local.kind === 220 || local.kind === 219) { emitDeclarationName(local); } else { @@ -30121,21 +30601,21 @@ var ts; if (node.flags & 4) { return; } - if (node.kind === 213) { + if (node.kind === 215) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 214) { + if (node.kind === 216) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 217) { + if (node.kind === 219) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30144,7 +30624,7 @@ var ts; } return; } - if (node.kind === 218) { + if (node.kind === 220) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30153,17 +30633,17 @@ var ts; } return; } - if (node.kind === 211 || node.kind === 163) { + if (node.kind === 213 || node.kind === 165) { if (shouldHoistVariable(node, false)) { - var name_28 = node.name; - if (name_28.kind === 69) { + var name_27 = node.name; + if (name_27.kind === 69) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_28); + hoistedVars.push(name_27); } else { - ts.forEachChild(name_28, visit); + ts.forEachChild(name_27, visit); } } return; @@ -30189,7 +30669,7 @@ var ts; return false; } return (ts.getCombinedNodeFlags(node) & 24576) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 248; + ts.getEnclosingBlockScopeContainer(node).kind === 250; } function isCurrentFileSystemExternalModule() { return modulekind === 4 && isCurrentFileExternalModule; @@ -30213,7 +30693,7 @@ var ts; } function emitSetters(exportStarFunction, dependencyGroups) { write("setters:["); - for (var i = 0; i < dependencyGroups.length; ++i) { + for (var i = 0; i < dependencyGroups.length; i++) { if (i !== 0) { write(","); } @@ -30227,24 +30707,24 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 222: + case 224: if (!entry.importClause) { break; } - case 221: + case 223: ts.Debug.assert(importVariableName !== ""); writeLine(); write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 228: + case 230: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { writeLine(); write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; ++i_2) { + for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { if (i_2 !== 0) { write(","); writeLine(); @@ -30278,13 +30758,13 @@ var ts; write("execute: function() {"); increaseIndent(); writeLine(); - for (var i = startIndex; i < node.statements.length; ++i) { + for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { - case 213: - case 222: + case 215: + case 224: continue; - case 228: + case 230: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -30292,7 +30772,7 @@ var ts; } } continue; - case 221: + case 223: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { continue; } @@ -30321,8 +30801,8 @@ var ts; write("["); var groupIndices = {}; var dependencyGroups = []; - for (var i = 0; i < externalImports.length; ++i) { - var text = getExternalModuleNameText(externalImports[i]); + for (var i = 0; i < externalImports.length; i++) { + var text = getExternalModuleNameText(externalImports[i], emitRelativePathAsModuleName); if (ts.hasProperty(groupIndices, text)) { var groupIndex = groupIndices[text]; dependencyGroups[groupIndex].push(externalImports[i]); @@ -30335,18 +30815,12 @@ var ts; if (i !== 0) { write(", "); } - if (emitRelativePathAsModuleName) { - var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); - if (name_29) { - text = "\"" + name_29 + "\""; - } - } write(text); } write("], function(" + exportFunctionForFile + ") {"); writeLine(); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitSystemModuleBody(node, dependencyGroups, startIndex); @@ -30370,13 +30844,7 @@ var ts; } for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; - var externalModuleName = getExternalModuleNameText(importNode); - if (emitRelativePathAsModuleName) { - var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_30) { - externalModuleName = "\"" + name_30 + "\""; - } - } + var externalModuleName = getExternalModuleNameText(importNode, emitRelativePathAsModuleName); var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); @@ -30424,7 +30892,7 @@ var ts; writeModuleName(node, emitRelativePathAsModuleName); emitAMDDependencies(node, true, emitRelativePathAsModuleName); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -30435,7 +30903,7 @@ var ts; write("});"); } function emitCommonJSModule(node) { - var startIndex = emitDirectivePrologues(node.statements, false); + var startIndex = emitDirectivePrologues(node.statements, false, true); emitEmitHelpers(node); collectExternalModuleInfo(node); emitExportStarHelper(); @@ -30454,7 +30922,7 @@ var ts; writeLines(" }\n})("); emitAMDFactoryHeader(dependencyNames); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -30468,7 +30936,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; var startIndex = emitDirectivePrologues(node.statements, false); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); @@ -30524,7 +30992,8 @@ var ts; if (result) { result = result.replace(/&(\w+);/g, function (s, m) { if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + var ch = String.fromCharCode(entities[m]); + return ch === "\"" ? "\\\"" : ch; } else { return s; @@ -30576,23 +31045,40 @@ var ts; } } } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { + function isUseStrictPrologue(node) { + return !!node.expression.text.match(/use strict/); + } + function ensureUseStrictPrologue(startWithNewLine, writeUseStrict) { + if (writeUseStrict) { + if (startWithNewLine) { + writeLine(); + } + write("\"use strict\";"); + } + } + function emitDirectivePrologues(statements, startWithNewLine, ensureUseStrict) { + var foundUseStrict = false; + for (var i = 0; i < statements.length; i++) { if (ts.isPrologueDirective(statements[i])) { + if (isUseStrictPrologue(statements[i])) { + foundUseStrict = true; + } if (startWithNewLine || i > 0) { writeLine(); } emit(statements[i]); } else { + ensureUseStrictPrologue(startWithNewLine || i > 0, !foundUseStrict && ensureUseStrict); return i; } } + ensureUseStrictPrologue(startWithNewLine, !foundUseStrict && ensureUseStrict); return statements.length; } function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); - for (var i = 0; i < lines.length; ++i) { + for (var i = 0; i < lines.length; i++) { var line = lines[i]; if (line.length) { writeLine(); @@ -30628,7 +31114,7 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + if (isOwnFileEmit || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; emitModule(node); } @@ -30641,7 +31127,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -30649,6 +31135,9 @@ var ts; } emitLeadingComments(node.endOfFileToken); } + function emit(node) { + emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); + } function emitNodeWithCommentsAndWithoutSourcemap(node) { emitNodeConsideringCommentsOption(node, emitNodeWithoutSourceMap); } @@ -30670,6 +31159,13 @@ var ts; } } } + function emitNodeWithSourceMap(node) { + if (node) { + emitStart(node); + emitNodeWithoutSourceMap(node); + emitEnd(node); + } + } function emitNodeWithoutSourceMap(node) { if (node) { emitJavaScriptWorker(node); @@ -30677,28 +31173,28 @@ var ts; } function isSpecializedCommentHandling(node) { switch (node.kind) { + case 217: case 215: - case 213: - case 222: - case 221: - case 216: - case 227: + case 224: + case 223: + case 218: + case 229: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 193: + case 195: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 218: + case 220: return shouldEmitModuleDeclaration(node); - case 217: + case 219: return shouldEmitEnumDeclaration(node); } ts.Debug.assert(!isSpecializedCommentHandling(node)); - if (node.kind !== 192 && + if (node.kind !== 194 && node.parent && - node.parent.kind === 174 && + node.parent.kind === 176 && node.parent.body === node && compilerOptions.target <= 1) { return false; @@ -30735,142 +31231,142 @@ var ts; case 13: case 14: return emitLiteral(node); - case 183: + case 185: return emitTemplateExpression(node); - case 190: + case 192: return emitTemplateSpan(node); - case 233: - case 234: - return emitJsxElement(node); + case 235: case 236: + return emitJsxElement(node); + case 238: return emitJsxText(node); - case 240: + case 242: return emitJsxExpression(node); case 135: return emitQualifiedName(node); - case 161: - return emitObjectBindingPattern(node); - case 162: - return emitArrayBindingPattern(node); case 163: - return emitBindingElement(node); + return emitObjectBindingPattern(node); case 164: - return emitArrayLiteral(node); + return emitArrayBindingPattern(node); case 165: + return emitBindingElement(node); + case 166: + return emitArrayLiteral(node); + case 167: return emitObjectLiteral(node); - case 245: + case 247: return emitPropertyAssignment(node); - case 246: + case 248: return emitShorthandPropertyAssignment(node); case 136: return emitComputedPropertyName(node); - case 166: - return emitPropertyAccess(node); - case 167: - return emitIndexedAccess(node); case 168: - return emitCallExpression(node); + return emitPropertyAccess(node); case 169: - return emitNewExpression(node); + return emitIndexedAccess(node); case 170: - return emitTaggedTemplateExpression(node); + return emitCallExpression(node); case 171: - return emit(node.expression); - case 189: - return emit(node.expression); + return emitNewExpression(node); case 172: - return emitParenExpression(node); - case 213: + return emitTaggedTemplateExpression(node); case 173: + return emit(node.expression); + case 191: + return emit(node.expression); case 174: - return emitFunctionDeclaration(node); - case 175: - return emitDeleteExpression(node); - case 176: - return emitTypeOfExpression(node); - case 177: - return emitVoidExpression(node); - case 178: - return emitAwaitExpression(node); - case 179: - return emitPrefixUnaryExpression(node); - case 180: - return emitPostfixUnaryExpression(node); - case 181: - return emitBinaryExpression(node); - case 182: - return emitConditionalExpression(node); - case 185: - return emitSpreadElementExpression(node); - case 184: - return emitYieldExpression(node); - case 187: - return; - case 192: - case 219: - return emitBlock(node); - case 193: - return emitVariableStatement(node); - case 194: - return write(";"); - case 195: - return emitExpressionStatement(node); - case 196: - return emitIfStatement(node); - case 197: - return emitDoStatement(node); - case 198: - return emitWhileStatement(node); - case 199: - return emitForStatement(node); - case 201: - case 200: - return emitForInOrForOfStatement(node); - case 202: - case 203: - return emitBreakOrContinueStatement(node); - case 204: - return emitReturnStatement(node); - case 205: - return emitWithStatement(node); - case 206: - return emitSwitchStatement(node); - case 241: - case 242: - return emitCaseOrDefaultClause(node); - case 207: - return emitLabeledStatement(node); - case 208: - return emitThrowStatement(node); - case 209: - return emitTryStatement(node); - case 244: - return emitCatchClause(node); - case 210: - return emitDebuggerStatement(node); - case 211: - return emitVariableDeclaration(node); - case 186: - return emitClassExpression(node); - case 214: - return emitClassDeclaration(node); + return emitParenExpression(node); case 215: - return emitInterfaceDeclaration(node); - case 217: - return emitEnumDeclaration(node); - case 247: - return emitEnumMember(node); - case 218: - return emitModuleDeclaration(node); - case 222: - return emitImportDeclaration(node); + case 175: + case 176: + return emitFunctionDeclaration(node); + case 177: + return emitDeleteExpression(node); + case 178: + return emitTypeOfExpression(node); + case 179: + return emitVoidExpression(node); + case 180: + return emitAwaitExpression(node); + case 181: + return emitPrefixUnaryExpression(node); + case 182: + return emitPostfixUnaryExpression(node); + case 183: + return emitBinaryExpression(node); + case 184: + return emitConditionalExpression(node); + case 187: + return emitSpreadElementExpression(node); + case 186: + return emitYieldExpression(node); + case 189: + return; + case 194: case 221: + return emitBlock(node); + case 195: + return emitVariableStatement(node); + case 196: + return write(";"); + case 197: + return emitExpressionStatement(node); + case 198: + return emitIfStatement(node); + case 199: + return emitDoStatement(node); + case 200: + return emitWhileStatement(node); + case 201: + return emitForStatement(node); + case 203: + case 202: + return emitForInOrForOfStatement(node); + case 204: + case 205: + return emitBreakOrContinueStatement(node); + case 206: + return emitReturnStatement(node); + case 207: + return emitWithStatement(node); + case 208: + return emitSwitchStatement(node); + case 243: + case 244: + return emitCaseOrDefaultClause(node); + case 209: + return emitLabeledStatement(node); + case 210: + return emitThrowStatement(node); + case 211: + return emitTryStatement(node); + case 246: + return emitCatchClause(node); + case 212: + return emitDebuggerStatement(node); + case 213: + return emitVariableDeclaration(node); + case 188: + return emitClassExpression(node); + case 216: + return emitClassDeclaration(node); + case 217: + return emitInterfaceDeclaration(node); + case 219: + return emitEnumDeclaration(node); + case 249: + return emitEnumMember(node); + case 220: + return emitModuleDeclaration(node); + case 224: + return emitImportDeclaration(node); + case 223: return emitImportEqualsDeclaration(node); - case 228: + case 230: return emitExportDeclaration(node); - case 227: + case 229: return emitExportAssignment(node); - case 248: + case 250: return emitSourceFileNode(node); } } @@ -30900,7 +31396,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 248 || node.pos !== node.parent.pos) { + if (node.parent.kind === 250 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -30912,7 +31408,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 248 || node.end !== node.parent.end) { + if (node.parent.kind === 250 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -30978,18 +31474,30 @@ var ts; } } } + function writeComment(text, lineMap, writer, comment, newLine) { + emitPos(comment.pos); + ts.writeCommentRange(text, lineMap, writer, comment, newLine); + emitPos(comment.end); + } function emitShebang() { var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); + writeLine(); } } var _a, _b; } - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (compilerOptions.declaration) { - ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); + function emitFile(_a, sourceFiles, isBundledEmit) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + emitJavaScript(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + else { + emitSkipped = true; + } + if (declarationFilePath) { + emitSkipped = ts.writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) || emitSkipped; } } } @@ -31003,10 +31511,10 @@ var ts; ts.ioWriteTime = 0; var emptyArray = []; ts.version = "1.8.0"; - function findConfigFile(searchPath) { + function findConfigFile(searchPath, fileExists) { var fileName = "tsconfig.json"; while (true) { - if (ts.sys.fileExists(fileName)) { + if (fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -31030,21 +31538,22 @@ var ts; ? compilerOptions.moduleResolution : compilerOptions.module === 1 ? 2 : 1; switch (moduleResolution) { - case 2: return nodeModuleNameResolver(moduleName, containingFile, host); + case 2: return nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); case 1: return classicNameResolver(moduleName, containingFile, compilerOptions, host); } } ts.resolveModuleName = resolveModuleName; - function nodeModuleNameResolver(moduleName, containingFile, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { var containingDirectory = ts.getDirectoryPath(containingFile); + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, false, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, false, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -31054,11 +31563,15 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + function directoryProbablyExists(directoryName, host) { + return !host.directoryExists || host.directoryExists(directoryName); + } + ts.directoryProbablyExists = directoryProbablyExists; + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; - if (host.fileExists(fileName)) { + if (!onlyRecordFailures && host.fileExists(fileName)) { return fileName; } else { @@ -31067,9 +31580,10 @@ var ts; } } } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); - if (host.fileExists(packageJsonPath)) { + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host); + if (directoryExists && host.fileExists(packageJsonPath)) { var jsonContent; try { var jsonText = host.readFile(packageJsonPath); @@ -31078,8 +31592,9 @@ var ts; catch (e) { jsonContent = { typings: undefined }; } - if (jsonContent.typings) { - var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + if (typeof jsonContent.typings === "string") { + var path = ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)); + var result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(ts.getDirectoryPath(path), host), host); if (result) { return result; } @@ -31088,7 +31603,7 @@ var ts; else { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -31097,12 +31612,13 @@ var ts; var baseName = ts.getBaseFileName(directory); if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -31127,10 +31643,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; - var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(extensions, function (extension) { + referencedSourceFile = ts.forEach(supportedExtensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { return undefined; } @@ -31225,14 +31741,15 @@ var ts; getCanonicalFileName: getCanonicalFileName, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return ts.sys.fileExists(fileName); }, - readFile: function (fileName) { return ts.sys.readFile(fileName); } + readFile: function (fileName) { return ts.sys.readFile(fileName); }, + directoryExists: function (directoryName) { return ts.sys.directoryExists(directoryName); } }; } ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -31270,8 +31787,10 @@ var ts; var noDiagnosticsTypeChecker; var classifiableNames; var skipDefaultLib = options.noLib; + var supportedExtensions = ts.getSupportedExtensions(options); var start = new Date().getTime(); host = host || createCompilerHost(options); + var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) @@ -31284,7 +31803,8 @@ var ts; (oldOptions.noResolve !== options.noResolve) || (oldOptions.target !== options.target) || (oldOptions.noLib !== options.noLib) || - (oldOptions.jsx !== options.jsx)) { + (oldOptions.jsx !== options.jsx) || + (oldOptions.allowJs !== options.allowJs)) { oldProgram = undefined; } } @@ -31294,9 +31814,7 @@ var ts; processRootFile(host.getDefaultLibFileName(options), true); } } - verifyCompilerOptions(); oldProgram = undefined; - ts.programTime += new Date().getTime() - start; program = { getRootFileNames: function () { return rootNames; }, getSourceFile: getSourceFile, @@ -31310,7 +31828,7 @@ var ts; getTypeChecker: getTypeChecker, getClassifiableNames: getClassifiableNames, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: getCommonSourceDirectory, emit: emit, getCurrentDirectory: function () { return currentDirectory; }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, @@ -31319,7 +31837,23 @@ var ts; getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; } }; + verifyCompilerOptions(); + ts.programTime += new Date().getTime() - start; return program; + function getCommonSourceDirectory() { + if (typeof commonSourceDirectory === "undefined") { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { + commonSourceDirectory += ts.directorySeparator; + } + } + return commonSourceDirectory; + } function getClassifiableNames() { if (!classifiableNames) { getTypeChecker(); @@ -31365,7 +31899,7 @@ var ts; if (resolveModuleNamesWorker) { var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); - for (var i = 0; i < moduleNames.length; ++i) { + for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; var oldResolution = ts.getResolvedModule(oldSourceFile, moduleNames[i]); var resolutionChanged = oldResolution @@ -31386,7 +31920,7 @@ var ts; } newSourceFiles.push(newSourceFile); } - for (var i = 0, len = newSourceFiles.length; i < len; ++i) { + for (var i = 0, len = newSourceFiles.length; i < len; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -31407,7 +31941,8 @@ var ts; getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }), + isEmitBlocked: isEmitBlocked }; } function getDiagnosticsProducingTypeChecker() { @@ -31420,9 +31955,15 @@ var ts; var _this = this; return runWithCancellationToken(function () { return emitWorker(_this, sourceFile, writeFileCallback, cancellationToken); }); } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); + } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken) { - if (options.noEmitOnError && getPreEmitDiagnostics(program, undefined, cancellationToken).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + if (options.noEmitOnError) { + var preEmitDiagnostics = getPreEmitDiagnostics(program, undefined, cancellationToken); + if (preEmitDiagnostics.length > 0) { + return { diagnostics: preEmitDiagnostics, sourceMaps: undefined, emitSkipped: true }; + } } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); var start = new Date().getTime(); @@ -31475,12 +32016,160 @@ var ts; var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile, cancellationToken); + var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? + getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) : + typeChecker.getDiagnostics(sourceFile, cancellationToken); var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile); }); } + function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return runWithCancellationToken(function () { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 223: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 229: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 216: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 245: + var heritageClause = node; + if (heritageClause.token === 106) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 217: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 220: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 218: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 143: + case 142: + case 144: + case 145: + case 146: + case 175: + case 215: + case 176: + case 215: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 195: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 213: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 170: + case 171: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start_2 = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_2, expression.typeArguments.end - start_2, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 138: + var parameter = node; + if (parameter.modifiers) { + var start_3 = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_3, parameter.modifiers.end - start_3, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 141: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 219: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 173: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 139: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start_4 = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_4, typeParameters.end - start_4, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { + var modifier = modifiers_1[_i]; + switch (modifier.kind) { + case 112: + case 110: + case 111: + case 122: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + case 113: + case 82: + case 74: + case 77: + case 115: + } + } + } + return false; + } + }); + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return runWithCancellationToken(function () { if (!ts.isDeclarationFile(sourceFile)) { @@ -31528,9 +32217,9 @@ var ts; function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { if (!collectOnlyRequireCalls) { switch (node.kind) { - case 222: - case 221: - case 228: + case 224: + case 223: + case 230: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; @@ -31542,7 +32231,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 218: + case 220: if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { collect(node, false, collectOnlyRequireCalls); @@ -31565,9 +32254,9 @@ var ts; var diagnosticArgument; var diagnostic; if (hasExtension(fileName)) { - if (!options.allowNonTsExtensions && !ts.forEach(ts.supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { + if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1; - diagnosticArgument = [fileName, "'" + ts.supportedExtensions.join("', '") + "'"]; + diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"]; } else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) { diagnostic = ts.Diagnostics.File_0_not_found; @@ -31585,7 +32274,7 @@ var ts; diagnostic = ts.Diagnostics.File_0_not_found; diagnosticArgument = [fileName]; } - else if (!ts.forEach(ts.supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { + else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { diagnostic = ts.Diagnostics.File_0_not_found; fileName += ".ts"; diagnosticArgument = [fileName]; @@ -31609,10 +32298,10 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } - function findSourceFile(fileName, normalizedAbsolutePath, isDefaultLib, refFile, refPos, refEnd) { - if (filesByName.contains(normalizedAbsolutePath)) { - var file_1 = filesByName.get(normalizedAbsolutePath); - if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== normalizedAbsolutePath) { + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + if (filesByName.contains(path)) { + var file_1 = filesByName.get(path); + if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } return file_1; @@ -31625,16 +32314,16 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); - filesByName.set(normalizedAbsolutePath, file); + filesByName.set(path, file); if (file) { - file.path = normalizedAbsolutePath; + file.path = path; if (host.useCaseSensitiveFileNames()) { - var existingFile = filesByNameIgnoreCase.get(normalizedAbsolutePath); + var existingFile = filesByNameIgnoreCase.get(path); if (existingFile) { reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd); } else { - filesByNameIgnoreCase.set(normalizedAbsolutePath, file); + filesByNameIgnoreCase.set(path, file); } } skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib; @@ -31667,15 +32356,15 @@ var ts; file.resolvedModules = {}; var moduleNames = ts.map(file.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; ++i) { + for (var i = 0; i < file.imports.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); if (resolution && !options.noResolve) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { if (!ts.isExternalModule(importedFile)) { - var start_2 = ts.getTokenPosOfNode(file.imports[i], file); - fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_2, file.imports[i].end - start_2, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); + var start_5 = ts.getTokenPosOfNode(file.imports[i], file); + fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } else if (importedFile.referencedFiles.length) { var firstRef = importedFile.referencedFiles[0]; @@ -31692,7 +32381,7 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var commonPathComponents; - ts.forEach(files, function (sourceFile) { + var failed = ts.forEach(files, function (sourceFile) { if (ts.isDeclarationFile(sourceFile)) { return; } @@ -31703,10 +32392,9 @@ var ts; return; } for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; + return true; } commonPathComponents.length = i; break; @@ -31716,6 +32404,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (failed) { + return ""; + } if (!commonPathComponents) { return currentDirectory; } @@ -31725,8 +32416,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var sourceFile = sourceFiles_2[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -31760,14 +32451,14 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")); } - if (options.sourceRoot) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap")); - } } if (options.inlineSources) { if (!options.sourceMap && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); } + if (options.sourceRoot) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources")); + } } if (options.out && options.outFile) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile")); @@ -31776,10 +32467,9 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap")); } - if (options.sourceRoot) { + if (options.sourceRoot && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap")); } - return; } var languageVersion = options.target || 0; var outFile = options.outFile || options.out; @@ -31796,7 +32486,7 @@ var ts; } else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); + programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file)); } if (options.module === 5 && languageVersion < 2) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); @@ -31807,14 +32497,9 @@ var ts; if (options.outDir || options.sourceRoot || options.mapRoot) { - if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { - commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); - } - else { - commonSourceDirectory = computeCommonSourceDirectory(files); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { - commonSourceDirectory += ts.directorySeparator; + var dir = getCommonSourceDirectory(); + if (options.outDir && dir === "" && ts.forEach(files, function (file) { return ts.getRootLength(file.fileName) > 1; })) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); } } if (options.noEmit) { @@ -31831,10 +32516,42 @@ var ts; programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration")); } } + else if (options.allowJs && options.declaration) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + if (options.reactNamespace && !ts.isIdentifier(options.reactNamespace, languageVersion)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace)); + } + if (!options.noEmit) { + var emitHost = getEmitHost(); + var emitFilesSeen = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); + ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); + if (filesByName.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + } + if (emitFilesSeen.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + } + else { + emitFilesSeen.set(emitFilePath, true); + } + } + } + } + function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) { + hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true); + programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName)); } } ts.createProgram = createProgram; @@ -31889,6 +32606,11 @@ var ts; description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, error: ts.Diagnostics.Argument_for_jsx_must_be_preserve_or_react }, + { + name: "reactNamespace", + type: "string", + description: ts.Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, { name: "listFiles", type: "boolean" @@ -32113,6 +32835,16 @@ var ts; name: "forceConsistentCasingInFileNames", type: "boolean", description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "allowJs", + type: "boolean", + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled } ]; var optionNameMapCache; @@ -32146,7 +32878,8 @@ var ts; function parseStrings(args) { var i = 0; while (i < args.length) { - var s = args[i++]; + var s = args[i]; + i++; if (s.charCodeAt(0) === 64) { parseResponseFile(s.slice(1)); } @@ -32162,19 +32895,22 @@ var ts; } switch (opt.type) { case "number": - options[opt.name] = parseInt(args[i++]); + options[opt.name] = parseInt(args[i]); + i++; break; case "boolean": options[opt.name] = true; break; case "string": - options[opt.name] = args[i++] || ""; + options[opt.name] = args[i] || ""; + i++; break; default: - var map_2 = opt.type; - var key = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(map_2, key)) { - options[opt.name] = map_2[key]; + var map_1 = opt.type; + var key = (args[i] || "").toLowerCase(); + i++; + if (ts.hasProperty(map_1, key)) { + options[opt.name] = map_1[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -32264,8 +33000,10 @@ var ts; } return output; } - function parseJsonConfigFileContent(json, host, basePath) { - var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), options = _a.options, errors = _a.errors; + function parseJsonConfigFileContent(json, host, basePath, existingOptions) { + if (existingOptions === void 0) { existingOptions = {}; } + var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), optionsFromJsonConfigFile = _a.options, errors = _a.errors; + var options = ts.extend(existingOptions, optionsFromJsonConfigFile); return { options: options, fileNames: getFileNames(), @@ -32282,23 +33020,26 @@ var ts; } } else { + var filesSeen = {}; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; - var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); - for (var i = 0; i < sysFiles.length; i++) { - var name_31 = sysFiles[i]; - if (ts.fileExtensionIs(name_31, ".d.ts")) { - var baseName = name_31.substr(0, name_31.length - ".d.ts".length); - if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_31); + var supportedExtensions = ts.getSupportedExtensions(options); + ts.Debug.assert(ts.indexOf(supportedExtensions, ".ts") < ts.indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick"); + for (var _i = 0, supportedExtensions_1 = supportedExtensions; _i < supportedExtensions_1.length; _i++) { + var extension = supportedExtensions_1[_i]; + var filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); + for (var _a = 0, filesInDirWithExtension_1 = filesInDirWithExtension; _a < filesInDirWithExtension_1.length; _a++) { + var fileName = filesInDirWithExtension_1[_a]; + if (extension === ".ts" && ts.fileExtensionIs(fileName, ".d.ts")) { + continue; } - } - else if (ts.fileExtensionIs(name_31, ".ts")) { - if (!ts.contains(sysFiles, name_31 + "x")) { - fileNames.push(name_31); + if (extension === ".d.ts" || (options.allowJs && ts.contains(ts.supportedJavascriptExtensions, extension))) { + var baseName = fileName.substr(0, fileName.length - extension.length); + if (ts.hasProperty(filesSeen, baseName + ".ts") || ts.hasProperty(filesSeen, baseName + ".tsx")) { + continue; + } } - } - else { - fileNames.push(name_31); + filesSeen[fileName] = true; + fileNames.push(fileName); } } } @@ -32562,7 +33303,7 @@ var ts; return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.version) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, ts.version), undefined); + printVersion(); return ts.sys.exit(ts.ExitStatus.Success); } if (commandLine.options.help) { @@ -32575,15 +33316,29 @@ var ts; reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--project"), undefined); return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } - configFileName = ts.normalizePath(ts.combinePaths(commandLine.options.project, "tsconfig.json")); if (commandLine.fileNames.length !== 0) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line), undefined); return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } + var fileOrDirectory = ts.normalizePath(commandLine.options.project); + if (!fileOrDirectory || ts.sys.directoryExists(fileOrDirectory)) { + configFileName = ts.combinePaths(fileOrDirectory, "tsconfig.json"); + if (!ts.sys.fileExists(configFileName)) { + reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0, commandLine.options.project), undefined); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + } + else { + configFileName = fileOrDirectory; + if (!ts.sys.fileExists(configFileName)) { + reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_specified_path_does_not_exist_Colon_0, commandLine.options.project), undefined); + return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + } } else if (commandLine.fileNames.length === 0 && isJSONSupported()) { var searchPath = ts.normalizePath(ts.sys.getCurrentDirectory()); - configFileName = ts.findConfigFile(searchPath); + configFileName = ts.findConfigFile(searchPath, ts.sys.fileExists); } if (commandLine.fileNames.length === 0 && !configFileName) { printVersion(); @@ -32629,7 +33384,7 @@ var ts; ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); return; } - var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, ts.getDirectoryPath(configFileName)); + var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, ts.getDirectoryPath(configFileName), commandLine.options); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors, undefined); ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); @@ -32642,7 +33397,7 @@ var ts; if (configFileName) { var configParseResult = parseConfigFile(); rootFileNames = configParseResult.fileNames; - compilerOptions = ts.extend(commandLine.options, configParseResult.options); + compilerOptions = configParseResult.options; } else { rootFileNames = commandLine.fileNames; @@ -32715,7 +33470,7 @@ var ts; startTimerForRecompilation(); } function watchedDirectoryChanged(fileName) { - if (fileName && !ts.isSupportedSourceFileName(fileName)) { + if (fileName && !ts.isSupportedSourceFileName(fileName, commandLine.options)) { return; } startTimerForHandlingDirectoryChanges(); @@ -32891,10 +33646,10 @@ var ts; function serializeCompilerOptions(options) { var result = {}; var optionsNameMap = ts.getOptionNameMap().optionNameMap; - for (var name_32 in options) { - if (ts.hasProperty(options, name_32)) { - var value = options[name_32]; - switch (name_32) { + for (var name_28 in options) { + if (ts.hasProperty(options, name_28)) { + var value = options[name_28]; + switch (name_28) { case "init": case "watch": case "version": @@ -32902,17 +33657,17 @@ var ts; case "project": break; default: - var optionDefinition = optionsNameMap[name_32.toLowerCase()]; + var optionDefinition = optionsNameMap[name_28.toLowerCase()]; if (optionDefinition) { if (typeof optionDefinition.type === "string") { - result[name_32] = value; + result[name_28] = value; } else { var typeMap = optionDefinition.type; for (var key in typeMap) { if (ts.hasProperty(typeMap, key)) { if (typeMap[key] === value) - result[name_32] = key; + result[name_28] = key; } } } diff --git a/lib/tsserver.js b/lib/tsserver.js index 9f0c1674080..b04981dc6db 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -19,7 +19,7 @@ var ts; function OperationCanceledException() { } return OperationCanceledException; - })(); + }()); ts.OperationCanceledException = OperationCanceledException; (function (ExitStatus) { ExitStatus[ExitStatus["Success"] = 0] = "Success"; @@ -247,9 +247,11 @@ var ts; var count = array.length; if (count > 0) { var pos = 0; - var result = arguments.length <= 2 ? array[pos++] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos++; while (pos < count) { - result = f(result, array[pos++]); + result = f(result, array[pos]); + pos++; } return result; } @@ -261,9 +263,11 @@ var ts; if (array) { var pos = array.length - 1; if (pos >= 0) { - var result = arguments.length <= 2 ? array[pos--] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos--; while (pos >= 0) { - result = f(result, array[pos--]); + result = f(result, array[pos]); + pos--; } return result; } @@ -346,6 +350,22 @@ var ts; return result; } ts.arrayToMap = arrayToMap; + function reduceProperties(map, callback, initial) { + var result = initial; + if (map) { + for (var key in map) { + if (hasProperty(map, key)) { + result = callback(result, map[key], String(key)); + } + } + } + return result; + } + ts.reduceProperties = reduceProperties; + function isArray(value) { + return Array.isArray ? Array.isArray(value) : value instanceof Array; + } + ts.isArray = isArray; function memoize(callback) { var value; return function () { @@ -639,7 +659,7 @@ var ts; } ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; function getBaseFileName(path) { - if (!path) { + if (path === undefined) { return undefined; } var i = path.lastIndexOf(ts.directorySeparator); @@ -664,14 +684,19 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); - function isSupportedSourceFileName(fileName) { + ts.supportedTypeScriptExtensions = [".ts", ".tsx", ".d.ts"]; + ts.supportedJavascriptExtensions = [".js", ".jsx"]; + var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); + function getSupportedExtensions(options) { + return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + ts.getSupportedExtensions = getSupportedExtensions; + function isSupportedSourceFileName(fileName, compilerOptions) { if (!fileName) { return false; } - for (var _i = 0, supportedExtensions_1 = ts.supportedExtensions; _i < supportedExtensions_1.length; _i++) { - var extension = supportedExtensions_1[_i]; + for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; } @@ -690,22 +715,6 @@ var ts; return path; } ts.removeFileExtension = removeFileExtension; - var backslashOrDoubleQuote = /[\"\\]/g; - var escapedCharsRegExp = /[\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" - }; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -902,7 +911,6 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _tty = require("tty"); function createWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } @@ -970,9 +978,6 @@ var ts; }; } var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } var platform = _os.platform(); var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { @@ -1055,9 +1060,6 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - if (isNode4OrLater()) { - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } @@ -1103,12 +1105,40 @@ var ts; } }; } + function getChakraSystem() { + return { + newLine: ChakraHost.newLine || "\r\n", + args: ChakraHost.args, + useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames, + write: ChakraHost.echo, + readFile: function (path, encoding) { + return ChakraHost.readFile(path); + }, + writeFile: function (path, data, writeByteOrderMark) { + if (writeByteOrderMark) { + data = "\uFEFF" + data; + } + ChakraHost.writeFile(path, data); + }, + resolvePath: ChakraHost.resolvePath, + fileExists: ChakraHost.fileExists, + directoryExists: ChakraHost.directoryExists, + createDirectory: ChakraHost.createDirectory, + getExecutingFilePath: function () { return ChakraHost.executingFile; }, + getCurrentDirectory: function () { return ChakraHost.currentDirectory; }, + readDirectory: ChakraHost.readDirectory, + exit: ChakraHost.quit + }; + } if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { return getNodeSystem(); } + else if (typeof ChakraHost !== "undefined") { + return getChakraSystem(); + } else { return undefined; } @@ -1226,7 +1256,7 @@ var ts; Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers_not_permitted_on_index_signature_members_1145", message: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, - Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_1148", message: "Cannot compile modules unless the '--module' flag is provided." }, + Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_optio_1148", message: "Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, @@ -1313,6 +1343,10 @@ var ts; _0_modifier_cannot_be_used_with_1_modifier: { code: 1243, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_be_used_with_1_modifier_1243", message: "'{0}' modifier cannot be used with '{1}' modifier." }, Abstract_methods_can_only_appear_within_an_abstract_class: { code: 1244, category: ts.DiagnosticCategory.Error, key: "Abstract_methods_can_only_appear_within_an_abstract_class_1244", message: "Abstract methods can only appear within an abstract class." }, Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { code: 1245, category: ts.DiagnosticCategory.Error, key: "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", message: "Method '{0}' cannot have an implementation because it is marked abstract." }, + An_interface_property_cannot_have_an_initializer: { code: 1246, category: ts.DiagnosticCategory.Error, key: "An_interface_property_cannot_have_an_initializer_1246", message: "An interface property cannot have an initializer." }, + A_type_literal_property_cannot_have_an_initializer: { code: 1247, category: ts.DiagnosticCategory.Error, key: "A_type_literal_property_cannot_have_an_initializer_1247", message: "A type literal property cannot have an initializer." }, + A_class_member_cannot_have_the_0_keyword: { code: 1248, category: ts.DiagnosticCategory.Error, key: "A_class_member_cannot_have_the_0_keyword_1248", message: "A class member cannot have the '{0}' keyword." }, + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: { code: 1249, category: ts.DiagnosticCategory.Error, key: "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", message: "A decorator can only decorate a method implementation, not an overload." }, with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_an_async_function_block_1300", message: "'with' statements are not allowed in an async function block." }, await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: ts.DiagnosticCategory.Error, key: "await_expression_is_only_allowed_within_an_async_function_1308", message: "'await' expression is only allowed within an async function." }, Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: ts.DiagnosticCategory.Error, key: "Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher_1311", message: "Async functions are only available when targeting ECMAScript 6 and higher." }, @@ -1326,11 +1360,12 @@ var ts; Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module_0_has_no_exported_member_1_2305", message: "Module '{0}' has no exported member '{1}'." }, File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File_0_is_not_a_module_2306", message: "File '{0}' is not a module." }, Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot_find_module_0_2307", message: "Cannot find module '{0}'." }, + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: { code: 2308, category: ts.DiagnosticCategory.Error, key: "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", message: "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", message: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type_0_recursively_references_itself_as_a_base_type_2310", message: "Type '{0}' recursively references itself as a base type." }, A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A_class_may_only_extend_another_class_2311", message: "A class may only extend another class." }, An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An_interface_may_only_extend_a_class_or_another_interface_2312", message: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list_2313", message: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Type_parameter_0_has_a_circular_constraint: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_has_a_circular_constraint_2313", message: "Type parameter '{0}' has a circular constraint." }, Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_1_type_argument_s_2314", message: "Generic type '{0}' requires {1} type argument(s)." }, Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_generic_2315", message: "Type '{0}' is not generic." }, Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global_type_0_must_be_a_class_or_interface_type_2316", message: "Global type '{0}' must be a class or interface type." }, @@ -1340,6 +1375,7 @@ var ts; Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", message: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive_stack_depth_comparing_types_0_and_1_2321", message: "Excessive stack depth comparing types '{0}' and '{1}'." }, Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_2322", message: "Type '{0}' is not assignable to type '{1}'." }, + Cannot_redeclare_exported_variable_0: { code: 2323, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_exported_variable_0_2323", message: "Cannot redeclare exported variable '{0}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property_0_is_missing_in_type_1_2324", message: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_in_type_1_but_not_in_type_2_2325", message: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types_of_property_0_are_incompatible_2326", message: "Types of property '{0}' are incompatible." }, @@ -1410,6 +1446,7 @@ var ts; Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload_signature_is_not_compatible_with_function_implementation_2394", message: "Overload signature is not compatible with function implementation." }, Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", message: "Individual declarations in merged declaration '{0}' must be all exported or all local." }, Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", message: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Declaration_name_conflicts_with_built_in_global_identifier_0: { code: 2397, category: ts.DiagnosticCategory.Error, key: "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", message: "Declaration name conflicts with built-in global identifier '{0}'." }, Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", message: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", message: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401", message: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, @@ -1523,6 +1560,8 @@ var ts; Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", message: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." }, All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -1532,7 +1571,7 @@ var ts; A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: { code: 2526, category: ts.DiagnosticCategory.Error, key: "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", message: "A 'this' type is available only in a non-static member of a class or interface." }, The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: { code: 2527, category: ts.DiagnosticCategory.Error, key: "The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary_2527", message: "The inferred type of '{0}' references an inaccessible 'this' type. A type annotation is necessary." }, A_module_cannot_have_multiple_default_exports: { code: 2528, category: ts.DiagnosticCategory.Error, key: "A_module_cannot_have_multiple_default_exports_2528", message: "A module cannot have multiple default exports." }, - JSX_element_attributes_type_0_must_be_an_object_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_must_be_an_object_type_2600", message: "JSX element attributes type '{0}' must be an object type." }, + JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, @@ -1548,6 +1587,9 @@ var ts; Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "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: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -1632,6 +1674,11 @@ var ts; Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_without_specifying_option_1_5052", message: "Option '{0}' cannot be specified without specifying option '{1}'." }, Option_0_cannot_be_specified_with_option_1: { code: 5053, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_with_option_1_5053", message: "Option '{0}' cannot be specified with option '{1}'." }, A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, + Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalide value for '--reactNamespace'. '{0}' is not a valid identifier." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003", message: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -1642,6 +1689,7 @@ var ts; Do_not_emit_outputs_if_any_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_if_any_errors_were_reported_6008", message: "Do not emit outputs if any errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)" }, Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, @@ -1697,6 +1745,8 @@ var ts; Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, + Allow_javascript_files_to_be_compiled: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6083", message: "Allow javascript files to be compiled." }, + Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -1744,7 +1794,8 @@ var ts; Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." } + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." } }; })(ts || (ts = {})); var ts; @@ -1934,7 +1985,8 @@ var ts; var pos = 0; var lineStart = 0; while (pos < text.length) { - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 13: if (text.charCodeAt(pos) === 10) { @@ -2037,6 +2089,9 @@ var ts; } ts.couldStartTrivia = couldStartTrivia; function skipTrivia(text, pos, stopAfterLineBreak) { + if (!(pos >= 0)) { + return pos; + } while (true) { var ch = text.charCodeAt(pos); switch (ch) { @@ -2254,6 +2309,18 @@ var ts; ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; + function isIdentifier(name, languageVersion) { + if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { + return false; + } + for (var i = 1, n = name.length; i < n; i++) { + if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { + return false; + } + } + return true; + } + ts.isIdentifier = isIdentifier; function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) { if (languageVariant === void 0) { languageVariant = 0; } var pos; @@ -2363,7 +2430,8 @@ var ts; return value; } function scanString() { - var quote = text.charCodeAt(pos++); + var quote = text.charCodeAt(pos); + pos++; var result = ""; var start = pos; while (true) { @@ -2450,7 +2518,8 @@ var ts; error(ts.Diagnostics.Unexpected_end_of_text); return ""; } - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 48: return "\0"; @@ -2659,7 +2728,8 @@ var ts; } return pos += 2, token = 31; } - return pos++, token = 49; + pos++; + return token = 49; case 34: case 39: tokenValue = scanString(); @@ -2670,7 +2740,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 62; } - return pos++, token = 40; + pos++; + return token = 40; case 38: if (text.charCodeAt(pos + 1) === 38) { return pos += 2, token = 51; @@ -2678,11 +2749,14 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 66; } - return pos++, token = 46; + pos++; + return token = 46; case 40: - return pos++, token = 17; + pos++; + return token = 17; case 41: - return pos++, token = 18; + pos++; + return token = 18; case 42: if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 59; @@ -2693,7 +2767,8 @@ var ts; } return pos += 2, token = 38; } - return pos++, token = 37; + pos++; + return token = 37; case 43: if (text.charCodeAt(pos + 1) === 43) { return pos += 2, token = 41; @@ -2701,9 +2776,11 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 57; } - return pos++, token = 35; + pos++; + return token = 35; case 44: - return pos++, token = 24; + pos++; + return token = 24; case 45: if (text.charCodeAt(pos + 1) === 45) { return pos += 2, token = 42; @@ -2711,7 +2788,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 58; } - return pos++, token = 36; + pos++; + return token = 36; case 46: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); @@ -2720,7 +2798,8 @@ var ts; if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { return pos += 3, token = 22; } - return pos++, token = 21; + pos++; + return token = 21; case 47: if (text.charCodeAt(pos + 1) === 47) { pos += 2; @@ -2766,7 +2845,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 61; } - return pos++, token = 39; + pos++; + return token = 39; case 48: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; @@ -2814,9 +2894,11 @@ var ts; tokenValue = scanNumber(); return token = 8; case 58: - return pos++, token = 54; + pos++; + return token = 54; case 59: - return pos++, token = 23; + pos++; + return token = 23; case 60: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2841,7 +2923,8 @@ var ts; text.charCodeAt(pos + 2) !== 42) { return pos += 2, token = 26; } - return pos++, token = 25; + pos++; + return token = 25; case 61: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2861,7 +2944,8 @@ var ts; if (text.charCodeAt(pos + 1) === 62) { return pos += 2, token = 34; } - return pos++, token = 56; + pos++; + return token = 56; case 62: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -2872,20 +2956,26 @@ var ts; return token = 7; } } - return pos++, token = 27; + pos++; + return token = 27; case 63: - return pos++, token = 53; + pos++; + return token = 53; case 91: - return pos++, token = 19; + pos++; + return token = 19; case 93: - return pos++, token = 20; + pos++; + return token = 20; case 94: if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 68; } - return pos++, token = 48; + pos++; + return token = 48; case 123: - return pos++, token = 15; + pos++; + return token = 15; case 124: if (text.charCodeAt(pos + 1) === 124) { return pos += 2, token = 52; @@ -2893,13 +2983,17 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 67; } - return pos++, token = 47; + pos++; + return token = 47; case 125: - return pos++, token = 16; + pos++; + return token = 16; case 126: - return pos++, token = 50; + pos++; + return token = 50; case 64: - return pos++, token = 55; + pos++; + return token = 55; case 92: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -2908,7 +3002,8 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + pos++; + return token = 0; default: if (isIdentifierStart(ch, languageVersion)) { pos++; @@ -2930,7 +3025,8 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + pos++; + return token = 0; } } } @@ -2946,10 +3042,12 @@ var ts; if (text.charCodeAt(pos + 1) === 61) { return pos += 2, token = 64; } - return pos++, token = 44; + pos++; + return token = 44; } if (text.charCodeAt(pos) === 61) { - return pos++, token = 29; + pos++; + return token = 29; } } return token; @@ -3032,7 +3130,7 @@ var ts; break; } } - return token = 236; + return token = 238; } function scanJsxIdentifier() { if (tokenIsIdentifierOrKeyword(token)) { @@ -3152,6 +3250,11 @@ var ts; description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, error: ts.Diagnostics.Argument_for_jsx_must_be_preserve_or_react }, + { + name: "reactNamespace", + type: "string", + description: ts.Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, { name: "listFiles", type: "boolean" @@ -3376,6 +3479,16 @@ var ts; name: "forceConsistentCasingInFileNames", type: "boolean", description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "allowJs", + type: "boolean", + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled } ]; var optionNameMapCache; @@ -3409,7 +3522,8 @@ var ts; function parseStrings(args) { var i = 0; while (i < args.length) { - var s = args[i++]; + var s = args[i]; + i++; if (s.charCodeAt(0) === 64) { parseResponseFile(s.slice(1)); } @@ -3425,17 +3539,20 @@ var ts; } switch (opt.type) { case "number": - options[opt.name] = parseInt(args[i++]); + options[opt.name] = parseInt(args[i]); + i++; break; case "boolean": options[opt.name] = true; break; case "string": - options[opt.name] = args[i++] || ""; + options[opt.name] = args[i] || ""; + i++; break; default: var map_1 = opt.type; - var key = (args[i++] || "").toLowerCase(); + var key = (args[i] || "").toLowerCase(); + i++; if (ts.hasProperty(map_1, key)) { options[opt.name] = map_1[key]; } @@ -3527,8 +3644,10 @@ var ts; } return output; } - function parseJsonConfigFileContent(json, host, basePath) { - var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), options = _a.options, errors = _a.errors; + function parseJsonConfigFileContent(json, host, basePath, existingOptions) { + if (existingOptions === void 0) { existingOptions = {}; } + var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), optionsFromJsonConfigFile = _a.options, errors = _a.errors; + var options = ts.extend(existingOptions, optionsFromJsonConfigFile); return { options: options, fileNames: getFileNames(), @@ -3545,23 +3664,26 @@ var ts; } } else { + var filesSeen = {}; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; - var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); - for (var i = 0; i < sysFiles.length; i++) { - var name_5 = sysFiles[i]; - if (ts.fileExtensionIs(name_5, ".d.ts")) { - var baseName = name_5.substr(0, name_5.length - ".d.ts".length); - if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_5); + var supportedExtensions = ts.getSupportedExtensions(options); + ts.Debug.assert(ts.indexOf(supportedExtensions, ".ts") < ts.indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick"); + for (var _i = 0, supportedExtensions_1 = supportedExtensions; _i < supportedExtensions_1.length; _i++) { + var extension = supportedExtensions_1[_i]; + var filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); + for (var _a = 0, filesInDirWithExtension_1 = filesInDirWithExtension; _a < filesInDirWithExtension_1.length; _a++) { + var fileName = filesInDirWithExtension_1[_a]; + if (extension === ".ts" && ts.fileExtensionIs(fileName, ".d.ts")) { + continue; } - } - else if (ts.fileExtensionIs(name_5, ".ts")) { - if (!ts.contains(sysFiles, name_5 + "x")) { - fileNames.push(name_5); + if (extension === ".d.ts" || (options.allowJs && ts.contains(ts.supportedJavascriptExtensions, extension))) { + var baseName = fileName.substr(0, fileName.length - extension.length); + if (ts.hasProperty(filesSeen, baseName + ".ts") || ts.hasProperty(filesSeen, baseName + ".tsx")) { + continue; + } } - } - else { - fileNames.push(name_5); + filesSeen[fileName] = true; + fileNames.push(fileName); } } } @@ -3669,7 +3791,7 @@ var ts; if (array1.length !== array2.length) { return false; } - for (var i = 0; i < array1.length; ++i) { + for (var i = 0; i < array1.length; i++) { var equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i]; if (!equals) { return false; @@ -3709,7 +3831,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 248) { + while (node && node.kind !== 250) { node = node.parent; } return node; @@ -3800,15 +3922,15 @@ var ts; return current; } switch (current.kind) { - case 248: + case 250: + case 222: + case 246: case 220: - case 244: - case 218: - case 199: - case 200: case 201: + case 202: + case 203: return current; - case 192: + case 194: if (!isFunctionLike(current.parent)) { return current; } @@ -3819,9 +3941,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 211 && + declaration.kind === 213 && declaration.parent && - declaration.parent.kind === 244; + declaration.parent.kind === 246; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3857,22 +3979,23 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 248: + case 250: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 211: - case 163: - case 214: - case 186: - case 215: - case 218: - case 217: - case 247: case 213: - case 173: + case 165: + case 216: + case 188: + case 217: + case 220: + case 219: + case 249: + case 215: + case 175: + case 143: errorNode = node.name; break; } @@ -3898,11 +4021,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 217 && isConst(node); + return node.kind === 219 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 163 || isBindingPattern(node))) { + while (node && (node.kind === 165 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3910,14 +4033,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 211) { + if (node.kind === 213) { node = node.parent; } - if (node && node.kind === 212) { + if (node && node.kind === 214) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 193) { + if (node && node.kind === 195) { flags |= node.flags; } return flags; @@ -3932,7 +4055,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 195 && node.expression.kind === 9; + return node.kind === 197 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -3962,7 +4085,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (151 <= node.kind && node.kind <= 160) { + if (150 <= node.kind && node.kind <= 162) { return true; } switch (node.kind) { @@ -3973,42 +4096,40 @@ var ts; case 131: return true; case 103: - return node.parent.kind !== 177; - case 9: - return node.parent.kind === 138; - case 188: + return node.parent.kind !== 179; + case 190: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 69: if (node.parent.kind === 135 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 166 && node.parent.name === node) { + else if (node.parent.kind === 168 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 166, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 168, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); case 135: - case 166: + case 168: case 97: var parent_1 = node.parent; if (parent_1.kind === 154) { return false; } - if (151 <= parent_1.kind && parent_1.kind <= 160) { + if (150 <= parent_1.kind && parent_1.kind <= 162) { return true; } switch (parent_1.kind) { - case 188: + case 190: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); case 137: return node === parent_1.constraint; case 141: case 140: case 138: - case 211: - return node === parent_1.type; case 213: - case 173: - case 174: + return node === parent_1.type; + case 215: + case 175: + case 176: case 144: case 143: case 142: @@ -4019,12 +4140,12 @@ var ts; case 148: case 149: return node === parent_1.type; - case 171: + case 173: return node === parent_1.type; - case 168: - case 169: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 170: + case 171: + return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; + case 172: return false; } } @@ -4035,23 +4156,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 204: + case 206: return visitor(node); - case 220: - case 192: - case 196: - case 197: + case 222: + case 194: case 198: case 199: case 200: case 201: - case 205: - case 206: - case 241: - case 242: + case 202: + case 203: case 207: - case 209: + case 208: + case 243: case 244: + case 209: + case 211: + case 246: return ts.forEachChild(node, traverse); } } @@ -4061,24 +4182,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 184: + case 186: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } + case 219: case 217: - case 215: + case 220: case 218: case 216: - case 214: - case 186: + case 188: return; default: if (isFunctionLike(node)) { - var name_6 = node.name; - if (name_6 && name_6.kind === 136) { - traverse(name_6.expression); + var name_5 = node.name; + if (name_5 && name_5.kind === 136) { + traverse(name_5.expression); return; } } @@ -4092,14 +4213,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 163: - case 247: + case 165: + case 249: case 138: - case 245: + case 247: case 141: case 140: - case 246: - case 211: + case 248: + case 213: return true; } } @@ -4111,7 +4232,7 @@ var ts; } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 214 || node.kind === 186); + return node && (node.kind === 216 || node.kind === 188); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4121,9 +4242,9 @@ var ts; function isFunctionLikeKind(kind) { switch (kind) { case 144: - case 173: - case 213: - case 174: + case 175: + case 215: + case 176: case 143: case 142: case 145: @@ -4144,8 +4265,8 @@ var ts; case 144: case 145: case 146: - case 213: - case 173: + case 215: + case 175: return true; } return false; @@ -4153,26 +4274,30 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { + case 201: + case 202: + case 203: case 199: case 200: - case 201: - case 197: - case 198: return true; - case 207: + case 209: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 192 && isFunctionLike(node.parent); + return node && node.kind === 194 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 && node.parent.kind === 165; + return node && node.kind === 143 && node.parent.kind === 167; } ts.isObjectLiteralMethod = isObjectLiteralMethod; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1; + } + ts.isIdentifierTypePredicate = isIdentifierTypePredicate; function getContainingFunction(node) { while (true) { node = node.parent; @@ -4212,13 +4337,13 @@ var ts; node = node.parent; } break; - case 174: + case 176: if (!includeArrowFunctions) { continue; } - case 213: - case 173: - case 218: + case 215: + case 175: + case 220: case 141: case 140: case 143: @@ -4229,37 +4354,27 @@ var ts; case 147: case 148: case 149: - case 217: - case 248: + case 219: + case 250: return node; } } } ts.getThisContainer = getThisContainer; - function getSuperContainer(node, includeFunctions) { + function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; - if (!node) + if (!node) { return node; + } switch (node.kind) { case 136: - if (isClassLike(node.parent.parent)) { - return node; - } node = node.parent; break; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - node = node.parent; - } - break; - case 213: - case 173: - case 174: - if (!includeFunctions) { + case 215: + case 175: + case 176: + if (!stopOnFunctions) { continue; } case 141: @@ -4270,6 +4385,14 @@ var ts; case 145: case 146: return node; + case 139: + if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; } } } @@ -4279,7 +4402,7 @@ var ts; switch (node.kind) { case 151: return node.typeName; - case 188: + case 190: return node.expression; case 69: case 135: @@ -4290,7 +4413,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 170) { + if (node.kind === 172) { return node.tag; } return node.expression; @@ -4298,23 +4421,23 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 214: + case 216: return true; case 141: - return node.parent.kind === 214; + return node.parent.kind === 216; case 138: - return node.parent.body && node.parent.parent.kind === 214; + return node.parent.body && node.parent.parent.kind === 216; case 145: case 146: case 143: - return node.body && node.parent.kind === 214; + return node.body && node.parent.kind === 216; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 214: + case 216: if (node.decorators) { return true; } @@ -4340,27 +4463,12 @@ var ts; return false; } ts.nodeIsDecorated = nodeIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 214: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 143: - case 146: - return ts.forEach(node.parameters, nodeIsDecorated); - } - return false; - } - ts.childIsDecorated = childIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 166; + return node.kind === 168; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 167; + return node.kind === 169; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -4370,34 +4478,34 @@ var ts; case 99: case 84: case 10: - case 164: - case 165: case 166: case 167: case 168: case 169: case 170: - case 189: case 171: case 172: + case 191: case 173: - case 186: case 174: - case 177: case 175: + case 188: case 176: case 179: - case 180: + case 177: + case 178: case 181: case 182: - case 185: case 183: - case 11: - case 187: - case 233: - case 234: case 184: - case 178: + case 187: + case 185: + case 11: + case 189: + case 235: + case 236: + case 186: + case 180: return true; case 135: while (node.parent.kind === 135) { @@ -4413,47 +4521,47 @@ var ts; case 97: var parent_2 = node.parent; switch (parent_2.kind) { - case 211: + case 213: case 138: case 141: case 140: + case 249: case 247: - case 245: - case 163: + case 165: return parent_2.initializer === node; - case 195: - case 196: case 197: case 198: - case 204: - case 205: - case 206: - case 241: - case 208: - case 206: - return parent_2.expression === node; case 199: + case 200: + case 206: + case 207: + case 208: + case 243: + case 210: + case 208: + return parent_2.expression === node; + case 201: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 212) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 214) || forStatement.condition === node || forStatement.incrementor === node; - case 200: - case 201: + case 202: + case 203: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 212) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214) || forInStatement.expression === node; - case 171: - case 189: + case 173: + case 191: return node === parent_2.expression; - case 190: + case 192: return node === parent_2.expression; case 136: return node === parent_2.expression; case 139: - case 240: - case 239: + case 242: + case 241: return true; - case 188: + case 190: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -4475,7 +4583,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 && node.moduleReference.kind === 232; + return node.kind === 223 && node.moduleReference.kind === 234; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4484,7 +4592,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 && node.moduleReference.kind !== 232; + return node.kind === 223 && node.moduleReference.kind !== 234; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -4496,43 +4604,54 @@ var ts; } ts.isInJavaScriptFile = isInJavaScriptFile; function isRequireCall(expression) { - return expression.kind === 168 && + return expression.kind === 170 && expression.expression.kind === 69 && expression.expression.text === "require" && expression.arguments.length === 1 && expression.arguments[0].kind === 9; } ts.isRequireCall = isRequireCall; - function isExportsPropertyAssignment(expression) { - return isInJavaScriptFile(expression) && - (expression.kind === 181) && - (expression.operatorToken.kind === 56) && - (expression.left.kind === 166) && - (expression.left.expression.kind === 69) && - ((expression.left.expression).text === "exports"); + function getSpecialPropertyAssignmentKind(expression) { + if (expression.kind !== 183) { + return 0; + } + var expr = expression; + if (expr.operatorToken.kind !== 56 || expr.left.kind !== 168) { + return 0; + } + var lhs = expr.left; + if (lhs.expression.kind === 69) { + var lhsId = lhs.expression; + if (lhsId.text === "exports") { + return 1; + } + else if (lhsId.text === "module" && lhs.name.text === "exports") { + return 2; + } + } + else if (lhs.expression.kind === 97) { + return 4; + } + else if (lhs.expression.kind === 168) { + var innerPropertyAccess = lhs.expression; + if (innerPropertyAccess.expression.kind === 69 && innerPropertyAccess.name.text === "prototype") { + return 3; + } + } + return 0; } - ts.isExportsPropertyAssignment = isExportsPropertyAssignment; - function isModuleExportsAssignment(expression) { - return isInJavaScriptFile(expression) && - (expression.kind === 181) && - (expression.operatorToken.kind === 56) && - (expression.left.kind === 166) && - (expression.left.expression.kind === 69) && - ((expression.left.expression).text === "module") && - (expression.left.name.text === "exports"); - } - ts.isModuleExportsAssignment = isModuleExportsAssignment; + ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 222) { + if (node.kind === 224) { return node.moduleSpecifier; } - if (node.kind === 221) { + if (node.kind === 223) { var reference = node.moduleReference; - if (reference.kind === 232) { + if (reference.kind === 234) { return reference.expression; } } - if (node.kind === 228) { + if (node.kind === 230) { return node.moduleSpecifier; } } @@ -4543,8 +4662,8 @@ var ts; case 138: case 143: case 142: - case 246: - case 245: + case 248: + case 247: case 141: case 140: return node.questionToken !== undefined; @@ -4554,9 +4673,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 261 && + return node.kind === 263 && node.parameters.length > 0 && - node.parameters[0].type.kind === 263; + node.parameters[0].type.kind === 265; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -4570,15 +4689,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 269); + return getJSDocTag(node, 271); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 268); + return getJSDocTag(node, 270); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 270); + return getJSDocTag(node, 272); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -4587,10 +4706,10 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 267) { + if (t.kind === 269) { var parameterTag = t; - var name_7 = parameterTag.preParameterName || parameterTag.postParameterName; - if (name_7.text === parameterName) { + var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; + if (name_6.text === parameterName) { return t; } } @@ -4606,12 +4725,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32) { - if (node.type && node.type.kind === 262) { + if (node.type && node.type.kind === 264) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 262; + return paramTag.typeExpression.type.kind === 264; } } return node.dotDotDotToken !== undefined; @@ -4632,7 +4751,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 162 || node.kind === 161); + return !!node && (node.kind === 164 || node.kind === 163); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -4656,34 +4775,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 174: - case 163: - case 214: - case 186: + case 176: + case 165: + case 216: + case 188: case 144: - case 217: - case 247: - case 230: - case 213: - case 173: - case 145: - case 223: - case 221: - case 226: + case 219: + case 249: + case 232: case 215: + case 175: + case 145: + case 225: + case 223: + case 228: + case 217: case 143: case 142: - case 218: - case 224: + case 220: + case 226: case 138: - case 245: + case 247: case 141: case 140: case 146: - case 246: - case 216: + case 248: + case 218: case 137: - case 211: + case 213: return true; } return false; @@ -4691,25 +4810,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 203: - case 202: - case 210: - case 197: - case 195: - case 194: - case 200: - case 201: - case 199: - case 196: - case 207: + case 205: case 204: + case 212: + case 199: + case 197: + case 196: + case 202: + case 203: + case 201: + case 198: + case 209: case 206: case 208: - case 209: - case 193: - case 198: - case 205: - case 227: + case 210: + case 211: + case 195: + case 200: + case 207: + case 229: return true; default: return false; @@ -4736,7 +4855,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 226 || parent.kind === 230) { + if (parent.kind === 228 || parent.kind === 232) { if (parent.propertyName) { return true; } @@ -4756,9 +4875,9 @@ var ts; case 142: case 145: case 146: + case 249: case 247: - case 245: - case 166: + case 168: return parent.name === node; case 135: if (parent.right === node) { @@ -4768,22 +4887,22 @@ var ts; return parent.kind === 154; } return false; - case 163: - case 226: + case 165: + case 228: return parent.propertyName === node; - case 230: + case 232: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 221 || - node.kind === 223 && !!node.name || - node.kind === 224 || + return node.kind === 223 || + node.kind === 225 && !!node.name || node.kind === 226 || - node.kind === 230 || - node.kind === 227 && node.expression.kind === 69; + node.kind === 228 || + node.kind === 232 || + node.kind === 229 && node.expression.kind === 69; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -4916,7 +5035,7 @@ var ts; return node.kind === 69 && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isModifier(token) { + function isModifierKind(token) { switch (token) { case 115: case 118: @@ -4932,39 +5051,56 @@ var ts; } return false; } - ts.isModifier = isModifier; + ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); return root.kind === 138; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 163) { + while (node.kind === 165) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 218 || n.kind === 248; + return isFunctionLike(n) || n.kind === 220 || n.kind === 250; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function cloneEntityName(node) { - if (node.kind === 69) { - var clone_1 = createSynthesizedNode(69); - clone_1.text = node.text; - return clone_1; + function cloneNode(node, location, flags, parent) { + var clone = location !== undefined + ? ts.createNode(node.kind, location.pos, location.end) + : createSynthesizedNode(node.kind); + for (var key in node) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { + continue; + } + clone[key] = node[key]; } - else { - var clone_2 = createSynthesizedNode(135); - clone_2.left = cloneEntityName(node.left); - clone_2.left.parent = clone_2; - clone_2.right = cloneEntityName(node.right); - clone_2.right.parent = clone_2; - return clone_2; + if (flags !== undefined) { + clone.flags = flags; } + if (parent !== undefined) { + clone.parent = parent; + } + return clone; + } + ts.cloneNode = cloneNode; + function cloneEntityName(node, parent) { + var clone = cloneNode(node, node, node.flags, parent); + if (isQualifiedName(clone)) { + var left = clone.left, right = clone.right; + clone.left = cloneEntityName(left, clone); + clone.right = cloneNode(right, right, right.flags, parent); + } + return clone; } ts.cloneEntityName = cloneEntityName; + function isQualifiedName(node) { + return node.kind === 135; + } + ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { return node.pos === -1; } @@ -5167,8 +5303,8 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, + increaseIndent: function () { indent++; }, + decreaseIndent: function () { indent--; }, getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, @@ -5179,8 +5315,10 @@ var ts; } ts.createTextWriter = createTextWriter; function getExternalModuleNameFromPath(host, fileName) { - var dir = host.getCurrentDirectory(); - var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, false); + var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; + var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, false); return ts.removeFileExtension(relativePath); } ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; @@ -5196,6 +5334,61 @@ var ts; return emitOutputFilePathWithoutExtension + extension; } ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getEmitScriptTarget(compilerOptions) { + return compilerOptions.target || 0; + } + ts.getEmitScriptTarget = getEmitScriptTarget; + function getEmitModuleKind(compilerOptions) { + return compilerOptions.module ? + compilerOptions.module : + getEmitScriptTarget(compilerOptions) === 2 ? 5 : 0; + } + ts.getEmitModuleKind = getEmitModuleKind; + function forEachExpectedEmitFile(host, action, targetSourceFile) { + var options = host.getCompilerOptions(); + if (options.outFile || options.out) { + onBundledEmit(host); + } + else { + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + if (!isDeclarationFile(sourceFile)) { + onSingleFileEmit(host, sourceFile); + } + } + } + function onSingleFileEmit(host, sourceFile) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, sourceFile.languageVariant === 1 && options.jsx === 1 ? ".jsx" : ".js"); + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: !isSourceFileJavaScript(sourceFile) ? getDeclarationEmitFilePath(jsFilePath, options) : undefined + }; + action(emitFileNames, [sourceFile], false); + } + function onBundledEmit(host) { + var bundledSources = ts.filter(host.getSourceFiles(), function (sourceFile) { return !isDeclarationFile(sourceFile) && + (!isExternalModule(sourceFile) || + (getEmitModuleKind(options) && isExternalModule(sourceFile))); }); + if (bundledSources.length) { + var jsFilePath = options.outFile || options.out; + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: getDeclarationEmitFilePath(jsFilePath, options) + }; + action(emitFileNames, bundledSources, true); + } + } + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + function getDeclarationEmitFilePath(jsFilePath, options) { + return options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; + } + } + ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); @@ -5204,7 +5397,7 @@ var ts; ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }); } ts.writeFile = writeFile; @@ -5228,16 +5421,6 @@ var ts; return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) { - return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; function getAllAccessorDeclarations(declarations, accessor) { var firstAccessor; var secondAccessor; @@ -5437,24 +5620,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 166: - case 167: - case 169: case 168: - case 233: - case 234: + case 169: + case 171: case 170: - case 164: + case 235: + case 236: case 172: - case 165: - case 186: - case 173: + case 166: + case 174: + case 167: + case 188: + case 175: case 69: case 10: case 8: case 9: case 11: - case 183: + case 185: case 84: case 93: case 97: @@ -5471,7 +5654,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 188 && + return node.kind === 190 && node.parent.token === 83 && isClassLike(node.parent.parent); } @@ -5493,15 +5676,15 @@ var ts; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { return (node.parent.kind === 135 && node.parent.right === node) || - (node.parent.kind === 166 && node.parent.name === node); + (node.parent.kind === 168 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 165) { + if (kind === 167) { return expression.properties.length === 0; } - if (kind === 164) { + if (kind === 166) { return expression.elements.length === 0; } return false; @@ -5512,13 +5695,9 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; function hasJavaScriptFileExtension(fileName) { - return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); + return ts.forEach(ts.supportedJavascriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; - function allowsJsxExpressions(fileName) { - return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); - } - ts.allowsJsxExpressions = allowsJsxExpressions; function getExpandedCharCodes(input) { var output = []; var length = input.length; @@ -5548,6 +5727,39 @@ var ts; } return output; } + ts.stringify = typeof JSON !== "undefined" && JSON.stringify + ? JSON.stringify + : stringifyFallback; + function stringifyFallback(value) { + return value === undefined ? undefined : stringifyValue(value); + } + function stringifyValue(value) { + return typeof value === "string" ? "\"" + escapeString(value) + "\"" + : typeof value === "number" ? isFinite(value) ? String(value) : "null" + : typeof value === "boolean" ? value ? "true" : "false" + : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) + : "null"; + } + function cycleCheck(cb, value) { + ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); + value.__cycle = true; + var result = cb(value); + delete value.__cycle; + return result; + } + function stringifyArray(value) { + return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; + } + function stringifyElement(memo, value) { + return (memo ? memo + "," : memo) + stringifyValue(value); + } + function stringifyObject(value) { + return "{" + ts.reduceProperties(value, stringifyProperty, "") + "}"; + } + function stringifyProperty(memo, value, key) { + return value === undefined || typeof value === "function" || key === "__cycle" ? memo + : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); + } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function convertToBase64(input) { var result = ""; @@ -5718,13 +5930,17 @@ var ts; function getTypeParameterOwner(d) { if (d && d.kind === 137) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 215) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217) { return current; } } } } ts.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node) { + return node.flags & 56 && node.parent.kind === 144 && ts.isClassLike(node.parent.parent); + } + ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); var ts; (function (ts) { @@ -5732,7 +5948,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 248) { + if (kind === 250) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -5775,7 +5991,7 @@ var ts; return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 246: + case 248: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -5785,9 +6001,9 @@ var ts; case 138: case 141: case 140: - case 245: - case 211: - case 163: + case 247: + case 213: + case 165: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5811,9 +6027,9 @@ var ts; case 144: case 145: case 146: - case 173: - case 213: - case 174: + case 175: + case 215: + case 176: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5843,271 +6059,271 @@ var ts; return visitNodes(cbNodes, node.types); case 160: return visitNode(cbNode, node.type); - case 161: - case 162: - return visitNodes(cbNodes, node.elements); + case 163: case 164: return visitNodes(cbNodes, node.elements); - case 165: - return visitNodes(cbNodes, node.properties); case 166: + return visitNodes(cbNodes, node.elements); + case 167: + return visitNodes(cbNodes, node.properties); + case 168: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 167: + case 169: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 168: - case 169: + case 170: + case 171: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 170: + case 172: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 171: + case 173: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 172: - return visitNode(cbNode, node.expression); - case 175: - return visitNode(cbNode, node.expression); - case 176: + case 174: return visitNode(cbNode, node.expression); case 177: return visitNode(cbNode, node.expression); - case 179: - return visitNode(cbNode, node.operand); - case 184: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 178: return visitNode(cbNode, node.expression); - case 180: - return visitNode(cbNode, node.operand); + case 179: + return visitNode(cbNode, node.expression); case 181: + return visitNode(cbNode, node.operand); + case 186: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 180: + return visitNode(cbNode, node.expression); + case 182: + return visitNode(cbNode, node.operand); + case 183: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 189: + case 191: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 182: + case 184: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 185: + case 187: return visitNode(cbNode, node.expression); - case 192: - case 219: + case 194: + case 221: return visitNodes(cbNodes, node.statements); - case 248: + case 250: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 193: + case 195: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 212: + case 214: return visitNodes(cbNodes, node.declarations); - case 195: + case 197: return visitNode(cbNode, node.expression); - case 196: + case 198: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 197: + case 199: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 198: + case 200: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 199: + case 201: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 200: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 201: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 202: - case 203: - return visitNode(cbNode, node.label); - case 204: - return visitNode(cbNode, node.expression); - case 205: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 203: + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 204: + case 205: + return visitNode(cbNode, node.label); case 206: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 220: - return visitNodes(cbNodes, node.clauses); - case 241: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 242: - return visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression); case 207: - return visitNode(cbNode, node.label) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 208: - return visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.caseBlock); + case 222: + return visitNodes(cbNodes, node.clauses); + case 243: + return visitNode(cbNode, node.expression) || + visitNodes(cbNodes, node.statements); + case 244: + return visitNodes(cbNodes, node.statements); case 209: + return visitNode(cbNode, node.label) || + visitNode(cbNode, node.statement); + case 210: + return visitNode(cbNode, node.expression); + case 211: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 244: + case 246: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 139: return visitNode(cbNode, node.expression); - case 214: - case 186: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 215: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 216: + case 188: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 217: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 247: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 218: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 219: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 249: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 220: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 221: + case 223: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 222: + case 224: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 223: + case 225: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 224: + case 226: return visitNode(cbNode, node.name); - case 225: - case 229: + case 227: + case 231: return visitNodes(cbNodes, node.elements); - case 228: + case 230: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 226: - case 230: + case 228: + case 232: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 227: + case 229: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 183: + case 185: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 190: + case 192: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 136: return visitNode(cbNode, node.expression); - case 243: + case 245: return visitNodes(cbNodes, node.types); - case 188: + case 190: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 232: + case 234: return visitNode(cbNode, node.expression); - case 231: - return visitNodes(cbNodes, node.decorators); case 233: + return visitNodes(cbNodes, node.decorators); + case 235: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 234: - case 235: + case 236: + case 237: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 238: + case 240: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 241: + return visitNode(cbNode, node.expression); + case 242: + return visitNode(cbNode, node.expression); case 239: - return visitNode(cbNode, node.expression); - case 240: - return visitNode(cbNode, node.expression); - case 237: return visitNode(cbNode, node.tagName); - case 249: - return visitNode(cbNode, node.type); - case 253: - return visitNodes(cbNodes, node.types); - case 254: - return visitNodes(cbNodes, node.types); - case 252: - return visitNode(cbNode, node.elementType); - case 256: + case 251: return visitNode(cbNode, node.type); case 255: + return visitNodes(cbNodes, node.types); + case 256: + return visitNodes(cbNodes, node.types); + case 254: + return visitNode(cbNode, node.elementType); + case 258: return visitNode(cbNode, node.type); case 257: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.type); case 259: + return visitNodes(cbNodes, node.members); + case 261: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 260: - return visitNode(cbNode, node.type); - case 261: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 262: return visitNode(cbNode, node.type); case 263: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.parameters) || + visitNode(cbNode, node.type); case 264: return visitNode(cbNode, node.type); - case 258: + case 265: + return visitNode(cbNode, node.type); + case 266: + return visitNode(cbNode, node.type); + case 260: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 265: - return visitNodes(cbNodes, node.tags); case 267: + return visitNodes(cbNodes, node.tags); + case 269: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 268: - return visitNode(cbNode, node.typeExpression); - case 269: - return visitNode(cbNode, node.typeExpression); case 270: + return visitNode(cbNode, node.typeExpression); + case 271: + return visitNode(cbNode, node.typeExpression); + case 272: return visitNodes(cbNodes, node.typeParameters); } } @@ -6157,6 +6373,9 @@ var ts; return result; } Parser.parseSourceFile = parseSourceFile; + function getLanguageVariant(fileName) { + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx") ? 1 : 0; + } function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { NodeConstructor = ts.objectAllocator.getNodeConstructor(); SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); @@ -6172,7 +6391,7 @@ var ts; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 : 0); + scanner.setLanguageVariant(getLanguageVariant(fileName)); } function clearState() { scanner.setText(""); @@ -6211,8 +6430,8 @@ var ts; return; function visit(node) { switch (node.kind) { - case 193: - case 213: + case 195: + case 215: case 138: addJSDocComment(node); } @@ -6247,14 +6466,14 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = new SourceFileConstructor(248, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(250, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 : 0; - sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 : 0; + sourceFile.languageVariant = getLanguageVariant(sourceFile.fileName); return sourceFile; } function setContextFlag(val, flag) { @@ -6306,9 +6525,6 @@ var ts; function doInYieldContext(func) { return doInsideOfContext(2, func); } - function doOutsideOfYieldContext(func) { - return doOutsideOfContext(2, func); - } function doInDecoratorContext(func) { return doInsideOfContext(4, func); } @@ -6321,9 +6537,6 @@ var ts; function doInYieldAndAwaitContext(func) { return doInsideOfContext(2 | 8, func); } - function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(2 | 8, func); - } function inContext(flags) { return (contextFlags & flags) !== 0; } @@ -6364,9 +6577,6 @@ var ts; function nextToken() { return token = scanner.scan(); } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } function reScanGreaterToken() { return token = scanner.reScanGreaterToken(); } @@ -6556,6 +6766,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(nextTokenCanFollowModifier); } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } function nextTokenCanFollowModifier() { if (token === 74) { return nextToken() === 81; @@ -6574,14 +6791,10 @@ var ts; nextToken(); return canFollowModifier(); } - nextToken(); - if (scanner.hasPrecedingLineBreak()) { - return false; - } - return canFollowModifier(); + return nextTokenIsOnSameLineAndCanFollowModifier(); } function parseAnyContextualModifier() { - return ts.isModifier(token) && tryParse(nextTokenCanFollowModifier); + return ts.isModifierKind(token) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier() { return token === 19 @@ -6848,7 +7061,7 @@ var ts; case 145: case 146: case 141: - case 191: + case 193: return true; case 143: var methodDeclaration = node; @@ -6862,8 +7075,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 241: - case 242: + case 243: + case 244: return true; } } @@ -6872,42 +7085,42 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 213: - case 193: - case 192: - case 196: + case 215: case 195: - case 208: - case 204: - case 206: - case 203: - case 202: - case 200: - case 201: - case 199: - case 198: - case 205: case 194: - case 209: - case 207: + case 198: case 197: case 210: - case 222: - case 221: - case 228: - case 227: - case 218: - case 214: - case 215: - case 217: + case 206: + case 208: + case 205: + case 204: + case 202: + case 203: + case 201: + case 200: + case 207: + case 196: + case 211: + case 209: + case 199: + case 212: + case 224: + case 223: + case 230: + case 229: + case 220: case 216: + case 217: + case 219: + case 218: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 247; + return node.kind === 249; } function isReusableTypeMember(node) { if (node) { @@ -6923,7 +7136,7 @@ var ts; return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 211) { + if (node.kind !== 213) { return false; } var variableDeclarator = node; @@ -7047,8 +7260,8 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(183); - template.head = parseLiteralNode(); + var template = createNode(185); + template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); @@ -7060,12 +7273,12 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(190); + var span = createNode(192); span.expression = allowInAnd(parseExpression); var literal; if (token === 16) { reScanTemplateToken(); - literal = parseLiteralNode(); + literal = parseTemplateLiteralFragment(); } else { literal = parseExpectedToken(14, false, ts.Diagnostics._0_expected, ts.tokenToString(16)); @@ -7073,8 +7286,17 @@ var ts; span.literal = literal; return finishNode(span); } + function parseStringLiteralTypeNode() { + return parseLiteralLikeNode(162, true); + } function parseLiteralNode(internName) { - var node = createNode(token); + return parseLiteralLikeNode(token, internName); + } + function parseTemplateLiteralFragment() { + return parseLiteralLikeNode(token, false); + } + function parseLiteralLikeNode(kind, internName) { + var node = createNode(kind); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; if (scanner.hasExtendedUnicodeEscape()) { @@ -7096,11 +7318,7 @@ var ts; function parseTypeReferenceOrTypePredicate() { var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (typeName.kind === 69 && token === 124 && !scanner.hasPrecedingLineBreak()) { - nextToken(); - var node_1 = createNode(150, typeName.pos); - node_1.parameterName = typeName; - node_1.type = parseType(); - return finishNode(node_1); + return parseTypePredicate(typeName); } var node = createNode(151, typeName.pos); node.typeName = typeName; @@ -7109,6 +7327,18 @@ var ts; } return finishNode(node); } + function parseTypePredicate(lhs) { + nextToken(); + var node = createNode(150, lhs.pos); + node.parameterName = lhs; + node.type = parseType(); + return finishNode(node); + } + function parseThisTypeNode() { + var node = createNode(161); + nextToken(); + return finishNode(node); + } function parseTypeQuery() { var node = createNode(154); parseExpected(101); @@ -7140,7 +7370,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 22 || isIdentifierOrPattern() || ts.isModifier(token) || token === 55; + return token === 22 || isIdentifierOrPattern() || ts.isModifierKind(token) || token === 55; } function setModifiers(node, modifiers) { if (modifiers) { @@ -7154,7 +7384,7 @@ var ts; setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); - if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifierKind(token)) { nextToken(); } node.questionToken = parseOptionalToken(53); @@ -7222,7 +7452,7 @@ var ts; if (token === 22 || token === 20) { return true; } - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { nextToken(); if (isIdentifier()) { return true; @@ -7269,6 +7499,9 @@ var ts; property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); + if (token === 56) { + property.initializer = parseNonParameterInitializer(); + } parseTypeMemberSemicolon(); return finishNode(property); } @@ -7280,7 +7513,7 @@ var ts; case 19: return true; default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = lookAhead(isStartOfIndexSignatureDeclaration); if (result) { return result; @@ -7290,7 +7523,7 @@ var ts; } } function isStartOfIndexSignatureDeclaration() { - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { nextToken(); } return isIndexSignature(); @@ -7320,7 +7553,7 @@ var ts; case 8: return parsePropertyOrMethodSignature(); default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { return result; @@ -7393,10 +7626,18 @@ var ts; var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); case 9: - return parseLiteralNode(true); + return parseStringLiteralTypeNode(); case 103: - case 97: return parseTokenNode(); + case 97: { + var thisKeyword = parseThisTypeNode(); + if (token === 124 && !scanner.hasPrecedingLineBreak()) { + return parseTypePredicate(thisKeyword); + } + else { + return thisKeyword; + } + } case 101: return parseTypeQuery(); case 15: @@ -7477,11 +7718,11 @@ var ts; if (token === 18 || token === 22) { return true; } - if (isIdentifier() || ts.isModifier(token)) { + if (isIdentifier() || ts.isModifierKind(token)) { nextToken(); if (token === 54 || token === 24 || token === 53 || token === 56 || - isIdentifier() || ts.isModifier(token)) { + isIdentifier() || ts.isModifierKind(token)) { return true; } if (token === 18) { @@ -7565,9 +7806,6 @@ var ts; token !== 55 && isStartOfExpression(); } - function allowInAndParseExpression() { - return allowInAnd(parseExpression); - } function parseExpression() { var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { @@ -7623,7 +7861,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(184); + var node = createNode(186); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 37 || isStartOfExpression())) { @@ -7637,7 +7875,7 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(174, identifier.pos); + var node = createNode(176, identifier.pos); var parameter = createNode(138, identifier.pos); parameter.name = identifier; finishNode(parameter); @@ -7749,7 +7987,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(174); + var node = createNode(176); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256); fillSignature(54, false, isAsync, !allowAmbiguity, node); @@ -7781,7 +8019,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(182, leftOperand.pos); + var node = createNode(184, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -7872,39 +8110,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(181, left.pos); + var node = createNode(183, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(189, left.pos); + var node = createNode(191, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(179); + var node = createNode(181); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(175); + var node = createNode(177); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(176); + var node = createNode(178); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(177); + var node = createNode(179); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -7919,7 +8157,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(178); + var node = createNode(180); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -7938,7 +8176,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 171) { + if (simpleUnaryExpression.kind === 173) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -7986,7 +8224,7 @@ var ts; } function parseIncrementExpression() { if (token === 41 || token === 42) { - var node = createNode(179); + var node = createNode(181); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -7998,7 +8236,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 || token === 42) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(180, expression.pos); + var node = createNode(182, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -8021,31 +8259,44 @@ var ts; if (token === 17 || token === 21 || token === 19) { return expression; } - var node = createNode(166, expression.pos); + var node = createNode(168, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 69) { + return lhs.text === rhs.text; + } + return lhs.right.text === rhs.right.text && + tagNamesAreEquivalent(lhs.left, rhs.left); + } function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 235) { - var node = createNode(233, opening.pos); + if (opening.kind === 237) { + var node = createNode(235, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); + if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { + parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName)); + } result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 234); + ts.Debug.assert(opening.kind === 236); result = opening; } if (inExpressionContext && token === 25) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(181, result.pos); + var badNode = createNode(183, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -8057,13 +8308,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(236, scanner.getStartPos()); + var node = createNode(238, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 236: + case 238: return parseJsxText(); case 15: return parseJsxExpression(false); @@ -8083,7 +8334,7 @@ var ts; break; } else if (token === 1) { - parseErrorAtCurrentToken(ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); + parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } result.push(parseJsxChild()); @@ -8099,7 +8350,7 @@ var ts; var attributes = parseList(13, parseJsxAttribute); var node; if (token === 27) { - node = createNode(235, fullStart); + node = createNode(237, fullStart); scanJsxText(); } else { @@ -8111,7 +8362,7 @@ var ts; parseExpected(27, undefined, false); scanJsxText(); } - node = createNode(234, fullStart); + node = createNode(236, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -8130,10 +8381,10 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(240); + var node = createNode(242); parseExpected(15); if (token !== 16) { - node.expression = parseExpression(); + node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { parseExpected(16); @@ -8149,7 +8400,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(238); + var node = createNode(240); node.name = parseIdentifierName(); if (parseOptional(56)) { switch (token) { @@ -8164,7 +8415,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(239); + var node = createNode(241); parseExpected(15); parseExpected(22); node.expression = parseExpression(); @@ -8172,7 +8423,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(237); + var node = createNode(239); parseExpected(26); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -8185,7 +8436,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(171); + var node = createNode(173); parseExpected(25); node.type = parseType(); parseExpected(27); @@ -8196,7 +8447,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21); if (dotToken) { - var propertyAccess = createNode(166, expression.pos); + var propertyAccess = createNode(168, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -8204,7 +8455,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(19)) { - var indexedAccess = createNode(167, expression.pos); + var indexedAccess = createNode(169, expression.pos); indexedAccess.expression = expression; if (token !== 20) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -8218,7 +8469,7 @@ var ts; continue; } if (token === 11 || token === 12) { - var tagExpression = createNode(170, expression.pos); + var tagExpression = createNode(172, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 ? parseLiteralNode() @@ -8237,7 +8488,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(168, expression.pos); + var callExpr = createNode(170, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -8245,7 +8496,7 @@ var ts; continue; } else if (token === 17) { - var callExpr = createNode(168, expression.pos); + var callExpr = createNode(170, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -8340,28 +8591,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(172); + var node = createNode(174); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); return finishNode(node); } function parseSpreadElement() { - var node = createNode(185); + var node = createNode(187); parseExpected(22); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 ? parseSpreadElement() : - token === 24 ? createNode(187) : + token === 24 ? createNode(189) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(164); + var node = createNode(166); parseExpected(19); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024; @@ -8388,7 +8639,6 @@ var ts; } var asteriskToken = parseOptionalToken(37); var tokenIsIdentifier = isIdentifier(); - var nameToken = token; var propertyName = parsePropertyName(); var questionToken = parseOptionalToken(53); if (asteriskToken || token === 17 || token === 25) { @@ -8396,7 +8646,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 || token === 16 || token === 56); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(246, fullStart); + var shorthandDeclaration = createNode(248, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56); @@ -8407,7 +8657,8 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(245, fullStart); + var propertyAssignment = createNode(247, fullStart); + propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(54); @@ -8416,7 +8667,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(165); + var node = createNode(167); parseExpected(15); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024; @@ -8430,7 +8681,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(173); + var node = createNode(175); setModifiers(node, parseModifiers()); parseExpected(87); node.asteriskToken = parseOptionalToken(37); @@ -8452,7 +8703,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(169); + var node = createNode(171); parseExpected(92); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -8462,7 +8713,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(192); + var node = createNode(194); if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -8490,12 +8741,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(194); + var node = createNode(196); parseExpected(23); return finishNode(node); } function parseIfStatement() { - var node = createNode(196); + var node = createNode(198); parseExpected(88); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8505,7 +8756,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(197); + var node = createNode(199); parseExpected(79); node.statement = parseStatement(); parseExpected(104); @@ -8516,7 +8767,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(198); + var node = createNode(200); parseExpected(104); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8539,21 +8790,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90)) { - var forInStatement = createNode(200, pos); + var forInStatement = createNode(202, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18); forOrForInOrForOfStatement = forInStatement; } else if (parseOptional(134)) { - var forOfStatement = createNode(201, pos); + var forOfStatement = createNode(203, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(199, pos); + var forStatement = createNode(201, pos); forStatement.initializer = initializer; parseExpected(23); if (token !== 23 && token !== 18) { @@ -8571,7 +8822,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 203 ? 70 : 75); + parseExpected(kind === 205 ? 70 : 75); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8579,7 +8830,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(204); + var node = createNode(206); parseExpected(94); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8588,7 +8839,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(205); + var node = createNode(207); parseExpected(105); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8597,7 +8848,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(241); + var node = createNode(243); parseExpected(71); node.expression = allowInAnd(parseExpression); parseExpected(54); @@ -8605,7 +8856,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(242); + var node = createNode(244); parseExpected(77); parseExpected(54); node.statements = parseList(3, parseStatement); @@ -8615,12 +8866,12 @@ var ts; return token === 71 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(206); + var node = createNode(208); parseExpected(96); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); - var caseBlock = createNode(220, scanner.getStartPos()); + var caseBlock = createNode(222, scanner.getStartPos()); parseExpected(15); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(16); @@ -8628,14 +8879,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(208); + var node = createNode(210); parseExpected(98); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(209); + var node = createNode(211); parseExpected(100); node.tryBlock = parseBlock(false); node.catchClause = token === 72 ? parseCatchClause() : undefined; @@ -8646,7 +8897,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(244); + var result = createNode(246); parseExpected(72); if (parseExpected(17)) { result.variableDeclaration = parseVariableDeclaration(); @@ -8656,7 +8907,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(210); + var node = createNode(212); parseExpected(76); parseSemicolon(); return finishNode(node); @@ -8665,13 +8916,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 && parseOptional(54)) { - var labeledStatement = createNode(207, fullStart); + var labeledStatement = createNode(209, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(195, fullStart); + var expressionStatement = createNode(197, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -8816,9 +9067,9 @@ var ts; case 86: return parseForOrForInOrForOfStatement(); case 75: - return parseBreakOrContinueStatement(202); + return parseBreakOrContinueStatement(204); case 70: - return parseBreakOrContinueStatement(203); + return parseBreakOrContinueStatement(205); case 94: return parseReturnStatement(); case 105: @@ -8888,7 +9139,7 @@ var ts; parseExportDeclaration(fullStart, decorators, modifiers); default: if (decorators || modifiers) { - var node = createMissingNode(231, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(233, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8909,16 +9160,16 @@ var ts; } function parseArrayBindingElement() { if (token === 24) { - return createNode(187); + return createNode(189); } - var node = createNode(163); + var node = createNode(165); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(163); + var node = createNode(165); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54) { @@ -8933,14 +9184,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(161); + var node = createNode(163); parseExpected(15); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(16); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(162); + var node = createNode(164); parseExpected(19); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(20); @@ -8959,7 +9210,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(211); + var node = createNode(213); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -8968,7 +9219,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(212); + var node = createNode(214); switch (token) { case 102: break; @@ -8997,7 +9248,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(193, fullStart); + var node = createNode(195, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -9005,7 +9256,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(213, fullStart); + var node = createNode(215, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87); @@ -9091,7 +9342,7 @@ var ts; if (token === 55) { return true; } - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { idToken = token; if (isClassMemberModifier(idToken)) { return true; @@ -9134,7 +9385,7 @@ var ts; } if (!decorators) { decorators = []; - decorators.pos = scanner.getStartPos(); + decorators.pos = decoratorStart; } var decorator = createNode(139, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); @@ -9145,14 +9396,21 @@ var ts; } return decorators; } - function parseModifiers() { + function parseModifiers(permitInvalidConstAsModifier) { var flags = 0; var modifiers; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token; - if (!parseAnyContextualModifier()) { - break; + if (token === 74 && permitInvalidConstAsModifier) { + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + break; + } + } + else { + if (!parseAnyContextualModifier()) { + break; + } } if (!modifiers) { modifiers = []; @@ -9185,13 +9443,13 @@ var ts; } function parseClassElement() { if (token === 23) { - var result = createNode(191); + var result = createNode(193); nextToken(); return finishNode(result); } var fullStart = getNodePos(); var decorators = parseDecorators(); - var modifiers = parseModifiers(); + var modifiers = parseModifiers(true); var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; @@ -9210,16 +9468,16 @@ var ts; return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators || modifiers) { - var name_8 = createMissingNode(69, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_8, undefined); + var name_7 = createMissingNode(69, true, ts.Diagnostics.Declaration_expected); + return parsePropertyDeclaration(fullStart, decorators, modifiers, name_7, undefined); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 186); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 188); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 214); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -9252,12 +9510,9 @@ var ts; } return undefined; } - function parseHeritageClausesWorker() { - return parseList(20, parseHeritageClause); - } function parseHeritageClause() { if (token === 83 || token === 106) { - var node = createNode(243); + var node = createNode(245); node.token = token; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -9266,7 +9521,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(188); + var node = createNode(190); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -9280,7 +9535,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(217, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107); @@ -9291,7 +9546,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(216, fullStart); + var node = createNode(218, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132); @@ -9303,13 +9558,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(247, scanner.getStartPos()); + var node = createNode(249, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217, fullStart); + var node = createNode(219, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81); @@ -9324,7 +9579,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(221, scanner.getStartPos()); if (parseExpected(15)) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -9335,7 +9590,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(218, fullStart); + var node = createNode(220, fullStart); var namespaceFlag = flags & 65536; node.decorators = decorators; setModifiers(node, modifiers); @@ -9347,7 +9602,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218, fullStart); + var node = createNode(220, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -9377,11 +9632,6 @@ var ts; function nextTokenIsSlash() { return nextToken() === 39; } - function nextTokenIsCommaOrFromKeyword() { - nextToken(); - return token === 24 || - token === 133; - } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(89); var afterImportPos = scanner.getStartPos(); @@ -9389,7 +9639,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 24 && token !== 133) { - var importEqualsDeclaration = createNode(221, fullStart); + var importEqualsDeclaration = createNode(223, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -9399,7 +9649,7 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(222, fullStart); + var importDeclaration = createNode(224, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || @@ -9413,13 +9663,13 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(223, fullStart); + var importClause = createNode(225, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(24)) { - importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(225); + importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(227); } return finishNode(importClause); } @@ -9429,7 +9679,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(232); + var node = createNode(234); parseExpected(127); parseExpected(17); node.expression = parseModuleSpecifier(); @@ -9437,14 +9687,17 @@ var ts; return finishNode(node); } function parseModuleSpecifier() { - var result = parseExpression(); - if (result.kind === 9) { + if (token === 9) { + var result = parseLiteralNode(); internIdentifier(result.text); + return result; + } + else { + return parseExpression(); } - return result; } function parseNamespaceImport() { - var namespaceImport = createNode(224); + var namespaceImport = createNode(226); parseExpected(37); parseExpected(116); namespaceImport.name = parseIdentifier(); @@ -9452,14 +9705,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(21, kind === 225 ? parseImportSpecifier : parseExportSpecifier, 15, 16); + node.elements = parseBracketedList(21, kind === 227 ? parseImportSpecifier : parseExportSpecifier, 15, 16); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(230); + return parseImportOrExportSpecifier(232); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(226); + return parseImportOrExportSpecifier(228); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -9478,13 +9731,13 @@ var ts; else { node.name = identifierName; } - if (kind === 226 && checkIdentifierIsKeyword) { + if (kind === 228 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37)) { @@ -9492,7 +9745,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(229); + node.exportClause = parseNamedImportsOrExports(231); if (token === 133 || (token === 9 && !scanner.hasPrecedingLineBreak())) { parseExpected(133); node.moduleSpecifier = parseModuleSpecifier(); @@ -9502,7 +9755,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(227, fullStart); + var node = createNode(229, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56)) { @@ -9522,11 +9775,13 @@ var ts; var amdModuleName; while (true) { var kind = triviaScanner.scan(); - if (kind === 5 || kind === 4 || kind === 3) { - continue; - } if (kind !== 2) { - break; + if (ts.isTrivia(kind)) { + continue; + } + else { + break; + } } var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); @@ -9572,10 +9827,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 - || node.kind === 221 && node.moduleReference.kind === 232 - || node.kind === 222 - || node.kind === 227 - || node.kind === 228 + || node.kind === 223 && node.moduleReference.kind === 234 + || node.kind === 224 + || node.kind === 229 + || node.kind === 230 ? node : undefined; }); @@ -9610,7 +9865,7 @@ var ts; function parseJSDocTypeExpression(start, length) { scanner.setText(sourceText, start, length); token = nextToken(); - var result = createNode(249); + var result = createNode(251); parseExpected(15); result.type = parseJSDocTopLevelType(); parseExpected(16); @@ -9621,12 +9876,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47) { - var unionType = createNode(253, type.pos); + var unionType = createNode(255, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56) { - var optionalType = createNode(260, type.pos); + var optionalType = createNode(262, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -9637,20 +9892,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19) { - var arrayType = createNode(252, type.pos); + var arrayType = createNode(254, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20); type = finishNode(arrayType); } else if (token === 53) { - var nullableType = createNode(255, type.pos); + var nullableType = createNode(257, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49) { - var nonNullableType = createNode(256, type.pos); + var nonNullableType = createNode(258, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -9694,27 +9949,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(264); + var result = createNode(266); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(263); + var result = createNode(265); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(262); + var result = createNode(264); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(261); + var result = createNode(263); nextToken(); parseExpected(17); result.parameters = parseDelimitedList(22, parseJSDocParameter); @@ -9731,14 +9986,8 @@ var ts; parameter.type = parseJSDocType(); return finishNode(parameter); } - function parseJSDocOptionalType(type) { - var result = createNode(260, type.pos); - nextToken(); - result.type = type; - return finishNode(result); - } function parseJSDocTypeReference() { - var result = createNode(259); + var result = createNode(261); result.name = parseSimplePropertyName(); while (parseOptional(21)) { if (token === 25) { @@ -9773,7 +10022,7 @@ var ts; return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(257); + var result = createNode(259); nextToken(); result.members = parseDelimitedList(24, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -9781,7 +10030,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(258); + var result = createNode(260); result.name = parseSimplePropertyName(); if (token === 54) { nextToken(); @@ -9790,13 +10039,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(256); + var result = createNode(258); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(254); + var result = createNode(256); nextToken(); result.types = parseDelimitedList(25, parseJSDocType); checkForTrailingComma(result.types); @@ -9810,7 +10059,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(253); + var result = createNode(255); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18); @@ -9828,7 +10077,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(250); + var result = createNode(252); nextToken(); return finishNode(result); } @@ -9841,11 +10090,11 @@ var ts; token === 27 || token === 56 || token === 47) { - var result = createNode(251, pos); + var result = createNode(253, pos); return finishNode(result); } else { - var result = createNode(255, pos); + var result = createNode(257, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -9916,7 +10165,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(265, start); + var result = createNode(267, start); result.tags = tags; return finishNode(result, end); } @@ -9953,7 +10202,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(266, atToken.pos); + var result = createNode(268, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -10004,7 +10253,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(267, atToken.pos); + var result = createNode(269, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -10014,27 +10263,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 268; })) { + if (ts.forEach(tags, function (t) { return t.kind === 270; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(268, atToken.pos); + var result = createNode(270, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 269; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(269, atToken.pos); + var result = createNode(271, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -10042,13 +10291,13 @@ var ts; while (true) { skipWhitespace(); var startPos = pos; - var name_9 = scanIdentifier(); - if (!name_9) { + var name_8 = scanIdentifier(); + if (!name_8) { parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(137, name_9.pos); - typeParameter.name = name_9; + var typeParameter = createNode(137, name_8.pos); + typeParameter.name = name_8; finishNode(typeParameter, pos); typeParameters.push(typeParameter); skipWhitespace(); @@ -10058,7 +10307,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(270, atToken.pos); + var result = createNode(272, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -10380,16 +10629,16 @@ var ts; : 4; } function getModuleInstanceState(node) { - if (node.kind === 215 || node.kind === 216) { + if (node.kind === 217 || node.kind === 218) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 222 || node.kind === 221) && !(node.flags & 2)) { + else if ((node.kind === 224 || node.kind === 223) && !(node.flags & 2)) { return 0; } - else if (node.kind === 219) { + else if (node.kind === 221) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -10405,7 +10654,7 @@ var ts; }); return state; } - else if (node.kind === 218) { + else if (node.kind === 220) { return getModuleInstanceState(node.body); } else { @@ -10448,6 +10697,8 @@ var ts; file.symbolCount = symbolCount; file.classifiableNames = classifiableNames; } + file = undefined; + options = undefined; parent = undefined; container = undefined; blockScopeContainer = undefined; @@ -10476,13 +10727,17 @@ var ts; if (symbolFlags & 6240 && !symbol.members) { symbol.members = {}; } - if (symbolFlags & 107455 && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; + if (symbolFlags & 107455) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220)) { + symbol.valueDeclaration = node; + } } } function getDeclarationName(node) { if (node.name) { - if (node.kind === 218 && node.name.kind === 9) { + if (node.kind === 220 && node.name.kind === 9) { return "\"" + node.name.text + "\""; } if (node.name.kind === 136) { @@ -10506,14 +10761,24 @@ var ts; return "__new"; case 149: return "__index"; - case 228: + case 230: return "__export"; - case 227: + case 229: return node.isExportEquals ? "export=" : "default"; - case 181: - return "export="; - case 213: - case 214: + case 183: + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 2: + return "export="; + case 1: + case 4: + return node.left.name.text; + case 3: + return node.left.expression.name.text; + } + ts.Debug.fail("Unknown binary declaration kind"); + break; + case 215: + case 216: return node.flags & 512 ? "default" : undefined; } } @@ -10561,7 +10826,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; if (symbolFlags & 8388608) { - if (node.kind === 230 || (node.kind === 221 && hasExportModifier)) { + if (node.kind === 232 || (node.kind === 223 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -10608,10 +10873,10 @@ var ts; var kind = node.kind; var flags = node.flags; flags &= ~1572864; - if (kind === 215) { + if (kind === 217) { seenThisKeyword = false; } - var saveState = kind === 248 || kind === 219 || ts.isFunctionLikeKind(kind); + var saveState = kind === 250 || kind === 221 || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -10629,7 +10894,7 @@ var ts; flags |= 1048576; } } - if (kind === 215) { + if (kind === 217) { flags = seenThisKeyword ? flags | 262144 : flags & ~262144; } node.flags = flags; @@ -10650,40 +10915,40 @@ var ts; return; } switch (node.kind) { - case 198: + case 200: bindWhileStatement(node); break; - case 197: + case 199: bindDoStatement(node); break; - case 199: + case 201: bindForStatement(node); break; - case 200: - case 201: + case 202: + case 203: bindForInOrForOfStatement(node); break; - case 196: + case 198: bindIfStatement(node); break; - case 204: - case 208: + case 206: + case 210: bindReturnOrThrow(node); break; - case 203: - case 202: + case 205: + case 204: bindBreakOrContinueStatement(node); break; - case 209: + case 211: bindTryStatement(node); break; - case 206: + case 208: bindSwitchStatement(node); break; - case 220: + case 222: bindCaseBlock(node); break; - case 207: + case 209: bindLabeledStatement(node); break; default: @@ -10745,14 +11010,14 @@ var ts; } function bindReturnOrThrow(n) { bind(n.expression); - if (n.kind === 204) { + if (n.kind === 206) { hasExplicitReturn = true; } currentReachabilityState = 4; } function bindBreakOrContinueStatement(n) { bind(n.label); - var isValidJump = jumpToLabel(n.label, n.kind === 203 ? currentReachabilityState : 4); + var isValidJump = jumpToLabel(n.label, n.kind === 205 ? currentReachabilityState : 4); if (isValidJump) { currentReachabilityState = 4; } @@ -10773,7 +11038,7 @@ var ts; var postSwitchLabel = pushImplicitLabel(); bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244; }); var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); } @@ -10798,37 +11063,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 186: - case 214: - case 215: + case 188: + case 216: case 217: + case 219: case 155: - case 165: + case 167: return 1; case 147: case 148: case 149: case 143: case 142: - case 213: + case 215: case 144: case 145: case 146: case 152: case 153: - case 173: - case 174: - case 218: - case 248: - case 216: - return 5; - case 244: - case 199: - case 200: - case 201: + case 175: + case 176: case 220: + case 250: + case 218: + return 5; + case 246: + case 201: + case 202: + case 203: + case 222: return 2; - case 192: + case 194: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -10844,18 +11109,18 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 218: + case 220: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248: + case 250: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186: - case 214: + case 188: + case 216: return declareClassMember(node, symbolFlags, symbolExcludes); - case 217: + case 219: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); case 155: - case 165: - case 215: + case 167: + case 217: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); case 152: case 153: @@ -10867,10 +11132,10 @@ var ts; case 144: case 145: case 146: - case 213: - case 173: - case 174: - case 216: + case 215: + case 175: + case 176: + case 218: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -10885,11 +11150,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 248 ? node : node.body; - if (body.kind === 248 || body.kind === 219) { + var body = node.kind === 250 ? node : node.body; + if (body.kind === 250 || body.kind === 221) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 228 || stat.kind === 227) { + if (stat.kind === 230 || stat.kind === 229) { return true; } } @@ -10948,7 +11213,7 @@ var ts; continue; } var identifier = prop.name; - var currentKind = prop.kind === 245 || prop.kind === 246 || prop.kind === 143 + var currentKind = prop.kind === 247 || prop.kind === 248 || prop.kind === 143 ? 1 : 2; var existingKind = seen[identifier.text]; @@ -10970,10 +11235,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 218: + case 220: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 248: + case 250: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -11095,17 +11360,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 248: - case 219: + case 250: + case 221: updateStrictModeStatementList(node.statements); return; - case 192: + case 194: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 214: - case 186: + case 216: + case 188: inStrictMode = true; return; } @@ -11130,45 +11395,60 @@ var ts; switch (node.kind) { case 69: return checkStrictModeIdentifier(node); - case 181: + case 183: if (ts.isInJavaScriptFile(node)) { - if (ts.isExportsPropertyAssignment(node)) { - bindExportsPropertyAssignment(node); - } - else if (ts.isModuleExportsAssignment(node)) { - bindModuleExportsAssignment(node); + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 0: + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } } return checkStrictModeBinaryExpression(node); - case 244: + case 246: return checkStrictModeCatchClause(node); - case 175: + case 177: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 180: + case 182: return checkStrictModePostfixUnaryExpression(node); - case 179: + case 181: return checkStrictModePrefixUnaryExpression(node); - case 205: + case 207: return checkStrictModeWithStatement(node); - case 97: + case 161: seenThisKeyword = true; return; + case 150: + return checkTypePredicate(node); case 137: return declareSymbolAndAddToSymbolTable(node, 262144, 530912); case 138: return bindParameter(node); - case 211: - case 163: + case 213: + case 165: return bindVariableDeclarationOrBindingElement(node); case 141: case 140: return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); - case 245: - case 246: - return bindPropertyOrMethodOrAccessor(node, 4, 107455); case 247: + case 248: + return bindPropertyOrMethodOrAccessor(node, 4, 107455); + case 249: return bindPropertyOrMethodOrAccessor(node, 8, 107455); case 147: case 148: @@ -11177,7 +11457,7 @@ var ts; case 143: case 142: return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); - case 213: + case 215: checkStrictModeFunctionName(node); return declareSymbolAndAddToSymbolTable(node, 16, 106927); case 144: @@ -11191,44 +11471,54 @@ var ts; return bindFunctionOrConstructorType(node); case 155: return bindAnonymousDeclaration(node, 2048, "__type"); - case 165: + case 167: return bindObjectLiteralExpression(node); - case 173: - case 174: + case 175: + case 176: checkStrictModeFunctionName(node); var bindingName = node.name ? node.name.text : "__function"; return bindAnonymousDeclaration(node, 16, bindingName); - case 168: + case 170: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 186: - case 214: - return bindClassLikeDeclaration(node); - case 215: - return bindBlockScopedDeclaration(node, 64, 792960); + case 188: case 216: - return bindBlockScopedDeclaration(node, 524288, 793056); + return bindClassLikeDeclaration(node); case 217: - return bindEnumDeclaration(node); + return bindBlockScopedDeclaration(node, 64, 792960); case 218: + return bindBlockScopedDeclaration(node, 524288, 793056); + case 219: + return bindEnumDeclaration(node); + case 220: return bindModuleDeclaration(node); - case 221: - case 224: - case 226: - case 230: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); case 223: - return bindImportClause(node); + case 226: case 228: + case 232: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 225: + return bindImportClause(node); + case 230: return bindExportDeclaration(node); - case 227: + case 229: return bindExportAssignment(node); - case 248: + case 250: return bindSourceFileIfExternalModule(); } } + function checkTypePredicate(node) { + var parameterName = node.parameterName, type = node.type; + if (parameterName && parameterName.kind === 69) { + checkStrictModeIdentifier(parameterName); + } + if (parameterName && parameterName.kind === 161) { + seenThisKeyword = true; + } + bind(type); + } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -11239,7 +11529,7 @@ var ts; bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 227 ? node.expression : node.right; + var boundExpression = node.kind === 229 ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } @@ -11277,13 +11567,30 @@ var ts; setCommonJsModuleIndicator(node); bindExportAssignment(node); } + function bindThisPropertyAssignment(node) { + if (container.kind === 175 || container.kind === 215) { + container.symbol.members = container.symbol.members || {}; + declareSymbol(container.symbol.members, container.symbol, node, 4, 107455); + } + } + function bindPrototypePropertyAssignment(node) { + var classId = node.left.expression.expression; + var funcSymbol = container.locals[classId.text]; + if (!funcSymbol || !(funcSymbol.flags & 16)) { + return; + } + if (!funcSymbol.members) { + funcSymbol.members = {}; + } + declareSymbol(funcSymbol.members, funcSymbol, node.left, 4, 107455); + } function bindCallExpression(node) { if (!file.commonJsModuleIndicator && ts.isRequireCall(node)) { setCommonJsModuleIndicator(node); } } function bindClassLikeDeclaration(node) { - if (node.kind === 214) { + if (node.kind === 216) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -11335,9 +11642,7 @@ var ts; else { declareSymbolAndAddToSymbolTable(node, 1, 107455); } - if (node.flags & 56 && - node.parent.kind === 144 && - ts.isClassLike(node.parent.parent)) { + if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -11402,15 +11707,15 @@ var ts; function checkUnreachable(node) { switch (currentReachabilityState) { case 4: - var reportError = (ts.isStatement(node) && node.kind !== 194) || - node.kind === 214 || - (node.kind === 218 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 217 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatement(node) && node.kind !== 196) || + node.kind === 216 || + (node.kind === 220 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 219 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 193 || + (node.kind !== 195 || ts.getCombinedNodeFlags(node.declarationList) & 24576 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -11444,15 +11749,18 @@ var ts; var nextNodeId = 1; var nextMergeId = 1; function getNodeId(node) { - if (!node.id) - node.id = nextNodeId++; + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } return node.id; } ts.getNodeId = getNodeId; ts.checkTime = 0; function getSymbolId(symbol) { if (!symbol.id) { - symbol.id = nextSymbolId++; + symbol.id = nextSymbolId; + nextSymbolId++; } return symbol.id; } @@ -11469,8 +11777,10 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 ? 5 : 0; + var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === 4; var emitResolver = createResolver(); var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + undefinedSymbol.declarations = []; var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, @@ -11482,6 +11792,7 @@ var ts; getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -11498,7 +11809,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getApparentTypeOfContextualType, + getContextualType: getContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -11523,15 +11834,15 @@ var ts; var undefinedType = createIntrinsicType(32 | 2097152, "undefined"); var nullType = createIntrinsicType(64 | 2097152, "null"); var unknownType = createIntrinsicType(1, "unknown"); - var circularType = createIntrinsicType(1, "__circular__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var emptyUnionType = emptyObjectType; var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); emptyGenericType.instantiations = {}; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); anyFunctionType.flags |= 8388608; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); + var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; var globalESSymbolConstructorSymbol; var getGlobalPromiseConstructorSymbol; @@ -11544,8 +11855,6 @@ var ts; var globalRegExpType; var globalTemplateStringsArrayType; var globalESSymbolType; - var jsxElementType; - var jsxIntrinsicElementsType; var globalIterableType; var globalIteratorType; var globalIterableIteratorType; @@ -11562,6 +11871,7 @@ var ts; var getGlobalPromiseConstructorLikeType; var getGlobalThenableType; var jsxElementClassType; + var deferredNodes; var tupleTypes = {}; var unionTypes = {}; var intersectionTypes = {}; @@ -11596,19 +11906,31 @@ var ts; "symbol": { type: esSymbolType, flags: 16777216 + }, + "undefined": { + type: undefinedType, + flags: 2097152 } }; + var jsxElementType; + var jsxTypes = {}; var JsxNames = { JSX: "JSX", IntrinsicElements: "IntrinsicElements", ElementClass: "ElementClass", ElementAttributesPropertyNameContainer: "ElementAttributesProperty", - Element: "Element" + Element: "Element", + IntrinsicAttributes: "IntrinsicAttributes", + IntrinsicClassAttributes: "IntrinsicClassAttributes" }; var subtypeRelation = {}; var assignableRelation = {}; var identityRelation = {}; var _displayBuilder; + var builtinGlobals = (_a = {}, + _a[undefinedSymbol.name] = undefinedSymbol, + _a + ); initializeTypeChecker(); return checker; function getEmitResolver(sourceFile, cancellationToken) { @@ -11662,8 +11984,10 @@ var ts; return result; } function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { @@ -11687,8 +12011,11 @@ var ts; target.constEnumOnlyModule = false; } target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) + if (source.valueDeclaration && + (!target.valueDeclaration || + (target.valueDeclaration.kind === 220 && source.valueDeclaration.kind !== 220))) { target.valueDeclaration = source.valueDeclaration; + } ts.forEach(source.declarations, function (node) { target.declarations.push(node); }); @@ -11740,6 +12067,21 @@ var ts; } } } + function addToSymbolTable(target, source, message) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (ts.hasProperty(target, id)) { + ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + } + else { + target[id] = source[id]; + } + } + } + function addDeclarationDiagnostic(id, message) { + return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; + } + } function getSymbolLinks(symbol) { if (symbol.flags & 67108864) return symbol; @@ -11751,10 +12093,16 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 248); + return ts.getAncestor(node, 250); } function isGlobalSourceFile(node) { - return node.kind === 248 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 250 && !ts.isExternalOrCommonJsModule(node); + } + function isPrimitiveApparentType(type) { + return type === globalStringType || + type === globalNumberType || + type === globalBooleanType || + type === globalESSymbolType; } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -11771,6 +12119,16 @@ var ts; } } } + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + var constructoDeclaration = parameter.parent; + var classDeclaration = parameter.parent.parent; + var parameterSymbol = getSymbol(constructoDeclaration.locals, parameterName, 107455); + var propertySymbol = getSymbol(classDeclaration.symbol.members, parameterName, 107455); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { var declarationFile = ts.getSourceFileOfNode(declaration); var useFile = ts.getSourceFileOfNode(usage); @@ -11782,18 +12140,18 @@ var ts; return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 211 || + return declaration.kind !== 213 || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 193 || - declaration.parent.parent.kind === 199) { + if (declaration.parent.parent.kind === 195 || + declaration.parent.parent.kind === 201) { return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 201 || - declaration.parent.parent.kind === 200) { + else if (declaration.parent.parent.kind === 203 || + declaration.parent.parent.kind === 202) { var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); } @@ -11829,23 +12187,38 @@ var ts; loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - if (!(meaning & 793056) || - !(result.flags & (793056 & ~262144)) || - !ts.isFunctionLike(location) || - lastLocation === location.body) { + var useResult = true; + if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { + if (meaning & result.flags & 793056) { + useResult = result.flags & 262144 + ? lastLocation === location.type || + lastLocation.kind === 138 || + lastLocation.kind === 137 + : false; + } + if (meaning & 107455 && result.flags & 1) { + useResult = + lastLocation.kind === 138 || + (lastLocation === location.type && + result.valueDeclaration.kind === 138); + } + } + if (useResult) { break loop; } - result = undefined; + else { + result = undefined; + } } } switch (location.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location)) break; - case 218: + case 220: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 248 || - (location.kind === 218 && location.name.kind === 9)) { + if (location.kind === 250 || + (location.kind === 220 && location.name.kind === 9)) { if (result = moduleExports["default"]) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { @@ -11855,7 +12228,7 @@ var ts; } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 230)) { + ts.getDeclarationOfKind(moduleExports[name], 232)) { break; } } @@ -11863,7 +12236,7 @@ var ts; break loop; } break; - case 217: + case 219: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } @@ -11879,9 +12252,9 @@ var ts; } } break; - case 214: - case 186: - case 215: + case 216: + case 188: + case 217: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 64) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -11889,7 +12262,7 @@ var ts; } break loop; } - if (location.kind === 186 && meaning & 32) { + if (location.kind === 188 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -11899,7 +12272,7 @@ var ts; break; case 136: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 215) { + if (ts.isClassLike(grandparent) || grandparent.kind === 217) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; @@ -11911,14 +12284,14 @@ var ts; case 144: case 145: case 146: - case 213: - case 174: + case 215: + case 176: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 173: + case 175: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -11971,7 +12344,7 @@ var ts; ts.Debug.assert((result.flags & 2) !== 0); var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 211), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -11988,10 +12361,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 221) { + if (node.kind === 223) { return node; } - while (node && node.kind !== 222) { + while (node && node.kind !== 224) { node = node.parent; } return node; @@ -12001,7 +12374,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 232) { + if (node.moduleReference.kind === 234) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -12010,9 +12383,12 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); - if (!exportDefaultSymbol) { + if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } + else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + return resolveSymbol(moduleSymbol.exports["export="]) || resolveSymbol(moduleSymbol); + } return exportDefaultSymbol; } } @@ -12020,14 +12396,6 @@ var ts; var moduleSpecifier = node.parent.parent.moduleSpecifier; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } - function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3) { - var typeAnnotation = moduleSymbol.valueDeclaration.type; - if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); - } - } - } function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { if (valueSymbol.flags & (793056 | 1536)) { return valueSymbol; @@ -12063,15 +12431,15 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); if (targetSymbol) { - var name_10 = specifier.propertyName || specifier.name; - if (name_10.text) { - var symbolFromModule = getExportOfModule(targetSymbol, name_10.text); - var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_10.text); + var name_9 = specifier.propertyName || specifier.name; + if (name_9.text) { + var symbolFromModule = getExportOfModule(targetSymbol, name_9.text); + var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_9.text); var symbol = symbolFromModule && symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name_10, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_10)); + error(name_9, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_9)); } return symbol; } @@ -12090,17 +12458,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 221: - return getTargetOfImportEqualsDeclaration(node); case 223: + return getTargetOfImportEqualsDeclaration(node); + case 225: return getTargetOfImportClause(node); - case 224: - return getTargetOfNamespaceImport(node); case 226: + return getTargetOfNamespaceImport(node); + case 228: return getTargetOfImportSpecifier(node); - case 230: + case 232: return getTargetOfExportSpecifier(node); - case 227: + case 229: return getTargetOfExportAssignment(node); } } @@ -12142,10 +12510,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 227) { + if (node.kind === 229) { checkExpressionCached(node.expression); } - else if (node.kind === 230) { + else if (node.kind === 232) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -12155,7 +12523,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 221); + importDeclaration = ts.getAncestor(entityName, 223); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -12165,7 +12533,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 221); + ts.Debug.assert(entityName.parent.kind === 223); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -12184,7 +12552,7 @@ var ts; return undefined; } } - else if (name.kind === 135 || name.kind === 166) { + else if (name.kind === 135 || name.kind === 168) { var left = name.kind === 135 ? name.left : name.expression; var right = name.kind === 135 ? name.right : name.name; var namespace = resolveEntityName(left, 1536, ignoreErrors); @@ -12210,14 +12578,10 @@ var ts; return; } var moduleReferenceLiteral = moduleReferenceExpression; - var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (moduleName === undefined) { return; } - if (moduleName.indexOf("!") >= 0) { - moduleName = moduleName.substr(0, moduleName.indexOf("!")); - } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); @@ -12260,35 +12624,58 @@ var ts; var links = getSymbolLinks(moduleSymbol); return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } - function extendExportSymbols(target, source) { + function extendExportSymbols(target, source, lookupTable, exportNode) { for (var id in source) { if (id !== "default" && !ts.hasProperty(target, id)) { target[id] = source[id]; + if (lookupTable && exportNode) { + lookupTable[id] = { + specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) + }; + } + } + else if (lookupTable && exportNode && id !== "default" && ts.hasProperty(target, id) && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { + if (!lookupTable[id].exportsWithDuplicate) { + lookupTable[id].exportsWithDuplicate = [exportNode]; + } + else { + lookupTable[id].exportsWithDuplicate.push(exportNode); + } } } } function getExportsForModule(moduleSymbol) { - var result; var visitedSymbols = []; - visit(moduleSymbol); - return result || moduleSymbol.exports; + return visit(moduleSymbol) || moduleSymbol.exports; function visit(symbol) { - if (symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { - visitedSymbols.push(symbol); - if (symbol !== moduleSymbol) { - if (!result) { - result = cloneSymbolTable(moduleSymbol.exports); - } - extendExportSymbols(result, symbol.exports); - } - var exportStars = symbol.exports["__export"]; - if (exportStars) { - for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - visit(resolveExternalModuleName(node, node.moduleSpecifier)); - } - } + if (!(symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol))) { + return; } + visitedSymbols.push(symbol); + var symbols = cloneSymbolTable(symbol.exports); + var exportStars = symbol.exports["__export"]; + if (exportStars) { + var nestedSymbols = {}; + var lookupTable = {}; + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + var exportedSymbols = visit(resolvedModule); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + } + for (var id in lookupTable) { + var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || ts.hasProperty(symbols, id)) { + continue; + } + for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { + var node = exportsWithDuplicate_1[_b]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + } + } + extendExportSymbols(symbols, nestedSymbols); + } + return symbols; } } function getMergedSymbol(symbol) { @@ -12329,7 +12716,8 @@ var ts; } function createType(flags) { var result = new Type(checker, flags); - result.id = typeCount++; + result.id = typeCount; + typeCount++; return result; } function createIntrinsicType(kind, intrinsicName) { @@ -12387,17 +12775,17 @@ var ts; } } switch (location_1.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 218: + case 220: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 214: - case 215: + case 216: + case 217: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -12430,7 +12818,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -12459,7 +12847,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -12514,8 +12902,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 218 && declaration.name.kind === 9) || - (declaration.kind === 248 && ts.isExternalOrCommonJsModule(declaration)); + return (declaration.kind === 220 && declaration.name.kind === 9) || + (declaration.kind === 250 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12550,8 +12938,8 @@ var ts; if (entityName.parent.kind === 154) { meaning = 107455 | 1048576; } - else if (entityName.kind === 135 || entityName.kind === 166 || - entityName.parent.kind === 221) { + else if (entityName.kind === 135 || entityName.kind === 168 || + entityName.parent.kind === 223) { meaning = 1536; } else { @@ -12581,9 +12969,9 @@ var ts; ts.releaseStringWriter(writer); return result; } - function signatureToString(signature, enclosingDeclaration, flags) { + function signatureToString(signature, enclosingDeclaration, flags, kind) { var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); var result = writer.string(); ts.releaseStringWriter(writer); return result; @@ -12605,7 +12993,7 @@ var ts; while (node.kind === 160) { node = node.parent; } - if (node.kind === 216) { + if (node.kind === 218) { return getSymbolOfNode(node); } } @@ -12619,10 +13007,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 186: + case 188: return "(Anonymous class)"; - case 173: - case 174: + case 175: + case 176: return "(Anonymous function)"; } } @@ -12687,9 +13075,15 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 16777343) { - writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) - ? "any" - : type.intrinsicName); + if (type.flags & 134217728) { + buildTypePredicateDisplay(writer, type.predicate); + buildTypeDisplay(type.predicate.type, writer, enclosingDeclaration, flags, symbolStack); + } + else { + writer.writeKeyword(!(globalFlags & 16) && isTypeAny(type) + ? "any" + : type.intrinsicName); + } } else if (type.flags & 33554432) { if (inObjectTypeLiteral) { @@ -12741,11 +13135,13 @@ var ts; } if (pos < end) { writePunctuation(writer, 25); - writeType(typeArguments[pos++], 0); + writeType(typeArguments[pos], 0); + pos++; while (pos < end) { writePunctuation(writer, 24); writeSpace(writer); - writeType(typeArguments[pos++], 0); + writeType(typeArguments[pos], 0); + pos++; } writePunctuation(writer, 27); } @@ -12828,7 +13224,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 248 || declaration.parent.kind === 219; + return declaration.parent.kind === 250 || declaration.parent.kind === 221; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -12861,7 +13257,7 @@ var ts; if (flags & 64) { writePunctuation(writer, 17); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, symbolStack); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack); if (flags & 64) { writePunctuation(writer, 18); } @@ -12873,7 +13269,7 @@ var ts; } writeKeyword(writer, 92); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, symbolStack); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, undefined, symbolStack); if (flags & 64) { writePunctuation(writer, 18); } @@ -12887,15 +13283,13 @@ var ts; writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 92); - writeSpace(writer); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } @@ -12936,7 +13330,7 @@ var ts; if (p.flags & 536870912) { writePunctuation(writer, 53); } - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); writePunctuation(writer, 23); writer.writeLine(); } @@ -13024,6 +13418,17 @@ var ts; } writePunctuation(writer, 18); } + function buildTypePredicateDisplay(writer, predicate) { + if (ts.isIdentifierTypePredicate(predicate)) { + writer.writeParameter(predicate.parameterName); + } + else { + writeKeyword(writer, 97); + } + writeSpace(writer); + writeKeyword(writer, 124); + writeSpace(writer); + } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { if (flags & 8) { writeSpace(writer); @@ -13033,20 +13438,14 @@ var ts; writePunctuation(writer, 54); } writeSpace(writer); - var returnType; - if (signature.typePredicate) { - writer.writeParameter(signature.typePredicate.parameterName); - writeSpace(writer); - writeKeyword(writer, 124); - writeSpace(writer); - returnType = signature.typePredicate.type; - } - else { - returnType = getReturnTypeOfSignature(signature); - } + var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { + if (kind === 1) { + writeKeyword(writer, 92); + writeSpace(writer); + } if (signature.target && (flags & 32)) { buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); } @@ -13069,73 +13468,33 @@ var ts; }); } function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 218) { - if (node.name.kind === 9) { - return node; - } - } - else if (node.kind === 248) { - return ts.isExternalOrCommonJsModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - var externalModule = getContainingExternalModule(node); - var exportAssignmentSymbol; - var resolvedExportSymbol; - if (externalModule) { - var externalModuleSymbol = getSymbolOfNode(externalModule); - exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - if (symbolOfNode.flags & 8388608) { - return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); - } - } - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608)) { - resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - return ts.forEach(resolvedExportSymbol.declarations, function (current) { - while (current) { - if (current === node) { - return true; - } - current = current.parent; - } - }); - } + if (node) { + var links = getNodeLinks(node); + if (links.isVisible === undefined) { + links.isVisible = !!determineIfDeclarationIsVisible(); } + return links.isVisible; } + return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 163: + case 165: return isDeclarationVisible(node.parent.parent); - case 211: + case 213: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 218: - case 214: - case 215: + case 220: case 216: - case 213: case 217: - case 221: + case 218: + case 215: + case 219: + case 223: var parent_4 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 2) && - !(node.kind !== 221 && parent_4.kind !== 248 && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 223 && parent_4.kind !== 250 && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } return isDeclarationVisible(parent_4); @@ -13153,7 +13512,7 @@ var ts; case 147: case 149: case 138: - case 219: + case 221: case 152: case 153: case 155: @@ -13164,33 +13523,26 @@ var ts; case 159: case 160: return isDeclarationVisible(node.parent); - case 223: - case 224: + case 225: case 226: + case 228: return false; case 137: - case 248: + case 250: return true; - case 227: + case 229: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 227) { + if (node.parent && node.parent.kind === 229) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 232) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -13265,7 +13617,7 @@ var ts; } function getDeclarationContainer(node) { node = ts.getRootDeclaration(node); - return node.kind === 211 ? node.parent.parent.parent : node.parent; + return node.kind === 213 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -13312,17 +13664,17 @@ var ts; return parentType; } var type; - if (pattern.kind === 161) { - var name_11 = declaration.propertyName || declaration.name; - if (isComputedNonLiteralName(name_11)) { + if (pattern.kind === 163) { + var name_10 = declaration.propertyName || declaration.name; + if (isComputedNonLiteralName(name_10)) { return anyType; } - var text = getTextOfPropertyName(name_11); + var text = getTextOfPropertyName(name_10); type = getTypeOfPropertyOfType(parentType, text) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { - error(name_11, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_11)); + error(name_10, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_10)); return unknownType; } } @@ -13350,10 +13702,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 200) { + if (declaration.parent.parent.kind === 202) { return anyType; } - if (declaration.parent.parent.kind === 201) { + if (declaration.parent.parent.kind === 203) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -13378,7 +13730,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 246) { + if (declaration.kind === 248) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -13425,7 +13777,7 @@ var ts; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } - var elementTypes = ts.map(elements, function (e) { return e.kind === 187 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 189 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -13434,7 +13786,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 161 + return pattern.kind === 163 ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -13444,7 +13796,13 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 245 ? getWidenedType(type) : type; + if (declaration.kind === 247) { + return type; + } + if (type.flags & 134217728 && (declaration.kind === 141 || declaration.kind === 140)) { + return type; + } + return getWidenedType(type); } type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { @@ -13462,17 +13820,19 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 244) { + if (declaration.parent.kind === 246) { return links.type = anyType; } - if (declaration.kind === 227) { + if (declaration.kind === 229) { return links.type = checkExpression(declaration.expression); } - if (declaration.kind === 181) { + if (declaration.kind === 183) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 166) { - return checkExpressionCached(declaration.parent.right); + if (declaration.kind === 168) { + if (declaration.parent.kind === 183) { + return links.type = checkExpressionCached(declaration.parent.right); + } } if (!pushTypeResolution(symbol, 0)) { return unknownType; @@ -13628,9 +13988,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 214 || node.kind === 186 || - node.kind === 213 || node.kind === 173 || - node.kind === 143 || node.kind === 174) { + if (node.kind === 216 || node.kind === 188 || + node.kind === 215 || node.kind === 175 || + node.kind === 143 || node.kind === 176) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -13639,15 +13999,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 215); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 215 || node.kind === 214 || - node.kind === 186 || node.kind === 216) { + if (node.kind === 217 || node.kind === 216 || + node.kind === 188 || node.kind === 218) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -13702,9 +14062,6 @@ var ts; } return type.resolvedBaseConstructorType; } - function hasClassBaseType(type) { - return !!ts.forEach(getBaseTypes(type), function (t) { return !!(t.symbol.flags & 32); }); - } function getBaseTypes(type) { var isClass = type.symbol.flags & 32; var isInterface = type.symbol.flags & 64; @@ -13773,7 +14130,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 217 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -13802,7 +14159,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215) { + if (declaration.kind === 217) { if (declaration.flags & 262144) { return false; } @@ -13851,7 +14208,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 216); + var declaration = ts.getDeclarationOfKind(symbol, 218); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -13934,7 +14291,7 @@ var ts; case 120: case 131: case 103: - case 9: + case 162: return true; case 156: return isIndependentType(node.elementType); @@ -13999,14 +14356,6 @@ var ts; } } } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { - var signature = baseSignatures_1[_i]; - signatures.push(signature); - } - } - } function resolveDeclaredMembers(type) { if (!type.declaredProperties) { var symbol = type.symbol; @@ -14067,33 +14416,32 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasStringLiterals) { + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasStringLiterals = hasStringLiterals; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (!hasClassBaseType(classType)) { - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1); + if (baseSignatures.length === 0) { + return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, 0, false, false)]; + } var baseTypeNode = getBaseTypeNodeOfClass(classType); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); var typeArgCount = typeArguments ? typeArguments.length : 0; var result = []; - for (var _i = 0, baseSignatures_2 = baseSignatures; _i < baseSignatures_2.length; _i++) { - var baseSig = baseSignatures_2[_i]; + for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { + var baseSig = baseSignatures_1[_i]; var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; if (typeParamCount === typeArgCount) { var sig = typeParamCount ? getSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); @@ -14123,7 +14471,7 @@ var ts; function findMatchingSignature(signatureList, signature, partialMatch, ignoreReturnTypes) { for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) { var s = signatureList_1[_i]; - if (compareSignatures(s, signature, partialMatch, ignoreReturnTypes, compareTypes)) { + if (compareSignaturesIdentical(s, signature, partialMatch, ignoreReturnTypes, compareTypesIdentical)) { return s; } } @@ -14212,35 +14560,28 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - var members; - var callSignatures; - var constructSignatures; - var stringIndexType; - var numberIndexType; if (type.target) { - members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false); - callSignatures = instantiateList(getSignaturesOfType(type.target, 0), type.mapper, instantiateSignature); - constructSignatures = instantiateList(getSignaturesOfType(type.target, 1), type.mapper, instantiateSignature); - stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0), type.mapper); - numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1), type.mapper); + var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false); + var callSignatures = instantiateList(getSignaturesOfType(type.target, 0), type.mapper, instantiateSignature); + var constructSignatures = instantiateList(getSignaturesOfType(type.target, 1), type.mapper, instantiateSignature); + var stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0), type.mapper); + var numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1), type.mapper); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else if (symbol.flags & 2048) { - members = symbol.members; - callSignatures = getSignaturesOfSymbol(members["__call"]); - constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0); - numberIndexType = getIndexTypeOfSymbol(symbol, 1); + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else { - members = emptySymbols; - callSignatures = emptyArray; - constructSignatures = emptyArray; + var members = emptySymbols; + var constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 | 8192)) { - callSignatures = getSignaturesOfSymbol(symbol); - } if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); @@ -14253,10 +14594,12 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); } } - stringIndexType = undefined; - numberIndexType = (symbol.flags & 384) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + setObjectTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexType); + if (symbol.flags & (16 | 8192)) { + type.callSignatures = getSignaturesOfSymbol(symbol); + } } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -14346,12 +14689,14 @@ var ts; function createUnionOrIntersectionProperty(containingType, name) { var types = containingType.types; var props; + var commonFlags = (containingType.flags & 32768) ? 536870912 : 0; for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { var current = types_2[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (prop && !(getDeclarationFlagsFromSymbol(prop) & (16 | 32))) { + commonFlags &= prop.flags; if (!props) { props = [prop]; } @@ -14379,7 +14724,10 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 | 67108864 | 268435456, name); + var result = createSymbol(4 | + 67108864 | + 268435456 | + commonFlags, name); result.containingType = containingType; result.declarations = declarations; result.type = containingType.flags & 16384 ? getUnionType(propTypes) : getIntersectionType(propTypes); @@ -14429,22 +14777,6 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfStructuredType(getApparentType(type), kind); } - function typeHasConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & (80896 | 16384)) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.constructSignatures.length > 0; - } - return false; - } - function typeHasCallOrConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & 130048) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.callSignatures.length > 0 || resolved.constructSignatures.length > 0; - } - return false; - } function getIndexTypeOfStructuredType(type, kind) { if (type.flags & 130048) { var resolved = resolveStructuredTypeMembers(type); @@ -14486,6 +14818,23 @@ var ts; } return false; } + function createTypePredicateFromTypePredicateNode(node) { + if (node.parameterName.kind === 69) { + var parameterName = node.parameterName; + return { + kind: 1, + parameterName: parameterName ? parameterName.text : undefined, + parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, + type: getTypeFromTypeNode(node.type) + }; + } + else { + return { + kind: 0, + type: getTypeFromTypeNode(node.type) + }; + } + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -14499,8 +14848,13 @@ var ts; var minArgumentCount = -1; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 9) { + var paramSymbol = param.symbol; + if (paramSymbol && !!(paramSymbol.flags & 4) && !ts.isBindingPattern(param.name)) { + var resolvedSymbol = resolveName(param, paramSymbol.name, 107455, undefined, undefined); + paramSymbol = resolvedSymbol; + } + parameters.push(paramSymbol); + if (param.type && param.type.kind === 162) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -14516,20 +14870,11 @@ var ts; minArgumentCount = declaration.parameters.length; } var returnType; - var typePredicate; if (classType) { returnType = classType; } else if (declaration.type) { returnType = getTypeFromTypeNode(declaration.type); - if (declaration.type.kind === 150) { - var typePredicateNode = declaration.type; - typePredicate = { - parameterName: typePredicateNode.parameterName ? typePredicateNode.parameterName.text : undefined, - parameterIndex: typePredicateNode.parameterName ? getTypePredicateParameterIndex(declaration.parameters, typePredicateNode.parameterName) : undefined, - type: getTypeFromTypeNode(typePredicateNode.type) - }; - } } else { if (declaration.kind === 145 && !ts.hasDynamicName(declaration)) { @@ -14540,7 +14885,7 @@ var ts; returnType = anyType; } } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); } return links.resolvedSignature; } @@ -14553,7 +14898,7 @@ var ts; switch (node.kind) { case 152: case 153: - case 213: + case 215: case 143: case 142: case 144: @@ -14562,8 +14907,8 @@ var ts; case 149: case 145: case 146: - case 173: - case 174: + case 175: + case 176: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -14679,17 +15024,38 @@ var ts; ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + function getConstraintDeclaration(type) { + return ts.getDeclarationOfKind(type.symbol, 137).constraint; + } + function hasConstraintReferenceTo(type, target) { + var checked; + while (type && type.flags & 512 && !ts.contains(checked, type)) { + if (type === target) { + return true; + } + (checked || (checked = [])).push(type); + var constraintDeclaration = getConstraintDeclaration(type); + type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); + } + return false; + } + function getConstraintOfTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 137).constraint); + var constraintDeclaration = getConstraintDeclaration(typeParameter); + var constraint = getTypeFromTypeNode(constraintDeclaration); + if (hasConstraintReferenceTo(constraint, typeParameter)) { + error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + constraint = unknownType; + } + typeParameter.constraint = constraint; } } - return type.constraint === noConstraintType ? undefined : type.constraint; + return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137).parent); @@ -14733,40 +15099,6 @@ var ts; } return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 137; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 151 && n.typeName.kind === 69) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); - if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent === typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); var typeParameters = type.localTypeParameters; @@ -14803,9 +15135,6 @@ var ts; return type; } function getTypeFromNonGenericTypeReference(node, symbol) { - if (symbol.flags & 262144 && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - return unknownType; - } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -14841,9 +15170,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 214: - case 215: + case 216: case 217: + case 219: return declaration; } } @@ -14875,10 +15204,6 @@ var ts; if (arity === void 0) { arity = 0; } return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); } - function tryGetGlobalType(name, arity) { - if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalSymbol(name, 793056, undefined), arity); - } function getExportedTypeFromNamespace(namespace, name) { var namespaceSymbol = getGlobalSymbol(namespace, 1536, undefined); var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793056); @@ -14979,7 +15304,7 @@ var ts; } function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { - return emptyObjectType; + return emptyUnionType; } var typeSet = []; addTypesToSet(typeSet, types, 16384); @@ -15045,8 +15370,7 @@ var ts; } return links.resolvedType; } - function getStringLiteralType(node) { - var text = node.text; + function getStringLiteralTypeForText(text) { if (ts.hasProperty(stringLiteralTypes, text)) { return stringLiteralTypes[text]; } @@ -15054,17 +15378,17 @@ var ts; type.text = text; return type; } - function getTypeFromStringLiteral(node) { + function getTypeFromStringLiteralTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); + links.resolvedType = getStringLiteralTypeForText(node.text); } return links.resolvedType; } function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 215)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 217)) { if (!(container.flags & 64) && (container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -15080,6 +15404,22 @@ var ts; } return links.resolvedType; } + function getPredicateType(node) { + return createPredicateType(getSymbolOfNode(node), createTypePredicateFromTypePredicateNode(node)); + } + function createPredicateType(symbol, predicate) { + var type = createType(8 | 134217728); + type.symbol = symbol; + type.predicate = predicate; + return type; + } + function getTypeFromPredicateTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getPredicateType(node); + } + return links.resolvedType; + } function getTypeFromTypeNode(node) { switch (node.kind) { case 117: @@ -15094,15 +15434,15 @@ var ts; return esSymbolType; case 103: return voidType; - case 97: + case 161: return getTypeFromThisTypeNode(node); - case 9: - return getTypeFromStringLiteral(node); + case 162: + return getTypeFromStringLiteralTypeNode(node); case 151: return getTypeFromTypeReference(node); case 150: - return booleanType; - case 188: + return getTypeFromPredicateTypeNode(node); + case 190: return getTypeFromTypeReference(node); case 154: return getTypeFromTypeQueryNode(node); @@ -15180,18 +15520,22 @@ var ts; return t; }; } - function createInferenceMapper(context) { - var mapper = function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); + function getInferenceMapper(context) { + if (!context.mapper) { + var mapper = function (t) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + context.inferences[i].isFixed = true; + return getInferredType(context, i); + } } - } - return t; - }; - mapper.context = context; - return mapper; + return t; + }; + mapper.context = context; + context.mapper = mapper; + } + return context.mapper; } function identityMapper(type) { return type; @@ -15199,33 +15543,39 @@ var ts; function combineTypeMappers(mapper1, mapper2) { return function (t) { return instantiateType(mapper1(t), mapper2); }; } - function instantiateTypeParameter(typeParameter, mapper) { + function cloneTypeParameter(typeParameter) { var result = createType(512); result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); + result.target = typeParameter; + return result; + } + function cloneTypePredicate(predicate, mapper) { + if (ts.isIdentifierTypePredicate(predicate)) { + return { + kind: 1, + parameterName: predicate.parameterName, + parameterIndex: predicate.parameterIndex, + type: instantiateType(predicate.type, mapper) + }; } else { - result.target = typeParameter; - result.mapper = mapper; + return { + kind: 0, + type: instantiateType(predicate.type, mapper) + }; } - return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) { + var tp = freshTypeParameters_1[_i]; + tp.mapper = mapper; + } } - if (signature.typePredicate) { - freshTypePredicate = { - parameterName: signature.typePredicate.parameterName, - parameterIndex: signature.typePredicate.parameterIndex, - type: instantiateType(signature.typePredicate.type, mapper) - }; - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); result.target = signature; result.mapper = mapper; return result; @@ -15283,31 +15633,35 @@ var ts; if (type.flags & 32768) { return getIntersectionType(instantiateList(type.types, mapper, instantiateType)); } + if (type.flags & 134217728) { + var predicate = type.predicate; + return createPredicateType(type.symbol, cloneTypePredicate(predicate, mapper)); + } } return type; } function isContextSensitive(node) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 173: - case 174: + case 175: + case 176: return isContextSensitiveFunctionLikeDeclaration(node); - case 165: + case 167: return ts.forEach(node.properties, isContextSensitive); - case 164: + case 166: return ts.forEach(node.elements, isContextSensitive); - case 182: + case 184: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 181: + case 183: return node.operatorToken.kind === 52 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 245: + case 247: return isContextSensitive(node.initializer); case 143: case 142: return isContextSensitiveFunctionLikeDeclaration(node); - case 172: + case 174: return isContextSensitive(node.expression); } return false; @@ -15332,7 +15686,7 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined); } - function compareTypes(source, target) { + function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; } function isTypeSubtypeOf(source, target) { @@ -15347,10 +15701,73 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + var sourceMax = getNumNonRestParameters(source); + var targetMax = getNumNonRestParameters(target); + var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + if (!related) { + return false; + } + } + if (!ignoreReturnTypes) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return true; + } + var sourceReturnType = getReturnTypeOfSignature(source); + if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { + if (!(sourceReturnType.flags & 134217728)) { + return false; + } + } + return isTypeAssignableTo(sourceReturnType, targetReturnType); + } + return true; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + var erasedSource = getErasedSignature(implementation); + var erasedTarget = getErasedSignature(overload); + var sourceReturnType = getReturnTypeOfSignature(erasedSource); + var targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType + || checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, undefined) + || checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, undefined)) { + return isSignatureAssignableTo(erasedSource, erasedTarget, true); + } + return false; + } + function getNumNonRestParameters(signature) { + var numParams = signature.parameters.length; + return signature.hasRestParameter ? + numParams - 1 : + numParams; + } + function getNumParametersToCheckForSignatureRelatability(source, sourceNonRestParamCount, target, targetNonRestParamCount) { + if (source.hasRestParameter === target.hasRestParameter) { + if (source.hasRestParameter) { + return Math.max(sourceNonRestParamCount, targetNonRestParamCount) + 1; + } + else { + return Math.min(sourceNonRestParamCount, targetNonRestParamCount); + } + } + else { + return source.hasRestParameter ? + targetNonRestParamCount : + sourceNonRestParamCount; + } } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; @@ -15405,6 +15822,11 @@ var ts; return -1; if (source.flags & 128 && target === numberType) return -1; + if (source.flags & 128 && target.flags & 128) { + if (result = enumRelatedTo(source, target)) { + return result; + } + } if (source.flags & 256 && target === stringType) return -1; if (relation === assignableRelation) { @@ -15413,6 +15835,36 @@ var ts; if (source === numberType && target.flags & 128) return -1; } + if (source.flags & 8 && target.flags & 8) { + if (source.flags & 134217728 && target.flags & 134217728) { + var sourcePredicate = source; + var targetPredicate = target; + if (sourcePredicate.predicate.kind !== targetPredicate.predicate.kind) { + if (reportErrors) { + reportError(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0; + } + if (sourcePredicate.predicate.kind === 1) { + var sourceIdentifierPredicate = sourcePredicate.predicate; + var targetIdentifierPredicate = targetPredicate.predicate; + if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + if (reportErrors) { + reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0; + } + } + var related = isRelatedTo(sourcePredicate.predicate.type, targetPredicate.predicate.type, reportErrors, headMessage); + if (related === 0 && reportErrors) { + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return related; + } + return -1; + } if (source.flags & 1048576) { if (hasExcessProperties(source, target, reportErrors)) { if (reportErrors) { @@ -15488,9 +15940,6 @@ var ts; } return objectTypeRelatedTo(source, source, target, false); } - if (source.flags & 512 && target.flags & 512) { - return typeParameterIdenticalTo(source, target); - } if (source.flags & 16384 && target.flags & 16384 || source.flags & 32768 && target.flags & 32768) { if (result = eachTypeRelatedToSomeType(source, target)) { @@ -15599,8 +16048,9 @@ var ts; if (sources.length !== targets.length && relation === identityRelation) { return 0; } + var length = sources.length <= targets.length ? sources.length : targets.length; var result = -1; - for (var i = 0; i < targets.length; i++) { + for (var i = 0; i < length; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; @@ -15609,23 +16059,17 @@ var ts; } return result; } - function typeParameterIdenticalTo(source, target) { - if (source.constraint === target.constraint) { - return -1; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0; - } - return isIdenticalTo(source.constraint, target.constraint); - } - function objectTypeRelatedTo(apparentSource, originalSource, target, reportErrors) { + function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0; } - var id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id; + var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (!elaborateErrors || (related === 3)) { + if (elaborateErrors && related === 2) { + relation[id] = 3; + } + else { return related === 1 ? -1 : 0; } } @@ -15646,13 +16090,13 @@ var ts; maybeStack = []; expandingFlags = 0; } - sourceStack[depth] = apparentSource; + sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; maybeStack[depth][id] = 1; depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2; @@ -15661,15 +16105,15 @@ var ts; result = 1; } else { - result = propertiesRelatedTo(apparentSource, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 0, reportErrors); + result &= signaturesRelatedTo(source, target, 0, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 1, reportErrors); + result &= signaturesRelatedTo(source, target, 1, reportErrors); if (result) { - result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= stringIndexTypesRelatedTo(source, originalSource, target, reportErrors); if (result) { - result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= numberIndexTypesRelatedTo(source, originalSource, target, reportErrors); } } } @@ -15791,61 +16235,38 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + if (kind === 1 && sourceSignatures.length && targetSignatures.length && + isAbstractConstructorType(source) && !isAbstractConstructorType(target)) { + if (reportErrors) { + reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0; + } var result = -1; var saveErrorInfo = errorInfo; - if (kind === 1) { - var sourceSig = sourceSignatures[0]; - var targetSig = targetSignatures[0]; - result &= abstractSignatureRelatedTo(source, sourceSig, target, targetSig); - if (result !== -1) { - return result; - } - } outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; if (!t.hasStringLiterals || target.flags & 262144) { - var localErrors = reportErrors; - var checkedAbstractAssignability = false; + var shouldElaborateErrors = reportErrors; for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { var s = sourceSignatures_1[_a]; if (!s.hasStringLiterals || source.flags & 262144) { - var related = signatureRelatedTo(s, t, localErrors); + var related = signatureRelatedTo(s, t, shouldElaborateErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } - localErrors = false; + shouldElaborateErrors = false; } } + if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, undefined, undefined, kind)); + } return 0; } } return result; - function abstractSignatureRelatedTo(source, sourceSig, target, targetSig) { - if (sourceSig && targetSig) { - var sourceDecl = source.symbol && getClassLikeDeclarationOfSymbol(source.symbol); - var targetDecl = target.symbol && getClassLikeDeclarationOfSymbol(target.symbol); - if (!sourceDecl) { - return -1; - } - var sourceErasedSignature = getErasedSignature(sourceSig); - var targetErasedSignature = getErasedSignature(targetSig); - var sourceReturnType = sourceErasedSignature && getReturnTypeOfSignature(sourceErasedSignature); - var targetReturnType = targetErasedSignature && getReturnTypeOfSignature(targetErasedSignature); - var sourceReturnDecl = sourceReturnType && sourceReturnType.symbol && getClassLikeDeclarationOfSymbol(sourceReturnType.symbol); - var targetReturnDecl = targetReturnType && targetReturnType.symbol && getClassLikeDeclarationOfSymbol(targetReturnType.symbol); - var sourceIsAbstract = sourceReturnDecl && sourceReturnDecl.flags & 128; - var targetIsAbstract = targetReturnDecl && targetReturnDecl.flags & 128; - if (sourceIsAbstract && !(targetIsAbstract && targetDecl)) { - if (reportErrors) { - reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); - } - return 0; - } - } - return -1; - } } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -15893,37 +16314,19 @@ var ts; } result &= related; } - if (source.typePredicate && target.typePredicate) { - var hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex; - var hasDifferentTypes; - if (hasDifferentParameterIndex || - (hasDifferentTypes = !isTypeIdenticalTo(source.typePredicate.type, target.typePredicate.type))) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return result; + } + var sourceReturnType = getReturnTypeOfSignature(source); + if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { + if (!(sourceReturnType.flags & 134217728)) { if (reportErrors) { - var sourceParamText = source.typePredicate.parameterName; - var targetParamText = target.typePredicate.parameterName; - var sourceTypeText = typeToString(source.typePredicate.type); - var targetTypeText = typeToString(target.typePredicate.type); - if (hasDifferentParameterIndex) { - reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceParamText, targetParamText); - } - else if (hasDifferentTypes) { - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, sourceTypeText, targetTypeText); - } - reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, sourceParamText + " is " + sourceTypeText, targetParamText + " is " + targetTypeText); + reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); } return 0; } } - else if (!source.typePredicate && target.typePredicate) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) - return result; - var sourceReturnType = getReturnTypeOfSignature(source); return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); } function signaturesIdenticalTo(source, target, kind) { @@ -15933,8 +16336,8 @@ var ts; return 0; } var result = -1; - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - var related = compareSignatures(sourceSignatures[i], targetSignatures[i], false, false, isRelatedTo); + for (var i = 0, len = sourceSignatures.length; i < len; i++) { + var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], false, false, isRelatedTo); if (!related) { return 0; } @@ -16014,6 +16417,37 @@ var ts; } return 0; } + function enumRelatedTo(source, target) { + if (source.symbol.name !== target.symbol.name || + source.symbol.flags & 128 || + target.symbol.flags & 128) { + return 0; + } + var targetEnumType = getTypeOfSymbol(target.symbol); + for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { + var property = _a[_i]; + if (property.flags & 8) { + var targetProperty = getPropertyOfType(targetEnumType, property.name); + if (!targetProperty || !(targetProperty.flags & 8)) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); + return 0; + } + } + } + return -1; + } + } + function isAbstractConstructorType(type) { + if (type.flags & 65536) { + var symbol = type.symbol; + if (symbol && symbol.flags & 32) { + var declaration = getClassLikeDeclarationOfSymbol(symbol); + if (declaration && declaration.flags & 128) { + return true; + } + } + } + return false; } function isDeeplyNestedGeneric(type, stack, depth) { if (type.flags & (4096 | 131072) && depth >= 5) { @@ -16031,7 +16465,7 @@ var ts; return false; } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0; + return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0; } function compareProperties(sourceProp, targetProp, compareTypes) { if (sourceProp === targetProp) { @@ -16066,31 +16500,19 @@ var ts; } return false; } - function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + function compareSignaturesIdentical(source, target, partialMatch, ignoreReturnTypes, compareTypes) { if (source === target) { return -1; } if (!(isMatchingSignature(source, target, partialMatch))) { return 0; } - var result = -1; - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return 0; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); - if (!related) { - return 0; - } - result &= related; - } - } - else if (source.typeParameters || target.typeParameters) { + if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { return 0; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1; var targetLen = target.parameters.length; for (var i = 0; i < targetLen; i++) { var s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); @@ -16207,10 +16629,13 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 6291456) { + if (type.flags & 140509184) { if (type.flags & (32 | 64)) { return anyType; } + if (type.flags & 134217728) { + return booleanType; + } if (type.flags & 524288) { return getWidenedTypeOfObjectLiteral(type); } @@ -16274,13 +16699,13 @@ var ts; ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 213: + case 215: case 143: case 142: case 145: case 146: - case 173: - case 174: + case 175: + case 176: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -16326,13 +16751,7 @@ var ts; } } function createInferenceContext(typeParameters, inferUnionTypes) { - var inferences = []; - for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { - var unused = typeParameters_1[_i]; - inferences.push({ - primary: undefined, secondary: undefined, isFixed: false - }); - } + var inferences = ts.map(typeParameters, createTypeInferencesObject); return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -16340,6 +16759,13 @@ var ts; inferredTypes: new Array(typeParameters.length) }; } + function createTypeInferencesObject() { + return { + primary: undefined, + secondary: undefined, + isFixed: false + }; + } function inferTypes(context, source, target) { var sourceStack; var targetStack; @@ -16355,6 +16781,21 @@ var ts; return false; } function inferFromTypes(source, target) { + if (source.flags & 16384 && target.flags & 16384 || + source.flags & 32768 && target.flags & 32768) { + var matchingTypes; + for (var _i = 0, _a = target.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (typeIdenticalToSomeType(t, source.types)) { + (matchingTypes || (matchingTypes = [])).push(t); + inferFromTypes(t, t); + } + } + if (matchingTypes) { + source = removeTypesFromUnionOrIntersection(source, matchingTypes); + target = removeTypesFromUnionOrIntersection(target, matchingTypes); + } + } if (target.flags & 512) { if (source.flags & 8388608) { return; @@ -16383,6 +16824,11 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } + else if (source.flags & 134217728 && target.flags & 134217728) { + if (source.predicate.kind === target.predicate.kind) { + inferFromTypes(source.predicate.type, target.predicate.type); + } + } else if (source.flags & 8192 && target.flags & 8192 && source.elementTypes.length === target.elementTypes.length) { var sourceTypes = source.elementTypes; var targetTypes = target.elementTypes; @@ -16394,8 +16840,8 @@ var ts; var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { - var t = targetTypes_2[_i]; + for (var _b = 0, targetTypes_2 = targetTypes; _b < targetTypes_2.length; _b++) { + var t = targetTypes_2[_b]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -16412,15 +16858,16 @@ var ts; } else if (source.flags & 49152) { var sourceTypes = source.types; - for (var _a = 0, sourceTypes_3 = sourceTypes; _a < sourceTypes_3.length; _a++) { - var sourceType = sourceTypes_3[_a]; + for (var _c = 0, sourceTypes_3 = sourceTypes; _c < sourceTypes_3.length; _c++) { + var sourceType = sourceTypes_3[_c]; inferFromTypes(sourceType, target); } } else { source = getApparentType(source); - if (source.flags & 80896 && (target.flags & (4096 | 8192) || - (target.flags & 65536) && target.symbol && target.symbol.flags & (8192 | 2048 | 32))) { + if (source.flags & 80896 && (target.flags & 4096 && target.typeArguments || + target.flags & 8192 || + target.flags & 65536 && target.symbol && target.symbol.flags & (8192 | 2048 | 32))) { if (isInProcess(source, target)) { return; } @@ -16466,14 +16913,7 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromTypes); - if (source.typePredicate && target.typePredicate) { - if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); - } - } - else { - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } function inferFromIndexTypes(source, target, sourceKind, targetKind) { var targetIndexType = getIndexTypeOfType(target, targetKind); @@ -16485,6 +16925,25 @@ var ts; } } } + function typeIdenticalToSomeType(type, types) { + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; + if (isTypeIdenticalTo(t, type)) { + return true; + } + } + return false; + } + function removeTypesFromUnionOrIntersection(type, typesToRemove) { + var reducedTypes = []; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (!typeIdenticalToSomeType(t, typesToRemove)) { + reducedTypes.push(t); + } + } + return type.flags & 16384 ? getUnionType(reducedTypes, true) : getIntersectionType(reducedTypes); + } function getInferenceCandidates(context, index) { var inferences = context.inferences[index]; return inferences.primary || inferences.secondary || emptyArray; @@ -16503,14 +16962,19 @@ var ts; inferredType = emptyObjectType; inferenceSucceeded = true; } + context.inferredTypes[index] = inferredType; if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + if (constraint) { + var instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); + if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + context.inferredTypes[index] = inferredType = instantiatedConstraint; + } + } } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { context.failedTypeParameterIndex = index; } - context.inferredTypes[index] = inferredType; } return inferredType; } @@ -16520,9 +16984,6 @@ var ts; } return context.inferredTypes; } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { @@ -16545,21 +17006,6 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384) { - var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - return getUnionType(emptyArray); - } - return type; - } function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } @@ -16577,10 +17023,7 @@ var ts; return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 56 && node.operatorToken.kind <= 68) { - var n = node.left; - while (n.kind === 172) { - n = n.expression; - } + var n = skipParenthesizedNodes(node.left); if (n.kind === 69 && getResolvedSymbol(n) === symbol) { return true; } @@ -16595,55 +17038,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 181: + case 183: return isAssignedInBinaryExpression(node); - case 211: - case 163: - return isAssignedInVariableDeclaration(node); - case 161: - case 162: - case 164: + case 213: case 165: + return isAssignedInVariableDeclaration(node); + case 163: + case 164: case 166: case 167: case 168: case 169: + case 170: case 171: - case 189: - case 172: - case 179: - case 175: - case 178: - case 176: + case 173: + case 191: + case 174: + case 181: case 177: case 180: - case 184: + case 178: + case 179: case 182: - case 185: - case 192: - case 193: + case 186: + case 184: + case 187: + case 194: case 195: - case 196: case 197: case 198: case 199: case 200: case 201: - case 204: - case 205: + case 202: + case 203: case 206: - case 241: - case 242: case 207: case 208: - case 209: + case 243: case 244: - case 233: - case 234: - case 238: - case 239: + case 209: + case 210: + case 211: + case 246: case 235: + case 236: case 240: + case 241: + case 237: + case 242: return ts.forEachChild(node, isAssignedIn); } return false; @@ -16653,53 +17096,66 @@ var ts; var type = getTypeOfSymbol(symbol); if (node && symbol.flags & 3) { if (isTypeAny(type) || type.flags & (80896 | 16384 | 512)) { + var declaration = ts.getDeclarationOfKind(symbol, 213); + var top_1 = declaration && getDeclarationContainer(declaration); + var originalType = type; + var nodeStack = []; loop: while (node.parent) { var child = node; node = node.parent; - var narrowedType = type; switch (node.kind) { - case 196: - if (child !== node.expression) { - narrowedType = narrowType(type, node.expression, child === node.thenStatement); - } + case 198: + case 184: + case 183: + nodeStack.push({ node: node, child: child }); break; - case 182: - if (child !== node.condition) { - narrowedType = narrowType(type, node.condition, child === node.whenTrue); - } - break; - case 181: - if (child === node.right) { - if (node.operatorToken.kind === 51) { - narrowedType = narrowType(type, node.left, true); - } - else if (node.operatorToken.kind === 52) { - narrowedType = narrowType(type, node.left, false); - } - } - break; - case 248: - case 218: - case 213: - case 143: - case 142: - case 145: - case 146: - case 144: + case 250: + case 220: break loop; } - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; + if (node === top_1) { + break; } } + var nodes; + while (nodes = nodeStack.pop()) { + var node_1 = nodes.node, child = nodes.child; + switch (node_1.kind) { + case 198: + if (child !== node_1.expression) { + type = narrowType(type, node_1.expression, child === node_1.thenStatement); + } + break; + case 184: + if (child !== node_1.condition) { + type = narrowType(type, node_1.condition, child === node_1.whenTrue); + } + break; + case 183: + if (child === node_1.right) { + if (node_1.operatorToken.kind === 51) { + type = narrowType(type, node_1.left, true); + } + else if (node_1.operatorToken.kind === 52) { + type = narrowType(type, node_1.left, false); + } + } + break; + default: + ts.Debug.fail("Unreachable!"); + } + if (type !== originalType && isVariableAssignedWithin(symbol, node_1)) { + type = originalType; + } + } + if (type === emptyUnionType) { + type = originalType; + } } } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 176 || expr.right.kind !== 9) { + if (expr.left.kind !== 178 || expr.right.kind !== 9) { return type; } var left = expr.left; @@ -16707,24 +17163,30 @@ var ts; if (left.expression.kind !== 69 || getResolvedSymbol(left.expression) !== symbol) { return type; } - var typeInfo = primitiveTypeInfo[right.text]; if (expr.operatorToken.kind === 33) { assumeTrue = !assumeTrue; } - if (assumeTrue) { - if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 16777216, true, false); - } - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - return removeTypesFromUnionType(type, typeInfo.flags, false, false); + var typeInfo = primitiveTypeInfo[right.text]; + if (typeInfo && typeInfo.type === undefinedType) { + return type; + } + if (!!(type.flags & 1) && typeInfo && assumeTrue) { + return typeInfo.type; + } + var flags; + if (typeInfo) { + flags = typeInfo.flags; } else { - if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true, false); - } - return type; + assumeTrue = !assumeTrue; + flags = 132 | 258 | 16777216 | 8; + } + if (!(type.flags & 16384)) { + return filterUnion(type) ? type : emptyUnionType; + } + return getUnionType(ts.filter(type.types, filterUnion), true); + function filterUnion(type) { + return assumeTrue === !!(type.flags & flags); } } function narrowTypeByAnd(type, expr, assumeTrue) { @@ -16734,7 +17196,7 @@ var ts; else { return getUnionType([ narrowType(type, expr.left, false), - narrowType(narrowType(type, expr.left, true), expr.right, false) + narrowType(type, expr.right, false) ]); } } @@ -16742,7 +17204,7 @@ var ts; if (assumeTrue) { return getUnionType([ narrowType(type, expr.left, true), - narrowType(narrowType(type, expr.left, false), expr.right, true) + narrowType(type, expr.right, true) ]); } else { @@ -16778,17 +17240,17 @@ var ts; } } if (targetType) { - if (!assumeTrue) { - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); - } - return type; - } - return getNarrowedType(type, targetType); + return getNarrowedType(type, targetType, assumeTrue); } return type; } - function getNarrowedType(originalType, narrowedTypeCandidate) { + function getNarrowedType(originalType, narrowedTypeCandidate, assumeTrue) { + if (!assumeTrue) { + if (originalType.flags & 16384) { + return getUnionType(ts.filter(originalType.types, function (t) { return !isTypeSubtypeOf(t, narrowedTypeCandidate); })); + } + return originalType; + } if (originalType.flags & 16384) { var assignableConstituents = ts.filter(originalType.types, function (t) { return isTypeAssignableTo(t, narrowedTypeCandidate); }); if (assignableConstituents.length) { @@ -16805,26 +17267,60 @@ var ts; return type; } var signature = getResolvedSignature(expr); - if (signature.typePredicate && - expr.arguments[signature.typePredicate.parameterIndex] && - getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { - if (!assumeTrue) { - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, signature.typePredicate.type); })); - } - return type; + var predicateType = getReturnTypeOfSignature(signature); + if (!predicateType || !(predicateType.flags & 134217728)) { + return type; + } + var predicate = predicateType.predicate; + if (ts.isIdentifierTypePredicate(predicate)) { + var callExpression = expr; + if (callExpression.arguments[predicate.parameterIndex] && + getSymbolAtTypePredicatePosition(callExpression.arguments[predicate.parameterIndex]) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); } - return getNarrowedType(type, signature.typePredicate.type); + } + else { + var expression = skipParenthesizedNodes(expr.expression); + return narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue); } return type; } + function narrowTypeByTypePredicateMember(type, expr, assumeTrue) { + if (type.flags & 1) { + return type; + } + var memberType = getTypeOfExpression(expr); + if (!(memberType.flags & 134217728)) { + return type; + } + return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); + } + function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { + if (expression.kind === 169 || expression.kind === 168) { + var accessExpression = expression; + var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); + if (possibleIdentifier.kind === 69 && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); + } + } + return type; + } + function getSymbolAtTypePredicatePosition(expr) { + expr = skipParenthesizedNodes(expr); + switch (expr.kind) { + case 69: + case 168: + case 135: + return getSymbolOfEntityNameOrPropertyAccessExpression(expr); + } + } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 168: + case 170: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 172: + case 174: return narrowType(type, expr.expression, assumeTrue); - case 181: + case 183: var operator = expr.operatorToken.kind; if (operator === 32 || operator === 33) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -16839,20 +17335,29 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 179: + case 181: if (expr.operator === 49) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 169: + case 168: + return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } + function skipParenthesizedNodes(expression) { + while (expression.kind === 174) { + expression = expression.expression; + } + return expression; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 174) { + if (container.kind === 176) { if (languageVersion < 2) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -16883,7 +17388,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 244) { + symbol.valueDeclaration.parent.kind === 246) { return; } var container; @@ -16892,11 +17397,11 @@ var ts; } else { container = symbol.valueDeclaration; - while (container.kind !== 212) { + while (container.kind !== 214) { container = container.parent; } container = container.parent; - if (container.kind === 193) { + if (container.kind === 195) { container = container.parent; } } @@ -16926,15 +17431,15 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 174) { + if (container.kind === 176) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 218: + case 220: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 217: + case 219: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; case 144: @@ -16959,6 +17464,18 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } + if (ts.isInJavaScriptFile(node) && container.kind === 175) { + if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { + var className = container.parent + .left + .expression + .expression; + var classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && (classSymbol.flags & 16)) { + return getInferredClassType(classSymbol); + } + } + } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { @@ -16970,50 +17487,64 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 168 && node.parent.expression === node; - var classDeclaration = ts.getContainingClass(node); - var classType = classDeclaration && getDeclaredTypeOfSymbol(getSymbolOfNode(classDeclaration)); - var baseClassType = classType && getBaseTypes(classType)[0]; + var isCallExpression = node.parent.kind === 170 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 174) { + while (container && container.kind === 176) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } } var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; - if (canUseSuperExpression) { - if ((container.flags & 64) || isCallExpression) { - nodeCheckFlag = 512; - } - else { - nodeCheckFlag = 256; - } - getNodeLinks(node).flags |= nodeCheckFlag; - if (needToCaptureLexicalThis) { - captureLexicalThis(node.parent, container); - } - } - if (!baseClassType) { - if (!classDeclaration || !ts.getClassExtendsHeritageClauseElement(classDeclaration)) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - } - return unknownType; - } if (!canUseSuperExpression) { - if (container && container.kind === 136) { + var current = node; + while (current && current !== container && current.kind !== 136) { + current = current.parent; + } + if (current && current.kind === 136) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return unknownType; } + if ((container.flags & 64) || isCallExpression) { + nodeCheckFlag = 512; + } + else { + nodeCheckFlag = 256; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 167) { + if (languageVersion < 2) { + error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return unknownType; + } + else { + return anyType; + } + } + var classLikeDeclaration = container.parent; + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration)); + var baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + } + return unknownType; + } if (container.kind === 144 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -17029,7 +17560,7 @@ var ts; return container.kind === 144; } else { - if (container && ts.isClassLike(container.parent)) { + if (ts.isClassLike(container.parent) || container.parent.kind === 167) { if (container.flags & 64) { return container.kind === 143 || container.kind === 142 || @@ -17140,7 +17671,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 170) { + if (template.parent.kind === 172) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -17160,6 +17691,11 @@ var ts; } return type; } + else if (operator === 51 || operator === 24) { + if (node === binaryExpression.right) { + return getContextualType(binaryExpression); + } + } return undefined; } function applyToContextualType(type, mapper) { @@ -17169,8 +17705,8 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var current = types_7[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var current = types_8[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -17242,21 +17778,20 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForJsxExpression(expr) { - if (expr.parent.kind === 238) { - var attrib = expr.parent; - var attrsType = getJsxElementAttributesType(attrib.parent); + function getContextualTypeForJsxAttribute(attribute) { + var kind = attribute.kind; + var jsxElement = attribute.parent; + var attrsType = getJsxElementAttributesType(jsxElement); + if (attribute.kind === 240) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } - else { - return getTypeOfPropertyOfType(attrsType, attrib.name.text); - } + return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - if (expr.kind === 239) { - return getJsxElementAttributesType(expr.parent); + else if (attribute.kind === 241) { + return attrsType; } - return undefined; + ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } function getApparentTypeOfContextualType(node) { var type = getContextualType(node); @@ -17271,39 +17806,41 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 211: + case 213: case 138: case 141: case 140: - case 163: + case 165: return getContextualTypeForInitializerExpression(node); - case 174: - case 204: + case 176: + case 206: return getContextualTypeForReturnExpression(node); - case 184: + case 186: return getContextualTypeForYieldOperand(parent); - case 168: - case 169: - return getContextualTypeForArgument(parent, node); + case 170: case 171: - case 189: + return getContextualTypeForArgument(parent, node); + case 173: + case 191: return getTypeFromTypeNode(parent.type); - case 181: + case 183: return getContextualTypeForBinaryOperand(node); - case 245: + case 247: return getContextualTypeForObjectLiteralElement(parent); - case 164: + case 166: return getContextualTypeForElementExpression(node); - case 182: + case 184: return getContextualTypeForConditionalOperand(node); - case 190: - ts.Debug.assert(parent.parent.kind === 183); + case 192: + ts.Debug.assert(parent.parent.kind === 185); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 172: + case 174: + return getContextualType(parent); + case 242: return getContextualType(parent); case 240: - case 239: - return getContextualTypeForJsxExpression(parent); + case 241: + return getContextualTypeForJsxAttribute(parent); } return undefined; } @@ -17317,7 +17854,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 173 || node.kind === 174; + return node.kind === 175 || node.kind === 176; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -17337,14 +17874,14 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var current = types_8[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var current = types_9[_i]; var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { signatureList = [signature]; } - else if (!compareSignatures(signatureList[0], signature, false, true, compareTypes)) { + else if (!compareSignaturesIdentical(signatureList[0], signature, false, true, compareTypesIdentical)) { return undefined; } else { @@ -17365,13 +17902,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 181 && parent.operatorToken.kind === 56 && parent.left === node) { + if (parent.kind === 183 && parent.operatorToken.kind === 56 && parent.left === node) { return true; } - if (parent.kind === 245) { + if (parent.kind === 247) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 164) { + if (parent.kind === 166) { return isAssignmentTarget(parent); } return false; @@ -17381,8 +17918,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function hasDefaultValue(node) { - return (node.kind === 163 && !!node.initializer) || - (node.kind === 181 && node.operatorToken.kind === 56); + return (node.kind === 165 && !!node.initializer) || + (node.kind === 183 && node.operatorToken.kind === 56); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -17391,7 +17928,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 185) { + if (inDestructuringPattern && e.kind === 187) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); @@ -17403,7 +17940,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 185; + hasSpreadElement = hasSpreadElement || e.kind === 187; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -17414,7 +17951,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 162 || pattern.kind === 164)) { + if (pattern && (pattern.kind === 164 || pattern.kind === 166)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -17422,7 +17959,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 187) { + if (patternElement.kind !== 189) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -17468,31 +18005,31 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 161 || contextualType.pattern.kind === 165); + (contextualType.pattern.kind === 163 || contextualType.pattern.kind === 167); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 245 || - memberDecl.kind === 246 || + if (memberDecl.kind === 247 || + memberDecl.kind === 248 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 245) { + if (memberDecl.kind === 247) { type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 143) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 246); + ts.Debug.assert(memberDecl.kind === 248); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 245 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 246 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 247 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 248 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912; } @@ -17571,34 +18108,19 @@ var ts; checkJsxOpeningLikeElement(node); return jsxElementType || anyType; } - function tagNamesAreEquivalent(lhs, rhs) { - if (lhs.kind !== rhs.kind) { - return false; - } - if (lhs.kind === 69) { - return lhs.text === rhs.text; - } - return lhs.right.text === rhs.right.text && - tagNamesAreEquivalent(lhs.left, rhs.left); - } function checkJsxElement(node) { checkJsxOpeningLikeElement(node.openingElement); - if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { - error(node.closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNode(node.openingElement.tagName)); - } - else { - getJsxElementTagSymbol(node.closingElement); - } + getJsxElementTagSymbol(node.closingElement); for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 240: + case 242: checkJsxExpression(child); break; - case 233: + case 235: checkJsxElement(child); break; - case 234: + case 236: checkJsxSelfClosingElement(child); break; } @@ -17666,14 +18188,13 @@ var ts; } return type; } - function getJsxIntrinsicElementsType() { - if (!jsxIntrinsicElementsType) { - jsxIntrinsicElementsType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.IntrinsicElements) || unknownType; + function getJsxType(name) { + if (jsxTypes[name] === undefined) { + return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; } - return jsxIntrinsicElementsType; + return jsxTypes[name]; } function getJsxElementTagSymbol(node) { - var flags = 8; var links = getNodeLinks(node); if (!links.resolvedSymbol) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -17685,7 +18206,7 @@ var ts; } return links.resolvedSymbol; function lookupIntrinsicTag(node) { - var intrinsicElementsType = getJsxIntrinsicElementsType(); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.text); if (intrinsicProp) { @@ -17745,12 +18266,7 @@ var ts; return unknownType; } } - var returnType = getUnionType(signatures.map(getReturnTypeOfSignature)); - var elemClassType = getJsxGlobalElementClassType(); - if (elemClassType) { - checkTypeRelatedTo(returnType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); - } - return returnType; + return getUnionType(signatures.map(getReturnTypeOfSignature)); } function getJsxElementPropertiesName() { var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1536, undefined); @@ -17779,6 +18295,20 @@ var ts; var sym = getJsxElementTagSymbol(node); if (links.jsxFlags & 4) { var elemInstanceType = getJsxElementInstanceType(node); + var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + var elemClassType = getJsxGlobalElementClassType(); + if (elemClassType) { + checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + } if (isTypeAny(elemInstanceType)) { return links.resolvedJsxType = elemInstanceType; } @@ -17797,12 +18327,29 @@ var ts; else if (isTypeAny(attributesType) || (attributesType === unknownType)) { return links.resolvedJsxType = attributesType; } - else if (!(attributesType.flags & 80896)) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_must_be_an_object_type, typeToString(attributesType)); + else if (attributesType.flags & 16384) { + error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); return links.resolvedJsxType = anyType; } else { - return links.resolvedJsxType = attributesType; + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + if (typeParams) { + if (typeParams.length === 1) { + apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); + } + } + else { + apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); + } + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return links.resolvedJsxType = apparentAttributesType; } } } @@ -17830,7 +18377,7 @@ var ts; return jsxElementClassType; } function getJsxIntrinsicTagNames() { - var intrinsics = getJsxIntrinsicElementsType(); + var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; } function checkJsxPreconditions(errorNode) { @@ -17846,21 +18393,21 @@ var ts; function checkJsxOpeningLikeElement(node) { checkGrammarJsxElement(node); checkJsxPreconditions(node); - if (compilerOptions.jsx === 2) { - var reactSym = resolveName(node.tagName, "React", 107455, ts.Diagnostics.Cannot_find_name_0, "React"); - if (reactSym) { - getSymbolLinks(reactSym).referenced = true; - } + var reactRefErr = compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; + var reactSym = resolveName(node.tagName, reactNamespace, 107455, reactRefErr, reactNamespace); + if (reactSym) { + getSymbolLinks(reactSym).referenced = true; } var targetAttributesType = getJsxElementAttributesType(node); var nameTable = {}; var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 238) { + if (node.attributes[i].kind === 240) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 239); + ts.Debug.assert(node.attributes[i].kind === 241); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -17895,10 +18442,10 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95) { - var errorNode = node.kind === 166 ? + var errorNode = node.kind === 168 ? node.name : node.right; - if (getDeclarationKindFromSymbol(prop) !== 143) { + if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 143) { error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); return false; } @@ -17967,7 +18514,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 166 + var left = node.kind === 168 ? node.expression : node.left; var type = checkExpression(left); @@ -17982,7 +18529,7 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 169 && node.parent.expression === node) { + if (node.parent.kind === 171 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -18005,15 +18552,15 @@ var ts; return unknownType; } if (node.argumentExpression) { - var name_12 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name_12 !== undefined) { - var prop = getPropertyOfType(objectType, name_12); + var name_11 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (name_11 !== undefined) { + var prop = getPropertyOfType(objectType, name_11); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_12, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_11, symbolToString(objectType.symbol)); return unknownType; } } @@ -18041,7 +18588,7 @@ var ts; if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 167 || indexArgumentExpression.kind === 166) { + if (indexArgumentExpression.kind === 169 || indexArgumentExpression.kind === 168) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -18084,7 +18631,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 170) { + if (node.kind === 172) { checkExpression(node.template); } else if (node.kind !== 139) { @@ -18138,7 +18685,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 185) { + if (arg && arg.kind === 187) { return i; } } @@ -18150,11 +18697,11 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 170) { + if (node.kind === 172) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 183) { + if (tagExpression.template.kind === 185) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -18174,7 +18721,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 169); + ts.Debug.assert(callExpression.kind === 171); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -18215,7 +18762,7 @@ var ts; } function inferTypeArguments(node, signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var inferenceMapper = createInferenceMapper(context); + var inferenceMapper = getInferenceMapper(context); for (var i = 0; i < typeParameters.length; i++) { if (!context.inferences[i].isFixed) { context.inferredTypes[i] = undefined; @@ -18227,7 +18774,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 187) { + if (arg === undefined || arg.kind !== 189) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -18248,13 +18795,11 @@ var ts; } getInferredTypes(context); } - function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors, headMessage) { + function checkTypeArguments(signature, typeArgumentNodes, typeArgumentTypes, reportErrors, headMessage) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; + var mapper; for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -18264,7 +18809,11 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); typeArgumentHeadMessage = headMessage; } - typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, typeArgumentHeadMessage, errorInfo); + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + var typeArgument = typeArgumentTypes[i]; + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo); } } } @@ -18274,12 +18823,12 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 187) { + if (arg === undefined || arg.kind !== 189) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { argType = arg.kind === 9 && !reportErrors - ? getStringLiteralType(arg) + ? getStringLiteralTypeForText(arg.text) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); } var errorNode = reportErrors ? getEffectiveArgumentErrorNode(node, i, arg) : undefined; @@ -18293,10 +18842,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 170) { + if (node.kind === 172) { var template = node.template; args = [undefined]; - if (template.kind === 183) { + if (template.kind === 185) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -18313,8 +18862,8 @@ var ts; function getEffectiveArgumentCount(node, args, signature) { if (node.kind === 139) { switch (node.parent.kind) { - case 214: - case 186: + case 216: + case 188: return 1; case 141: return 2; @@ -18334,7 +18883,7 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } @@ -18355,7 +18904,7 @@ var ts; return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } @@ -18374,7 +18923,7 @@ var ts; case 69: case 8: case 9: - return getStringLiteralType(element.name); + return getStringLiteralTypeForText(element.name.text); case 136: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216)) { @@ -18392,7 +18941,7 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 214) { + if (node.kind === 216) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } @@ -18429,14 +18978,14 @@ var ts; if (node.kind === 139) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 170) { + else if (argIndex === 0 && node.kind === 172) { return globalTemplateStringsArrayType; } return undefined; } function getEffectiveArgument(node, args, argIndex) { if (node.kind === 139 || - (argIndex === 0 && node.kind === 170)) { + (argIndex === 0 && node.kind === 172)) { return undefined; } return args[argIndex]; @@ -18445,7 +18994,7 @@ var ts; if (node.kind === 139) { return node.expression; } - else if (argIndex === 0 && node.kind === 170) { + else if (argIndex === 0 && node.kind === 172) { return node.template; } else { @@ -18453,7 +19002,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 170; + var isTaggedTemplate = node.kind === 172; var isDecorator = node.kind === 139; var typeArguments; if (!isTaggedTemplate && !isDecorator) { @@ -18501,7 +19050,8 @@ var ts; } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true, headMessage); + var typeArguments_1 = node.typeArguments; + checkTypeArguments(candidateForTypeArgumentError, typeArguments_1, ts.map(typeArguments_1, getTypeFromTypeNode), true, headMessage); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -18553,7 +19103,7 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { @@ -18685,8 +19235,8 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 214: - case 186: + case 216: + case 188: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; case 138: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; @@ -18722,13 +19272,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 168) { + if (node.kind === 170) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 169) { + else if (node.kind === 171) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 170) { + else if (node.kind === 172) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else if (node.kind === 139) { @@ -18740,19 +19290,30 @@ var ts; } return links.resolvedSignature; } + function getInferredClassType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.inferredClassType) { + links.inferredClassType = createAnonymousType(undefined, symbol.members, emptyArray, emptyArray, undefined, undefined); + } + return links.inferredClassType; + } function checkCallExpression(node) { checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); if (node.expression.kind === 95) { return voidType; } - if (node.kind === 169) { + if (node.kind === 171) { var declaration = signature.declaration; if (declaration && declaration.kind !== 144 && declaration.kind !== 148 && declaration.kind !== 153) { - if (compilerOptions.noImplicitAny) { + var funcSymbol = checkExpression(node.expression).symbol; + if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16)) { + return getInferredClassType(funcSymbol); + } + else if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -18801,7 +19362,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { if (element.name.kind === 69) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -18835,7 +19396,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 192) { + if (func.body.kind !== 194) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -18940,22 +19501,29 @@ var ts; if (returnType === voidType || isTypeAny(returnType)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 192 || !(func.flags & 524288)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 || !(func.flags & 524288)) { return; } - if (func.flags & 1048576) { - if (compilerOptions.noImplicitReturns) { - error(func.type, ts.Diagnostics.Not_all_code_paths_return_a_value); - } - } - else { + var hasExplicitReturn = func.flags & 1048576; + if (returnType && !hasExplicitReturn) { error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } + else if (compilerOptions.noImplicitReturns) { + if (!returnType) { + var inferredReturnType = hasExplicitReturn + ? getReturnTypeOfSignature(getSignatureFromDeclaration(func)) + : voidType; + if (inferredReturnType === voidType || isTypeAny(inferredReturnType)) { + return; + } + } + error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); + } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 173) { + if (!hasGrammarError && node.kind === 175) { checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -18988,6 +19556,7 @@ var ts; } if (!contextChecked) { checkSignatureDeclaration(node); + checkNodeDeferred(node); } } } @@ -18997,39 +19566,34 @@ var ts; } return type; } - function checkFunctionExpressionOrObjectLiteralMethodBody(node) { + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); if (isAsync) { emitAwaiter = true; } - var returnType = node.type && getTypeFromTypeNode(node.type); - var promisedType; - if (returnType && isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - if (returnType && !node.asteriskToken) { - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if (!node.asteriskToken) { + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 192) { + if (node.body.kind === 194) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); - if (returnType) { + if (returnOrPromisedType) { if (isAsync) { var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); - checkTypeAssignableTo(awaitedType, promisedType, node.body); + checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { - checkTypeAssignableTo(exprType, returnType, node.body); + checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } - checkFunctionAndClassExpressionBodies(node.body); } } } @@ -19051,13 +19615,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 166: { + case 168: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 167: + case 169: return true; - case 172: + case 174: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -19066,21 +19630,21 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69: - case 166: { + case 168: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384) !== 0; } - case 167: { + case 169: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9) { - var name_13 = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_13); + var name_12 = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_12); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 16384) !== 0; } return false; } - case 172: + case 174: return isConstVariableReference(n.expression); default: return false; @@ -19156,8 +19720,8 @@ var ts; } if (type.flags & 49152) { var types = type.types; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var current = types_9[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var current = types_10[_i]; if (current.flags & kind) { return true; } @@ -19172,8 +19736,8 @@ var ts; } if (type.flags & 49152) { var types = type.types; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var current = types_10[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var current = types_11[_i]; if (!(current.flags & kind)) { return false; } @@ -19210,22 +19774,22 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 245 || p.kind === 246) { - var name_14 = p.name; - if (name_14.kind === 136) { - checkComputedPropertyName(name_14); + if (p.kind === 247 || p.kind === 248) { + var name_13 = p.name; + if (name_13.kind === 136) { + checkComputedPropertyName(name_13); } - if (isComputedNonLiteralName(name_14)) { + if (isComputedNonLiteralName(name_13)) { continue; } - var text = getTextOfPropertyName(name_14); + var text = getTextOfPropertyName(name_13); var type = isTypeAny(sourceType) ? sourceType : getTypeOfPropertyOfType(sourceType, text) || isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - if (p.kind === 246) { + if (p.kind === 248) { checkDestructuringAssignment(p, type); } else { @@ -19233,7 +19797,7 @@ var ts; } } else { - error(name_14, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_14)); + error(name_13, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_13)); } } else { @@ -19247,8 +19811,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187) { - if (e.kind !== 185) { + if (e.kind !== 189) { + if (e.kind !== 187) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -19273,7 +19837,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 181 && restExpression.operatorToken.kind === 56) { + if (restExpression.kind === 183 && restExpression.operatorToken.kind === 56) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -19287,7 +19851,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 246) { + if (exprOrAssignment.kind === 248) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -19297,14 +19861,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 181 && target.operatorToken.kind === 56) { + if (target.kind === 183 && target.operatorToken.kind === 56) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 165) { + if (target.kind === 167) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 164) { + if (target.kind === 166) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -19321,7 +19885,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 && (left.kind === 165 || left.kind === 164)) { + if (operator === 56 && (left.kind === 167 || left.kind === 166)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -19520,7 +20084,7 @@ var ts; function checkStringLiteralExpression(node) { var contextualType = getContextualType(node); if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { - return getStringLiteralType(node); + return getStringLiteralTypeForText(node.text); } return stringType; } @@ -19583,8 +20147,8 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 166 && node.parent.expression === node) || - (node.parent.kind === 167 && node.parent.expression === node) || + var ok = (node.parent.kind === 168 && node.parent.expression === node) || + (node.parent.kind === 169 && node.parent.expression === node) || ((node.kind === 69 || node.kind === 135) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); @@ -19611,7 +20175,7 @@ var ts; return booleanType; case 8: return checkNumericLiteral(node); - case 183: + case 185: return checkTemplateExpression(node); case 9: return checkStringLiteralExpression(node); @@ -19619,58 +20183,58 @@ var ts; return stringType; case 10: return globalRegExpType; - case 164: - return checkArrayLiteral(node, contextualMapper); - case 165: - return checkObjectLiteral(node, contextualMapper); case 166: - return checkPropertyAccessExpression(node); + return checkArrayLiteral(node, contextualMapper); case 167: - return checkIndexedAccess(node); + return checkObjectLiteral(node, contextualMapper); case 168: + return checkPropertyAccessExpression(node); case 169: - return checkCallExpression(node); + return checkIndexedAccess(node); case 170: - return checkTaggedTemplateExpression(node); - case 172: - return checkExpression(node.expression, contextualMapper); - case 186: - return checkClassExpression(node); - case 173: - case 174: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 176: - return checkTypeOfExpression(node); case 171: - case 189: - return checkAssertion(node); + return checkCallExpression(node); + case 172: + return checkTaggedTemplateExpression(node); + case 174: + return checkExpression(node.expression, contextualMapper); + case 188: + return checkClassExpression(node); case 175: - return checkDeleteExpression(node); - case 177: - return checkVoidExpression(node); + case 176: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); case 178: - return checkAwaitExpression(node); + return checkTypeOfExpression(node); + case 173: + case 191: + return checkAssertion(node); + case 177: + return checkDeleteExpression(node); case 179: - return checkPrefixUnaryExpression(node); + return checkVoidExpression(node); case 180: - return checkPostfixUnaryExpression(node); + return checkAwaitExpression(node); case 181: - return checkBinaryExpression(node, contextualMapper); + return checkPrefixUnaryExpression(node); case 182: - return checkConditionalExpression(node, contextualMapper); - case 185: - return checkSpreadElementExpression(node, contextualMapper); - case 187: - return undefinedType; + return checkPostfixUnaryExpression(node); + case 183: + return checkBinaryExpression(node, contextualMapper); case 184: + return checkConditionalExpression(node, contextualMapper); + case 187: + return checkSpreadElementExpression(node, contextualMapper); + case 189: + return undefinedType; + case 186: return checkYieldExpression(node); - case 240: + case 242: return checkJsxExpression(node); - case 233: - return checkJsxElement(node); - case 234: - return checkJsxSelfClosingElement(node); case 235: + return checkJsxElement(node); + case 236: + return checkJsxSelfClosingElement(node); + case 237: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -19680,8 +20244,8 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); + getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } } @@ -19707,8 +20271,8 @@ var ts; return false; } return node.kind === 143 || - node.kind === 213 || - node.kind === 173; + node.kind === 215 || + node.kind === 175; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -19722,12 +20286,12 @@ var ts; } return -1; } - function isInLegalTypePredicatePosition(node) { + function isInLegalParameterTypePredicatePosition(node) { switch (node.parent.kind) { - case 174: + case 176: case 147: - case 213: - case 173: + case 215: + case 175: case 152: case 143: case 142: @@ -19735,11 +20299,23 @@ var ts; } return false; } + function isInLegalThisTypePredicatePosition(node) { + if (isInLegalParameterTypePredicatePosition(node)) { + return true; + } + switch (node.parent.kind) { + case 141: + case 140: + case 145: + return node === node.parent.type; + } + return false; + } function checkSignatureDeclaration(node) { if (node.kind === 149) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 || node.kind === 213 || node.kind === 153 || + else if (node.kind === 152 || node.kind === 215 || node.kind === 153 || node.kind === 147 || node.kind === 144 || node.kind === 148) { checkGrammarFunctionLikeDeclaration(node); @@ -19748,9 +20324,14 @@ var ts; ts.forEach(node.parameters, checkParameter); if (node.type) { if (node.type.kind === 150) { - var typePredicate = getSignatureFromDeclaration(node).typePredicate; + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + if (!returnType || !(returnType.flags & 134217728)) { + return; + } + var typePredicate = returnType.predicate; var typePredicateNode = node.type; - if (isInLegalTypePredicatePosition(typePredicateNode)) { + checkSourceElement(typePredicateNode); + if (ts.isIdentifierTypePredicate(typePredicate)) { if (typePredicate.parameterIndex >= 0) { if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); @@ -19766,8 +20347,8 @@ var ts; if (hasReportedError) { break; } - if (param.name.kind === 161 || - param.name.kind === 162) { + if (param.name.kind === 163 || + param.name.kind === 164) { (function checkBindingPattern(pattern) { for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -19777,8 +20358,8 @@ var ts; hasReportedError = true; break; } - else if (element.name.kind === 162 || - element.name.kind === 161) { + else if (element.name.kind === 164 || + element.name.kind === 163) { checkBindingPattern(element.name); } } @@ -19790,9 +20371,6 @@ var ts; } } } - else { - error(typePredicateNode, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } } else { checkSourceElement(node.type); @@ -19827,7 +20405,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 215) { + if (node.kind === 217) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -19869,7 +20447,7 @@ var ts; } function checkMethodDeclaration(node) { checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); - checkFunctionLikeDeclaration(node); + checkFunctionOrMethodDeclaration(node); if (node.flags & 128 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } @@ -19890,7 +20468,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 168 && n.expression.kind === 95; + return n.kind === 170 && n.expression.kind === 95; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -19911,7 +20489,7 @@ var ts; if (n.kind === 97) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 173 && n.kind !== 213) { + else if (n.kind !== 175 && n.kind !== 215) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -19936,7 +20514,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 195 && isSuperCallExpression(statement.expression)) { + if (statement.kind === 197 && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -19960,6 +20538,8 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); if (node.kind === 145) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288)) { if (node.flags & 1048576) { @@ -19972,6 +20552,9 @@ var ts; } } } + if (node.name.kind === 136) { + checkComputedPropertyName(node.name); + } if (!ts.hasDynamicName(node)) { var otherKind = node.kind === 145 ? 146 : 145; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); @@ -19990,18 +20573,32 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - checkFunctionLikeDeclaration(node); + if (node.parent.kind !== 167) { + checkSourceElement(node.body); + } + else { + checkNodeDeferred(node); + } + } + function checkAccessorDeferred(node) { + checkSourceElement(node.body); } function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArguments) { + function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var typeArguments; + var mapper; var result = true; for (var i = 0; i < typeParameters.length; i++) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { + if (!typeArguments) { + typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + mapper = createTypeMapper(typeParameters, typeArguments); + } var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; @@ -20058,7 +20655,7 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 215) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217) { ts.Debug.assert(signatureDeclarationNode.kind === 147 || signatureDeclarationNode.kind === 148); var signatureKind = signatureDeclarationNode.kind === 147 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -20070,7 +20667,7 @@ var ts; } for (var _i = 0, signaturesToCheck_1 = signaturesToCheck; _i < signaturesToCheck_1.length; _i++) { var otherSignature = signaturesToCheck_1[_i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature, false)) { return; } } @@ -20078,9 +20675,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 215 && - n.parent.kind !== 214 && - n.parent.kind !== 186 && + if (n.parent.kind !== 217 && + n.parent.kind !== 216 && + n.parent.kind !== 188 && ts.isInAmbientContext(n)) { if (!(flags & 4)) { flags |= 2; @@ -20153,14 +20750,16 @@ var ts; seen = c === node; } }); - if (subsequentNode) { + if (subsequentNode && subsequentNode.pos === node.end) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 143 || node.kind === 142); - ts.Debug.assert((node.flags & 64) !== (subsequentNode.flags & 64)); - var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode_1, diagnostic); + var reportError = (node.kind === 143 || node.kind === 142) && + (node.flags & 64) !== (subsequentNode.flags & 64); + if (reportError) { + var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + error(errorNode_1, diagnostic); + } return; } else if (ts.nodeIsPresent(subsequentNode.body)) { @@ -20189,11 +20788,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 215 || node.parent.kind === 155 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 217 || node.parent.kind === 155 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 213 || node.kind === 143 || node.kind === 142 || node.kind === 144) { + if (node.kind === 215 || node.kind === 143 || node.kind === 142 || node.kind === 144) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -20247,7 +20846,7 @@ var ts; if (!bodySignature.hasStringLiterals) { for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { var signature = signatures_3[_a]; - if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + if (!signature.hasStringLiterals && !isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } @@ -20306,16 +20905,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 215: + case 217: return 2097152; - case 218: + case 220: return d.name.kind === 9 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 214: - case 217: + case 216: + case 219: return 2097152 | 1048576; - case 221: + case 223: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -20422,15 +21021,16 @@ var ts; error(node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName); return unknownType; } + checkReturnTypeAnnotationAsExpression(node); var promiseConstructorType = getTypeOfSymbol(promiseConstructor); if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) { return unknownType; } var promiseName = ts.getEntityNameFromTypeNode(node.type); - var root = getFirstIdentifier(promiseName); - var rootSymbol = getSymbol(node.locals, root.text, 107455); + var promiseNameOrNamespaceRoot = getFirstIdentifier(promiseName); + var rootSymbol = getSymbol(node.locals, promiseNameOrNamespaceRoot.text, 107455); if (rootSymbol) { - error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, root.text, getFullyQualifiedName(promiseConstructor)); + error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, promiseNameOrNamespaceRoot.text, getFullyQualifiedName(promiseConstructor)); return unknownType; } return checkAwaitedType(promiseType, node, ts.Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type); @@ -20445,7 +21045,7 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 214: + case 216: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); @@ -20482,23 +21082,10 @@ var ts; } } function checkTypeAnnotationAsExpression(node) { - switch (node.kind) { - case 141: - checkTypeNodeAsExpression(node.type); - break; - case 138: - checkTypeNodeAsExpression(node.type); - break; - case 143: - checkTypeNodeAsExpression(node.type); - break; - case 145: - checkTypeNodeAsExpression(node.type); - break; - case 146: - checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node)); - break; - } + checkTypeNodeAsExpression(node.type); + } + function checkReturnTypeAnnotationAsExpression(node) { + checkTypeNodeAsExpression(node.type); } function checkParameterTypeAnnotationsAsExpressions(node) { for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -20518,16 +21105,18 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 214: + case 216: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; case 143: - checkParameterTypeAnnotationsAsExpressions(node); - case 146: case 145: + case 146: + checkParameterTypeAnnotationsAsExpressions(node); + checkReturnTypeAnnotationAsExpression(node); + break; case 141: case 138: checkTypeAnnotationAsExpression(node); @@ -20542,13 +21131,13 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || checkGrammarForGenerator(node); + checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); } } - function checkFunctionLikeDeclaration(node) { + function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); @@ -20561,7 +21150,8 @@ var ts; if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration : undefined; }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } @@ -20572,13 +21162,9 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { - var returnType = getTypeFromTypeNode(node.type); - var promisedType; - if (isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + if (!node.asteriskToken) { + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { @@ -20590,13 +21176,10 @@ var ts; } } function checkBlock(node) { - if (node.kind === 192) { + if (node.kind === 194) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 219) { - checkFunctionAndClassExpressionBodies(node); - } } function checkCollisionWithArgumentsInGeneratedCode(node) { if (!ts.hasRestParameter(node) || ts.isInAmbientContext(node) || ts.nodeIsMissing(node.body)) { @@ -20672,11 +21255,11 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 218 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 220 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 248 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 250 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -20684,7 +21267,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 24576) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 211 && !node.initializer) { + if (node.kind === 213 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -20694,18 +21277,18 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 212); - var container = varDeclList.parent.kind === 193 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214); + var container = varDeclList.parent.kind === 195 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 192 && ts.isFunctionLike(container.parent) || - container.kind === 219 || - container.kind === 218 || - container.kind === 248); + (container.kind === 194 && ts.isFunctionLike(container.parent) || + container.kind === 221 || + container.kind === 220 || + container.kind === 250); if (!namesShareScope) { - var name_15 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_15, name_15); + var name_14 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); } } } @@ -20747,7 +21330,7 @@ var ts; checkExpressionCached(node.initializer); } } - if (node.kind === 163) { + if (node.kind === 165) { if (node.propertyName && node.propertyName.kind === 136) { checkComputedPropertyName(node.propertyName); } @@ -20785,7 +21368,7 @@ var ts; } if (node.kind !== 141 && node.kind !== 140) { checkExportsOnMergedDeclarations(node); - if (node.kind === 211 || node.kind === 163) { + if (node.kind === 213 || node.kind === 165) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -20806,7 +21389,7 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 165) { + if (node.modifiers && node.parent.kind === 167) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -20825,7 +21408,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 194) { + if (node.thenStatement.kind === 196) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -20842,12 +21425,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 212) { + if (node.initializer && node.initializer.kind === 214) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -20862,13 +21445,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 164 || varExpr.kind === 165) { + if (varExpr.kind === 166 || varExpr.kind === 167) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -20883,7 +21466,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -20893,7 +21476,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 164 || varExpr.kind === 165) { + if (varExpr.kind === 166 || varExpr.kind === 167) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258)) { @@ -21021,7 +21604,13 @@ var ts; } function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { ts.Debug.assert(languageVersion < 2); - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var arrayType = arrayOrStringType; + if (arrayOrStringType.flags & 16384) { + arrayType = getUnionType(ts.filter(arrayOrStringType.types, function (t) { return !(t.flags & 258); })); + } + else if (arrayOrStringType.flags & 258) { + arrayType = emptyUnionType; + } var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { @@ -21081,7 +21670,7 @@ var ts; error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } - else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || signature.typePredicate) { + else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || returnType.flags & 134217728) { if (ts.isAsyncFunctionLike(func)) { var promisedType = getPromisedType(returnType); var awaitedType = checkAwaitedType(exprType, node.expression, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -21112,7 +21701,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 242 && !hasDuplicateDefaultClause) { + if (clause.kind === 244 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -21124,13 +21713,12 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 241) { + if (produceDiagnostics && clause.kind === 243) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); - if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) { - return; - } - if (!isTypeAssignableTo(expressionType, caseType)) { + var expressionTypeIsAssignableToCaseType = (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) || + isTypeAssignableTo(expressionType, caseType); + if (!expressionTypeIsAssignableToCaseType) { checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } } @@ -21144,7 +21732,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 207 && current.label.text === node.label.text) { + if (current.kind === 209 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -21284,8 +21872,12 @@ var ts; } function checkClassExpression(node) { checkClassLikeDeclaration(node); + checkNodeDeferred(node); return getTypeOfSymbol(getSymbolOfNode(node)); } + function checkClassExpressionDeferred(node) { + ts.forEach(node.members, checkSourceElement); + } function checkClassDeclaration(node) { if (!node.name && !(node.flags & 512)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); @@ -21383,7 +21975,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(derivedClassDecl.flags & 128))) { - if (derivedClassDecl.kind === 186) { + if (derivedClassDecl.kind === 188) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -21493,7 +22085,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 215); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -21558,7 +22150,8 @@ var ts; error(member.name, ts.Diagnostics.Enum_member_must_have_initializer); } if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; + getNodeLinks(member).enumMemberValue = autoValue; + autoValue++; } } nodeLinks.flags |= 8192; @@ -21590,7 +22183,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 179: + case 181: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -21601,7 +22194,7 @@ var ts; case 50: return ~value_1; } return undefined; - case 181: + case 183: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -21626,11 +22219,11 @@ var ts; return undefined; case 8: return +e.text; - case 172: + case 174: return evalConstant(e.expression); case 69: - case 167: - case 166: + case 169: + case 168: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -21641,7 +22234,7 @@ var ts; } else { var expression; - if (e.kind === 167) { + if (e.kind === 169) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -21658,7 +22251,7 @@ var ts; if (current.kind === 69) { break; } - else if (current.kind === 166) { + else if (current.kind === 168) { current = current.expression; } else { @@ -21717,7 +22310,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 217) { + if (declaration.kind !== 219) { return false; } var enumDeclaration = declaration; @@ -21740,8 +22333,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 214 || - (declaration.kind === 213 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 216 || + (declaration.kind === 215 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -21792,7 +22385,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 214); + var mergedClass = ts.getDeclarationOfKind(symbol, 216); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -21814,7 +22407,7 @@ var ts; if (node.kind === 135) { node = node.left; } - else if (node.kind === 166) { + else if (node.kind === 168) { node = node.expression; } else { @@ -21830,9 +22423,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 219 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 248 && !inAmbientExternalModule) { - error(moduleName, node.kind === 228 ? + var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; + if (node.parent.kind !== 250 && !inAmbientExternalModule) { + error(moduleName, node.kind === 230 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -21851,7 +22444,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 230 ? + var message = node.kind === 232 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -21877,7 +22470,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224) { + if (importClause.namedBindings.kind === 226) { checkImportBinding(importClause.namedBindings); } else { @@ -21928,8 +22521,8 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 219 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 248 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; + if (node.parent.kind !== 250 && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -21942,7 +22535,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 248 && node.parent.kind !== 219 && node.parent.kind !== 218) { + if (node.parent.kind !== 250 && node.parent.kind !== 221 && node.parent.kind !== 220) { return grammarErrorOnFirstToken(node, errorMessage); } } @@ -21956,8 +22549,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 248 ? node.parent : node.parent.parent; - if (container.kind === 218 && container.name.kind === 69) { + var container = node.parent.kind === 250 ? node.parent : node.parent.parent; + if (container.kind === 220 && container.name.kind === 69) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -21980,15 +22573,6 @@ var ts; } } } - function getModuleStatements(node) { - if (node.kind === 248) { - return node.statements; - } - if (node.kind === 218 && node.body.kind === 219) { - return node.body.statements; - } - return emptyArray; - } function hasExportedMembers(moduleSymbol) { for (var id in moduleSymbol.exports) { if (id !== "export=") { @@ -22006,13 +22590,41 @@ var ts; var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } + var exports_2 = getExportsOfModule(moduleSymbol); + for (var id in exports_2) { + if (id === "__export") { + continue; + } + var _a = exports_2[id], declarations = _a.declarations, flags = _a.flags; + if (!(flags & (1536 | 64 | 384)) && (flags & 524288 ? declarations.length - 1 : declarations.length) > 1) { + var exportedDeclarations = ts.filter(declarations, isNotOverload); + if (exportedDeclarations.length > 1) { + for (var _i = 0, exportedDeclarations_1 = exportedDeclarations; _i < exportedDeclarations_1.length; _i++) { + var declaration = exportedDeclarations_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); + } + } + } + } links.exportsChecked = true; } + function isNotOverload(declaration) { + return declaration.kind !== 215 || !!declaration.body; + } } function checkTypePredicate(node) { - if (!isInLegalTypePredicatePosition(node)) { + var parameterName = node.parameterName; + if (parameterName.kind === 69 && !isInLegalParameterTypePredicatePosition(node)) { error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); } + else if (parameterName.kind === 161) { + if (!isInLegalThisTypePredicatePosition(node)) { + error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); + } + else { + getTypeFromThisTypeNode(parameterName); + } + } } function checkSourceElement(node) { if (!node) { @@ -22021,10 +22633,10 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 218: - case 214: + case 220: + case 216: + case 217: case 215: - case 213: cancellationToken.throwIfCancellationRequested(); } } @@ -22068,170 +22680,97 @@ var ts; return checkUnionOrIntersectionType(node); case 160: return checkSourceElement(node.type); - case 213: - return checkFunctionDeclaration(node); - case 192: - case 219: - return checkBlock(node); - case 193: - return checkVariableStatement(node); - case 195: - return checkExpressionStatement(node); - case 196: - return checkIfStatement(node); - case 197: - return checkDoStatement(node); - case 198: - return checkWhileStatement(node); - case 199: - return checkForStatement(node); - case 200: - return checkForInStatement(node); - case 201: - return checkForOfStatement(node); - case 202: - case 203: - return checkBreakOrContinueStatement(node); - case 204: - return checkReturnStatement(node); - case 205: - return checkWithStatement(node); - case 206: - return checkSwitchStatement(node); - case 207: - return checkLabeledStatement(node); - case 208: - return checkThrowStatement(node); - case 209: - return checkTryStatement(node); - case 211: - return checkVariableDeclaration(node); - case 163: - return checkBindingElement(node); - case 214: - return checkClassDeclaration(node); case 215: - return checkInterfaceDeclaration(node); - case 216: - return checkTypeAliasDeclaration(node); - case 217: - return checkEnumDeclaration(node); - case 218: - return checkModuleDeclaration(node); - case 222: - return checkImportDeclaration(node); - case 221: - return checkImportEqualsDeclaration(node); - case 228: - return checkExportDeclaration(node); - case 227: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); case 194: - checkGrammarStatementInAmbientContext(node); - return; + case 221: + return checkBlock(node); + case 195: + return checkVariableStatement(node); + case 197: + return checkExpressionStatement(node); + case 198: + return checkIfStatement(node); + case 199: + return checkDoStatement(node); + case 200: + return checkWhileStatement(node); + case 201: + return checkForStatement(node); + case 202: + return checkForInStatement(node); + case 203: + return checkForOfStatement(node); + case 204: + case 205: + return checkBreakOrContinueStatement(node); + case 206: + return checkReturnStatement(node); + case 207: + return checkWithStatement(node); + case 208: + return checkSwitchStatement(node); + case 209: + return checkLabeledStatement(node); case 210: + return checkThrowStatement(node); + case 211: + return checkTryStatement(node); + case 213: + return checkVariableDeclaration(node); + case 165: + return checkBindingElement(node); + case 216: + return checkClassDeclaration(node); + case 217: + return checkInterfaceDeclaration(node); + case 218: + return checkTypeAliasDeclaration(node); + case 219: + return checkEnumDeclaration(node); + case 220: + return checkModuleDeclaration(node); + case 224: + return checkImportDeclaration(node); + case 223: + return checkImportEqualsDeclaration(node); + case 230: + return checkExportDeclaration(node); + case 229: + return checkExportAssignment(node); + case 196: checkGrammarStatementInAmbientContext(node); return; - case 231: + case 212: + checkGrammarStatementInAmbientContext(node); + return; + case 233: return checkMissingDeclaration(node); } } - function checkFunctionAndClassExpressionBodies(node) { - switch (node.kind) { - case 173: - case 174: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - checkFunctionExpressionOrObjectLiteralMethodBody(node); - break; - case 186: - ts.forEach(node.members, checkSourceElement); - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; - case 143: - case 142: - ts.forEach(node.decorators, checkFunctionAndClassExpressionBodies); - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - if (ts.isObjectLiteralMethod(node)) { - checkFunctionExpressionOrObjectLiteralMethodBody(node); - } - break; - case 144: - case 145: - case 146: - case 213: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - break; - case 205: - checkFunctionAndClassExpressionBodies(node.expression); - break; - case 139: - case 138: - case 141: - case 140: - case 161: - case 162: - case 163: - case 164: - case 165: - case 245: - case 166: - case 167: - case 168: - case 169: - case 170: - case 183: - case 190: - case 171: - case 189: - case 172: - case 176: - case 177: - case 178: - case 175: - case 179: - case 180: - case 181: - case 182: - case 185: - case 184: - case 192: - case 219: - case 193: - case 195: - case 196: - case 197: - case 198: - case 199: - case 200: - case 201: - case 202: - case 203: - case 204: - case 206: - case 220: - case 241: - case 242: - case 207: - case 208: - case 209: - case 244: - case 211: - case 212: - case 214: - case 243: - case 188: - case 217: - case 247: - case 227: - case 248: - case 240: - case 233: - case 234: - case 238: - case 239: - case 235: - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; + function checkNodeDeferred(node) { + if (deferredNodes) { + deferredNodes.push(node); + } + } + function checkDeferredNodes() { + for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { + var node = deferredNodes_1[_i]; + switch (node.kind) { + case 175: + case 176: + case 143: + case 142: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 145: + case 146: + checkAccessorDeferred(node); + break; + case 188: + checkClassExpressionDeferred(node); + break; + } } } function checkSourceFile(node) { @@ -22251,9 +22790,12 @@ var ts; emitExtends = false; emitDecorate = false; emitParam = false; + emitAwaiter = false; potentialThisCollisions.length = 0; + deferredNodes = []; ts.forEach(node.statements, checkSourceElement); - checkFunctionAndClassExpressionBodies(node); + checkDeferredNodes(); + deferredNodes = undefined; if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -22309,7 +22851,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 205 && node.parent.statement === node) { + if (node.parent.kind === 207 && node.parent.statement === node) { return true; } node = node.parent; @@ -22331,28 +22873,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 248: + case 250: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 218: + case 220: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 217: + case 219: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 186: + case 188: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 214: - case 215: + case 216: + case 217: if (!(memberFlags & 64)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 173: + case 175: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -22392,10 +22934,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 137: - case 214: - case 215: case 216: case 217: + case 218: + case 219: return true; } } @@ -22408,19 +22950,19 @@ var ts; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 166) { + while (node.parent && node.parent.kind === 168) { node = node.parent; } - return node.parent && node.parent.kind === 188; + return node.parent && node.parent.kind === 190; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { while (nodeOnRightSide.parent.kind === 135) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 221) { + if (nodeOnRightSide.parent.kind === 223) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 227) { + if (nodeOnRightSide.parent.kind === 229) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -22432,10 +22974,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 227) { + if (entityName.parent.kind === 229) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 166) { + if (entityName.kind !== 168) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -22445,7 +22987,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 188) { + if (entityName.parent.kind === 190) { meaning = 793056; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -22457,9 +22999,9 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 235) || - (entityName.parent.kind === 234) || - (entityName.parent.kind === 237)) { + else if ((entityName.parent.kind === 237) || + (entityName.parent.kind === 236) || + (entityName.parent.kind === 239)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -22470,7 +23012,7 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 166) { + else if (entityName.kind === 168) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); @@ -22490,7 +23032,7 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 238) { + else if (entityName.parent.kind === 240) { return getJsxAttributePropertySymbol(entityName.parent); } if (entityName.parent.kind === 150) { @@ -22507,12 +23049,12 @@ var ts; } if (node.kind === 69) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 227 + return node.parent.kind === 229 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 163 && - node.parent.parent.kind === 161 && + else if (node.parent.kind === 165 && + node.parent.parent.kind === 163 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -22523,13 +23065,15 @@ var ts; } switch (node.kind) { case 69: - case 166: + case 168: case 135: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97: case 95: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; + case 161: + return getTypeFromTypeNode(node).symbol; case 121: var constructorDeclaration = node.parent; if (constructorDeclaration && constructorDeclaration.kind === 144) { @@ -22539,12 +23083,12 @@ var ts; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 222 || node.parent.kind === 228) && + ((node.parent.kind === 224 || node.parent.kind === 230) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 167 && node.parent.argumentExpression === node) { + if (node.parent.kind === 169 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -22558,7 +23102,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 246) { + if (location && location.kind === 248) { return resolveEntityName(location.name, 107455); } return undefined; @@ -22629,9 +23173,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name_16 = symbol.name; + var name_15 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_16); + var symbol = getPropertyOfType(t, name_15); if (symbol) { symbols.push(symbol); } @@ -22649,6 +23193,25 @@ var ts; function isArgumentsLocalBinding(node) { return getReferencedValueSymbol(node) === argumentsSymbol; } + function moduleExportsSomeValue(moduleReferenceExpression) { + var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol) { + return true; + } + var hasExportAssignment = getExportAssignmentSymbol(moduleSymbol) !== undefined; + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + var symbolLinks = getSymbolLinks(moduleSymbol); + if (symbolLinks.exportsSomeValue === undefined) { + symbolLinks.exportsSomeValue = hasExportAssignment + ? !!(moduleSymbol.flags & 107455) + : ts.forEachValue(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks.exportsSomeValue; + function isValue(s) { + s = resolveSymbol(s); + return s && !!(s.flags & 107455); + } + } function getReferencedExportContainer(node) { var symbol = getReferencedValueSymbol(node); if (symbol) { @@ -22661,11 +23224,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 248) { + if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 250) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 218 || n.kind === 217) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 220 || n.kind === 219) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -22678,11 +23241,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 192: - case 220: - case 199: - case 200: + case 194: + case 222: case 201: + case 202: + case 203: return true; } return false; @@ -22708,22 +23271,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 221: case 223: - case 224: + case 225: case 226: - case 230: - return isAliasResolvedToValue(getSymbolOfNode(node)); case 228: + case 232: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 230: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 227: + case 229: return node.expression && node.expression.kind === 69 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 248 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 250 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -22771,7 +23334,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 247) { + if (node.kind === 249) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -22857,17 +23420,6 @@ var ts; var symbol = getReferencedValueSymbol(reference); return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; } - function instantiateSingleCallFunctionType(functionType, typeArguments) { - if (functionType === unknownType) { - return unknownType; - } - var signature = getSingleCallSignature(functionType); - if (!signature) { - return unknownType; - } - var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); - return getOrCreateTypeFromSignature(instantiatedSignature); - } function createResolver() { return { getReferencedExportContainer: getReferencedExportContainer, @@ -22891,6 +23443,7 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, + moduleExportsSomeValue: moduleExportsSomeValue, isArgumentsLocalBinding: isArgumentsLocalBinding, getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; @@ -22901,7 +23454,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 248); + return ts.getDeclarationOfKind(moduleSymbol, 250); } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { @@ -22912,10 +23465,10 @@ var ts; mergeSymbolTable(globals, file.locals); } }); + addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; globalArrayType = getGlobalType("Array", 1); globalObjectType = getGlobalType("Object"); globalFunctionType = getGlobalType("Function"); @@ -22976,7 +23529,12 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + if (node.kind === 143 && !ts.nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } + else { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + } } else if (node.kind === 145 || node.kind === 146) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); @@ -22996,30 +23554,30 @@ var ts; case 143: case 142: case 149: - case 218: - case 222: - case 221: - case 228: - case 227: + case 220: + case 224: + case 223: + case 230: + case 229: case 138: break; - case 213: - if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && - node.parent.kind !== 219 && node.parent.kind !== 248) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - break; - case 214: case 215: - case 193: - case 216: - if (node.modifiers && node.parent.kind !== 219 && node.parent.kind !== 248) { + if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && + node.parent.kind !== 221 && node.parent.kind !== 250) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; + case 216: case 217: + case 195: + case 218: + if (node.modifiers && node.parent.kind !== 221 && node.parent.kind !== 250) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + break; + case 219: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74) && - node.parent.kind !== 219 && node.parent.kind !== 248) { + node.parent.kind !== 221 && node.parent.kind !== 250) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -23034,6 +23592,11 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 74: + if (node.kind !== 219 && node.parent.kind === 216) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74)); + } + break; case 112: case 111: case 110: @@ -23058,7 +23621,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 219 || node.parent.kind === 248) { + else if (node.parent.kind === 221 || node.parent.kind === 250) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128) { @@ -23078,7 +23641,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 219 || node.parent.kind === 248) { + else if (node.parent.kind === 221 || node.parent.kind === 250) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 138) { @@ -23103,7 +23666,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } else if (node.kind === 138) { @@ -23118,13 +23681,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } else if (node.kind === 138) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 219) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4; @@ -23134,11 +23697,11 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 214) { + if (node.kind !== 216) { if (node.kind !== 143) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 214 && node.parent.flags & 128)) { + if (!(node.parent.kind === 216 && node.parent.flags & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64) { @@ -23183,7 +23746,7 @@ var ts; } return; } - else if ((node.kind === 222 || node.kind === 221) && flags & 4) { + else if ((node.kind === 224 || node.kind === 223) && flags & 4) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 138 && (flags & 56) && ts.isBindingPattern(node.name)) { @@ -23199,9 +23762,9 @@ var ts; } switch (node.kind) { case 143: - case 213: - case 173: - case 174: + case 215: + case 175: + case 176: if (!node.asteriskToken) { return false; } @@ -23266,7 +23829,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 174) { + if (node.kind === 176) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -23333,7 +23896,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 187) { + if (arg.kind === 189) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -23408,14 +23971,14 @@ var ts; return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 181 && computedPropertyName.expression.operatorToken.kind === 24) { + if (computedPropertyName.expression.kind === 183 && computedPropertyName.expression.operatorToken.kind === 24) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 213 || - node.kind === 173 || + ts.Debug.assert(node.kind === 215 || + node.kind === 175 || node.kind === 143); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -23439,22 +24002,26 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; - var name_17 = prop.name; - if (prop.kind === 187 || - name_17.kind === 136) { - checkGrammarComputedPropertyName(name_17); - continue; + var _loop_1 = function(prop) { + var name_16 = prop.name; + if (prop.kind === 189 || + name_16.kind === 136) { + checkGrammarComputedPropertyName(name_16); + return "continue"; } - if (prop.kind === 246 && !inDestructuring && prop.objectAssignmentInitializer) { - return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); + if (prop.kind === 248 && !inDestructuring && prop.objectAssignmentInitializer) { + return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } + ts.forEach(prop.modifiers, function (mod) { + if (mod.kind !== 118 || prop.kind !== 143) { + grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); + } + }); var currentKind = void 0; - if (prop.kind === 245 || prop.kind === 246) { + if (prop.kind === 247 || prop.kind === 248) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_17.kind === 8) { - checkGrammarNumericLiteral(name_17); + if (name_16.kind === 8) { + checkGrammarNumericLiteral(name_16); } currentKind = Property; } @@ -23470,45 +24037,51 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = currentKind; + if (!ts.hasProperty(seen, name_16.text)) { + seen[name_16.text] = currentKind; } else { - var existingKind = seen[name_17.text]; + var existingKind = seen[name_16.text]; if (currentKind === Property && existingKind === Property) { - continue; + return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_17.text] = currentKind | existingKind; + seen[name_16.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } + }; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + var state_1 = _loop_1(prop); + if (typeof state_1 === "object") return state_1.value + if (state_1 === "continue") continue; } } function checkGrammarJsxElement(node) { var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 239) { + if (attr.kind === 241) { continue; } var jsxAttr = attr; - var name_18 = jsxAttr.name; - if (!ts.hasProperty(seen, name_18.text)) { - seen[name_18.text] = true; + var name_17 = jsxAttr.name; + if (!ts.hasProperty(seen, name_17.text)) { + seen[name_17.text] = true; } else { - return grammarErrorOnNode(name_18, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 240 && !initializer.expression) { + if (initializer && initializer.kind === 242 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -23517,24 +24090,28 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 212) { + if (forInOrOfStatement.initializer.kind === 214) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 200 + var declarations = variableList.declarations; + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } - var firstDeclaration = variableList.declarations[0]; + var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 200 + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 200 + var diagnostic = forInOrOfStatement.kind === 202 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -23595,7 +24172,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 165) { + if (node.parent.kind === 167) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -23614,7 +24191,7 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 215) { + else if (node.parent.kind === 217) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } else if (node.parent.kind === 155) { @@ -23628,9 +24205,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 207: + case 209: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 202 + var isMisplacedContinueLabel = node.kind === 204 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -23638,8 +24215,8 @@ var ts; return false; } break; - case 206: - if (node.kind === 203 && !node.label) { + case 208: + if (node.kind === 205 && !node.label) { return false; } break; @@ -23652,13 +24229,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 203 + var message = node.kind === 205 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 203 + var message = node.kind === 205 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -23670,7 +24247,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 162 || node.name.kind === 161) { + if (node.name.kind === 164 || node.name.kind === 163) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -23679,7 +24256,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 200 && node.parent.parent.kind !== 201) { + if (node.parent.parent.kind !== 202 && node.parent.parent.kind !== 203) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -23695,12 +24272,12 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 69) { - if (name.text === "let") { + if (name.originalKeywordKind === 108) { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } @@ -23708,7 +24285,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -23725,15 +24302,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 196: - case 197: case 198: - case 205: case 199: case 200: - case 201: - return false; case 207: + case 201: + case 202: + case 203: + return false; + case 209: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -23748,18 +24325,6 @@ var ts; } } } - function isIntegerLiteral(expression) { - if (expression.kind === 179) { - var unaryExpression = expression; - if (unaryExpression.operator === 35 || unaryExpression.operator === 36) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 8) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); - } - return false; - } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -23784,10 +24349,6 @@ var ts; return true; } } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 && - (node.text === "eval" || node.text === "arguments"); - } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -23805,27 +24366,33 @@ var ts; return true; } } - else if (node.parent.kind === 215) { + else if (node.parent.kind === 217) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); + } } else if (node.parent.kind === 155) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } } if (ts.isInAmbientContext(node) && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 215 || - node.kind === 216 || - node.kind === 222 || - node.kind === 221 || - node.kind === 228 || - node.kind === 227 || + if (node.kind === 217 || + node.kind === 218 || + node.kind === 224 || + node.kind === 223 || + node.kind === 230 || + node.kind === 229 || (node.flags & 4) || (node.flags & (2 | 512))) { return false; @@ -23835,7 +24402,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 193) { + if (ts.isDeclaration(decl) || decl.kind === 195) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -23854,7 +24421,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 192 || node.parent.kind === 219 || node.parent.kind === 248) { + if (node.parent.kind === 194 || node.parent.kind === 221 || node.parent.kind === 250) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -23877,19 +24444,248 @@ var ts; return true; } } + var _a; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); var ts; +(function (ts) { + var nullSourceMapWriter; + function getNullSourceMapWriter() { + if (nullSourceMapWriter === undefined) { + nullSourceMapWriter = { + getSourceMapData: function () { return undefined; }, + setSourceFile: function (sourceFile) { }, + emitStart: function (range) { }, + emitEnd: function (range) { }, + emitPos: function (pos) { }, + getText: function () { return undefined; }, + getSourceMappingURL: function () { return undefined; }, + initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, + reset: function () { } + }; + } + return nullSourceMapWriter; + } + ts.getNullSourceMapWriter = getNullSourceMapWriter; + function createSourceMapWriter(host, writer) { + var compilerOptions = host.getCompilerOptions(); + var currentSourceFile; + var sourceMapDir; + var sourceMapSourceIndex; + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan; + var lastEncodedNameIndex; + var sourceMapData; + return { + getSourceMapData: function () { return sourceMapData; }, + setSourceFile: setSourceFile, + emitPos: emitPos, + emitStart: emitStart, + emitEnd: emitEnd, + getText: getText, + getSourceMappingURL: getSourceMappingURL, + initialize: initialize, + reset: reset + }; + function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + if (sourceMapData) { + reset(); + } + currentSourceFile = undefined; + sourceMapSourceIndex = -1; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + lastEncodedNameIndex = 0; + sourceMapData = { + sourceMapFilePath: sourceMapFilePath, + jsSourceMappingURL: !compilerOptions.inlineSourceMap ? ts.getBaseFileName(ts.normalizeSlashes(sourceMapFilePath)) : undefined, + sourceMapFile: ts.getBaseFileName(ts.normalizeSlashes(filePath)), + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined, + sourceMapDecodedMappings: [] + }; + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (!isBundledEmit) { + ts.Debug.assert(sourceFiles.length === 1); + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(filePath)); + } + } + function reset() { + currentSourceFile = undefined; + sourceMapDir = undefined; + sourceMapSourceIndex = undefined; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = undefined; + lastEncodedNameIndex = undefined; + sourceMapData = undefined; + } + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + } + function emitPos(pos) { + if (pos === -1) { + return; + } + var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + sourceLinePos.line++; + sourceLinePos.character++; + var emittedLine = writer.getLine(); + var emittedColumn = writer.getColumn(); + if (!lastRecordedSourceMapSpan || + lastRecordedSourceMapSpan.emittedLine !== emittedLine || + lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || + (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && + (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || + (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + encodeLastRecordedSourceMapSpan(); + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + sourceIndex: sourceMapSourceIndex + }; + } + else { + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; + } + } + function emitStart(range) { + var rangeHasDecorators = !!range.decorators; + emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + } + function emitEnd(range) { + emitPos(range.end); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; + var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSourceFile.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true); + sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + if (sourceMapSourceIndex === -1) { + sourceMapSourceIndex = sourceMapData.sourceMapSources.length; + sourceMapData.sourceMapSources.push(source); + sourceMapData.inputSourceFileNames.push(sourceFile.fileName); + if (compilerOptions.inlineSources) { + sourceMapData.sourceMapSourcesContent.push(sourceFile.text); + } + } + } + function getText() { + encodeLastRecordedSourceMapSpan(); + return ts.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings, + sourcesContent: sourceMapData.sourceMapSourcesContent + }); + } + function getSourceMappingURL() { + if (compilerOptions.inlineSourceMap) { + var base64SourceMapText = ts.convertToBase64(getText()); + return sourceMapData.jsSourceMappingURL = "data:application/json;base64," + base64SourceMapText; + } + else { + return sourceMapData.jsSourceMappingURL; + } + } + } + ts.createSourceMapWriter = createSourceMapWriter; + var base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + function base64FormatEncode(inValue) { + if (inValue < 64) { + return base64Chars.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + function base64VLQFormatEncode(inValue) { + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + var encodedStr = ""; + do { + var currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } +})(ts || (ts = {})); +var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + var declarationDiagnostics = ts.createDiagnosticCollection(); + ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName); + function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + var declarationFilePath = _a.declarationFilePath; + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit); + } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -23907,93 +24703,67 @@ var ts; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var noDeclare = !root; + var noDeclare; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; var referencePathsOutput = ""; - if (root) { + var emittedReferencedFiles = []; + var addedGlobalFileReference = false; + var allSourcesModuleElementDeclarationEmitInfo = []; + ts.forEach(sourceFiles, function (sourceFile) { + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 4096) || - ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + if (referencedFile && !ts.contains(emittedReferencedFiles, referencedFile)) { + if (writeReferencePath(referencedFile, !isBundledEmit && !addedGlobalFileReference)) { addedGlobalFileReference = true; } + emittedReferencedFiles.push(referencedFile); } }); } - emitSourceFile(root); + if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { + noDeclare = false; + emitSourceFile(sourceFile); + } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + } if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222); + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 224); createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 0); + ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + increaseIndent(); + } writeImportDeclaration(aliasEmitInfo.node); aliasEmitInfo.asynchronousOutput = writer.getText(); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + decreaseIndent(); + } } }); setWriter(oldWriter); + allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; } - } - else { - var emittedReferencedFiles = []; - var prevModuleElementDeclarationEmitInfo = []; - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isDeclarationFile(sourceFile)) { - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (ts.isDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - } - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - noDeclare = false; - emitSourceFile(sourceFile); - } - else if (ts.isExternalModule(sourceFile)) { - noDeclare = true; - write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); - writeLine(); - increaseIndent(); - emitSourceFile(sourceFile); - decreaseIndent(); - write("}"); - writeLine(); - if (moduleElementDeclarationEmitInfo.length) { - var oldWriter = writer; - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222); - createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 1); - increaseIndent(); - writeImportDeclaration(aliasEmitInfo.node); - aliasEmitInfo.asynchronousOutput = writer.getText(); - decreaseIndent(); - } - }); - setWriter(oldWriter); - } - prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); - moduleElementDeclarationEmitInfo = []; - } - }); - moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); - } + }); return { reportedDeclarationError: reportedDeclarationError, - moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -24036,10 +24806,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 211) { + if (declaration.kind === 213) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 225 || declaration.kind === 226 || declaration.kind === 223) { + else if (declaration.kind === 227 || declaration.kind === 228 || declaration.kind === 225) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -24050,7 +24820,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 222) { + if (moduleElementEmitInfo.node.kind === 224) { moduleElementEmitInfo.isVisible = true; } else { @@ -24058,12 +24828,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 218) { + if (nodeToCheck.kind === 220) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 218) { + if (nodeToCheck.kind === 220) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -24084,10 +24854,10 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } } } @@ -24097,7 +24867,8 @@ var ts; } function reportInaccessibleThisError() { if (errorNameNode) { - diagnostics.push(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); } } function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { @@ -24165,10 +24936,10 @@ var ts; case 120: case 131: case 103: - case 97: - case 9: + case 161: + case 162: return writeTextOfNode(currentText, type); - case 188: + case 190: return emitExpressionWithTypeArguments(type); case 151: return emitTypeReference(type); @@ -24209,13 +24980,13 @@ var ts; } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 221 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 223 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 166); + ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 168); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -24288,9 +25059,10 @@ var ts; } var count = 0; while (true) { - var name_19 = baseName + "_" + (++count); - if (!ts.hasProperty(currentIdentifiers, name_19)) { - return name_19; + count++; + var name_18 = baseName + "_" + count; + if (!ts.hasProperty(currentIdentifiers, name_18)) { + return name_18; } } } @@ -24331,10 +25103,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 221 || - (node.parent.kind === 248 && isCurrentFileExternalModule)) { + else if (node.kind === 223 || + (node.parent.kind === 250 && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -24343,7 +25115,7 @@ var ts; }); } else { - if (node.kind === 222) { + if (node.kind === 224) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -24361,37 +25133,37 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 213: - return writeFunctionDeclaration(node); - case 193: - return writeVariableStatement(node); case 215: - return writeInterfaceDeclaration(node); - case 214: - return writeClassDeclaration(node); - case 216: - return writeTypeAliasDeclaration(node); + return writeFunctionDeclaration(node); + case 195: + return writeVariableStatement(node); case 217: - return writeEnumDeclaration(node); + return writeInterfaceDeclaration(node); + case 216: + return writeClassDeclaration(node); case 218: + return writeTypeAliasDeclaration(node); + case 219: + return writeEnumDeclaration(node); + case 220: return writeModuleDeclaration(node); - case 221: + case 223: return writeImportEqualsDeclaration(node); - case 222: + case 224: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 248) { + if (node.parent.kind === 250) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 215 && !noDeclare) { + else if (node.kind !== 217 && !noDeclare) { write("declare "); } } @@ -24424,7 +25196,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + emitExternalModuleSpecifier(node); write(");"); } writer.writeLine(); @@ -24438,7 +25210,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 224) { + if (namedBindings.kind === 226) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -24464,7 +25236,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 224) { + if (node.importClause.namedBindings.kind === 226) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -24476,13 +25248,22 @@ var ts; } write(" from "); } - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); write(";"); writer.writeLine(); } - function emitExternalModuleSpecifier(moduleSpecifier) { - if (moduleSpecifier.kind === 9 && (!root) && (compilerOptions.out || compilerOptions.outFile)) { - var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + function emitExternalModuleSpecifier(parent) { + var moduleSpecifier; + if (parent.kind === 223) { + var node = parent; + moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); + } + else { + var node = parent; + moduleSpecifier = node.moduleSpecifier; + } + if (moduleSpecifier.kind === 9 && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { write("\""); write(moduleName); @@ -24517,7 +25298,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); } write(";"); writer.writeLine(); @@ -24532,7 +25313,7 @@ var ts; write("module "); } writeTextOfNode(currentText, node.name); - while (node.body.kind !== 219) { + while (node.body.kind !== 221) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -24625,10 +25406,10 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 214: + case 216: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 215: + case 217: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 148: @@ -24642,14 +25423,14 @@ var ts; if (node.parent.flags & 64) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214) { + else if (node.parent.parent.kind === 216) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 213: + case 215: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -24682,7 +25463,7 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 214) { + if (node.parent.parent.kind === 216) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -24762,7 +25543,7 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 211 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 213 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -24780,7 +25561,7 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 211) { + if (node.kind === 213) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24795,7 +25576,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -24821,7 +25602,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187) { + if (element.kind !== 189) { elements.push(element); } } @@ -24955,13 +25736,13 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 213) { + if (node.kind === 215) { emitModuleElementDeclarationFlags(node); } else if (node.kind === 143) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 213) { + if (node.kind === 215) { write("function "); writeTextOfNode(currentText, node.name); } @@ -24982,6 +25763,8 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; if (node.kind === 148 || node.kind === 153) { write("new "); } @@ -24992,8 +25775,6 @@ var ts; else { write("("); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); if (node.kind === 149) { write("]"); @@ -25043,7 +25824,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 214) { + else if (node.parent.kind === 216) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25056,7 +25837,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 213: + case 215: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25129,7 +25910,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214) { + else if (node.parent.parent.kind === 216) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25141,7 +25922,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 213: + case 215: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25152,12 +25933,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 161) { + if (bindingPattern.kind === 163) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 162) { + else if (bindingPattern.kind === 164) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -25168,18 +25949,10 @@ var ts; } } function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.kind === 187) { + if (bindingElement.kind === 189) { write(" "); } - else if (bindingElement.kind === 163) { + else if (bindingElement.kind === 165) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -25201,19 +25974,19 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 213: - case 218: - case 221: case 215: - case 214: - case 216: + case 220: + case 223: case 217: + case 216: + case 218: + case 219: return emitModuleElement(node, isModuleElementVisible(node)); - case 193: + case 195: return emitModuleElement(node, isVariableStatementVisible(node)); - case 222: + case 224: return emitModuleElement(node, !node.importClause); - case 228: + case 230: return emitExportDeclaration(node); case 144: case 143: @@ -25229,31 +26002,47 @@ var ts; case 141: case 140: return emitPropertyDeclaration(node); - case 247: + case 249: return emitEnumMemberDeclaration(node); - case 227: + case 229: return emitExportAssignment(node); - case 248: + case 250: return emitSourceFile(node); } } - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 4096 - ? referencedFile.fileName - : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) - ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); - referencePathsOutput += "/// " + newLine; + function writeReferencePath(referencedFile, addBundledFileReference) { + var declFileName; + var addedBundledEmitReference = false; + if (ts.isDeclarationFile(referencedFile)) { + declFileName = referencedFile.fileName; + } + else { + ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile); + } + if (declFileName) { + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); + referencePathsOutput += "/// " + newLine; + } + return addedBundledEmitReference; + function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) { + if (isBundledEmit && !addBundledFileReference) { + return; + } + ts.Debug.assert(!!emitFileNames.declarationFilePath || ts.isSourceFileJavaScript(referencedFile), "Declaration file is not present only for javascript files"); + declFileName = emitFileNames.declarationFilePath || emitFileNames.jsFilePath; + addedBundledEmitReference = isBundledEmit; + } } } - function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { + function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit); + var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; + if (!emitSkipped) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM); } + return emitSkipped; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; @@ -25272,10 +26061,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function getResolvedExternalModuleName(host, file) { return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); } @@ -25550,41 +26335,17 @@ var ts; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; - var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 ? 5 : 0; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var modulekind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - var diagnostics = []; + var emitterDiagnostics = ts.createDiagnosticCollection(); + var emitSkipped = false; var newLine = host.getNewLine(); - var jsxDesugaring = host.getCompilerOptions().jsx !== 1; - var shouldEmitJsx = function (s) { return (s.languageVariant === 1 && !jsxDesugaring); }; - var outFile = compilerOptions.outFile || compilerOptions.out; var emitJavaScript = createFileEmitter(); - if (targetSourceFile === undefined) { - if (outFile) { - emitFile(outFile); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - } - } - else { - if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { - emitFile(outFile); - } - } - diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); + ts.forEachExpectedEmitFile(host, emitFile, targetSourceFile); return { - emitSkipped: false, - diagnostics: diagnostics, + emitSkipped: emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), sourceMaps: sourceMapDataList }; function isUniqueLocalName(name, container) { @@ -25631,6 +26392,8 @@ var ts; function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; + var sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? ts.createSourceMapWriter(host, writer) : ts.getNullSourceMapWriter(); + var setSourceFile = sourceMap.setSourceFile, emitStart = sourceMap.emitStart, emitEnd = sourceMap.emitEnd, emitPos = sourceMap.emitPos; var currentSourceFile; var currentText; var currentLineMap; @@ -25647,24 +26410,16 @@ var ts; var decorateEmitted; var paramEmitted; var awaiterEmitted; - var tempFlags; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; var exportEquals; - var hasExportStars; - var writeEmittedFiles = writeJavaScriptFile; + var hasExportStarsToExportValues; var detachedCommentsInfo; - var writeComment = ts.writeCommentRange; - var emit = emitNodeWithCommentsAndWithoutSourcemap; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; - var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; var sourceMapData; - var root; + var isOwnFileEmit; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, @@ -25683,14 +26438,29 @@ var ts; _b ); return doEmit; - function doEmit(jsFilePath, rootFile) { + function doEmit(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + generatedNameSet = {}; + nodeToGeneratedName = []; + isOwnFileEmit = !isBundledEmit; + if (isBundledEmit && modulekind) { + ts.forEach(sourceFiles, emitEmitHelpers); + } + ts.forEach(sourceFiles, emitSourceFile); + writeLine(); + var sourceMappingURL = sourceMap.getSourceMappingURL(); + if (sourceMappingURL) { + write("//# sourceMappingURL=" + sourceMappingURL); + } + writeEmittedFiles(writer.getText(), jsFilePath, sourceMapFilePath, compilerOptions.emitBOM); + sourceMap.reset(); writer.reset(); currentSourceFile = undefined; currentText = undefined; currentLineMap = undefined; exportFunctionForFile = undefined; - generatedNameSet = {}; - nodeToGeneratedName = []; + generatedNameSet = undefined; + nodeToGeneratedName = undefined; computedPropertyNamesToGeneratedNames = undefined; convertedLoopState = undefined; extendsEmitted = false; @@ -25703,31 +26473,12 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = undefined; + hasExportStarsToExportValues = undefined; detachedCommentsInfo = undefined; sourceMapData = undefined; isEs6Module = false; renamedDependencies = undefined; isCurrentFileExternalModule = false; - root = rootFile; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(jsFilePath, root); - } - if (root) { - emitSourceFile(root); - } - else { - if (modulekind) { - ts.forEach(host.getSourceFiles(), emitEmitHelpers); - } - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { - emitSourceFile(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), jsFilePath, compilerOptions.emitBOM); } function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -25738,7 +26489,8 @@ var ts; renamedDependencies = sourceFile.renamedDependencies; currentFileIdentifiers = sourceFile.identifiers; isCurrentFileExternalModule = ts.isExternalModule(sourceFile); - emit(sourceFile); + setSourceFile(sourceFile); + emitNodeWithCommentsAndWithoutSourcemap(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && @@ -25747,19 +26499,19 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_20 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_20)) { + var name_19 = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name_19)) { tempFlags |= flags; - return name_20; + return name_19; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_21 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_21)) { - return name_21; + var name_20 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_20)) { + return name_20; } } } @@ -25797,17 +26549,17 @@ var ts; switch (node.kind) { case 69: return makeUniqueName(node.text); - case 218: - case 217: + case 220: + case 219: return generateNameForModuleOrEnum(node); - case 222: - case 228: + case 224: + case 230: return generateNameForImportOrExportDeclaration(node); - case 213: - case 214: - case 227: + case 215: + case 216: + case 229: return generateNameForExportDefault(); - case 186: + case 188: return generateNameForClassExpression(); } } @@ -25815,289 +26567,14 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps(jsFilePath, root) { - var sourceMapDir; - var sourceMapSourceIndex = -1; - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; + function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark) { + if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { + ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), false); } - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } + if (sourceMapDataList) { + sourceMapDataList.push(sourceMap.getSourceMapData()); } - function recordSourceMapSpan(pos) { - var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); - sourceLinePos.line++; - sourceLinePos.character++; - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine !== emittedLine || - lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - encodeLastRecordedSourceMapSpan(); - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentText, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - sourceMapData.inputSourceFileNames.push(node.fileName); - if (compilerOptions.inlineSources) { - if (!sourceMapData.sourceMapSourcesContent) { - sourceMapData.sourceMapSourcesContent = []; - } - sourceMapData.sourceMapSourcesContent.push(node.text); - } - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - var name_22 = node.name; - if (!name_22 || name_22.kind !== 136) { - scopeName = "." + scopeName; - } - scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - recordScopeNameStart(scopeName); - } - else if (node.kind === 213 || - node.kind === 173 || - node.kind === 143 || - node.kind === 142 || - node.kind === 145 || - node.kind === 146 || - node.kind === 218 || - node.kind === 214 || - node.kind === 217) { - if (node.name) { - var name_23 = node.name; - scopeName = name_23.kind === 136 - ? ts.getTextOfNode(name_23) - : node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { - if (typeof JSON !== "undefined") { - var map_2 = { - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }; - if (sourcesContent !== undefined) { - map_2.sourcesContent = sourcesContent; - } - return JSON.stringify(map_2); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); - sourceMapDataList.push(sourceMapData); - var sourceMapUrl; - if (compilerOptions.inlineSourceMap) { - var base64SourceMapText = ts.convertToBase64(sourceMapText); - sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; - } - else { - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); - sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; - } - writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); - } - var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapSourcesContent: undefined, - sourceMapDecodedMappings: [] - }; - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithSourceMap(node) { - if (node) { - if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); - } - if (node.kind !== 248) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); - } - } - } - function emitNodeWithCommentsAndWithSourcemap(node) { - emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithCommentsAndWithSourcemap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { - ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, emitterDiagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function createTempVariable(flags) { var result = ts.createSynthesizedNode(69); @@ -26128,7 +26605,9 @@ var ts; write(";"); } } - function emitTokenText(tokenKind, startPos, emitFn) { + function emitToken(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(currentText, startPos); + emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); @@ -26136,7 +26615,9 @@ var ts; else { write(tokenString); } - return startPos + tokenString.length; + var tokenEndPos = tokenStartPos + tokenString.length; + emitPos(tokenEndPos); + return tokenEndPos; } function emitOptional(prefix, node) { if (node) { @@ -26153,11 +26634,6 @@ var ts; write(")"); } } - function emitTrailingCommaIfPresent(nodeList) { - if (nodeList.hasTrailingComma) { - write(","); - } - } function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); @@ -26323,10 +26799,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 183) { + if (node.template.kind === 185) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 181 + var needsParens = templateSpan.expression.kind === 183 && templateSpan.expression.operatorToken.kind === 24; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -26350,7 +26826,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 172 + var needsParens = templateSpan.expression.kind !== 174 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -26370,11 +26846,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 168: - case 169: - return parent.expression === template; case 170: + case 171: + return parent.expression === template; case 172: + case 174: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -26382,7 +26858,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 181: + case 183: switch (expression.operatorToken.kind) { case 37: case 39: @@ -26394,8 +26870,8 @@ var ts; default: return -1; } + case 186: case 184: - case 182: return -1; default: return 1; @@ -26418,13 +26894,13 @@ var ts; } } function emitAttributeName(name) { - if (/[A-Za-z_]+[\w*]/.test(name.text)) { - write("\""); + if (/^[A-Za-z_]\w*$/.test(name.text)) { emit(name); - write("\""); } else { + write("\""); emit(name); + write("\""); } } function emitJsxAttribute(node) { @@ -26439,7 +26915,7 @@ var ts; } function emitJsxElement(openingNode, children) { var syntheticReactRef = ts.createSynthesizedNode(69); - syntheticReactRef.text = "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; emitLeadingComments(openingNode); emitExpressionIdentifier(syntheticReactRef); @@ -26451,12 +26927,12 @@ var ts; } else { var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 239; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 241; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 239) { + if (attrs[i_1].kind === 241) { if (i_1 === 0) { write("{}, "); } @@ -26470,7 +26946,7 @@ var ts; emit(attrs[i_1].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 238); + ts.Debug.assert(attrs[i_1].kind === 240); if (haveOpenedObjectLiteral) { write(", "); } @@ -26501,10 +26977,10 @@ var ts; } if (children) { for (var i = 0; i < children.length; i++) { - if (children[i].kind === 240 && !(children[i].expression)) { + if (children[i].kind === 242 && !(children[i].expression)) { continue; } - if (children[i].kind === 236) { + if (children[i].kind === 238) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -26521,11 +26997,11 @@ var ts; write(")"); emitTrailingComments(openingNode); } - if (node.kind === 233) { + if (node.kind === 235) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 234); + ts.Debug.assert(node.kind === 236); emitJsxElement(node); } } @@ -26547,11 +27023,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 239) { + if (attribs[i].kind === 241) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 238); + ts.Debug.assert(attribs[i].kind === 240); emitJsxAttribute(attribs[i]); } } @@ -26559,11 +27035,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 234)) { + if (node.attributes.length > 0 || (node.kind === 236)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 234) { + if (node.kind === 236) { write("/>"); } else { @@ -26582,16 +27058,16 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 233) { + if (node.kind === 235) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 234); + ts.Debug.assert(node.kind === 236); emitJsxOpeningOrSelfClosingElement(node); } } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 163); + ts.Debug.assert(node.kind !== 165); if (node.kind === 9) { emitLiteral(node); } @@ -26626,59 +27102,60 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 164: - case 189: - case 181: - case 168: - case 241: - case 136: - case 182: - case 139: - case 175: - case 197: - case 167: - case 227: - case 195: - case 188: - case 199: - case 200: - case 201: - case 196: - case 234: - case 235: - case 239: - case 240: - case 169: - case 172: - case 180: - case 179: - case 204: - case 246: - case 185: - case 206: - case 170: - case 190: - case 208: - case 171: - case 176: - case 177: - case 198: - case 205: - case 184: - return true; - case 163: - case 247: - case 138: - case 245: - case 141: - case 211: - return parent.initializer === node; case 166: - return parent.expression === node; + case 191: + case 183: + case 170: + case 243: + case 136: + case 184: + case 139: + case 177: + case 199: + case 169: + case 229: + case 197: + case 190: + case 201: + case 202: + case 203: + case 198: + case 239: + case 236: + case 237: + case 241: + case 242: + case 171: case 174: + case 182: + case 181: + case 206: + case 248: + case 187: + case 208: + case 172: + case 192: + case 210: case 173: + case 178: + case 179: + case 200: + case 207: + case 186: + return true; + case 165: + case 249: + case 138: + case 247: + case 141: + case 213: + return parent.initializer === node; + case 168: + return parent.expression === node; + case 176: + case 175: return parent.body === node; - case 221: + case 223: return parent.moduleReference === node; case 135: return parent.left === node; @@ -26692,7 +27169,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 248) { + if (container.kind === 250) { if (modulekind !== 5 && modulekind !== 4) { write("exports."); } @@ -26706,15 +27183,15 @@ var ts; if (modulekind !== 5) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 223) { + if (declaration.kind === 225) { write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 226) { + else if (declaration.kind === 228) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_24 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); + var name_21 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -26745,10 +27222,10 @@ var ts; if (languageVersion < 2) { var parent_6 = node.parent; switch (parent_6.kind) { - case 163: - case 214: - case 217: - case 211: + case 165: + case 216: + case 219: + case 213: return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); } } @@ -26757,8 +27234,8 @@ var ts; function emitIdentifier(node) { if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { - var name_25 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_25); + var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_22); return; } } @@ -26782,6 +27259,9 @@ var ts; if (resolver.getNodeCheckFlags(node) & 2) { write("_this"); } + else if (convertedLoopState) { + write(convertedLoopState.thisName || (convertedLoopState.thisName = makeUniqueName("this"))); + } else { write("this"); } @@ -26855,10 +27335,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 181 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 183 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 182 && node.parent.condition === node) { + else if (node.parent.kind === 184 && node.parent.condition === node) { return true; } return false; @@ -26866,11 +27346,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69: - case 164: case 166: - case 167: case 168: - case 172: + case 169: + case 170: + case 174: return false; } return true; @@ -26887,17 +27367,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 185) { + if (e.kind === 187) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 164) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 185) { + while (i < length && elements[i].kind !== 187) { i++; } write("["); @@ -26920,7 +27400,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 185; + return node.kind === 187; } function emitArrayLiteral(node) { var elements = node.elements; @@ -27032,10 +27512,10 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 245) { + if (property.kind === 247) { emit(property.initializer); } - else if (property.kind === 246) { + else if (property.kind === 248) { emitExpressionIdentifier(property.name); } else if (property.kind === 143) { @@ -27084,35 +27564,35 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(181, startsOnNewLine); + var result = ts.createSynthesizedNode(183, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(168); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(167); + var result = ts.createSynthesizedNode(169); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - while (expr.kind === 171 || expr.kind === 189) { + while (expr.kind === 173 || expr.kind === 191) { expr = expr.expression; } if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 169 && + expr.kind !== 171 && expr.kind !== 8) { return expr; } - var node = ts.createSynthesizedNode(172); + var node = ts.createSynthesizedNode(174); node.expression = expr; return node; } @@ -27139,7 +27619,7 @@ var ts; } function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 248; + return container && container.kind !== 250; } function emitShorthandPropertyAssignment(node) { writeTextOfNode(currentText, node.name); @@ -27157,7 +27637,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 166 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 168 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -27168,7 +27648,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 166 || node.kind === 167 + return node.kind === 168 || node.kind === 169 ? resolver.getConstantValue(node) : undefined; } @@ -27251,6 +27731,9 @@ var ts; case 135: emitQualifiedNameAsExpression(node, useFallback); break; + default: + emitNodeWithoutSourceMap(node); + break; } } function emitIndexedAccess(node) { @@ -27263,10 +27746,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 185; }); + return ts.forEach(elements, function (e) { return e.kind === 187; }); } function skipParentheses(node) { - while (node.kind === 172 || node.kind === 171 || node.kind === 189) { + while (node.kind === 174 || node.kind === 173 || node.kind === 191) { node = node.expression; } return node; @@ -27287,12 +27770,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 166) { + if (expr.kind === 168) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 167) { + else if (expr.kind === 169) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -27333,7 +27816,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 166 && node.expression.expression.kind === 95; + superCall = node.expression.kind === 168 && node.expression.expression.kind === 95; } if (superCall && languageVersion < 2) { write(".call("); @@ -27384,21 +27867,21 @@ var ts; } } function emitParenExpression(node) { - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 174) { - if (node.expression.kind === 171 || node.expression.kind === 189) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176) { + if (node.expression.kind === 173 || node.expression.kind === 191) { var operand = node.expression.expression; - while (operand.kind === 171 || operand.kind === 189) { + while (operand.kind === 173 || operand.kind === 191) { operand = operand.expression; } - if (operand.kind !== 179 && + if (operand.kind !== 181 && + operand.kind !== 179 && + operand.kind !== 178 && operand.kind !== 177 && - operand.kind !== 176 && - operand.kind !== 175 && - operand.kind !== 180 && - operand.kind !== 169 && - !(operand.kind === 168 && node.parent.kind === 169) && - !(operand.kind === 173 && node.parent.kind === 168) && - !(operand.kind === 8 && node.parent.kind === 166)) { + operand.kind !== 182 && + operand.kind !== 171 && + !(operand.kind === 170 && node.parent.kind === 171) && + !(operand.kind === 175 && node.parent.kind === 170) && + !(operand.kind === 8 && node.parent.kind === 168)) { emit(operand); return; } @@ -27427,21 +27910,22 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 211 || node.parent.kind === 163); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 || node.parent.kind === 165); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); } function emitPrefixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + var exportChanged = (node.operator === 41 || node.operator === 42) && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); if (exportChanged) { write(exportFunctionForFile + "(\""); emitNodeWithoutSourceMap(node.operand); write("\", "); } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 179) { + if (node.operand.kind === 181) { var operand = node.operand; if (node.operator === 35 && (operand.operator === 35 || operand.operator === 41)) { write(" "); @@ -27484,10 +27968,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 248) { + if (current.kind === 250) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 219) { + else if (ts.isFunctionLike(current) || current.kind === 221) { return false; } else { @@ -27503,7 +27987,7 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(167, false); + synthesizedLHS = ts.createSynthesizedNode(169, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 && @@ -27520,7 +28004,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(166, false); + synthesizedLHS = ts.createSynthesizedNode(168, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -27548,8 +28032,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 56 && - (node.left.kind === 165 || node.left.kind === 164)) { - emitDestructuring(node, node.parent.kind === 195); + (node.left.kind === 167 || node.left.kind === 166)) { + emitDestructuring(node, node.parent.kind === 197); } else { var exportChanged = node.operatorToken.kind >= 56 && @@ -27601,7 +28085,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 192) { + if (node && node.kind === 194) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -27615,22 +28099,20 @@ var ts; } emitToken(15, node.pos); increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 219) { - ts.Debug.assert(node.parent.kind === 218); + if (node.kind === 221) { + ts.Debug.assert(node.parent.kind === 220); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 219) { + if (node.kind === 221) { emitTempDeclarations(true); } decreaseIndent(); writeLine(); emitToken(16, node.statements.end); - scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 192) { + if (node.kind === 194) { write(" "); emit(node); } @@ -27642,7 +28124,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 174); + emitParenthesizedIf(node.expression, node.expression.kind === 176); write(";"); } function emitIfStatement(node) { @@ -27655,7 +28137,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80, node.thenStatement.end); - if (node.elseStatement.kind === 196) { + if (node.elseStatement.kind === 198) { write(" "); emit(node.elseStatement); } @@ -27675,7 +28157,7 @@ var ts; else { emitNormalLoopBody(node, true); } - if (node.statement.kind === 192) { + if (node.statement.kind === 194) { write(" "); } else { @@ -27766,7 +28248,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 207) { + if (node.parent.kind === 209) { emitLabelAndColon(node.parent); } loopEmitter(node, loop); @@ -27776,10 +28258,10 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 199: - case 200: case 201: - if (node.initializer.kind === 212) { + case 202: + case 203: + if (node.initializer.kind === 214) { loopInitializer = node.initializer; } break; @@ -27792,7 +28274,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 192; + var bodyIsBlock = node.statement.kind === 194; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -27807,6 +28289,9 @@ var ts; if (convertedOuterLoopState.argumentsName) { convertedLoopState.argumentsName = convertedOuterLoopState.argumentsName; } + if (convertedOuterLoopState.thisName) { + convertedLoopState.thisName = convertedOuterLoopState.thisName; + } if (convertedOuterLoopState.hoistedLocalVariables) { convertedLoopState.hoistedLocalVariables = convertedOuterLoopState.hoistedLocalVariables; } @@ -27828,6 +28313,15 @@ var ts; writeLine(); } } + if (convertedLoopState.thisName) { + if (convertedOuterLoopState) { + convertedOuterLoopState.thisName = convertedLoopState.thisName; + } + else { + write("var " + convertedLoopState.thisName + " = this;"); + writeLine(); + } + } if (convertedLoopState.hoistedLocalVariables) { if (convertedOuterLoopState) { convertedOuterLoopState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; @@ -27877,7 +28371,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 192) { + else if (node.statement.kind === 194) { emitLines(node.statement.statements); } else { @@ -27973,7 +28467,7 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer && node.initializer.kind === 212) { + if (node.initializer && node.initializer.kind === 214) { var variableDeclarationList = node.initializer; var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); if (startIsEmitted) { @@ -27999,7 +28493,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 201) { + if (languageVersion < 2 && node.kind === 203) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -28010,7 +28504,7 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); @@ -28020,7 +28514,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 200) { + if (node.kind === 202) { write(" in "); } else { @@ -28035,9 +28529,6 @@ var ts; emitNormalLoopBody(node, true); } } - function emitDownLevelForOfStatement(node) { - emitLoop(node, emitDownLevelForOfStatementWorker); - } function emitDownLevelForOfStatementWorker(node, loop) { var endPos = emitToken(86, node.pos); write(" "); @@ -28076,7 +28567,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 212) { + if (node.initializer.kind === 214) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -28098,7 +28589,7 @@ var ts; } else { var assignmentExpression = createBinaryExpression(node.initializer, 56, rhsIterationValue, false); - if (node.initializer.kind === 164 || node.initializer.kind === 165) { + if (node.initializer.kind === 166 || node.initializer.kind === 167) { emitDestructuring(assignmentExpression, true, undefined); } else { @@ -28120,12 +28611,12 @@ var ts; } function emitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 203 ? 2 : 4; + var jump = node.kind === 205 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 203) { + if (node.kind === 205) { convertedLoopState.nonLocalJumps |= 2; write("return \"break\";"); } @@ -28136,7 +28627,7 @@ var ts; } else { var labelMarker; - if (node.kind === 203) { + if (node.kind === 205) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -28149,7 +28640,7 @@ var ts; return; } } - emitToken(node.kind === 203 ? 70 : 75, node.pos); + emitToken(node.kind === 205 ? 70 : 75, node.pos); emitOptional(" ", node.label); write(";"); } @@ -28214,7 +28705,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 241) { + if (node.kind === 243) { write("case "); emit(node.expression); write(":"); @@ -28283,7 +28774,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 218); + } while (node && node.kind !== 220); return node; } function emitContainingModuleName(node) { @@ -28308,20 +28799,20 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8); zero.text = "0"; - var result = ts.createSynthesizedNode(177); + var result = ts.createSynthesizedNode(179); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 248) { - ts.Debug.assert(!!(node.flags & 512) || node.kind === 227); + if (node.parent.kind === 250) { + ts.Debug.assert(!!(node.flags & 512) || node.kind === 229); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { if (!isEs6Module) { - if (languageVersion === 1) { + if (languageVersion !== 0) { write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); } - else if (languageVersion === 0) { + else { write("exports.__esModule = true;"); writeLine(); } @@ -28409,7 +28900,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 211 || name.parent.kind === 163); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 || name.parent.kind === 165); if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } @@ -28433,7 +28924,7 @@ var ts; function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var canDefineTempVariablesInPlace = false; - if (root.kind === 211) { + if (root.kind === 213) { var isExported = ts.getCombinedNodeFlags(root) & 2; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; @@ -28441,7 +28932,7 @@ var ts; else if (root.kind === 138) { canDefineTempVariablesInPlace = true; } - if (root.kind === 181) { + if (root.kind === 183) { emitAssignmentExpression(root); } else { @@ -28458,14 +28949,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value, true); - var equals = ts.createSynthesizedNode(181); + var equals = ts.createSynthesizedNode(183); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(182); + var cond = ts.createSynthesizedNode(184); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53); cond.whenTrue = whenTrue; @@ -28493,7 +28984,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(168); + var call = ts.createSynthesizedNode(170); var sliceIdentifier = ts.createSynthesizedNode(69); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -28508,9 +28999,9 @@ var ts; } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 245 || p.kind === 246) { + if (p.kind === 247 || p.kind === 248) { var propName = p.name; - var target_1 = p.kind === 246 ? p : p.initializer || propName; + var target_1 = p.kind === 248 ? p : p.initializer || propName; emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); } } @@ -28522,8 +29013,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187) { - if (e.kind !== 185) { + if (e.kind !== 189) { + if (e.kind !== 187) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -28533,20 +29024,20 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 246) { + if (target.kind === 248) { if (target.objectAssignmentInitializer) { value = createDefaultValueCheck(value, target.objectAssignmentInitializer); } target = target.name; } - else if (target.kind === 181 && target.operatorToken.kind === 56) { + else if (target.kind === 183 && target.operatorToken.kind === 56) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 165) { + if (target.kind === 167) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 164) { + else if (target.kind === 166) { emitArrayLiteralAssignment(target, value); } else { @@ -28564,14 +29055,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 172) { + if (root.parent.kind !== 174) { write("("); } value = ensureIdentifier(value, true); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 172) { + if (root.parent.kind !== 174) { write(")"); } } @@ -28592,11 +29083,11 @@ var ts; } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 161) { + if (pattern.kind === 163) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 187) { + else if (element.kind !== 189) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -28628,8 +29119,8 @@ var ts; var isLetDefinedInLoop = (resolver.getNodeCheckFlags(node) & 16384) && (getCombinedFlagsForIdentifier(node.name) & 8192); if (isLetDefinedInLoop && - node.parent.parent.kind !== 200 && - node.parent.parent.kind !== 201) { + node.parent.parent.kind !== 202 && + node.parent.parent.kind !== 203) { initializer = createVoidZero(); } } @@ -28647,7 +29138,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 187) { + if (node.kind === 189) { return; } var name = node.name; @@ -28659,7 +29150,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 211 && node.parent.kind !== 163)) { + if (!node.parent || (node.parent.kind !== 213 && node.parent.kind !== 165)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -28667,7 +29158,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2) && modulekind === 5 && - node.parent.kind === 248; + node.parent.kind === 250; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -28712,12 +29203,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_26 = createTempVariable(0); + var name_23 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_26); - emit(name_26); + tempParameters.push(name_23); + emit(name_23); } else { emit(node.name); @@ -28821,7 +29312,7 @@ var ts; emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 174 && languageVersion >= 2; + return node.kind === 176 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { @@ -28832,20 +29323,24 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 173) { + if (node.kind === 175) { return !!node.name; } - if (node.kind === 213) { - return !!node.name || languageVersion < 2; + if (node.kind === 215) { + return !!node.name || modulekind !== 5; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { return emitCommentsOnNotEmittedNode(node); } - if (node.kind !== 143 && node.kind !== 142 && - node.parent && node.parent.kind !== 245 && - node.parent.kind !== 168) { + var kind = node.kind, parent = node.parent; + if (kind !== 143 && + kind !== 142 && + parent && + parent.kind !== 247 && + parent.kind !== 170 && + parent.kind !== 166) { emitLeadingComments(node); } emitStart(node); @@ -28866,11 +29361,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 && node.kind === 213 && node.parent === currentSourceFile && node.name) { + if (modulekind !== 5 && kind === 215 && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (node.kind !== 143 && node.kind !== 142) { + if (kind !== 143 && kind !== 142) { emitTrailingComments(node); } } @@ -28902,7 +29397,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 174; + var isArrowFunction = node.kind === 176; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; if (!isArrowFunction) { write(" {"); @@ -28912,17 +29407,16 @@ var ts; } write(" __awaiter(this"); if (hasLexicalArguments) { - write(", arguments"); + write(", arguments, "); } else { - write(", void 0"); + write(", void 0, "); } if (promiseConstructor) { - write(", "); - emitNodeWithoutSourceMap(promiseConstructor); + emitEntityNameAsExpression(promiseConstructor, false); } else { - write(", Promise"); + write("Promise"); } if (hasLexicalArguments) { write(", function* (_arguments)"); @@ -28944,7 +29438,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 192) { + if (node.body.kind === 194) { emitBlockFunctionBody(node, node.body); } else { @@ -28969,7 +29463,7 @@ var ts; emitSignatureParameters(node); } var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync && languageVersion === 2) { + if (isAsync) { emitAsyncFunctionBodyForES6(node); } else { @@ -28996,14 +29490,13 @@ var ts; } write(" "); var current = body; - while (current.kind === 171) { + while (current.kind === 173) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 165); + emitParenthesizedIf(body, current.kind === 167); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); increaseIndent(); var outPos = writer.getTextPos(); emitDetachedCommentsAndUpdateCommentsInfo(node.body); @@ -29024,8 +29517,10 @@ var ts; increaseIndent(); writeLine(); emitLeadingComments(node.body); + emitStart(body); write("return "); emit(body); + emitEnd(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -29035,11 +29530,9 @@ var ts; emitStart(node.body); write("}"); emitEnd(node.body); - scopeEmitEnd(); } function emitBlockFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedCommentsAndUpdateCommentsInfo(body.statements); @@ -29066,14 +29559,13 @@ var ts; decreaseIndent(); } emitToken(16, body.statements.end); - scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 195) { + if (statement && statement.kind === 197) { var expr = statement.expression; - if (expr && expr.kind === 168) { + if (expr && expr.kind === 170) { var func = expr.expression; if (func && func.kind === 95) { return statement; @@ -29156,7 +29648,7 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 191) { + if (member.kind === 193) { writeLine(); write(";"); } @@ -29253,7 +29745,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 191) { + else if (member.kind === 193) { writeLine(); write(";"); } @@ -29314,7 +29806,6 @@ var ts; } var startIndex = 0; write(" {"); - scopeEmitStart(node, "constructor"); increaseIndent(); if (ctor) { startIndex = emitDirectivePrologues(ctor.body.statements, true); @@ -29362,7 +29853,6 @@ var ts; } decreaseIndent(); emitToken(16, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { emitTrailingComments(ctor); @@ -29387,7 +29877,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 214) { + if (node.kind === 216) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 512)) { write("export "); @@ -29404,7 +29894,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 186; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -29414,7 +29904,7 @@ var ts; write(" = "); } write("class"); - if ((node.name || (node.flags & 512 && staticProperties.length > 0)) && !thisNodeIsDecorated) { + if ((node.name || (node.flags & 512 && (staticProperties.length > 0 || modulekind !== 5))) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -29425,14 +29915,12 @@ var ts; } write(" {"); increaseIndent(); - scopeEmitStart(node); writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); if (thisNodeIsDecorated) { write(";"); } @@ -29454,24 +29942,34 @@ var ts; emitPropertyDeclarations(node, staticProperties); emitDecoratorsOfClass(node); } - if (!isES6ExportedDeclaration(node) && (node.flags & 2)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!(node.flags & 2)) { + return; } - else if (isES6ExportedDeclaration(node) && (node.flags & 512) && thisNodeIsDecorated) { - writeLine(); - write("export default "); - emitDeclarationName(node); - write(";"); + if (modulekind !== 5) { + emitExportMemberAssignment(node); + } + else { + if (node.flags & 512) { + if (thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + else if (node.parent.kind !== 250) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 214) { + if (node.kind === 216) { if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); } @@ -29495,7 +29993,6 @@ var ts; tempParameters = undefined; computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); - scopeEmitStart(node); if (baseTypeNode) { writeLine(); emitStart(baseTypeNode); @@ -29526,18 +30023,17 @@ var ts; decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); emitStart(node); - write(")("); + write("("); if (baseTypeNode) { emit(baseTypeNode.expression); } - write(")"); - if (node.kind === 214) { + write("))"); + if (node.kind === 216) { write(";"); } emitEnd(node); - if (node.kind === 214) { + if (node.kind === 216) { emitExportMemberAssignment(node); } } @@ -29555,30 +30051,29 @@ var ts; function emitDecoratorsOfConstructor(node) { var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); - if (!decorators && !hasDecoratedParameters) { + var firstParameterDecorator = constructor && ts.forEach(constructor.parameters, function (parameter) { return parameter.decorators; }); + if (!decorators && !firstParameterDecorator) { return; } writeLine(); - emitStart(node); + emitStart(node.decorators || firstParameterDecorator); emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + } emitSerializedTypeMetadata(node, argumentsWritten >= 0); decreaseIndent(); writeLine(); write("], "); emitDeclarationName(node); - write(");"); - emitEnd(node); + write(")"); + emitEnd(node.decorators || firstParameterDecorator); + write(";"); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { @@ -29590,9 +30085,6 @@ var ts; if (!ts.nodeCanBeDecorated(member)) { continue; } - if (!ts.nodeOrChildIsDecorated(member)) { - continue; - } var decorators = void 0; var functionLikeMember = void 0; if (ts.isAccessor(member)) { @@ -29612,27 +30104,27 @@ var ts; functionLikeMember = member; } } + var firstParameterDecorator = functionLikeMember && ts.forEach(functionLikeMember.parameters, function (parameter) { return parameter.decorators; }); + if (!decorators && !firstParameterDecorator) { + continue; + } writeLine(); - emitStart(member); + emitStart(decorators || firstParameterDecorator); write("__decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + } emitSerializedTypeMetadata(member, argumentsWritten > 0); decreaseIndent(); writeLine(); write("], "); - emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); - emitEnd(member.name); if (languageVersion > 0) { if (member.kind !== 141) { write(", null"); @@ -29641,8 +30133,9 @@ var ts; write(", void 0"); } } - write(");"); - emitEnd(member); + write(")"); + emitEnd(decorators || firstParameterDecorator); + write(";"); writeLine(); } } @@ -29655,15 +30148,13 @@ var ts; if (ts.nodeIsDecorated(parameter)) { var decorators = parameter.decorators; argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { - emitStart(decorator); write("__param(" + parameterIndex + ", "); emit(decorator.expression); write(")"); - emitEnd(decorator); }); leadingComma = true; } - ++parameterIndex; + parameterIndex++; } } return argumentsWritten; @@ -29687,7 +30178,7 @@ var ts; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 214: + case 216: case 143: case 146: return true; @@ -29696,7 +30187,7 @@ var ts; } function emitSerializedTypeOfNode(node) { switch (node.kind) { - case 214: + case 216: write("Function"); return; case 141: @@ -29740,7 +30231,7 @@ var ts; write("Boolean"); return; case 130: - case 9: + case 162: write("String"); return; case 128: @@ -29757,6 +30248,7 @@ var ts; case 158: case 159: case 117: + case 161: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -29770,8 +30262,7 @@ var ts; while (ts.isDeclaration(location) || ts.isTypeNode(location)) { location = location.parent; } - var typeName = ts.cloneEntityName(node.typeName); - typeName.parent = location; + var typeName = ts.cloneEntityName(node.typeName, location); var result = resolver.getTypeReferenceSerializationKind(typeName); switch (result) { case ts.TypeReferenceSerializationKind.Unknown: @@ -29821,7 +30312,7 @@ var ts; function emitSerializedParameterTypesOfNode(node) { if (node) { var valueDeclaration; - if (node.kind === 214) { + if (node.kind === 216) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -29911,9 +30402,10 @@ var ts; return; } if (!shouldHoistDeclarationInSystemJsModule(node)) { - if (!(node.flags & 2) || isES6ExportedDeclaration(node)) { + var isES6ExportedEnum = isES6ExportedDeclaration(node); + if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219))) { emitStart(node); - if (isES6ExportedDeclaration(node)) { + if (isES6ExportedEnum) { write("export "); } write("var "); @@ -29930,12 +30422,10 @@ var ts; emitEnd(node.name); write(") {"); increaseIndent(); - scopeEmitStart(node); emitLines(node.members); decreaseIndent(); writeLine(); emitToken(16, node.members.end); - scopeEmitEnd(); write(")("); emitModuleMemberName(node); write(" || ("); @@ -29993,7 +30483,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 218) { + if (moduleDeclaration.body.kind === 220) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -30004,6 +30494,9 @@ var ts; function isModuleMergedWithES6Class(node) { return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 32768); } + function isFirstDeclarationOfKind(node, declarations, kind) { + return !ts.forEach(declarations, function (declaration) { return declaration.kind === kind && declaration.pos < node.pos; }); + } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { @@ -30012,15 +30505,18 @@ var ts; var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + var isES6ExportedNamespace = isES6ExportedDeclaration(node); + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220)) { + emitStart(node); + if (isES6ExportedNamespace) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); } emitStart(node); write("(function ("); @@ -30028,7 +30524,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 219) { + if (node.body.kind === 221) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -30044,7 +30540,6 @@ var ts; else { write("{"); increaseIndent(); - scopeEmitStart(node); emitCaptureThisForNodeIfNecessary(node); writeLine(); emit(node.body); @@ -30052,7 +30547,6 @@ var ts; writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; emitToken(16, moduleBlock.statements.end); - scopeEmitEnd(); } write(")("); if ((node.flags & 2) && !isES6ExportedDeclaration(node)) { @@ -30101,16 +30595,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 221) { + if (node.kind === 223) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 224) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 222 && node.importClause && !!node.importClause.name; + return node.kind === 224 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -30137,7 +30631,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 224) { + if (node.importClause.namedBindings.kind === 226) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -30163,7 +30657,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 221 && (node.flags & 2) !== 0; + var isExportedImport = node.kind === 223 && (node.flags & 2) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2) { emitLeadingComments(node); @@ -30175,7 +30669,7 @@ var ts; write(" = "); } else { - var isNakedImport = 222 && !node.importClause; + var isNakedImport = 224 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -30282,15 +30776,17 @@ var ts; } } else { - writeLine(); - write("__export("); - if (modulekind !== 2) { - emitRequire(ts.getExternalModuleName(node)); + if (hasExportStarsToExportValues && resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + writeLine(); + write("__export("); + if (modulekind !== 2) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); } - else { - write(generatedName); - } - write(");"); } emitEnd(node); } @@ -30340,8 +30836,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 213 && - expression.kind !== 214) { + if (expression.kind !== 215 && + expression.kind !== 216) { write(";"); } emitEnd(node); @@ -30374,26 +30870,28 @@ var ts; externalImports = []; exportSpecifiers = {}; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 222: + case 224: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 221: - if (node.moduleReference.kind === 232 && resolver.isReferencedAliasDeclaration(node)) { + case 223: + if (node.moduleReference.kind === 234 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 228: + case 230: if (node.moduleSpecifier) { if (!node.exportClause) { - externalImports.push(node); - hasExportStars = true; + if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } } else if (resolver.isValueAliasDeclaration(node)) { externalImports.push(node); @@ -30402,12 +30900,12 @@ var ts; else { for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_27 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_27] || (exportSpecifiers[name_27] = [])).push(specifier); + var name_24 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); } } break; - case 227: + case 229: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -30416,7 +30914,7 @@ var ts; } } function emitExportStarHelper() { - if (hasExportStars) { + if (hasExportStarsToExportValues) { writeLine(); write("function __export(m) {"); increaseIndent(); @@ -30432,14 +30930,20 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 222 && node.importClause) { + if (node.kind === 224 && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 228 && node.moduleSpecifier) { + if (node.kind === 230 && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } - function getExternalModuleNameText(importNode) { + function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { + if (emitRelativePathAsModuleName) { + var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_25) { + return "\"" + name_25 + "\""; + } + } var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 9) { return tryRenameExternalModule(moduleName) || getLiteralText(moduleName); @@ -30454,8 +30958,8 @@ var ts; var started = false; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; - var skipNode = importNode.kind === 228 || - (importNode.kind === 222 && !importNode.importClause); + var skipNode = importNode.kind === 230 || + (importNode.kind === 224 && !importNode.importClause); if (skipNode) { continue; } @@ -30473,14 +30977,14 @@ var ts; } } function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { - if (!hasExportStars) { + if (!hasExportStarsToExportValues) { return undefined; } if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 228 && externalImport.exportClause) { + if (externalImport.kind === 230 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -30495,7 +30999,7 @@ var ts; increaseIndent(); var started = false; if (exportedDeclarations) { - for (var i = 0; i < exportedDeclarations.length; ++i) { + for (var i = 0; i < exportedDeclarations.length; i++) { writeExportedName(exportedDeclarations[i]); } } @@ -30509,7 +31013,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 228) { + if (externalImport.kind !== 230) { continue; } var exportDecl = externalImport; @@ -30581,13 +31085,13 @@ var ts; writeLine(); write("var "); var seen = {}; - for (var i = 0; i < hoistedVars.length; ++i) { + for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_28 = local.kind === 69 + var name_26 = local.kind === 69 ? local : local.name; - if (name_28) { - var text = ts.unescapeIdentifier(name_28.text); + if (name_26) { + var text = ts.unescapeIdentifier(name_26.text); if (ts.hasProperty(seen, text)) { continue; } @@ -30598,7 +31102,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 214 || local.kind === 218 || local.kind === 217) { + if (local.kind === 216 || local.kind === 220 || local.kind === 219) { emitDeclarationName(local); } else { @@ -30632,21 +31136,21 @@ var ts; if (node.flags & 4) { return; } - if (node.kind === 213) { + if (node.kind === 215) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 214) { + if (node.kind === 216) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 217) { + if (node.kind === 219) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30655,7 +31159,7 @@ var ts; } return; } - if (node.kind === 218) { + if (node.kind === 220) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30664,17 +31168,17 @@ var ts; } return; } - if (node.kind === 211 || node.kind === 163) { + if (node.kind === 213 || node.kind === 165) { if (shouldHoistVariable(node, false)) { - var name_29 = node.name; - if (name_29.kind === 69) { + var name_27 = node.name; + if (name_27.kind === 69) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_29); + hoistedVars.push(name_27); } else { - ts.forEachChild(name_29, visit); + ts.forEachChild(name_27, visit); } } return; @@ -30700,7 +31204,7 @@ var ts; return false; } return (ts.getCombinedNodeFlags(node) & 24576) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 248; + ts.getEnclosingBlockScopeContainer(node).kind === 250; } function isCurrentFileSystemExternalModule() { return modulekind === 4 && isCurrentFileExternalModule; @@ -30724,7 +31228,7 @@ var ts; } function emitSetters(exportStarFunction, dependencyGroups) { write("setters:["); - for (var i = 0; i < dependencyGroups.length; ++i) { + for (var i = 0; i < dependencyGroups.length; i++) { if (i !== 0) { write(","); } @@ -30738,24 +31242,24 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 222: + case 224: if (!entry.importClause) { break; } - case 221: + case 223: ts.Debug.assert(importVariableName !== ""); writeLine(); write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 228: + case 230: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { writeLine(); write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; ++i_2) { + for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { if (i_2 !== 0) { write(","); writeLine(); @@ -30789,13 +31293,13 @@ var ts; write("execute: function() {"); increaseIndent(); writeLine(); - for (var i = startIndex; i < node.statements.length; ++i) { + for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { - case 213: - case 222: + case 215: + case 224: continue; - case 228: + case 230: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -30803,7 +31307,7 @@ var ts; } } continue; - case 221: + case 223: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { continue; } @@ -30832,8 +31336,8 @@ var ts; write("["); var groupIndices = {}; var dependencyGroups = []; - for (var i = 0; i < externalImports.length; ++i) { - var text = getExternalModuleNameText(externalImports[i]); + for (var i = 0; i < externalImports.length; i++) { + var text = getExternalModuleNameText(externalImports[i], emitRelativePathAsModuleName); if (ts.hasProperty(groupIndices, text)) { var groupIndex = groupIndices[text]; dependencyGroups[groupIndex].push(externalImports[i]); @@ -30846,18 +31350,12 @@ var ts; if (i !== 0) { write(", "); } - if (emitRelativePathAsModuleName) { - var name_30 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); - if (name_30) { - text = "\"" + name_30 + "\""; - } - } write(text); } write("], function(" + exportFunctionForFile + ") {"); writeLine(); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitSystemModuleBody(node, dependencyGroups, startIndex); @@ -30881,13 +31379,7 @@ var ts; } for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; - var externalModuleName = getExternalModuleNameText(importNode); - if (emitRelativePathAsModuleName) { - var name_31 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_31) { - externalModuleName = "\"" + name_31 + "\""; - } - } + var externalModuleName = getExternalModuleNameText(importNode, emitRelativePathAsModuleName); var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); @@ -30935,7 +31427,7 @@ var ts; writeModuleName(node, emitRelativePathAsModuleName); emitAMDDependencies(node, true, emitRelativePathAsModuleName); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -30946,7 +31438,7 @@ var ts; write("});"); } function emitCommonJSModule(node) { - var startIndex = emitDirectivePrologues(node.statements, false); + var startIndex = emitDirectivePrologues(node.statements, false, true); emitEmitHelpers(node); collectExternalModuleInfo(node); emitExportStarHelper(); @@ -30965,7 +31457,7 @@ var ts; writeLines(" }\n})("); emitAMDFactoryHeader(dependencyNames); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, true); + var startIndex = emitDirectivePrologues(node.statements, true, true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -30979,7 +31471,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; var startIndex = emitDirectivePrologues(node.statements, false); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); @@ -31035,7 +31527,8 @@ var ts; if (result) { result = result.replace(/&(\w+);/g, function (s, m) { if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + var ch = String.fromCharCode(entities[m]); + return ch === "\"" ? "\\\"" : ch; } else { return s; @@ -31087,23 +31580,40 @@ var ts; } } } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { + function isUseStrictPrologue(node) { + return !!node.expression.text.match(/use strict/); + } + function ensureUseStrictPrologue(startWithNewLine, writeUseStrict) { + if (writeUseStrict) { + if (startWithNewLine) { + writeLine(); + } + write("\"use strict\";"); + } + } + function emitDirectivePrologues(statements, startWithNewLine, ensureUseStrict) { + var foundUseStrict = false; + for (var i = 0; i < statements.length; i++) { if (ts.isPrologueDirective(statements[i])) { + if (isUseStrictPrologue(statements[i])) { + foundUseStrict = true; + } if (startWithNewLine || i > 0) { writeLine(); } emit(statements[i]); } else { + ensureUseStrictPrologue(startWithNewLine || i > 0, !foundUseStrict && ensureUseStrict); return i; } } + ensureUseStrictPrologue(startWithNewLine, !foundUseStrict && ensureUseStrict); return statements.length; } function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); - for (var i = 0; i < lines.length; ++i) { + for (var i = 0; i < lines.length; i++) { var line = lines[i]; if (line.length) { writeLine(); @@ -31139,7 +31649,7 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + if (isOwnFileEmit || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1]; emitModule(node); } @@ -31152,7 +31662,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -31160,6 +31670,9 @@ var ts; } emitLeadingComments(node.endOfFileToken); } + function emit(node) { + emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); + } function emitNodeWithCommentsAndWithoutSourcemap(node) { emitNodeConsideringCommentsOption(node, emitNodeWithoutSourceMap); } @@ -31181,6 +31694,13 @@ var ts; } } } + function emitNodeWithSourceMap(node) { + if (node) { + emitStart(node); + emitNodeWithoutSourceMap(node); + emitEnd(node); + } + } function emitNodeWithoutSourceMap(node) { if (node) { emitJavaScriptWorker(node); @@ -31188,28 +31708,28 @@ var ts; } function isSpecializedCommentHandling(node) { switch (node.kind) { + case 217: case 215: - case 213: - case 222: - case 221: - case 216: - case 227: + case 224: + case 223: + case 218: + case 229: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 193: + case 195: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 218: + case 220: return shouldEmitModuleDeclaration(node); - case 217: + case 219: return shouldEmitEnumDeclaration(node); } ts.Debug.assert(!isSpecializedCommentHandling(node)); - if (node.kind !== 192 && + if (node.kind !== 194 && node.parent && - node.parent.kind === 174 && + node.parent.kind === 176 && node.parent.body === node && compilerOptions.target <= 1) { return false; @@ -31246,142 +31766,142 @@ var ts; case 13: case 14: return emitLiteral(node); - case 183: + case 185: return emitTemplateExpression(node); - case 190: + case 192: return emitTemplateSpan(node); - case 233: - case 234: - return emitJsxElement(node); + case 235: case 236: + return emitJsxElement(node); + case 238: return emitJsxText(node); - case 240: + case 242: return emitJsxExpression(node); case 135: return emitQualifiedName(node); - case 161: - return emitObjectBindingPattern(node); - case 162: - return emitArrayBindingPattern(node); case 163: - return emitBindingElement(node); + return emitObjectBindingPattern(node); case 164: - return emitArrayLiteral(node); + return emitArrayBindingPattern(node); case 165: + return emitBindingElement(node); + case 166: + return emitArrayLiteral(node); + case 167: return emitObjectLiteral(node); - case 245: + case 247: return emitPropertyAssignment(node); - case 246: + case 248: return emitShorthandPropertyAssignment(node); case 136: return emitComputedPropertyName(node); - case 166: - return emitPropertyAccess(node); - case 167: - return emitIndexedAccess(node); case 168: - return emitCallExpression(node); + return emitPropertyAccess(node); case 169: - return emitNewExpression(node); + return emitIndexedAccess(node); case 170: - return emitTaggedTemplateExpression(node); + return emitCallExpression(node); case 171: - return emit(node.expression); - case 189: - return emit(node.expression); + return emitNewExpression(node); case 172: - return emitParenExpression(node); - case 213: + return emitTaggedTemplateExpression(node); case 173: + return emit(node.expression); + case 191: + return emit(node.expression); case 174: - return emitFunctionDeclaration(node); - case 175: - return emitDeleteExpression(node); - case 176: - return emitTypeOfExpression(node); - case 177: - return emitVoidExpression(node); - case 178: - return emitAwaitExpression(node); - case 179: - return emitPrefixUnaryExpression(node); - case 180: - return emitPostfixUnaryExpression(node); - case 181: - return emitBinaryExpression(node); - case 182: - return emitConditionalExpression(node); - case 185: - return emitSpreadElementExpression(node); - case 184: - return emitYieldExpression(node); - case 187: - return; - case 192: - case 219: - return emitBlock(node); - case 193: - return emitVariableStatement(node); - case 194: - return write(";"); - case 195: - return emitExpressionStatement(node); - case 196: - return emitIfStatement(node); - case 197: - return emitDoStatement(node); - case 198: - return emitWhileStatement(node); - case 199: - return emitForStatement(node); - case 201: - case 200: - return emitForInOrForOfStatement(node); - case 202: - case 203: - return emitBreakOrContinueStatement(node); - case 204: - return emitReturnStatement(node); - case 205: - return emitWithStatement(node); - case 206: - return emitSwitchStatement(node); - case 241: - case 242: - return emitCaseOrDefaultClause(node); - case 207: - return emitLabeledStatement(node); - case 208: - return emitThrowStatement(node); - case 209: - return emitTryStatement(node); - case 244: - return emitCatchClause(node); - case 210: - return emitDebuggerStatement(node); - case 211: - return emitVariableDeclaration(node); - case 186: - return emitClassExpression(node); - case 214: - return emitClassDeclaration(node); + return emitParenExpression(node); case 215: - return emitInterfaceDeclaration(node); - case 217: - return emitEnumDeclaration(node); - case 247: - return emitEnumMember(node); - case 218: - return emitModuleDeclaration(node); - case 222: - return emitImportDeclaration(node); + case 175: + case 176: + return emitFunctionDeclaration(node); + case 177: + return emitDeleteExpression(node); + case 178: + return emitTypeOfExpression(node); + case 179: + return emitVoidExpression(node); + case 180: + return emitAwaitExpression(node); + case 181: + return emitPrefixUnaryExpression(node); + case 182: + return emitPostfixUnaryExpression(node); + case 183: + return emitBinaryExpression(node); + case 184: + return emitConditionalExpression(node); + case 187: + return emitSpreadElementExpression(node); + case 186: + return emitYieldExpression(node); + case 189: + return; + case 194: case 221: + return emitBlock(node); + case 195: + return emitVariableStatement(node); + case 196: + return write(";"); + case 197: + return emitExpressionStatement(node); + case 198: + return emitIfStatement(node); + case 199: + return emitDoStatement(node); + case 200: + return emitWhileStatement(node); + case 201: + return emitForStatement(node); + case 203: + case 202: + return emitForInOrForOfStatement(node); + case 204: + case 205: + return emitBreakOrContinueStatement(node); + case 206: + return emitReturnStatement(node); + case 207: + return emitWithStatement(node); + case 208: + return emitSwitchStatement(node); + case 243: + case 244: + return emitCaseOrDefaultClause(node); + case 209: + return emitLabeledStatement(node); + case 210: + return emitThrowStatement(node); + case 211: + return emitTryStatement(node); + case 246: + return emitCatchClause(node); + case 212: + return emitDebuggerStatement(node); + case 213: + return emitVariableDeclaration(node); + case 188: + return emitClassExpression(node); + case 216: + return emitClassDeclaration(node); + case 217: + return emitInterfaceDeclaration(node); + case 219: + return emitEnumDeclaration(node); + case 249: + return emitEnumMember(node); + case 220: + return emitModuleDeclaration(node); + case 224: + return emitImportDeclaration(node); + case 223: return emitImportEqualsDeclaration(node); - case 228: + case 230: return emitExportDeclaration(node); - case 227: + case 229: return emitExportAssignment(node); - case 248: + case 250: return emitSourceFileNode(node); } } @@ -31411,7 +31931,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 248 || node.pos !== node.parent.pos) { + if (node.parent.kind === 250 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -31423,7 +31943,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 248 || node.end !== node.parent.end) { + if (node.parent.kind === 250 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -31489,18 +32009,30 @@ var ts; } } } + function writeComment(text, lineMap, writer, comment, newLine) { + emitPos(comment.pos); + ts.writeCommentRange(text, lineMap, writer, comment, newLine); + emitPos(comment.end); + } function emitShebang() { var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); + writeLine(); } } var _a, _b; } - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (compilerOptions.declaration) { - ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); + function emitFile(_a, sourceFiles, isBundledEmit) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + emitJavaScript(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + else { + emitSkipped = true; + } + if (declarationFilePath) { + emitSkipped = ts.writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) || emitSkipped; } } } @@ -31514,10 +32046,10 @@ var ts; ts.ioWriteTime = 0; var emptyArray = []; ts.version = "1.8.0"; - function findConfigFile(searchPath) { + function findConfigFile(searchPath, fileExists) { var fileName = "tsconfig.json"; while (true) { - if (ts.sys.fileExists(fileName)) { + if (fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -31541,21 +32073,22 @@ var ts; ? compilerOptions.moduleResolution : compilerOptions.module === 1 ? 2 : 1; switch (moduleResolution) { - case 2: return nodeModuleNameResolver(moduleName, containingFile, host); + case 2: return nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); case 1: return classicNameResolver(moduleName, containingFile, compilerOptions, host); } } ts.resolveModuleName = resolveModuleName; - function nodeModuleNameResolver(moduleName, containingFile, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { var containingDirectory = ts.getDirectoryPath(containingFile); + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, false, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, false, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -31565,11 +32098,15 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + function directoryProbablyExists(directoryName, host) { + return !host.directoryExists || host.directoryExists(directoryName); + } + ts.directoryProbablyExists = directoryProbablyExists; + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; - if (host.fileExists(fileName)) { + if (!onlyRecordFailures && host.fileExists(fileName)) { return fileName; } else { @@ -31578,9 +32115,10 @@ var ts; } } } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); - if (host.fileExists(packageJsonPath)) { + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host); + if (directoryExists && host.fileExists(packageJsonPath)) { var jsonContent; try { var jsonText = host.readFile(packageJsonPath); @@ -31589,8 +32127,9 @@ var ts; catch (e) { jsonContent = { typings: undefined }; } - if (jsonContent.typings) { - var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + if (typeof jsonContent.typings === "string") { + var path = ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)); + var result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(ts.getDirectoryPath(path), host), host); if (result) { return result; } @@ -31599,7 +32138,7 @@ var ts; else { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -31608,12 +32147,13 @@ var ts; var baseName = ts.getBaseFileName(directory); if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); + var result = loadNodeModuleFromFile(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -31638,10 +32178,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; - var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(extensions, function (extension) { + referencedSourceFile = ts.forEach(supportedExtensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { return undefined; } @@ -31736,14 +32276,15 @@ var ts; getCanonicalFileName: getCanonicalFileName, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return ts.sys.fileExists(fileName); }, - readFile: function (fileName) { return ts.sys.readFile(fileName); } + readFile: function (fileName) { return ts.sys.readFile(fileName); }, + directoryExists: function (directoryName) { return ts.sys.directoryExists(directoryName); } }; } ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -31781,8 +32322,10 @@ var ts; var noDiagnosticsTypeChecker; var classifiableNames; var skipDefaultLib = options.noLib; + var supportedExtensions = ts.getSupportedExtensions(options); var start = new Date().getTime(); host = host || createCompilerHost(options); + var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) @@ -31795,7 +32338,8 @@ var ts; (oldOptions.noResolve !== options.noResolve) || (oldOptions.target !== options.target) || (oldOptions.noLib !== options.noLib) || - (oldOptions.jsx !== options.jsx)) { + (oldOptions.jsx !== options.jsx) || + (oldOptions.allowJs !== options.allowJs)) { oldProgram = undefined; } } @@ -31805,9 +32349,7 @@ var ts; processRootFile(host.getDefaultLibFileName(options), true); } } - verifyCompilerOptions(); oldProgram = undefined; - ts.programTime += new Date().getTime() - start; program = { getRootFileNames: function () { return rootNames; }, getSourceFile: getSourceFile, @@ -31821,7 +32363,7 @@ var ts; getTypeChecker: getTypeChecker, getClassifiableNames: getClassifiableNames, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: getCommonSourceDirectory, emit: emit, getCurrentDirectory: function () { return currentDirectory; }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, @@ -31830,7 +32372,23 @@ var ts; getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; } }; + verifyCompilerOptions(); + ts.programTime += new Date().getTime() - start; return program; + function getCommonSourceDirectory() { + if (typeof commonSourceDirectory === "undefined") { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { + commonSourceDirectory += ts.directorySeparator; + } + } + return commonSourceDirectory; + } function getClassifiableNames() { if (!classifiableNames) { getTypeChecker(); @@ -31876,7 +32434,7 @@ var ts; if (resolveModuleNamesWorker) { var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); - for (var i = 0; i < moduleNames.length; ++i) { + for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; var oldResolution = ts.getResolvedModule(oldSourceFile, moduleNames[i]); var resolutionChanged = oldResolution @@ -31897,7 +32455,7 @@ var ts; } newSourceFiles.push(newSourceFile); } - for (var i = 0, len = newSourceFiles.length; i < len; ++i) { + for (var i = 0, len = newSourceFiles.length; i < len; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -31918,7 +32476,8 @@ var ts; getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }), + isEmitBlocked: isEmitBlocked }; } function getDiagnosticsProducingTypeChecker() { @@ -31931,9 +32490,15 @@ var ts; var _this = this; return runWithCancellationToken(function () { return emitWorker(_this, sourceFile, writeFileCallback, cancellationToken); }); } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); + } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken) { - if (options.noEmitOnError && getPreEmitDiagnostics(program, undefined, cancellationToken).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + if (options.noEmitOnError) { + var preEmitDiagnostics = getPreEmitDiagnostics(program, undefined, cancellationToken); + if (preEmitDiagnostics.length > 0) { + return { diagnostics: preEmitDiagnostics, sourceMaps: undefined, emitSkipped: true }; + } } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); var start = new Date().getTime(); @@ -31986,12 +32551,160 @@ var ts; var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile, cancellationToken); + var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? + getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) : + typeChecker.getDiagnostics(sourceFile, cancellationToken); var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile); }); } + function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return runWithCancellationToken(function () { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 223: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 229: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 216: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 245: + var heritageClause = node; + if (heritageClause.token === 106) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 217: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 220: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 218: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 143: + case 142: + case 144: + case 145: + case 146: + case 175: + case 215: + case 176: + case 215: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 195: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 213: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 170: + case 171: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start_2 = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_2, expression.typeArguments.end - start_2, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 138: + var parameter = node; + if (parameter.modifiers) { + var start_3 = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_3, parameter.modifiers.end - start_3, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 141: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 219: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 173: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 139: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start_4 = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_4, typeParameters.end - start_4, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { + var modifier = modifiers_1[_i]; + switch (modifier.kind) { + case 112: + case 110: + case 111: + case 122: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + case 113: + case 82: + case 74: + case 77: + case 115: + } + } + } + return false; + } + }); + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return runWithCancellationToken(function () { if (!ts.isDeclarationFile(sourceFile)) { @@ -32039,9 +32752,9 @@ var ts; function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { if (!collectOnlyRequireCalls) { switch (node.kind) { - case 222: - case 221: - case 228: + case 224: + case 223: + case 230: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; @@ -32053,7 +32766,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 218: + case 220: if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { collect(node, false, collectOnlyRequireCalls); @@ -32076,9 +32789,9 @@ var ts; var diagnosticArgument; var diagnostic; if (hasExtension(fileName)) { - if (!options.allowNonTsExtensions && !ts.forEach(ts.supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { + if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1; - diagnosticArgument = [fileName, "'" + ts.supportedExtensions.join("', '") + "'"]; + diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"]; } else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) { diagnostic = ts.Diagnostics.File_0_not_found; @@ -32096,7 +32809,7 @@ var ts; diagnostic = ts.Diagnostics.File_0_not_found; diagnosticArgument = [fileName]; } - else if (!ts.forEach(ts.supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { + else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { diagnostic = ts.Diagnostics.File_0_not_found; fileName += ".ts"; diagnosticArgument = [fileName]; @@ -32120,10 +32833,10 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, existingFileName)); } } - function findSourceFile(fileName, normalizedAbsolutePath, isDefaultLib, refFile, refPos, refEnd) { - if (filesByName.contains(normalizedAbsolutePath)) { - var file_1 = filesByName.get(normalizedAbsolutePath); - if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== normalizedAbsolutePath) { + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + if (filesByName.contains(path)) { + var file_1 = filesByName.get(path); + if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } return file_1; @@ -32136,16 +32849,16 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); - filesByName.set(normalizedAbsolutePath, file); + filesByName.set(path, file); if (file) { - file.path = normalizedAbsolutePath; + file.path = path; if (host.useCaseSensitiveFileNames()) { - var existingFile = filesByNameIgnoreCase.get(normalizedAbsolutePath); + var existingFile = filesByNameIgnoreCase.get(path); if (existingFile) { reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd); } else { - filesByNameIgnoreCase.set(normalizedAbsolutePath, file); + filesByNameIgnoreCase.set(path, file); } } skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib; @@ -32178,15 +32891,15 @@ var ts; file.resolvedModules = {}; var moduleNames = ts.map(file.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; ++i) { + for (var i = 0; i < file.imports.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); if (resolution && !options.noResolve) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { if (!ts.isExternalModule(importedFile)) { - var start_2 = ts.getTokenPosOfNode(file.imports[i], file); - fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_2, file.imports[i].end - start_2, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); + var start_5 = ts.getTokenPosOfNode(file.imports[i], file); + fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } else if (importedFile.referencedFiles.length) { var firstRef = importedFile.referencedFiles[0]; @@ -32203,7 +32916,7 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var commonPathComponents; - ts.forEach(files, function (sourceFile) { + var failed = ts.forEach(files, function (sourceFile) { if (ts.isDeclarationFile(sourceFile)) { return; } @@ -32214,10 +32927,9 @@ var ts; return; } for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; + return true; } commonPathComponents.length = i; break; @@ -32227,6 +32939,9 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + if (failed) { + return ""; + } if (!commonPathComponents) { return currentDirectory; } @@ -32236,8 +32951,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var sourceFile = sourceFiles_2[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -32271,14 +32986,14 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")); } - if (options.sourceRoot) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap")); - } } if (options.inlineSources) { if (!options.sourceMap && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); } + if (options.sourceRoot) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources")); + } } if (options.out && options.outFile) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile")); @@ -32287,10 +33002,9 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap")); } - if (options.sourceRoot) { + if (options.sourceRoot && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap")); } - return; } var languageVersion = options.target || 0; var outFile = options.outFile || options.out; @@ -32307,7 +33021,7 @@ var ts; } else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); + programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file)); } if (options.module === 5 && languageVersion < 2) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower)); @@ -32318,14 +33032,9 @@ var ts; if (options.outDir || options.sourceRoot || options.mapRoot) { - if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { - commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); - } - else { - commonSourceDirectory = computeCommonSourceDirectory(files); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { - commonSourceDirectory += ts.directorySeparator; + var dir = getCommonSourceDirectory(); + if (options.outDir && dir === "" && ts.forEach(files, function (file) { return ts.getRootLength(file.fileName) > 1; })) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); } } if (options.noEmit) { @@ -32342,10 +33051,42 @@ var ts; programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration")); } } + else if (options.allowJs && options.declaration) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + if (options.reactNamespace && !ts.isIdentifier(options.reactNamespace, languageVersion)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace)); + } + if (!options.noEmit) { + var emitHost = getEmitHost(); + var emitFilesSeen = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); + ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); + if (filesByName.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + } + if (emitFilesSeen.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + } + else { + emitFilesSeen.set(emitFilePath, true); + } + } + } + } + function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) { + hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true); + programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName)); } } ts.createProgram = createProgram; @@ -32360,7 +33101,7 @@ var ts; } var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); if (!tokenAtLocation || sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { return undefined; @@ -32371,14 +33112,20 @@ var ts; } return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { - return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + var start = startNode.decorators ? + ts.skipTrivia(sourceFile.text, startNode.decorators.end) : + startNode.getStart(sourceFile); + return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { - if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart()).line) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); } return spanInNode(otherwiseOnNode); } + function spanInNodeArray(nodeArray) { + return ts.createTextSpanFromBounds(ts.skipTrivia(sourceFile.text, nodeArray.pos), nodeArray.end); + } function spanInPreviousNode(node) { return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); } @@ -32388,98 +33135,103 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 197) { + if (node.parent.kind === 199) { return spanInPreviousNode(node); } - if (node.parent.kind === 199) { + if (node.parent.kind === 139) { + return spanInNode(node.parent); + } + if (node.parent.kind === 201) { return textSpan(node); } - if (node.parent.kind === 181 && node.parent.operatorToken.kind === 24) { + if (node.parent.kind === 183 && node.parent.operatorToken.kind === 24) { return textSpan(node); } - if (node.parent.kind === 174 && node.parent.body === node) { + if (node.parent.kind === 176 && node.parent.body === node) { return textSpan(node); } } switch (node.kind) { - case 193: + case 195: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 211: + case 213: case 141: case 140: return spanInVariableDeclaration(node); case 138: return spanInParameterDeclaration(node); - case 213: + case 215: case 143: case 142: case 145: case 146: case 144: - case 173: - case 174: + case 175: + case 176: return spanInFunctionDeclaration(node); - case 192: + case 194: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 219: + case 221: return spanInBlock(node); - case 244: + case 246: return spanInBlock(node.block); - case 195: + case 197: return textSpan(node.expression); - case 204: + case 206: return textSpan(node.getChildAt(0), node.expression); + case 200: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 199: + return spanInNode(node.statement); + case 212: + return textSpan(node.getChildAt(0)); case 198: return textSpan(node, ts.findNextToken(node.expression, node)); - case 197: - return spanInNode(node.statement); - case 210: - return textSpan(node.getChildAt(0)); - case 196: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 207: - return spanInNode(node.statement); - case 203: - case 202: - return textSpan(node.getChildAt(0), node.label); - case 199: - return spanInForStatement(node); - case 200: - case 201: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 206: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 241: - case 242: - return spanInNode(node.statements[0]); case 209: - return spanInBlock(node.tryBlock); + return spanInNode(node.statement); + case 205: + case 204: + return textSpan(node.getChildAt(0), node.label); + case 201: + return spanInForStatement(node); + case 202: + case 203: + return textSpan(node, ts.findNextToken(node.expression, node)); case 208: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 243: + case 244: + return spanInNode(node.statements[0]); + case 211: + return spanInBlock(node.tryBlock); + case 210: return textSpan(node, node.expression); - case 227: + case 229: return textSpan(node, node.expression); - case 221: + case 223: return textSpan(node, node.moduleReference); - case 222: + case 224: return textSpan(node, node.moduleSpecifier); - case 228: + case 230: return textSpan(node, node.moduleSpecifier); - case 218: + case 220: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 214: - case 217: - case 247: - case 168: - case 169: - return textSpan(node); - case 205: - return spanInNode(node.statement); - case 215: case 216: + case 219: + case 249: + case 170: + case 171: + return textSpan(node); + case 207: + return spanInNode(node.statement); + case 139: + return spanInNodeArray(node.parent.decorators); + case 217: + case 218: return undefined; case 23: case 1: @@ -32506,10 +33258,10 @@ var ts; case 85: return spanInNextNode(node); default: - if (node.parent.kind === 245 && node.parent.name === node) { + if (node.parent.kind === 247 && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 171 && node.parent.type === node) { + if (node.parent.kind === 173 && node.parent.type === node) { return spanInNode(node.parent.expression); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { @@ -32519,12 +33271,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 200 || - variableDeclaration.parent.parent.kind === 201) { + if (variableDeclaration.parent.parent.kind === 202 || + variableDeclaration.parent.parent.kind === 203) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 193; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 199 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -32570,7 +33322,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2) || - (functionDeclaration.parent.kind === 214 && functionDeclaration.kind !== 144); + (functionDeclaration.parent.kind === 216 && functionDeclaration.kind !== 144); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -32590,23 +33342,23 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 218: + case 220: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 198: - case 196: case 200: - case 201: + case 198: + case 202: + case 203: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 199: + case 201: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 212) { + if (forStatement.initializer.kind === 214) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -32625,33 +33377,33 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 217: + case 219: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 214: + case 216: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 220: + case 222: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 219: + case 221: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 217: - case 214: + case 219: + case 216: return textSpan(node); - case 192: + case 194: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 244: + case 246: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 220: + case 222: var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { @@ -32663,43 +33415,43 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 197) { + if (node.parent.kind === 199) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 173: - case 213: - case 174: + case 175: + case 215: + case 176: case 143: case 142: case 145: case 146: case 144: - case 198: - case 197: + case 200: case 199: + case 201: return spanInPreviousNode(node); default: return spanInNode(node.parent); } } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 245) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 247) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 171) { + if (node.parent.kind === 173) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 197) { + if (node.parent.kind === 199) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -32777,7 +33529,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 174; + return ts.isFunctionBlock(node) && node.parent.kind !== 176; } var depth = 0; var maxDepth = 20; @@ -32789,23 +33541,23 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 192: + case 194: if (!ts.isFunctionBlock(n)) { var parent_7 = n.parent; var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); - if (parent_7.kind === 197 || - parent_7.kind === 200 || + if (parent_7.kind === 199 || + parent_7.kind === 202 || + parent_7.kind === 203 || parent_7.kind === 201 || - parent_7.kind === 199 || - parent_7.kind === 196 || parent_7.kind === 198 || - parent_7.kind === 205 || - parent_7.kind === 244) { + parent_7.kind === 200 || + parent_7.kind === 207 || + parent_7.kind === 246) { addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 209) { + if (parent_7.kind === 211) { var tryStatement = parent_7; if (tryStatement.tryBlock === n) { addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); @@ -32828,23 +33580,23 @@ var ts; }); break; } - case 219: { + case 221: { var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 214: - case 215: + case 216: case 217: - case 165: - case 220: { + case 219: + case 167: + case 222: { var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 164: + case 166: var openBracket = ts.findChildOfKind(n, 19, sourceFile); var closeBracket = ts.findChildOfKind(n, 20, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -32871,10 +33623,10 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_32 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_32); + for (var name_28 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_28); if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); if (!matches) { continue; } @@ -32885,14 +33637,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_32); + matches = patternMatcher.getMatches(containers, name_28); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -32946,7 +33698,7 @@ var ts; } return true; } - if (expression.kind === 166) { + if (expression.kind === 168) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -33011,7 +33763,7 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + function getNavigationBarItems(sourceFile, compilerOptions) { var hasGlobalNode = false; return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); function getIndent(node) { @@ -33019,14 +33771,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 218: + case 220: do { current = current.parent; - } while (current.kind === 218); - case 214: + } while (current.kind === 220); + case 216: + case 219: case 217: case 215: - case 213: indent++; } current = current.parent; @@ -33037,26 +33789,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 193: + case 195: ts.forEach(node.declarationList.declarations, visit); break; - case 161: - case 162: + case 163: + case 164: ts.forEach(node.elements, visit); break; - case 228: + case 230: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222: + case 224: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224) { + if (importClause.namedBindings.kind === 226) { childNodes.push(importClause.namedBindings); } else { @@ -33065,20 +33817,20 @@ var ts; } } break; - case 163: - case 211: + case 165: + case 213: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 214: + case 216: + case 219: case 217: + case 220: case 215: - case 218: - case 213: - case 221: - case 226: - case 230: + case 223: + case 228: + case 232: childNodes.push(node); break; } @@ -33113,17 +33865,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 214: + case 216: + case 219: case 217: - case 215: topLevelNodes.push(node); break; - case 218: + case 220: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 213: + case 215: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -33134,9 +33886,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 213) { - if (functionDeclaration.body && functionDeclaration.body.kind === 192) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 213 && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 215) { + if (functionDeclaration.body && functionDeclaration.body.kind === 194) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 && !isEmpty(s.name.text); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -33206,7 +33958,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 149: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 247: + case 249: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 147: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -33215,16 +33967,16 @@ var ts; case 141: case 140: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 213: + case 215: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 211: - case 163: + case 213: + case 165: var variableDeclarationNode; - var name_33; - if (node.kind === 163) { - name_33 = node.name; + var name_29; + if (node.kind === 165) { + name_29 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 211) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 213) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -33232,24 +33984,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_33 = node.name; + name_29 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); } case 144: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 230: - case 226: - case 221: + case 232: + case 228: case 223: - case 224: + case 225: + case 226: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -33279,17 +34031,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 248: + case 250: return createSourceFileItem(node); - case 214: + case 216: return createClassItem(node); - case 217: + case 219: return createEnumItem(node); - case 215: + case 217: return createIterfaceItem(node); - case 218: + case 220: return createModuleItem(node); - case 213: + case 215: return createFunctionItem(node); } return undefined; @@ -33299,7 +34051,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 218) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 220) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -33311,7 +34063,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 192) { + if (node.body && node.body.kind === 194) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -33359,13 +34111,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 218) { + while (node.body.kind === 220) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 248 + return node.kind === 250 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -33396,7 +34148,6 @@ var ts; function createPatternMatcher(pattern) { var stringToWordSpans = {}; pattern = pattern.trim(); - var fullPatternSegment = createSegment(pattern); var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { @@ -33426,7 +34177,7 @@ var ts; return undefined; } var totalMatch = candidateMatch; - for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { + for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) { var segment = dotSeparatedSegments[i]; var containerName = candidateContainers[j]; var containerMatch = matchSegment(containerName, segment); @@ -33593,33 +34344,6 @@ var ts; } } ts.createPatternMatcher = createPatternMatcher; - function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); - } - function comparePunctuation(result1, result2) { - if (result1.punctuationStripped !== result2.punctuationStripped) { - return result1.punctuationStripped ? 1 : -1; - } - return 0; - } - function compareCase(result1, result2) { - if (result1.isCaseSensitive !== result2.isCaseSensitive) { - return result1.isCaseSensitive ? -1 : 1; - } - return 0; - } - function compareType(result1, result2) { - return result1.kind - result2.kind; - } - function compareCamelCase(result1, result2) { - if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { - return result2.camelCaseWeight - result1.camelCaseWeight; - } - return 0; - } function createSegment(text) { return { totalTextChunk: createTextChunk(text), @@ -33649,14 +34373,6 @@ var ts; var str = String.fromCharCode(ch); return str === str.toLowerCase(); } - function containsUpperCaseLetter(string) { - for (var i = 0, n = string.length; i < n; i++) { - if (isUpperCaseLetter(string.charCodeAt(i))) { - return true; - } - } - return false; - } function startsWith(string, search) { for (var i = 0, n = search.length; i < n; i++) { if (string.charCodeAt(i) !== search.charCodeAt(i)) { @@ -33705,9 +34421,10 @@ var ts; for (var i = 0; i < pattern.length; i++) { var ch = pattern.charCodeAt(i); if (isWordChar(ch)) { - if (wordLength++ === 0) { + if (wordLength === 0) { wordStart = i; } + wordLength++; } else { if (wordLength > 0) { @@ -33855,14 +34572,14 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 168) { + if (argumentInfo.invocation.kind !== 170) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; var name = expression.kind === 69 ? expression - : expression.kind === 166 + : expression.kind === 168 ? expression.name : undefined; if (!name || !name.text) { @@ -33891,7 +34608,7 @@ var ts; } } function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 168 || node.parent.kind === 169) { + if (node.parent.kind === 170 || node.parent.kind === 171) { var callExpression = node.parent; if (node.kind === 25 || node.kind === 17) { @@ -33922,23 +34639,23 @@ var ts; }; } } - else if (node.kind === 11 && node.parent.kind === 170) { + else if (node.kind === 11 && node.parent.kind === 172) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 12 && node.parent.parent.kind === 170) { + else if (node.kind === 12 && node.parent.parent.kind === 172) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183); + ts.Debug.assert(templateExpression.kind === 185); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 190 && node.parent.parent.parent.kind === 170) { + else if (node.parent.kind === 192 && node.parent.parent.parent.kind === 172) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183); + ts.Debug.assert(templateExpression.kind === 185); if (node.kind === 14 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -34002,7 +34719,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 183) { + if (template.kind === 185) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -34011,7 +34728,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 248; n = n.parent) { + for (var n = node; n.kind !== 250; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -34191,24 +34908,24 @@ var ts; return false; } switch (n.kind) { - case 214: - case 215: + case 216: case 217: - case 165: - case 161: - case 155: - case 192: case 219: - case 220: + case 167: + case 163: + case 155: + case 194: + case 221: + case 222: return nodeEndsWith(n, 16, sourceFile); - case 244: + case 246: return isCompletedNode(n.block, sourceFile); - case 169: + case 171: if (!n.arguments) { return true; } - case 168: - case 172: + case 170: + case 174: case 160: return nodeEndsWith(n, 18, sourceFile); case 152: @@ -34217,13 +34934,13 @@ var ts; case 144: case 145: case 146: - case 213: - case 173: + case 215: + case 175: case 143: case 142: case 148: case 147: - case 174: + case 176: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -34231,19 +34948,19 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 18, sourceFile); - case 218: + case 220: return n.body && isCompletedNode(n.body, sourceFile); - case 196: + case 198: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 195: + case 197: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23); + case 166: case 164: - case 162: - case 167: + case 169: case 136: case 157: return nodeEndsWith(n, 20, sourceFile); @@ -34252,15 +34969,15 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20, sourceFile); - case 241: - case 242: + case 243: + case 244: return false; - case 199: - case 200: case 201: - case 198: + case 202: + case 203: + case 200: return isCompletedNode(n.statement, sourceFile); - case 197: + case 199: var hasWhileKeyword = findChildOfKind(n, 104, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 18, sourceFile); @@ -34268,25 +34985,25 @@ var ts; return isCompletedNode(n.statement, sourceFile); case 154: return isCompletedNode(n.exprName, sourceFile); - case 176: - case 175: + case 178: case 177: - case 184: - case 185: + case 179: + case 186: + case 187: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 170: + case 172: return isCompletedNode(n.template, sourceFile); - case 183: + case 185: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 190: + case 192: return ts.nodeIsPresent(n.literal); - case 179: - return isCompletedNode(n.operand, sourceFile); case 181: + return isCompletedNode(n.operand, sourceFile); + case 183: return isCompletedNode(n.right, sourceFile); - case 182: + case 184: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -34329,7 +35046,7 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 271 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 273 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -34409,7 +35126,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 236) { + if (isToken(n) || n.kind === 238) { return n; } var children = n.getChildren(); @@ -34417,16 +35134,16 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 236) { + if (isToken(n) || n.kind === 238) { return n; } var children = n.getChildren(); for (var i = 0, len = children.length; i < len; i++) { var child = children[i]; - if (position < child.end && (nodeHasTokens(child) || child.kind === 236)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 238)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 236 && start === child.end); + (child.kind === 238 && start === child.end); if (lookInPreviousChild) { var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); @@ -34436,7 +35153,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 248); + ts.Debug.assert(startNode !== undefined || n.kind === 250); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -34453,7 +35170,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && token.kind === 9 && position > token.getStart(); + return token && (token.kind === 9 || token.kind === 162) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -34536,10 +35253,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 || node.kind === 168) { + if (node.kind === 151 || node.kind === 170) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 214 || node.kind === 215) { + if (ts.isFunctionLike(node) || node.kind === 216 || node.kind === 217) { return node.typeParameters; } return undefined; @@ -34562,6 +35279,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 + || kind === 162 || kind === 10 || ts.isTemplateLiteralKind(kind)) { return true; @@ -34789,7 +35507,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 226 || location.parent.kind === 230) && + (location.parent.kind === 228 || location.parent.kind === 232) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -34827,6 +35545,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, + getCurrentLeadingTrivia: function () { return leadingTrivia; }, lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { ts.Debug.assert(scanner !== undefined); @@ -34890,10 +35609,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 238: - case 235: + case 240: case 237: - case 234: + case 239: + case 236: return node.kind === 69; } } @@ -35081,7 +35800,7 @@ var ts; return false; }; return FormattingContext; - })(); + }()); formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35102,7 +35821,7 @@ var ts; "flag=" + this.Flag + "]"; }; return Rule; - })(); + }()); formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35132,7 +35851,7 @@ var ts; return new RuleDescriptor(left, right); }; return RuleDescriptor; - })(); + }()); formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35159,7 +35878,7 @@ var ts; return result; }; return RuleOperation; - })(); + }()); formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35192,7 +35911,7 @@ var ts; }; RuleOperationContext.Any = new RuleOperationContext(); return RuleOperationContext; - })(); + }()); formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35259,6 +35978,7 @@ var ts; this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([115, 73, 122, 77, 81, 82, 83, 123, 106, 89, 107, 125, 126, 110, 112, 111, 129, 113, 132]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([83, 106])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); + this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(34, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(22, 69), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(53, formatting.Shared.TokenRange.FromTokens([18, 24])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); @@ -35278,65 +35998,61 @@ var ts; this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([114, 37]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2)); this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(118, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsSameLineTokenContext), 2)); this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(118, 87), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69, formatting.Shared.TokenRange.FromTokens([11, 12])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - 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, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, - this.SpaceBetweenTagAndTemplateString, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket, - this.NoSpaceAfterTypeAssertion, - this.SpaceBeforeAt, - this.NoSpaceAfterAt, - this.SpaceAfterDecorator, - ]; - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69, formatting.Shared.TokenRange.FromTokens([11, 12])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, + 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, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, + this.NoSpaceBetweenTagAndTemplateString, + this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceBeforeArrow, this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket, + this.NoSpaceAfterTypeAssertion, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, this.SpaceAfterTryFinally + ]; + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNextTokenNotCloseBracket), 2)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); @@ -35359,45 +36075,49 @@ var ts; this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(19, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12, 13]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13, 14])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_34 in o) { - if (o[name_34] === rule) { - return name_34; + for (var name_30 in o) { + if (o[name_30] === rule) { + return name_30; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 199; + return context.contextNode.kind === 201; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 181: - case 182: - case 189: + case 183: + case 184: + case 191: case 150: case 158: case 159: return true; - case 163: - case 216: - case 221: - case 211: + case 165: + case 218: + case 223: + case 213: case 138: - case 247: + case 249: case 141: case 140: return context.currentTokenSpan.kind === 56 || context.nextTokenSpan.kind === 56; - case 200: + case 202: return context.currentTokenSpan.kind === 90 || context.nextTokenSpan.kind === 90; - case 201: + case 203: return context.currentTokenSpan.kind === 134 || context.nextTokenSpan.kind === 134; } return false; @@ -35406,7 +36126,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 182; + return context.contextNode.kind === 184; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); @@ -35431,86 +36151,86 @@ var ts; return true; } switch (node.kind) { - case 192: - case 220: - case 165: - case 219: + case 194: + case 222: + case 167: + case 221: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 213: + case 215: case 143: case 142: case 145: case 146: case 147: - case 173: + case 175: case 144: - case 174: - case 215: + case 176: + case 217: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 213 || context.contextNode.kind === 173; + return context.contextNode.kind === 215 || context.contextNode.kind === 175; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 214: - case 186: - case 215: + case 216: + case 188: case 217: + case 219: case 155: - case 218: + case 220: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 214: - case 218: - case 217: - case 192: - case 244: + case 216: + case 220: case 219: - case 206: + case 194: + case 246: + case 221: + case 208: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 196: - case 206: - case 199: - case 200: - case 201: case 198: - case 209: - case 197: - case 205: - case 244: + case 208: + case 201: + case 202: + case 203: + case 200: + case 211: + case 199: + case 207: + case 246: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 165; + return context.contextNode.kind === 167; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 168; + return context.contextNode.kind === 170; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 169; + return context.contextNode.kind === 171; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -35518,8 +36238,11 @@ var ts; Rules.IsPreviousTokenNotComma = function (context) { return context.currentTokenSpan.kind !== 24; }; + Rules.IsNextTokenNotCloseBracket = function (context) { + return context.nextTokenSpan.kind !== 20; + }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 174; + return context.contextNode.kind === 176; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -35540,14 +36263,14 @@ var ts; return node.kind === 139; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 212 && + return context.currentTokenParent.kind === 214 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 218; + return context.contextNode.kind === 220; }; Rules.IsObjectTypeContext = function (context) { return context.contextNode.kind === 155; @@ -35558,20 +36281,20 @@ var ts; } switch (parent.kind) { case 151: - case 171: - case 214: - case 186: - case 215: - case 213: case 173: - case 174: + case 216: + case 188: + case 217: + case 215: + case 175: + case 176: case 143: case 142: case 147: case 148: - case 168: - case 169: - case 188: + case 170: + case 171: + case 190: return true; default: return false; @@ -35582,16 +36305,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 171; + return context.contextNode.kind === 173; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 177; + return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 179; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 184 && context.contextNode.expression !== undefined; + return context.contextNode.kind === 186 && context.contextNode.expression !== undefined; }; return Rules; - })(); + }()); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35655,7 +36378,7 @@ var ts; return null; }; return RulesMap; - })(); + }()); formatting.RulesMap = RulesMap; var MaskBitSize = 5; var Mask = 0x1f; @@ -35692,7 +36415,7 @@ var ts; this.rulesInsertionIndexBitmap = temp; }; return RulesBucketConstructionState; - })(); + }()); formatting.RulesBucketConstructionState = RulesBucketConstructionState; var RulesBucket = (function () { function RulesBucket() { @@ -35727,7 +36450,7 @@ var ts; state.IncreaseInsertionIndex(position); }; return RulesBucket; - })(); + }()); formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -35753,7 +36476,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenRangeAccess; - })(); + }()); Shared.TokenRangeAccess = TokenRangeAccess; var TokenValuesAccess = (function () { function TokenValuesAccess(tks) { @@ -35766,7 +36489,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenValuesAccess; - })(); + }()); Shared.TokenValuesAccess = TokenValuesAccess; var TokenSingleValueAccess = (function () { function TokenSingleValueAccess(token) { @@ -35779,7 +36502,7 @@ var ts; return tokenValue === this.token; }; return TokenSingleValueAccess; - })(); + }()); Shared.TokenSingleValueAccess = TokenSingleValueAccess; var TokenAllAccess = (function () { function TokenAllAccess() { @@ -35798,7 +36521,7 @@ var ts; return "[allTokens]"; }; return TokenAllAccess; - })(); + }()); Shared.TokenAllAccess = TokenAllAccess; var TokenRange = (function () { function TokenRange(tokenAccess) { @@ -35840,7 +36563,7 @@ var ts; TokenRange.Comments = TokenRange.FromTokens([2, 3]); TokenRange.TypeNames = TokenRange.FromTokens([69, 128, 130, 120, 131, 103, 117]); return TokenRange; - })(); + }()); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -35911,6 +36634,14 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeCloseBracket); rules.push(this.globalRules.NoSpaceBetweenBrackets); } + if (options.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces) { + rules.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail); + } + else { + rules.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail); + } if (options.InsertSpaceAfterSemicolonInForStatements) { rules.push(this.globalRules.SpaceAfterSemicolonInFor); } @@ -35936,7 +36667,7 @@ var ts; return rules; }; return RulesProvider; - })(); + }()); formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -36009,17 +36740,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 214: - case 215: + case 216: + case 217: return ts.rangeContainsRange(parent.members, node); - case 218: + case 220: var body = parent.body; - return body && body.kind === 192 && ts.rangeContainsRange(body.statements, node); - case 248: - case 192: - case 219: + return body && body.kind === 194 && ts.rangeContainsRange(body.statements, node); + case 250: + case 194: + case 221: return ts.rangeContainsRange(parent.statements, node); - case 244: + case 246: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -36083,17 +36814,17 @@ var ts; } function getOwnOrInheritedDelta(n, options, sourceFile) { var previousLine = -1; - var childKind = 0; + var child; while (n) { var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; if (previousLine !== -1 && line !== previousLine) { break; } - if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { + if (formatting.SmartIndenter.shouldIndentChildNode(n, child)) { return options.IndentSize; } previousLine = line; - childKind = n.kind; + child = n; n = n.parent; } return 0; @@ -36121,10 +36852,18 @@ var ts; var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } + if (!formattingScanner.isOnToken()) { + var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (leadingTrivia) { + processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + trimTrailingWhitespacesForRemainingRange(); + } + } formattingScanner.close(); return edits; function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { - if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || + ts.rangeContainsStartEnd(range, startPos, endPos)) { if (inheritedIndentation !== -1) { return inheritedIndentation; } @@ -36141,33 +36880,20 @@ var ts; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { var indentation = inheritedIndentation; - if (indentation === -1) { - if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || - parent.kind === 248 || - parent.kind === 241 || - parent.kind === 242) { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - else { - indentation = parentDynamicIndentation.getIndentation(); - } - } - else { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); - } - else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - } - } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0) ? options.IndentSize : 0; + var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { indentation = startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta(node) + delta); + } + else if (indentation === -1) { + if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + } } return { indentation: indentation, @@ -36179,10 +36905,10 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 214: return 73; - case 215: return 107; - case 213: return 87; - case 217: return 217; + case 216: return 73; + case 217: return 107; + case 215: return 87; + case 219: return 219; case 145: return 123; case 146: return 129; case 143: @@ -36196,16 +36922,16 @@ var ts; } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { - getIndentationForComment: function (kind, tokenIndentation) { + getIndentationForComment: function (kind, tokenIndentation, container) { switch (kind) { case 16: case 20: case 18: - return indentation + delta; + return indentation + getEffectiveDelta(delta, container); } return tokenIndentation !== -1 ? tokenIndentation : indentation; }, - getIndentationForToken: function (line, kind) { + getIndentationForToken: function (line, kind, container) { if (nodeStartLine !== line && node.decorators) { if (kind === getFirstNonDecoratorTokenOfNode(node)) { return indentation; @@ -36223,20 +36949,20 @@ var ts; case 55: return indentation; default: - return nodeStartLine !== line ? indentation + delta : indentation; + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; } }, getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getDelta: function (child) { return getEffectiveDelta(delta, child); }, recomputeIndentation: function (lineAdded) { - if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { if (lineAdded) { indentation += options.IndentSize; } else { indentation -= options.IndentSize; } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0)) { + if (formatting.SmartIndenter.shouldIndentChildNode(node)) { delta = options.IndentSize; } else { @@ -36245,6 +36971,9 @@ var ts; } } }; + function getEffectiveDelta(delta, child) { + return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { @@ -36297,7 +37026,7 @@ var ts; if (ts.isToken(child)) { var tokenInfo = formattingScanner.readTokenInfo(child); ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } var effectiveParentStartLine = child.kind === 139 ? childStartLine : undecoratedParentStartLine; @@ -36342,7 +37071,7 @@ var ts; } } } - function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation, container) { ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); var indentToken = false; @@ -36374,10 +37103,10 @@ var ts; } if (indentToken) { var tokenIndentation = (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) ? - dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind) : + dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container) : -1; if (currentTokenInfo.leadingTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation); + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); var indentNextTokenOrTrivia = true; for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; @@ -36458,9 +37187,7 @@ var ts; dynamicIndentation.recomputeIndentation(true); } } - trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + trimTrailingWhitespaces = !(rule.Operation.Action & 8) && rule.Flag !== 1; } else { trimTrailingWhitespaces = true; @@ -36536,16 +37263,29 @@ var ts; if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } - var pos = lineEndPosition; - while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== lineEndPosition) { - ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); - recordDelete(pos + 1, lineEndPosition - pos); + var whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + ts.Debug.assert(whitespaceStart === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); } } } + function getTrailingWhitespaceStartPosition(start, end) { + var pos = end; + while (pos >= start && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + function trimTrailingWhitespacesForRemainingRange() { + var startPosition = previousRange ? previousRange.end : originalRange.pos; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; + trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); + } function newTextChange(start, len, newText) { return { span: ts.createTextSpan(start, len), newText: newText }; } @@ -36592,8 +37332,8 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 192: - case 219: + case 194: + case 221: return true; } return false; @@ -36601,11 +37341,11 @@ var ts; function getOpenTokenForList(node, list) { switch (node.kind) { case 144: - case 213: - case 173: + case 215: + case 175: case 143: case 142: - case 174: + case 176: if (node.typeParameters === list) { return 25; } @@ -36613,8 +37353,8 @@ var ts; return 17; } break; - case 168: - case 169: + case 170: + case 171: if (node.typeArguments === list) { return 25; } @@ -36723,7 +37463,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 && precedingToken.parent.kind !== 181) { + if (precedingToken.kind === 24 && precedingToken.parent.kind !== 183) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -36734,7 +37474,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -36794,7 +37534,7 @@ var ts; return actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent, current) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } current = parent; @@ -36821,7 +37561,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 248 || !parentAndChildShareLine); + (parent.kind === 250 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -36845,7 +37585,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 196 && parent.elseStatement === child) { + if (parent.kind === 198 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -36863,13 +37603,13 @@ var ts; return node.parent.typeArguments; } break; - case 165: + case 167: return node.parent.properties; - case 164: + case 166: return node.parent.elements; - case 213: - case 173: - case 174: + case 215: + case 175: + case 176: case 143: case 142: case 147: @@ -36884,8 +37624,8 @@ var ts; } break; } - case 169: - case 168: { + case 171: + case 170: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -36913,8 +37653,8 @@ var ts; if (node.kind === 18) { return -1; } - if (node.parent && (node.parent.kind === 168 || - node.parent.kind === 169) && + if (node.parent && (node.parent.kind === 170 || + node.parent.kind === 171) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -36932,10 +37672,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { + case 170: + case 171: case 168: case 169: - case 166: - case 167: node = node.expression; break; default: @@ -36989,34 +37729,35 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 195: - case 214: - case 186: - case 215: - case 217: + case 197: case 216: - case 164: - case 192: + case 188: + case 217: case 219: - case 165: + case 218: + case 166: + case 194: + case 221: + case 167: case 155: case 157: - case 220: - case 242: - case 241: - case 172: - case 166: + case 222: + case 244: + case 243: + case 174: case 168: - case 169: - case 193: - case 211: - case 227: - case 204: - case 182: - case 162: - case 161: - case 233: - case 234: + case 170: + case 171: + case 195: + case 213: + case 229: + case 206: + case 184: + case 164: + case 163: + case 237: + case 236: + case 242: case 142: case 147: case 148: @@ -37024,34 +37765,38 @@ var ts; case 152: case 153: case 160: - case 170: - case 178: + case 172: + case 180: + case 227: return true; } return false; } - function shouldIndentChildNode(parent, child) { - if (nodeContentIsAlwaysIndented(parent)) { - return true; - } - switch (parent) { - case 197: - case 198: - case 200: - case 201: + function nodeWillIndentChild(parent, child, indentByDefault) { + var childKind = child ? child.kind : 0; + switch (parent.kind) { case 199: - case 196: - case 213: - case 173: + case 200: + case 202: + case 203: + case 201: + case 198: + case 215: + case 175: case 143: - case 174: + case 176: case 144: case 145: case 146: - return child !== 192; - default: - return false; + return childKind !== 194; + case 235: + return childKind !== 239; } + return indentByDefault; + } + SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; + function shouldIndentChildNode(parent, child) { + return nodeContentIsAlwaysIndented(parent.kind) || nodeWillIndentChild(parent, child, false); } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); @@ -37081,7 +37826,7 @@ var ts; return undefined; }; return StringScriptSnapshot; - })(); + }()); function fromString(text) { return new StringScriptSnapshot(text); } @@ -37180,7 +37925,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(271, nodes.pos, nodes.end, 2048, this); + var list = createNode(273, nodes.pos, nodes.end, 2048, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -37257,7 +38002,7 @@ var ts; return child.kind < 135 ? child : child.getLastToken(sourceFile); }; return NodeObject; - })(); + }()); var SymbolObject = (function () { function SymbolObject(flags, name) { this.flags = flags; @@ -37279,7 +38024,7 @@ var ts; return this.documentationComment; }; return SymbolObject; - })(); + }()); function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { var documentationComment = []; var docComments = getJsDocCommentsSeparatedByNewLines(); @@ -37304,13 +38049,13 @@ var ts; } }); } - if (declaration.kind === 218 && declaration.body.kind === 218) { + if (declaration.kind === 220 && declaration.body.kind === 220) { return; } - while (declaration.kind === 218 && declaration.parent.kind === 218) { + while (declaration.kind === 220 && declaration.parent.kind === 220) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 211 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -37355,7 +38100,8 @@ var ts; return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { - while (blankLineCount--) { + while (blankLineCount) { + blankLineCount--; docComments.push(ts.textPart("")); } docComments.push(ts.textPart(text)); @@ -37552,7 +38298,7 @@ var ts; : undefined; }; return TypeObject; - })(); + }()); var SignatureObject = (function () { function SignatureObject(checker) { this.checker = checker; @@ -37576,7 +38322,7 @@ var ts; return this.documentationComment; }; return SignatureObject; - })(); + }()); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { @@ -37622,7 +38368,7 @@ var ts; } if (declaration.name.kind === 136) { var expr = declaration.name.expression; - if (expr.kind === 166) { + if (expr.kind === 168) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -37642,7 +38388,7 @@ var ts; } function visit(node) { switch (node.kind) { - case 213: + case 215: case 143: case 142: var functionDeclaration = node; @@ -37661,30 +38407,30 @@ var ts; ts.forEachChild(node, visit); } break; - case 214: - case 215: case 216: case 217: case 218: - case 221: - case 230: - case 226: - case 221: + case 219: + case 220: case 223: - case 224: + case 232: + case 228: + case 223: + case 225: + case 226: case 145: case 146: case 155: addDeclaration(node); case 144: - case 193: - case 212: - case 161: - case 162: - case 219: + case 195: + case 214: + case 163: + case 164: + case 221: ts.forEachChild(node, visit); break; - case 192: + case 194: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } @@ -37693,30 +38439,30 @@ var ts; if (!(node.flags & 56)) { break; } - case 211: - case 163: + case 213: + case 165: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 247: + case 249: case 141: case 140: addDeclaration(node); break; - case 228: + case 230: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222: + case 224: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224) { + if (importClause.namedBindings.kind === 226) { addDeclaration(importClause.namedBindings); } else { @@ -37729,12 +38475,12 @@ var ts; } }; return SourceFileObject; - })(NodeObject); + }(NodeObject)); var TextChange = (function () { function TextChange() { } return TextChange; - })(); + }()); ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { @@ -37853,7 +38599,7 @@ var ts; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; - })(); + }()); ts.ClassificationTypeNames = ClassificationTypeNames; function displayPartsToString(displayParts) { if (displayParts) { @@ -37867,14 +38613,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 173) { + if (declaration.kind === 175) { return true; } - if (declaration.kind !== 211 && declaration.kind !== 213) { + if (declaration.kind !== 213 && declaration.kind !== 215) { return false; } for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { - if (parent_8.kind === 248 || parent_8.kind === 219) { + if (parent_8.kind === 250 || parent_8.kind === 221) { return false; } } @@ -37949,7 +38695,7 @@ var ts; return file && file.scriptSnapshot; }; return HostCache; - })(); + }()); var SyntaxTreeCache = (function () { function SyntaxTreeCache(host) { this.host = host; @@ -37977,7 +38723,7 @@ var ts; return this.currentSourceFile; }; return SyntaxTreeCache; - })(); + }()); function setSourceFileFields(sourceFile, scriptSnapshot, version) { sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; @@ -38005,7 +38751,7 @@ var ts; sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); outputText = text; } }, @@ -38015,7 +38761,8 @@ var ts; getCurrentDirectory: function () { return ""; }, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return fileName === inputFileName; }, - readFile: function (fileName) { return ""; } + readFile: function (fileName) { return ""; }, + directoryExists: function (directoryExists) { return true; } }; var program = ts.createProgram([inputFileName], options, compilerHost); var diagnostics; @@ -38093,7 +38840,7 @@ var ts; var buckets = {}; var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { - return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx; + return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -38104,7 +38851,7 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; entries.forEachValue(function (key, entry) { @@ -38120,7 +38867,7 @@ var ts; sourceFiles: sourceFiles }; }); - return JSON.stringify(bucketInfoArray, null, 2); + return JSON.stringify(bucketInfoArray, undefined, 2); } function acquireDocument(fileName, compilationSettings, scriptSnapshot, version) { return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, true); @@ -38404,7 +39151,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 207 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 209 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -38413,16 +39160,16 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 && - (node.parent.kind === 203 || node.parent.kind === 202) && + (node.parent.kind === 205 || node.parent.kind === 204) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 && - node.parent.kind === 207 && + node.parent.kind === 209 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 207; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 209; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -38436,22 +39183,22 @@ var ts; return node.parent.kind === 135 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 166 && node.parent.name === node; + return node && node.parent && node.parent.kind === 168 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 168 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 170 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 169 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 218 && node.parent.name === node; + return node.parent.kind === 220 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 && @@ -38459,22 +39206,22 @@ var ts; } function isNameOfPropertyAssignment(node) { return (node.kind === 69 || node.kind === 9 || node.kind === 8) && - (node.parent.kind === 245 || node.parent.kind === 246) && node.parent.name === node; + (node.parent.kind === 247 || node.parent.kind === 248) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 || node.kind === 8) { switch (node.parent.kind) { case 141: case 140: - case 245: case 247: + case 249: case 143: case 142: case 145: case 146: - case 218: + case 220: return node.parent.name === node; - case 167: + case 169: return node.parent.argumentExpression === node; } } @@ -38527,17 +39274,17 @@ var ts; return undefined; } switch (node.kind) { - case 248: + case 250: case 143: case 142: - case 213: - case 173: + case 215: + case 175: case 145: case 146: - case 214: - case 215: + case 216: case 217: - case 218: + case 219: + case 220: return node; } } @@ -38545,18 +39292,18 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 218: return ScriptElementKind.moduleElement; - case 214: return ScriptElementKind.classElement; - case 215: return ScriptElementKind.interfaceElement; - case 216: return ScriptElementKind.typeElement; - case 217: return ScriptElementKind.enumElement; - case 211: + case 220: return ScriptElementKind.moduleElement; + case 216: return ScriptElementKind.classElement; + case 217: return ScriptElementKind.interfaceElement; + case 218: return ScriptElementKind.typeElement; + case 219: return ScriptElementKind.enumElement; + case 213: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 213: return ScriptElementKind.functionElement; + case 215: return ScriptElementKind.functionElement; case 145: return ScriptElementKind.memberGetAccessorElement; case 146: return ScriptElementKind.memberSetAccessorElement; case 143: @@ -38570,13 +39317,13 @@ var ts; case 147: return ScriptElementKind.callSignatureElement; case 144: return ScriptElementKind.constructorImplementationElement; case 137: return ScriptElementKind.typeParameterElement; - case 247: return ScriptElementKind.variableElement; + case 249: return ScriptElementKind.variableElement; case 138: return (node.flags & 56) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 221: - case 226: case 223: - case 230: - case 224: + case 228: + case 225: + case 232: + case 226: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -38595,7 +39342,7 @@ var ts; } }; return CancellationTokenObject; - })(); + }()); function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -38648,7 +39395,8 @@ var ts; (oldSettings.target !== newSettings.target || oldSettings.module !== newSettings.module || oldSettings.noResolve !== newSettings.noResolve || - oldSettings.jsx !== newSettings.jsx); + oldSettings.jsx !== newSettings.jsx || + oldSettings.allowJs !== newSettings.allowJs); var compilerHost = { getSourceFile: getOrCreateSourceFile, getCancellationToken: function () { return cancellationToken; }, @@ -38665,6 +39413,10 @@ var ts; readFile: function (fileName) { var entry = hostCache.getOrCreateEntry(fileName); return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + }, + directoryExists: function (directoryName) { + ts.Debug.assert(!host.resolveModuleNames); + return ts.directoryProbablyExists(directoryName, host); } }; if (host.resolveModuleNames) { @@ -38699,8 +39451,11 @@ var ts; return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } function sourceFileUpToDate(sourceFile) { + if (!sourceFile) { + return false; + } var path = sourceFile.path || ts.toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName); - return sourceFile && sourceFile.version === hostCache.getVersion(path); + return sourceFile.version === hostCache.getVersion(path); } function programUpToDate() { if (!program) { @@ -38739,9 +39494,6 @@ var ts; function getSemanticDiagnostics(fileName) { synchronizeHostData(); var targetSourceFile = getValidSourceFile(fileName); - if (ts.isSourceFileJavaScript(targetSourceFile)) { - return getJavaScriptSemanticDiagnostics(targetSourceFile); - } var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); if (!program.getCompilerOptions().declaration) { return semanticDiagnostics; @@ -38749,150 +39501,6 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } - function getJavaScriptSemanticDiagnostics(sourceFile) { - var diagnostics = []; - walk(sourceFile); - return diagnostics; - function walk(node) { - if (!node) { - return false; - } - switch (node.kind) { - case 221: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); - return true; - case 227: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); - return true; - case 214: - var classDeclaration = node; - if (checkModifiers(classDeclaration.modifiers) || - checkTypeParameters(classDeclaration.typeParameters)) { - return true; - } - break; - case 243: - var heritageClause = node; - if (heritageClause.token === 106) { - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 215: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 218: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 216: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); - return true; - case 143: - case 142: - case 144: - case 145: - case 146: - case 173: - case 213: - case 174: - case 213: - var functionDeclaration = node; - if (checkModifiers(functionDeclaration.modifiers) || - checkTypeParameters(functionDeclaration.typeParameters) || - checkTypeAnnotation(functionDeclaration.type)) { - return true; - } - break; - case 193: - var variableStatement = node; - if (checkModifiers(variableStatement.modifiers)) { - return true; - } - break; - case 211: - var variableDeclaration = node; - if (checkTypeAnnotation(variableDeclaration.type)) { - return true; - } - break; - case 168: - case 169: - var expression = node; - if (expression.typeArguments && expression.typeArguments.length > 0) { - var start = expression.typeArguments.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 138: - var parameter = node; - if (parameter.modifiers) { - var start = parameter.modifiers.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); - return true; - } - if (parameter.questionToken) { - diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, '?')); - return true; - } - if (parameter.type) { - diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 141: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 217: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 171: - var typeAssertionExpression = node; - diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); - return true; - case 139: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); - return true; - } - return ts.forEachChild(node, walk); - } - function checkTypeParameters(typeParameters) { - if (typeParameters) { - var start = typeParameters.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkTypeAnnotation(type) { - if (type) { - diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkModifiers(modifiers) { - if (modifiers) { - for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { - var modifier = modifiers_1[_i]; - switch (modifier.kind) { - case 112: - case 110: - case 111: - case 122: - diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); - return true; - case 113: - case 82: - case 74: - case 77: - case 115: - } - } - } - return false; - } - } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); @@ -38916,20 +39524,14 @@ var ts; return undefined; } if (performCharacterChecks) { - if (!ts.isIdentifierStart(name.charCodeAt(0), target)) { + if (!ts.isIdentifier(name, target)) { return undefined; } - for (var i = 1, n = name.length; i < n; i++) { - if (!ts.isIdentifierPart(name.charCodeAt(i), target)) { - return undefined; - } - } } return name; } function getCompletionData(fileName, position) { var typeChecker = program.getTypeChecker(); - var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; @@ -38950,9 +39552,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { + case 271: case 269: - case 267: - case 268: + case 270: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -38973,9 +39575,9 @@ var ts; log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); var contextToken = previousToken; if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_3 = new Date().getTime(); + var start_6 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_3)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_6)); } var node = currentToken; var isRightOfDot = false; @@ -38989,7 +39591,7 @@ var ts; } var parent_9 = contextToken.parent, kind = contextToken.kind; if (kind === 21) { - if (parent_9.kind === 166) { + if (parent_9.kind === 168) { node = contextToken.parent.expression; isRightOfDot = true; } @@ -39006,7 +39608,7 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 && contextToken.parent.kind === 237) { + else if (kind === 39 && contextToken.parent.kind === 239) { isStartingCloseTag = true; } } @@ -39045,7 +39647,7 @@ var ts; function getTypeScriptMemberSymbols() { isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 || node.kind === 135 || node.kind === 166) { + if (node.kind === 69 || node.kind === 135 || node.kind === 168) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeChecker.getAliasedSymbol(symbol); @@ -39091,7 +39693,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 234) || (jsxContainer.kind === 235)) { + if ((jsxContainer.kind === 236) || (jsxContainer.kind === 237)) { attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes); @@ -39131,15 +39733,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 236) { + if (contextToken.kind === 238) { return true; } if (contextToken.kind === 27 && contextToken.parent) { - if (contextToken.parent.kind === 235) { + if (contextToken.parent.kind === 237) { return true; } - if (contextToken.parent.kind === 237 || contextToken.parent.kind === 234) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 233; + if (contextToken.parent.kind === 239 || contextToken.parent.kind === 236) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 235; } } return false; @@ -39149,36 +39751,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24: - return containingNodeKind === 168 + return containingNodeKind === 170 || containingNodeKind === 144 - || containingNodeKind === 169 - || containingNodeKind === 164 - || containingNodeKind === 181 + || containingNodeKind === 171 + || containingNodeKind === 166 + || containingNodeKind === 183 || containingNodeKind === 152; case 17: - return containingNodeKind === 168 + return containingNodeKind === 170 || containingNodeKind === 144 - || containingNodeKind === 169 - || containingNodeKind === 172 + || containingNodeKind === 171 + || containingNodeKind === 174 || containingNodeKind === 160; case 19: - return containingNodeKind === 164 + return containingNodeKind === 166 || containingNodeKind === 149 || containingNodeKind === 136; case 125: case 126: return true; case 21: - return containingNodeKind === 218; + return containingNodeKind === 220; case 15: - return containingNodeKind === 214; + return containingNodeKind === 216; case 56: - return containingNodeKind === 211 - || containingNodeKind === 181; + return containingNodeKind === 213 + || containingNodeKind === 183; case 12: - return containingNodeKind === 183; + return containingNodeKind === 185; case 13: - return containingNodeKind === 190; + return containingNodeKind === 192; case 112: case 110: case 111: @@ -39195,11 +39797,12 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 + || contextToken.kind === 162 || contextToken.kind === 10 || ts.isTemplateLiteralKind(contextToken.kind)) { - var start_4 = contextToken.getStart(); + var start_7 = contextToken.getStart(); var end = contextToken.getEnd(); - if (start_4 < position && position < end) { + if (start_7 < position && position < end) { return true; } if (position === end) { @@ -39213,12 +39816,12 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 165) { + if (objectLikeContainer.kind === 167) { isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 161) { + else if (objectLikeContainer.kind === 163) { isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); if (ts.isVariableLike(rootDeclaration)) { @@ -39244,9 +39847,9 @@ var ts; return true; } function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 225 ? - 222 : - 228; + var declarationKind = namedImportsOrExports.kind === 227 ? + 224 : + 230; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -39268,7 +39871,7 @@ var ts; case 15: case 24: var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 165 || parent_10.kind === 161)) { + if (parent_10 && (parent_10.kind === 167 || parent_10.kind === 163)) { return parent_10; } break; @@ -39282,8 +39885,8 @@ var ts; case 15: case 24: switch (contextToken.parent.kind) { - case 225: - case 229: + case 227: + case 231: return contextToken.parent; } } @@ -39297,28 +39900,28 @@ var ts; case 26: case 39: case 69: - case 238: - case 239: - if (parent_11 && (parent_11.kind === 234 || parent_11.kind === 235)) { + case 240: + case 241: + if (parent_11 && (parent_11.kind === 236 || parent_11.kind === 237)) { return parent_11; } - else if (parent_11.kind === 238) { + else if (parent_11.kind === 240) { return parent_11.parent; } break; case 9: - if (parent_11 && ((parent_11.kind === 238) || (parent_11.kind === 239))) { + if (parent_11 && ((parent_11.kind === 240) || (parent_11.kind === 241))) { return parent_11.parent; } break; case 16: if (parent_11 && - parent_11.kind === 240 && + parent_11.kind === 242 && parent_11.parent && - (parent_11.parent.kind === 238)) { + (parent_11.parent.kind === 240)) { return parent_11.parent.parent; } - if (parent_11 && parent_11.kind === 239) { + if (parent_11 && parent_11.kind === 241) { return parent_11.parent; } break; @@ -39328,9 +39931,9 @@ var ts; } function isFunction(kind) { switch (kind) { - case 173: - case 174: - case 213: + case 175: + case 176: + case 215: case 143: case 142: case 145: @@ -39346,54 +39949,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24: - return containingNodeKind === 211 || - containingNodeKind === 212 || - containingNodeKind === 193 || - containingNodeKind === 217 || - isFunction(containingNodeKind) || + return containingNodeKind === 213 || containingNodeKind === 214 || - containingNodeKind === 186 || - containingNodeKind === 215 || - containingNodeKind === 162 || - containingNodeKind === 216; + containingNodeKind === 195 || + containingNodeKind === 219 || + isFunction(containingNodeKind) || + containingNodeKind === 216 || + containingNodeKind === 188 || + containingNodeKind === 217 || + containingNodeKind === 164 || + containingNodeKind === 218; case 21: - return containingNodeKind === 162; + return containingNodeKind === 164; case 54: - return containingNodeKind === 163; + return containingNodeKind === 165; case 19: - return containingNodeKind === 162; + return containingNodeKind === 164; case 17: - return containingNodeKind === 244 || + return containingNodeKind === 246 || isFunction(containingNodeKind); case 15: - return containingNodeKind === 217 || - containingNodeKind === 215 || + return containingNodeKind === 219 || + containingNodeKind === 217 || containingNodeKind === 155; case 23: return containingNodeKind === 140 && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 215 || + (contextToken.parent.parent.kind === 217 || contextToken.parent.parent.kind === 155); case 25: - return containingNodeKind === 214 || - containingNodeKind === 186 || - containingNodeKind === 215 || - containingNodeKind === 216 || + return containingNodeKind === 216 || + containingNodeKind === 188 || + containingNodeKind === 217 || + containingNodeKind === 218 || isFunction(containingNodeKind); case 113: return containingNodeKind === 141; case 22: return containingNodeKind === 138 || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 162); + contextToken.parent.parent.kind === 164); case 112: case 110: case 111: return containingNodeKind === 138; case 116: - return containingNodeKind === 226 || - containingNodeKind === 230 || - containingNodeKind === 224; + return containingNodeKind === 228 || + containingNodeKind === 232 || + containingNodeKind === 226; case 73: case 81: case 107: @@ -39442,8 +40045,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_35 = element.propertyName || element.name; - exisingImportsOrExports[name_35.text] = true; + var name_31 = element.propertyName || element.name; + exisingImportsOrExports[name_31.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -39457,16 +40060,17 @@ var ts; var existingMemberNames = {}; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; - if (m.kind !== 245 && - m.kind !== 246 && - m.kind !== 163) { + if (m.kind !== 247 && + m.kind !== 248 && + m.kind !== 165 && + m.kind !== 143) { continue; } if (m.getStart() <= position && position <= m.getEnd()) { continue; } var existingName = void 0; - if (m.kind === 163 && m.propertyName) { + if (m.kind === 165 && m.propertyName) { if (m.propertyName.kind === 69) { existingName = m.propertyName.text; } @@ -39485,7 +40089,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 238) { + if (attr.kind === 240) { seenNames[attr.name.text] = true; } } @@ -39522,10 +40126,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_36 in nameTable) { - if (!uniqueNames[name_36]) { - uniqueNames[name_36] = name_36; - var displayName = getCompletionEntryDisplayName(name_36, target, true); + for (var name_32 in nameTable) { + if (!uniqueNames[name_32]) { + uniqueNames[name_32] = name_32; + var displayName = getCompletionEntryDisplayName(name_32, target, true); if (displayName) { var entry = { name: displayName, @@ -39614,7 +40218,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32) - return ts.getDeclarationOfKind(symbol, 186) ? + return ts.getDeclarationOfKind(symbol, 188) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384) return ScriptElementKind.enumElement; @@ -39710,14 +40314,14 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 166) { + if (location.parent && location.parent.kind === 168) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 168 || location.kind === 169) { + if (location.kind === 170 || location.kind === 171) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -39729,7 +40333,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 169 || callExpression.expression.kind === 95; + var useConstructSignatures = callExpression.kind === 171 || callExpression.expression.kind === 95; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -39759,16 +40363,16 @@ var ts; case ScriptElementKind.letElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); + displayParts.push(ts.punctuationPart(54)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); + displayParts.push(ts.keywordPart(92)); displayParts.push(ts.spacePart()); } - if (!(type.flags & ts.TypeFlags.Anonymous)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); + if (!(type.flags & 65536)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); } - addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); + addSignatureDisplayParts(signature, allSignatures, 8); break; default: addSignatureDisplayParts(signature, allSignatures); @@ -39800,7 +40404,7 @@ var ts; } } if (symbolFlags & 32 && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 186)) { + if (ts.getDeclarationOfKind(symbol, 188)) { pushTypePart(ScriptElementKind.localClassElement); } else { @@ -39840,7 +40444,7 @@ var ts; } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 218); + var declaration = ts.getDeclarationOfKind(symbol, 220); var isNamespace = declaration && declaration.name && declaration.name.kind === 69; displayParts.push(ts.keywordPart(isNamespace ? 126 : 125)); displayParts.push(ts.spacePart()); @@ -39861,32 +40465,34 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var container = ts.getContainingFunction(location); - if (container) { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 137).parent; - var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 148) { - displayParts.push(ts.keywordPart(92)); + var declaration = ts.getDeclarationOfKind(symbol, 137); + ts.Debug.assert(declaration !== undefined); + declaration = declaration.parent; + if (declaration) { + if (ts.isFunctionLikeKind(declaration.kind)) { + var signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === 148) { + displayParts.push(ts.keywordPart(92)); + displayParts.push(ts.spacePart()); + } + else if (declaration.kind !== 147 && declaration.name) { + addFullSymbolName(declaration.symbol); + } + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); + } + else { + displayParts.push(ts.keywordPart(132)); displayParts.push(ts.spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } - else if (signatureDeclaration.kind !== 147 && signatureDeclaration.name) { - addFullSymbolName(signatureDeclaration.symbol); - } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); - } - else { - var declaration = ts.getDeclarationOfKind(symbol, 137).parent; - displayParts.push(ts.keywordPart(132)); - displayParts.push(ts.spacePart()); - addFullSymbolName(declaration.symbol); - writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } } } if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 247) { + if (declaration.kind === 249) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -39902,7 +40508,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 221) { + if (declaration.kind === 223) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -40032,9 +40638,10 @@ var ts; if (!symbol) { switch (node.kind) { case 69: - case 166: + case 168: case 135: case 97: + case 161: case 95: var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -40108,7 +40715,7 @@ var ts; var definition; ts.forEach(signatureDeclarations, function (d) { if ((selectConstructors && d.kind === 144) || - (!selectConstructors && (d.kind === 213 || d.kind === 143 || d.kind === 142))) { + (!selectConstructors && (d.kind === 215 || d.kind === 143 || d.kind === 142))) { declarations.push(d); if (d.body) definition = d; @@ -40163,7 +40770,7 @@ var ts; symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 246) { + if (node.parent.kind === 248) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -40236,6 +40843,7 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 || node.kind === 97 || + node.kind === 161 || node.kind === 95 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -40287,58 +40895,58 @@ var ts; switch (node.kind) { case 88: case 80: - if (hasKind(node.parent, 196)) { + if (hasKind(node.parent, 198)) { return getIfElseOccurrences(node.parent); } break; case 94: - if (hasKind(node.parent, 204)) { + if (hasKind(node.parent, 206)) { return getReturnOccurrences(node.parent); } break; case 98: - if (hasKind(node.parent, 208)) { + if (hasKind(node.parent, 210)) { return getThrowOccurrences(node.parent); } break; case 72: - if (hasKind(parent(parent(node)), 209)) { + if (hasKind(parent(parent(node)), 211)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100: case 85: - if (hasKind(parent(node), 209)) { + if (hasKind(parent(node), 211)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96: - if (hasKind(node.parent, 206)) { + if (hasKind(node.parent, 208)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71: case 77: - if (hasKind(parent(parent(parent(node))), 206)) { + if (hasKind(parent(parent(parent(node))), 208)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70: case 75: - if (hasKind(node.parent, 203) || hasKind(node.parent, 202)) { + if (hasKind(node.parent, 205) || hasKind(node.parent, 204)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86: - if (hasKind(node.parent, 199) || - hasKind(node.parent, 200) || - hasKind(node.parent, 201)) { + if (hasKind(node.parent, 201) || + hasKind(node.parent, 202) || + hasKind(node.parent, 203)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104: case 79: - if (hasKind(node.parent, 198) || hasKind(node.parent, 197)) { + if (hasKind(node.parent, 200) || hasKind(node.parent, 199)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -40354,8 +40962,8 @@ var ts; } break; default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 193)) { + if (ts.isModifierKind(node.kind) && node.parent && + (ts.isDeclaration(node.parent) || node.parent.kind === 195)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -40367,10 +40975,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 208) { + if (node.kind === 210) { statementAccumulator.push(node); } - else if (node.kind === 209) { + else if (node.kind === 211) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -40391,10 +40999,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 248) { + if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250) { return parent_12; } - if (parent_12.kind === 209) { + if (parent_12.kind === 211) { var tryStatement = parent_12; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -40409,7 +41017,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 203 || node.kind === 202) { + if (node.kind === 205 || node.kind === 204) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -40424,15 +41032,15 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 206: - if (statement.kind === 202) { + case 208: + if (statement.kind === 204) { continue; } - case 199: - case 200: case 201: - case 198: - case 197: + case 202: + case 203: + case 200: + case 199: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -40449,24 +41057,24 @@ var ts; function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 214 || - container.kind === 186 || + if (!(container.kind === 216 || + container.kind === 188 || (declaration.kind === 138 && hasKind(container, 144)))) { return undefined; } } else if (modifier === 113) { - if (!(container.kind === 214 || container.kind === 186)) { + if (!(container.kind === 216 || container.kind === 188)) { return undefined; } } else if (modifier === 82 || modifier === 122) { - if (!(container.kind === 219 || container.kind === 248)) { + if (!(container.kind === 221 || container.kind === 250)) { return undefined; } } else if (modifier === 115) { - if (!(container.kind === 214 || declaration.kind === 214)) { + if (!(container.kind === 216 || declaration.kind === 216)) { return undefined; } } @@ -40477,8 +41085,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 219: - case 248: + case 221: + case 250: if (modifierFlag & 128) { nodes = declaration.members.concat(declaration); } @@ -40489,8 +41097,8 @@ var ts; case 144: nodes = container.parameters.concat(container.parent.members); break; - case 214: - case 186: + case 216: + case 188: nodes = container.members; if (modifierFlag & 56) { var constructor = ts.forEach(container.members, function (member) { @@ -40570,7 +41178,7 @@ var ts; function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86, 104, 79)) { - if (loopNode.kind === 197) { + if (loopNode.kind === 199) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104)) { @@ -40591,13 +41199,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { + case 201: + case 202: + case 203: case 199: case 200: - case 201: - case 197: - case 198: return getLoopBreakContinueOccurrences(owner); - case 206: + case 208: return getSwitchCaseDefaultOccurrences(owner); } } @@ -40647,7 +41255,7 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 192))) { + if (!(func && hasKind(func.body, 194))) { return undefined; } var keywords = []; @@ -40661,7 +41269,7 @@ var ts; } function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 196) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 198) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { @@ -40672,7 +41280,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 196)) { + if (!hasKind(ifStatement.elseStatement, 198)) { break; } ifStatement = ifStatement.elseStatement; @@ -40776,7 +41384,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97) { + if (node.kind === 97 || node.kind === 161) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95) { @@ -40801,8 +41409,8 @@ var ts; } else { var internedName = getInternedName(symbol, node, declarations); - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; cancellationToken.throwIfCancellationRequested(); var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { @@ -40830,7 +41438,7 @@ var ts; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 226 || declaration.kind === 230; + return declaration.kind === 228 || declaration.kind === 232; }); } function getInternedName(symbol, location, declarations) { @@ -40843,13 +41451,13 @@ var ts; } function getSymbolScope(symbol) { var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 173 || valueDeclaration.kind === 186)) { + if (valueDeclaration && (valueDeclaration.kind === 175 || valueDeclaration.kind === 188)) { return valueDeclaration; } if (symbol.flags & (4 | 8192)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 214); + return ts.getAncestor(privateDeclaration, 216); } } if (symbol.flags & 8388608) { @@ -40858,7 +41466,7 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var scope = undefined; + var scope; var declarations = symbol.getDeclarations(); if (declarations) { for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { @@ -40870,7 +41478,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 248 && !ts.isExternalModule(container)) { + if (container.kind === 250 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -41064,19 +41672,19 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 248: + case 250: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 213: - case 173: + case 215: + case 175: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 248) { + if (searchSpaceNode.kind === 250) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -41102,13 +41710,13 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 97) { + if (!node || (node.kind !== 97 && node.kind !== 161)) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 173: - case 213: + case 175: + case 215: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } @@ -41119,14 +41727,14 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 186: - case 214: + case 188: + case 216: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 248: - if (container.kind === 248 && !ts.isExternalModule(container)) { + case 250: + if (container.kind === 250 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -41148,6 +41756,10 @@ var ts; result.push(shorthandValueSymbol); } } + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 && + ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { + result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + } ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { result.push(rootSymbol); @@ -41161,11 +41773,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 214) { + if (declaration.kind === 216) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 215) { + else if (declaration.kind === 217) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -41215,17 +41827,17 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_37 = node.text; + var name_33 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_37); + var unionProperty = contextualType.getProperty(name_33); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_37); + var symbol = t.getProperty(name_33); if (symbol) { result_4.push(symbol); } @@ -41234,7 +41846,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_37); + var symbol_1 = contextualType.getProperty(name_33); if (symbol_1) { return [symbol_1]; } @@ -41279,10 +41891,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 180 || parent.kind === 179) { + if (parent.kind === 182 || parent.kind === 181) { return true; } - else if (parent.kind === 181 && parent.left === node) { + else if (parent.kind === 183 && parent.left === node) { var operator = parent.operatorToken.kind; return 56 <= operator && operator <= 68; } @@ -41293,9 +41905,6 @@ var ts; synchronizeHostData(); return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } - function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); - } function getEmitOutput(fileName) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -41316,32 +41925,32 @@ var ts; function getMeaningFromDeclaration(node) { switch (node.kind) { case 138: - case 211: - case 163: + case 213: + case 165: case 141: case 140: - case 245: - case 246: case 247: + case 248: + case 249: case 143: case 142: case 144: case 145: case 146: - case 213: - case 173: - case 174: - case 244: + case 215: + case 175: + case 176: + case 246: return 1; case 137: - case 215: - case 216: + case 217: + case 218: case 155: return 2; - case 214: - case 217: + case 216: + case 219: return 1 | 2; - case 218: + case 220: if (node.name.kind === 9) { return 4 | 1; } @@ -41351,14 +41960,14 @@ var ts; else { return 4; } - case 225: - case 226: - case 221: - case 222: case 227: case 228: + case 223: + case 224: + case 229: + case 230: return 1 | 2 | 4; - case 248: + case 250: return 4 | 1; } return 1 | 2 | 4; @@ -41368,8 +41977,9 @@ var ts; node = node.parent; } return node.parent.kind === 151 || - (node.parent.kind === 188 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - node.kind === 97 && !ts.isExpression(node); + (node.parent.kind === 190 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + (node.kind === 97 && !ts.isExpression(node)) || + node.kind === 161; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -41377,16 +41987,16 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 166) { - while (root.parent && root.parent.kind === 166) { + if (root.parent.kind === 168) { + while (root.parent && root.parent.kind === 168) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 188 && root.parent.parent.kind === 243) { + if (!isLastClause && root.parent.kind === 190 && root.parent.parent.kind === 245) { var decl = root.parent.parent.parent; - return (decl.kind === 214 && root.parent.parent.token === 106) || - (decl.kind === 215 && root.parent.parent.token === 83); + return (decl.kind === 216 && root.parent.parent.token === 106) || + (decl.kind === 217 && root.parent.parent.token === 83); } return false; } @@ -41411,13 +42021,13 @@ var ts; ts.Debug.assert(node.kind === 69); if (node.parent.kind === 135 && node.parent.right === node && - node.parent.parent.kind === 221) { + node.parent.parent.kind === 223) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 227) { + if (node.parent.kind === 229) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -41451,14 +42061,16 @@ var ts; return; } switch (node.kind) { - case 166: + case 168: case 135: case 9: + case 162: case 84: case 99: case 93: case 95: case 97: + case 161: case 69: break; default: @@ -41470,7 +42082,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 218 && + if (nodeForStartPos.parent.parent.kind === 220 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -41490,17 +42102,17 @@ var ts; } function getNavigationBarItems(fileName) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.NavigationBar.getNavigationBarItems(sourceFile); + return ts.NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings()); } function getSemanticClassifications(fileName, span) { return convertClassifications(getEncodedSemanticClassifications(fileName, span)); } function checkForClassificationCancellation(kind) { switch (kind) { - case 218: - case 214: + case 220: + case 216: + case 217: case 215: - case 213: cancellationToken.throwIfCancellationRequested(); } } @@ -41548,7 +42160,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 218 && + return declaration.kind === 220 && ts.getModuleInstanceState(declaration) === 1; }); } @@ -41684,16 +42296,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18); pos = tag.tagName.end; switch (tag.kind) { - case 267: + case 269: processJSDocParameterTag(tag); break; - case 270: + case 272: processJSDocTemplateTag(tag); break; - case 269: + case 271: processElement(tag.typeExpression); break; - case 268: + case 270: processElement(tag.typeExpression); break; } @@ -41774,16 +42386,16 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 56) { - if (token.parent.kind === 211 || + if (token.parent.kind === 213 || token.parent.kind === 141 || token.parent.kind === 138) { return 5; } } - if (token.parent.kind === 181 || - token.parent.kind === 179 || - token.parent.kind === 180 || - token.parent.kind === 182) { + if (token.parent.kind === 183 || + token.parent.kind === 181 || + token.parent.kind === 182 || + token.parent.kind === 184) { return 5; } } @@ -41792,7 +42404,7 @@ var ts; else if (tokenKind === 8) { return 4; } - else if (tokenKind === 9) { + else if (tokenKind === 9 || tokenKind === 162) { return 6; } else if (tokenKind === 10) { @@ -41804,7 +42416,7 @@ var ts; else if (tokenKind === 69) { if (token) { switch (token.parent.kind) { - case 214: + case 216: if (token.parent.name === token) { return 11; } @@ -41814,17 +42426,17 @@ var ts; return 15; } return; - case 215: + case 217: if (token.parent.name === token) { return 13; } return; - case 217: + case 219: if (token.parent.name === token) { return 12; } return; - case 218: + case 220: if (token.parent.name === token) { return 14; } @@ -41834,17 +42446,17 @@ var ts; return 17; } return; - case 235: + case 237: if (token.parent.tagName === token) { return 19; } return; - case 237: + case 239: if (token.parent.tagName === token) { return 20; } return; - case 234: + case 236: if (token.parent.tagName === token) { return 21; } @@ -41948,7 +42560,6 @@ var ts; return []; } function getDocCommentTemplateAtPosition(fileName, position) { - var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) { return undefined; @@ -41961,16 +42572,16 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 213: + case 215: case 143: case 144: - case 214: - case 193: + case 216: + case 195: break findOwner; - case 248: + case 250: return undefined; - case 218: - if (commentOwner.parent.kind === 218) { + case 220: + if (commentOwner.parent.kind === 220) { return undefined; } break findOwner; @@ -42004,7 +42615,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 193) { + if (commentOwner.kind === 195) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -42014,14 +42625,14 @@ var ts; return emptyArray; } function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 172) { + while (rightHandSide.kind === 174) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 173: - case 174: + case 175: + case 176: return rightHandSide.parameters; - case 186: + case 188: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 144) { @@ -42102,12 +42713,16 @@ var ts; var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); + var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); if (defaultLibFileName) { for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { var current = declarations_10[_i]; var sourceFile_2 = current.getSourceFile(); + if (!sourceFile_2) { + continue; + } var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)); - if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + if (canonicalName === canonicalDefaultLibName) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); } } @@ -42117,10 +42732,10 @@ var ts; if (kind) { return { canRename: true, - localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) }; @@ -42200,7 +42815,7 @@ var ts; case 9: case 8: if (ts.isDeclarationName(node) || - node.parent.kind === 232 || + node.parent.kind === 234 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -42213,7 +42828,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 167 && + node.parent.kind === 169 && node.parent.argumentExpression === node; } function createClassifier() { @@ -42301,7 +42916,7 @@ var ts; } switch (lexState) { case 3: - text = '"\\\n' + text; + text = "\"\\\n" + text; offset = 3; break; case 2: @@ -42395,7 +43010,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9) { + if (token === 9 || token === 162) { var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; @@ -42525,6 +43140,7 @@ var ts; case 8: return 4; case 9: + case 162: return 6; case 10: return 7; @@ -42681,9 +43297,6 @@ var ts; this.byteLength = byteLength; this.hrtime = hrtime; this.logger = logger; - this.pendingOperation = false; - this.fileHash = {}; - this.nextFileId = 1; this.changeSeq = 0; this.handlers = (_a = {}, _a[CommandNames.Exit] = function () { @@ -42708,7 +43321,7 @@ var ts; }, _a[CommandNames.Open] = function (request) { var openArgs = request.arguments; - _this.openClientFile(openArgs.file); + _this.openClientFile(openArgs.file, openArgs.fileContent); return { responseRequired: false }; }, _a[CommandNames.Quickinfo] = function (request) { @@ -42888,10 +43501,6 @@ var ts; this.logError(err, "syntactic check"); } }; - Session.prototype.errorCheck = function (file, project) { - this.syntacticCheck(file, project); - this.semanticCheck(file, project); - }; Session.prototype.reloadProjects = function () { this.projectService.reloadProjects(); }; @@ -42922,7 +43531,8 @@ var ts; var index = 0; var checkOne = function () { if (matchSeq(seq)) { - var checkSpec = checkList[index++]; + var checkSpec = checkList[index]; + index++; if (checkSpec.project.getSourceFileFromName(checkSpec.fileName, requireOpen)) { _this.syntacticCheck(checkSpec.fileName, checkSpec.project); _this.immediateId = setImmediate(function () { @@ -43141,9 +43751,9 @@ var ts; symbolDisplayString: displayString }; }; - Session.prototype.openClientFile = function (fileName) { + Session.prototype.openClientFile = function (fileName, fileContent) { var file = ts.normalizePath(fileName); - this.projectService.openClientFile(file); + this.projectService.openClientFile(file, fileContent); }; Session.prototype.getQuickInfo = function (line, offset, fileName) { var file = ts.normalizePath(fileName); @@ -43454,7 +44064,7 @@ var ts; }; Session.prototype.getDiagnosticsForProject = function (delay, fileName) { var _this = this; - var _a = this.getProjectInfo(fileName, true), configFileName = _a.configFileName, fileNames = _a.fileNames; + var fileNames = this.getProjectInfo(fileName, true).fileNames; var fileNamesInProject = fileNames.filter(function (value, index, array) { return value.indexOf("lib.d.ts") < 0; }); var highPriorityFiles = []; var mediumPriorityFiles = []; @@ -43546,7 +44156,7 @@ var ts; } }; return Session; - })(); + }()); server.Session = Session; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); @@ -43608,7 +44218,7 @@ var ts; return this.snap().getChangeRange(oldSnapshot); }; return ScriptInfo; - })(); + }()); server.ScriptInfo = ScriptInfo; var LSHost = (function () { function LSHost(host, project) { @@ -43621,7 +44231,8 @@ var ts; this.filenameToScript = ts.createFileMap(); this.moduleResolutionHost = { fileExists: function (fileName) { return _this.fileExists(fileName); }, - readFile: function (fileName) { return _this.host.readFile(fileName); } + readFile: function (fileName) { return _this.host.readFile(fileName); }, + directoryExists: function (directoryName) { return _this.host.directoryExists(directoryName); } }; } LSHost.prototype.resolveModuleNames = function (moduleNames, containingFile) { @@ -43748,12 +44359,10 @@ var ts; throw new Error("No script with name '" + filename + "'"); }; LSHost.prototype.resolvePath = function (path) { - var start = new Date().getTime(); var result = this.host.resolvePath(path); return result; }; LSHost.prototype.fileExists = function (path) { - var start = new Date().getTime(); var result = this.host.fileExists(path); return result; }; @@ -43790,32 +44399,8 @@ var ts; return { line: lineOffset.line, offset: lineOffset.offset + 1 }; }; return LSHost; - })(); + }()); server.LSHost = LSHost; - function getAbsolutePath(filename, directory) { - var rootLength = ts.getRootLength(filename); - if (rootLength > 0) { - return filename; - } - else { - var splitFilename = filename.split("/"); - var splitDir = directory.split("/"); - var i = 0; - var dirTail = 0; - var sflen = splitFilename.length; - while ((i < sflen) && (splitFilename[i].charAt(0) == ".")) { - var dots = splitFilename[i]; - if (dots == "..") { - dirTail++; - } - else if (dots != ".") { - return undefined; - } - i++; - } - return splitDir.slice(0, splitDir.length - dirTail).concat(splitFilename.slice(i)).join("/"); - } - } var Project = (function () { function Project(projectService, projectOptions) { this.projectService = projectService; @@ -43902,7 +44487,7 @@ var ts; } }; return Project; - })(); + }()); server.Project = Project; function copyListRemovingItem(item, list) { var copiedList = []; @@ -43926,7 +44511,7 @@ var ts; this.openFileRootsConfigured = []; this.directoryWatchersForTsconfig = {}; this.directoryWatchersRefCount = {}; - this.timerForDetectingProjectFilelistChanges = {}; + this.timerForDetectingProjectFileListChanges = {}; this.addDefaultHostConfiguration(); } ProjectService.prototype.addDefaultHostConfiguration = function () { @@ -43959,22 +44544,22 @@ var ts; } }; ProjectService.prototype.directoryWatchedForSourceFilesChanged = function (project, fileName) { - if (fileName && !ts.isSupportedSourceFileName(fileName)) { + if (fileName && !ts.isSupportedSourceFileName(fileName, project.projectOptions ? project.projectOptions.compilerOptions : undefined)) { return; } this.log("Detected source file changes: " + fileName); - this.startTimerForDetectingProjectFilelistChanges(project); + this.startTimerForDetectingProjectFileListChanges(project); }; - ProjectService.prototype.startTimerForDetectingProjectFilelistChanges = function (project) { + ProjectService.prototype.startTimerForDetectingProjectFileListChanges = function (project) { var _this = this; - if (this.timerForDetectingProjectFilelistChanges[project.projectFilename]) { - clearTimeout(this.timerForDetectingProjectFilelistChanges[project.projectFilename]); + if (this.timerForDetectingProjectFileListChanges[project.projectFilename]) { + clearTimeout(this.timerForDetectingProjectFileListChanges[project.projectFilename]); } - this.timerForDetectingProjectFilelistChanges[project.projectFilename] = setTimeout(function () { return _this.handleProjectFilelistChanges(project); }, 250); + this.timerForDetectingProjectFileListChanges[project.projectFilename] = setTimeout(function () { return _this.handleProjectFileListChanges(project); }, 250); }; - ProjectService.prototype.handleProjectFilelistChanges = function (project) { + ProjectService.prototype.handleProjectFileListChanges = function (project) { var _this = this; - var _a = this.configFileToProjectOptions(project.projectFilename), succeeded = _a.succeeded, projectOptions = _a.projectOptions, error = _a.error; + var projectOptions = this.configFileToProjectOptions(project.projectFilename).projectOptions; var newRootFiles = projectOptions.files.map((function (f) { return _this.getCanonicalFileName(f); })); var currentRootFiles = project.getRootFiles().map((function (f) { return _this.getCanonicalFileName(f); })); if (!ts.arrayIsEqualTo(currentRootFiles && currentRootFiles.sort(), newRootFiles && newRootFiles.sort())) { @@ -43989,7 +44574,7 @@ var ts; return; } this.log("Detected newly added tsconfig file: " + fileName); - var _a = this.configFileToProjectOptions(fileName), succeeded = _a.succeeded, projectOptions = _a.projectOptions, error = _a.error; + var projectOptions = this.configFileToProjectOptions(fileName).projectOptions; var rootFilesInTsconfig = projectOptions.files.map(function (f) { return _this.getCanonicalFileName(f); }); var openFileRoots = this.openFileRoots.map(function (s) { return _this.getCanonicalFileName(s.fileName); }); for (var _i = 0, openFileRoots_1 = openFileRoots; _i < openFileRoots_1.length; _i++) { @@ -44108,7 +44693,8 @@ var ts; else { for (var _i = 0, _a = project.directoriesWatchedForTsconfig; _i < _a.length; _i++) { var directory = _a[_i]; - if (!(--project.projectService.directoryWatchersRefCount[directory])) { + project.projectService.directoryWatchersRefCount[directory]--; + if (!project.projectService.directoryWatchersRefCount[directory]) { this.log("Close directory watcher for: " + directory); project.projectService.directoryWatchersForTsconfig[directory].close(); delete project.projectService.directoryWatchersForTsconfig[directory]; @@ -44308,14 +44894,14 @@ var ts; filename = ts.normalizePath(filename); return ts.lookUp(this.filenameToScriptInfo, filename); }; - ProjectService.prototype.openFile = function (fileName, openedByClient) { + ProjectService.prototype.openFile = function (fileName, openedByClient, fileContent) { var _this = this; fileName = ts.normalizePath(fileName); var info = ts.lookUp(this.filenameToScriptInfo, fileName); if (!info) { var content; if (this.host.fileExists(fileName)) { - content = this.host.readFile(fileName); + content = fileContent || this.host.readFile(fileName); } if (!content) { if (openedByClient) { @@ -44332,6 +44918,9 @@ var ts; } } if (info) { + if (fileContent) { + info.svc.reload(fileContent); + } if (openedByClient) { info.isOpen = true; } @@ -44352,9 +44941,9 @@ var ts; } return undefined; }; - ProjectService.prototype.openClientFile = function (fileName) { + ProjectService.prototype.openClientFile = function (fileName, fileContent) { this.openOrUpdateConfiguredProjectForFile(fileName); - var info = this.openFile(fileName, true); + var info = this.openFile(fileName, true, fileContent); this.addOpenFile(info); this.printProjects(); return info; @@ -44568,7 +45157,7 @@ var ts; return project; }; return ProjectService; - })(); + }()); server.ProjectService = ProjectService; var CompilerService = (function () { function CompilerService(project, opt) { @@ -44607,11 +45196,12 @@ var ts; InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, PlaceOpenBraceOnNewLineForFunctions: false, PlaceOpenBraceOnNewLineForControlBlocks: false }; return CompilerService; - })(); + }()); server.CompilerService = CompilerService; (function (CharRangeSection) { CharRangeSection[CharRangeSection["PreStart"] = 0] = "PreStart"; @@ -44630,7 +45220,7 @@ var ts; BaseLineIndexWalker.prototype.leaf = function (rangeStart, rangeLength, ll) { }; return BaseLineIndexWalker; - })(); + }()); var EditWalker = (function (_super) { __extends(EditWalker, _super); function EditWalker() { @@ -44814,7 +45404,7 @@ var ts; } }; return EditWalker; - })(BaseLineIndexWalker); + }(BaseLineIndexWalker)); var TextChange = (function () { function TextChange(pos, deleteLen, insertedText) { this.pos = pos; @@ -44825,7 +45415,7 @@ var ts; return ts.createTextChangeRange(ts.createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0); }; return TextChange; - })(); + }()); server.TextChange = TextChange; var ScriptVersionCache = (function () { function ScriptVersionCache() { @@ -44929,7 +45519,7 @@ var ts; ScriptVersionCache.changeLengthThreshold = 256; ScriptVersionCache.maxVersions = 8; return ScriptVersionCache; - })(); + }()); server.ScriptVersionCache = ScriptVersionCache; var LineIndexSnapshot = (function () { function LineIndexSnapshot(version, cache) { @@ -44948,7 +45538,8 @@ var ts; var count = 1; var pos = 0; this.index.every(function (ll, s, len) { - starts[count++] = pos; + starts[count] = pos; + count++; pos += ll.text.length; return true; }, 0); @@ -44956,9 +45547,9 @@ var ts; }; LineIndexSnapshot.prototype.getLineMapper = function () { var _this = this; - return (function (line) { + return function (line) { return _this.index.lineNumberToInfo(line).offset; - }); + }; }; LineIndexSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { if (this.version <= scriptVersion) { @@ -44973,7 +45564,7 @@ var ts; return this.getTextChangeRangeSinceVersion(oldSnap.version); }; return LineIndexSnapshot; - })(); + }()); server.LineIndexSnapshot = LineIndexSnapshot; var LineIndex = (function () { function LineIndex() { @@ -45145,7 +45736,7 @@ var ts; return { lines: lines, lineMap: lineStarts }; }; return LineIndex; - })(); + }()); server.LineIndex = LineIndex; var LineNode = (function () { function LineNode() { @@ -45194,7 +45785,8 @@ var ts; while (adjustedStart >= childCharCount) { this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); adjustedStart -= childCharCount; - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); } if ((adjustedStart + rangeLength) <= childCharCount) { @@ -45207,14 +45799,16 @@ var ts; return; } var adjustedLength = rangeLength - (childCharCount - adjustedStart); - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); while (adjustedLength > childCharCount) { if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { return; } adjustedLength -= childCharCount; - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); } if (adjustedLength > 0) { @@ -45332,7 +45926,8 @@ var ts; if (childIndex < clen) { splitNode = new LineNode(); while (childIndex < clen) { - splitNode.add(this.children[childIndex++]); + splitNode.add(this.children[childIndex]); + childIndex++; } splitNode.updateCounts(); } @@ -45370,7 +45965,9 @@ var ts; var nodeIndex = 0; childIndex++; while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) { - this.children[childIndex++] = nodes[nodeIndex++]; + this.children[childIndex] = nodes[nodeIndex]; + childIndex++; + nodeIndex++; } var splitNodes = []; var splitNodeCount = 0; @@ -45383,7 +45980,8 @@ var ts; } var splitNode = splitNodes[0]; while (nodeIndex < nodeCount) { - splitNode.add(nodes[nodeIndex++]); + splitNode.add(nodes[nodeIndex]); + nodeIndex++; if (splitNode.children.length === lineCollectionCapacity) { splitNodeIndex++; splitNode = splitNodes[splitNodeIndex]; @@ -45416,7 +46014,7 @@ var ts; return this.totalLines; }; return LineNode; - })(); + }()); server.LineNode = LineNode; var LineLeaf = (function () { function LineLeaf(text) { @@ -45441,7 +46039,7 @@ var ts; return 1; }; return LineLeaf; - })(); + }()); server.LineLeaf = LineLeaf; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); @@ -45449,9 +46047,7 @@ var ts; (function (ts) { var server; (function (server) { - var nodeproto = require("_debugger"); var readline = require("readline"); - var path = require("path"); var fs = require("fs"); var rl = readline.createInterface({ input: process.stdin, @@ -45519,7 +46115,7 @@ var ts; } }; return Logger; - })(); + }()); var IOSession = (function (_super) { __extends(IOSession, _super); function IOSession(host, logger) { @@ -45541,7 +46137,7 @@ var ts; }); }; return IOSession; - })(server.Session); + }(server.Session)); function parseLoggingEnvironmentString(logEnvStr) { var logEnv = {}; var args = logEnvStr.split(" "); @@ -45616,7 +46212,6 @@ var ts; var ScriptSnapshotShimAdapter = (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { this.scriptSnapshotShim = scriptSnapshotShim; - this.lineStartPositions = null; } ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { return this.scriptSnapshotShim.getText(start, end); @@ -45639,7 +46234,7 @@ var ts; } }; return ScriptSnapshotShimAdapter; - })(); + }()); var LanguageServiceShimHostAdapter = (function () { function LanguageServiceShimHostAdapter(shimHost) { var _this = this; @@ -45655,6 +46250,9 @@ var ts; }); }; } + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } LanguageServiceShimHostAdapter.prototype.log = function (s) { if (this.loggingEnabled) { @@ -45690,9 +46288,6 @@ var ts; return this.files = JSON.parse(encoded); }; LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { - if (this.files && this.files.indexOf(fileName) < 0) { - return undefined; - } var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); }; @@ -45720,15 +46315,10 @@ var ts; return this.shimHost.getCurrentDirectory(); }; LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { - try { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - catch (e) { - return ""; - } + return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); }; return LanguageServiceShimHostAdapter; - })(); + }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; var ThrottledCancellationToken = (function () { function ThrottledCancellationToken(hostCancellationToken) { @@ -45745,19 +46335,17 @@ var ts; return false; }; return ThrottledCancellationToken; - })(); + }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { + var _this = this; this.shimHost = shimHost; + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension, exclude) { - var encoded; - try { - encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); - } - catch (e) { - encoded = this.shimHost.readDirectory(rootDir, extension); - } + var encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); return JSON.parse(encoded); }; CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) { @@ -45767,18 +46355,19 @@ var ts; return this.shimHost.readFile(fileName); }; return CoreServicesShimHostAdapter; - })(); + }()); ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; function simpleForwardCall(logger, actionDescription, action, logPerformance) { + var start; if (logPerformance) { logger.log(actionDescription); - var start = Date.now(); + start = Date.now(); } var result = action(); if (logPerformance) { var end = Date.now(); logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { + if (typeof result === "string") { var str = result; if (str.length > 128) { str = str.substring(0, 128) + "..."; @@ -45811,7 +46400,7 @@ var ts; this.factory.unregisterShim(this); }; return ShimBase; - })(); + }()); function realizeDiagnostics(diagnostics, newLine) { return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); } @@ -45849,9 +46438,7 @@ var ts; _super.prototype.dispose.call(this, dummy); }; LanguageServiceShimObject.prototype.refresh = function (throwOnError) { - this.forwardJSONCall("refresh(" + throwOnError + ")", function () { - return null; - }); + this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; }); }; LanguageServiceShimObject.prototype.cleanupSemanticCache = function () { var _this = this; @@ -45866,29 +46453,19 @@ var ts; }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { var _this = this; @@ -45913,62 +46490,39 @@ var ts; }; LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { - var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); + return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { var _this = this; - return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { - var spanInfo = _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); + return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); }); }; LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { - var spanInfo = _this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); + return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); + return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); }); }; LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getTypeDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { - return _this.languageService.getRenameInfo(fileName, position); - }); + return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); }); }; LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { - return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); }; LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { - var textRanges = _this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); + return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { var _this = this; @@ -45979,21 +46533,15 @@ var ts; }; LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getReferencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { var _this = this; - return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { - return _this.languageService.findReferences(fileName, position); - }); + return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); }); }; LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getOccurrencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { var _this = this; @@ -46005,40 +46553,31 @@ var ts; }; LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { - var completion = _this.languageService.getCompletionsAtPosition(fileName, position); - return completion; - }); + return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { var _this = this; - return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { - var details = _this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); + return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { var _this = this; return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; + return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) { var _this = this; return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; + return _this.languageService.getFormattingEditsForDocument(fileName, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) { var _this = this; return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; + return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); }); }; LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) { @@ -46047,42 +46586,26 @@ var ts; }; LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { var _this = this; - return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { - var items = _this.languageService.getNavigateToItems(searchValue, maxResultCount); - return items; - }); + return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount); }); }; LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) { var _this = this; - return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { - var items = _this.languageService.getNavigationBarItems(fileName); - return items; - }); + return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); }); }; LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) { var _this = this; - return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { - var items = _this.languageService.getOutliningSpans(fileName); - return items; - }); + return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); }); }; LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) { var _this = this; - return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { - var items = _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); + return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); }); }; LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { var _this = this; - return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { - var output = _this.languageService.getEmitOutput(fileName); - output.emitOutputStatus = output.emitSkipped ? 1 : 0; - return output; - }); + return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); }); }; return LanguageServiceShimObject; - })(ShimBase); + }(ShimBase)); function convertClassifications(classifications) { return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; } @@ -46100,17 +46623,17 @@ var ts; }; ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - var items = classification.entries; var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; + for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) { + var item = _a[_i]; + result += item.length + "\n"; + result += item.classification + "\n"; } result += classification.finalLexState; return result; }; return ClassifierShimObject; - })(ShimBase); + }(ShimBase)); var CoreServicesShimObject = (function (_super) { __extends(CoreServicesShimObject, _super); function CoreServicesShimObject(factory, logger, host) { @@ -46168,24 +46691,22 @@ var ts; return { options: {}, files: [], - errors: [realizeDiagnostic(result.error, '\r\n')] + errors: [realizeDiagnostic(result.error, "\r\n")] }; } var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); return { options: configFile.options, files: configFile.fileNames, - errors: realizeDiagnostics(configFile.errors, '\r\n') + errors: realizeDiagnostics(configFile.errors, "\r\n") }; }); }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { - return this.forwardJSONCall("getDefaultCompilationSettings()", function () { - return ts.getDefaultCompilerOptions(); - }); + return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); }); }; return CoreServicesShimObject; - })(ShimBase); + }(ShimBase)); var TypeScriptServicesFactory = (function () { function TypeScriptServicesFactory() { this._shims = []; @@ -46243,7 +46764,7 @@ var ts; throw new Error("Invalid operation"); }; return TypeScriptServicesFactory; - })(); + }()); ts.TypeScriptServicesFactory = TypeScriptServicesFactory; if (typeof module !== "undefined" && module.exports) { module.exports = ts; @@ -46256,4 +46777,4 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); -var toolsVersion = "1.6"; +var toolsVersion = "1.8"; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 32a6dee4623..3196ae2199f 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -194,118 +194,120 @@ declare namespace ts { UnionType = 158, IntersectionType = 159, ParenthesizedType = 160, - ObjectBindingPattern = 161, - ArrayBindingPattern = 162, - BindingElement = 163, - ArrayLiteralExpression = 164, - ObjectLiteralExpression = 165, - PropertyAccessExpression = 166, - ElementAccessExpression = 167, - CallExpression = 168, - NewExpression = 169, - TaggedTemplateExpression = 170, - TypeAssertionExpression = 171, - ParenthesizedExpression = 172, - FunctionExpression = 173, - ArrowFunction = 174, - DeleteExpression = 175, - TypeOfExpression = 176, - VoidExpression = 177, - AwaitExpression = 178, - PrefixUnaryExpression = 179, - PostfixUnaryExpression = 180, - BinaryExpression = 181, - ConditionalExpression = 182, - TemplateExpression = 183, - YieldExpression = 184, - SpreadElementExpression = 185, - ClassExpression = 186, - OmittedExpression = 187, - ExpressionWithTypeArguments = 188, - AsExpression = 189, - TemplateSpan = 190, - SemicolonClassElement = 191, - Block = 192, - VariableStatement = 193, - EmptyStatement = 194, - ExpressionStatement = 195, - IfStatement = 196, - DoStatement = 197, - WhileStatement = 198, - ForStatement = 199, - ForInStatement = 200, - ForOfStatement = 201, - ContinueStatement = 202, - BreakStatement = 203, - ReturnStatement = 204, - WithStatement = 205, - SwitchStatement = 206, - LabeledStatement = 207, - ThrowStatement = 208, - TryStatement = 209, - DebuggerStatement = 210, - VariableDeclaration = 211, - VariableDeclarationList = 212, - FunctionDeclaration = 213, - ClassDeclaration = 214, - InterfaceDeclaration = 215, - TypeAliasDeclaration = 216, - EnumDeclaration = 217, - ModuleDeclaration = 218, - ModuleBlock = 219, - CaseBlock = 220, - ImportEqualsDeclaration = 221, - ImportDeclaration = 222, - ImportClause = 223, - NamespaceImport = 224, - NamedImports = 225, - ImportSpecifier = 226, - ExportAssignment = 227, - ExportDeclaration = 228, - NamedExports = 229, - ExportSpecifier = 230, - MissingDeclaration = 231, - ExternalModuleReference = 232, - JsxElement = 233, - JsxSelfClosingElement = 234, - JsxOpeningElement = 235, - JsxText = 236, - JsxClosingElement = 237, - JsxAttribute = 238, - JsxSpreadAttribute = 239, - JsxExpression = 240, - CaseClause = 241, - DefaultClause = 242, - HeritageClause = 243, - CatchClause = 244, - PropertyAssignment = 245, - ShorthandPropertyAssignment = 246, - EnumMember = 247, - SourceFile = 248, - JSDocTypeExpression = 249, - JSDocAllType = 250, - JSDocUnknownType = 251, - JSDocArrayType = 252, - JSDocUnionType = 253, - JSDocTupleType = 254, - JSDocNullableType = 255, - JSDocNonNullableType = 256, - JSDocRecordType = 257, - JSDocRecordMember = 258, - JSDocTypeReference = 259, - JSDocOptionalType = 260, - JSDocFunctionType = 261, - JSDocVariadicType = 262, - JSDocConstructorType = 263, - JSDocThisType = 264, - JSDocComment = 265, - JSDocTag = 266, - JSDocParameterTag = 267, - JSDocReturnTag = 268, - JSDocTypeTag = 269, - JSDocTemplateTag = 270, - SyntaxList = 271, - Count = 272, + ThisType = 161, + StringLiteralType = 162, + ObjectBindingPattern = 163, + ArrayBindingPattern = 164, + BindingElement = 165, + ArrayLiteralExpression = 166, + ObjectLiteralExpression = 167, + PropertyAccessExpression = 168, + ElementAccessExpression = 169, + CallExpression = 170, + NewExpression = 171, + TaggedTemplateExpression = 172, + TypeAssertionExpression = 173, + ParenthesizedExpression = 174, + FunctionExpression = 175, + ArrowFunction = 176, + DeleteExpression = 177, + TypeOfExpression = 178, + VoidExpression = 179, + AwaitExpression = 180, + PrefixUnaryExpression = 181, + PostfixUnaryExpression = 182, + BinaryExpression = 183, + ConditionalExpression = 184, + TemplateExpression = 185, + YieldExpression = 186, + SpreadElementExpression = 187, + ClassExpression = 188, + OmittedExpression = 189, + ExpressionWithTypeArguments = 190, + AsExpression = 191, + TemplateSpan = 192, + SemicolonClassElement = 193, + Block = 194, + VariableStatement = 195, + EmptyStatement = 196, + ExpressionStatement = 197, + IfStatement = 198, + DoStatement = 199, + WhileStatement = 200, + ForStatement = 201, + ForInStatement = 202, + ForOfStatement = 203, + ContinueStatement = 204, + BreakStatement = 205, + ReturnStatement = 206, + WithStatement = 207, + SwitchStatement = 208, + LabeledStatement = 209, + ThrowStatement = 210, + TryStatement = 211, + DebuggerStatement = 212, + VariableDeclaration = 213, + VariableDeclarationList = 214, + FunctionDeclaration = 215, + ClassDeclaration = 216, + InterfaceDeclaration = 217, + TypeAliasDeclaration = 218, + EnumDeclaration = 219, + ModuleDeclaration = 220, + ModuleBlock = 221, + CaseBlock = 222, + ImportEqualsDeclaration = 223, + ImportDeclaration = 224, + ImportClause = 225, + NamespaceImport = 226, + NamedImports = 227, + ImportSpecifier = 228, + ExportAssignment = 229, + ExportDeclaration = 230, + NamedExports = 231, + ExportSpecifier = 232, + MissingDeclaration = 233, + ExternalModuleReference = 234, + JsxElement = 235, + JsxSelfClosingElement = 236, + JsxOpeningElement = 237, + JsxText = 238, + JsxClosingElement = 239, + JsxAttribute = 240, + JsxSpreadAttribute = 241, + JsxExpression = 242, + CaseClause = 243, + DefaultClause = 244, + HeritageClause = 245, + CatchClause = 246, + PropertyAssignment = 247, + ShorthandPropertyAssignment = 248, + EnumMember = 249, + SourceFile = 250, + JSDocTypeExpression = 251, + JSDocAllType = 252, + JSDocUnknownType = 253, + JSDocArrayType = 254, + JSDocUnionType = 255, + JSDocTupleType = 256, + JSDocNullableType = 257, + JSDocNonNullableType = 258, + JSDocRecordType = 259, + JSDocRecordMember = 260, + JSDocTypeReference = 261, + JSDocOptionalType = 262, + JSDocFunctionType = 263, + JSDocVariadicType = 264, + JSDocConstructorType = 265, + JSDocThisType = 266, + JSDocComment = 267, + JSDocTag = 268, + JSDocParameterTag = 269, + JSDocReturnTag = 270, + JSDocTypeTag = 271, + JSDocTemplateTag = 272, + SyntaxList = 273, + Count = 274, FirstAssignment = 56, LastAssignment = 68, FirstReservedWord = 70, @@ -314,8 +316,8 @@ declare namespace ts { LastKeyword = 134, FirstFutureReservedWord = 106, LastFutureReservedWord = 114, - FirstTypeNode = 151, - LastTypeNode = 160, + FirstTypeNode = 150, + LastTypeNode = 162, FirstPunctuation = 15, LastPunctuation = 68, FirstToken = 0, @@ -359,10 +361,14 @@ declare namespace ts { } enum JsxFlags { None = 0, + /** An element from a named property of the JSX.IntrinsicElements interface */ IntrinsicNamedElement = 1, + /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ IntrinsicIndexedElement = 2, - ClassElement = 4, - UnknownElement = 8, + /** An element backed by a class, class-like, or function value */ + ValueElement = 4, + /** Element resolution failed */ + UnknownElement = 16, IntrinsicElement = 3, } interface Node extends TextRange { @@ -375,9 +381,11 @@ declare namespace ts { interface NodeArray extends Array, TextRange { hasTrailingComma?: boolean; } - interface ModifiersArray extends NodeArray { + interface ModifiersArray extends NodeArray { flags: number; } + interface Modifier extends Node { + } interface Identifier extends PrimaryExpression { text: string; originalKeywordKind?: SyntaxKind; @@ -393,6 +401,9 @@ declare namespace ts { _declarationBrand: any; name?: DeclarationName; } + interface DeclarationStatement extends Declaration, Statement { + name?: Identifier; + } interface ComputedPropertyName extends Node { expression: Expression; } @@ -405,10 +416,15 @@ declare namespace ts { expression?: Expression; } interface SignatureDeclaration extends Declaration { + name?: PropertyName; typeParameters?: NodeArray; parameters: NodeArray; type?: TypeNode; } + interface CallSignatureDeclaration extends SignatureDeclaration, TypeElement { + } + interface ConstructSignatureDeclaration extends SignatureDeclaration, TypeElement { + } interface VariableDeclaration extends Declaration { parent?: VariableDeclarationList; name: Identifier | BindingPattern; @@ -431,18 +447,25 @@ declare namespace ts { name: Identifier | BindingPattern; initializer?: Expression; } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; + interface PropertySignature extends TypeElement { + name: PropertyName; questionToken?: Node; type?: TypeNode; initializer?: Expression; } + interface PropertyDeclaration extends ClassElement { + questionToken?: Node; + name: PropertyName; + type?: TypeNode; + initializer?: Expression; + } interface ObjectLiteralElement extends Declaration { _objectLiteralBrandBrand: any; + name?: PropertyName; } interface PropertyAssignment extends ObjectLiteralElement { _propertyAssignmentBrand: any; - name: DeclarationName; + name: PropertyName; questionToken?: Node; initializer: Expression; } @@ -460,9 +483,16 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } + interface PropertyLikeDeclaration extends Declaration { + name: PropertyName; + } interface BindingPattern extends Node { elements: NodeArray; } + interface ObjectBindingPattern extends BindingPattern { + } + interface ArrayBindingPattern extends BindingPattern { + } /** * Several node kinds share function-like features such as a signature, * a name, and a body. These nodes should extend FunctionLikeDeclaration. @@ -477,45 +507,61 @@ declare namespace ts { questionToken?: Node; body?: Block | Expression; } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { + interface FunctionDeclaration extends FunctionLikeDeclaration, DeclarationStatement { name?: Identifier; - body?: Block; + body?: FunctionBody; + } + interface MethodSignature extends SignatureDeclaration, TypeElement { + name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; + name: PropertyName; + body?: FunctionBody; } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; + body?: FunctionBody; } interface SemicolonClassElement extends ClassElement { _semicolonClassElementBrand: any; } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; - body: Block; + name: PropertyName; + body: FunctionBody; } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { + interface GetAccessorDeclaration extends AccessorDeclaration { + } + interface SetAccessorDeclaration extends AccessorDeclaration { + } + interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { _indexSignatureDeclarationBrand: any; } interface TypeNode extends Node { _typeNodeBrand: any; } + interface ThisTypeNode extends TypeNode { + _thisTypeNodeBrand: any; + } interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { _functionOrConstructorTypeNodeBrand: any; } + interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + } + interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + } interface TypeReferenceNode extends TypeNode { typeName: EntityName; typeArguments?: NodeArray; } interface TypePredicateNode extends TypeNode { - parameterName: Identifier; + parameterName: Identifier | ThisTypeNode; type: TypeNode; } interface TypeQueryNode extends TypeNode { exprName: EntityName; } interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; + members: NodeArray; } interface ArrayTypeNode extends TypeNode { elementType: TypeNode; @@ -533,13 +579,18 @@ declare namespace ts { interface ParenthesizedTypeNode extends TypeNode { type: TypeNode; } - interface StringLiteral extends LiteralExpression, TypeNode { + interface StringLiteralTypeNode extends LiteralLikeNode, TypeNode { + _stringLiteralTypeBrand: any; + } + interface StringLiteral extends LiteralExpression { _stringLiteralBrand: any; } interface Expression extends Node { _expressionBrand: any; contextualType?: Type; } + interface OmittedExpression extends Expression { + } interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -594,25 +645,34 @@ declare namespace ts { colonToken: Node; whenFalse: Expression; } + type FunctionBody = Block; + type ConciseBody = FunctionBody | Expression; interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { name?: Identifier; - body: Block | Expression; + body: FunctionBody; } interface ArrowFunction extends Expression, FunctionLikeDeclaration { equalsGreaterThanToken: Node; + body: ConciseBody; } - interface LiteralExpression extends PrimaryExpression { + interface LiteralLikeNode extends Node { text: string; isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; } + interface LiteralExpression extends LiteralLikeNode, PrimaryExpression { + _literalExpressionBrand: any; + } + interface TemplateLiteralFragment extends LiteralLikeNode { + _templateLiteralFragmentBrand: any; + } interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; + head: TemplateLiteralFragment; templateSpans: NodeArray; } interface TemplateSpan extends Node { expression: Expression; - literal: LiteralExpression; + literal: TemplateLiteralFragment; } interface ParenthesizedExpression extends PrimaryExpression { expression: Expression; @@ -694,6 +754,14 @@ declare namespace ts { interface Statement extends Node { _statementBrand: any; } + interface EmptyStatement extends Statement { + } + interface DebuggerStatement extends Statement { + } + interface MissingDeclaration extends DeclarationStatement, ClassElement, ObjectLiteralElement, TypeElement { + name?: Identifier; + } + type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; interface Block extends Statement { statements: NodeArray; } @@ -730,9 +798,13 @@ declare namespace ts { initializer: VariableDeclarationList | Expression; expression: Expression; } - interface BreakOrContinueStatement extends Statement { + interface BreakStatement extends Statement { label?: Identifier; } + interface ContinueStatement extends Statement { + label?: Identifier; + } + type BreakOrContinueStatement = BreakStatement | ContinueStatement; interface ReturnStatement extends Statement { expression?: Expression; } @@ -748,7 +820,7 @@ declare namespace ts { clauses: NodeArray; } interface CaseClause extends Node { - expression?: Expression; + expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { @@ -777,24 +849,31 @@ declare namespace ts { heritageClauses?: NodeArray; members: NodeArray; } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { + interface ClassDeclaration extends ClassLikeDeclaration, DeclarationStatement { + name?: Identifier; } interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { } interface ClassElement extends Declaration { _classElementBrand: any; + name?: PropertyName; } - interface InterfaceDeclaration extends Declaration, Statement { + interface TypeElement extends Declaration { + _typeElementBrand: any; + name?: PropertyName; + questionToken?: Node; + } + interface InterfaceDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; - members: NodeArray; + members: NodeArray; } interface HeritageClause extends Node { token: SyntaxKind; types?: NodeArray; } - interface TypeAliasDeclaration extends Declaration, Statement { + interface TypeAliasDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; type: TypeNode; @@ -803,18 +882,19 @@ declare namespace ts { name: DeclarationName; initializer?: Expression; } - interface EnumDeclaration extends Declaration, Statement { + interface EnumDeclaration extends DeclarationStatement { name: Identifier; members: NodeArray; } - interface ModuleDeclaration extends Declaration, Statement { + type ModuleBody = ModuleBlock | ModuleDeclaration; + interface ModuleDeclaration extends DeclarationStatement { name: Identifier | LiteralExpression; body: ModuleBlock | ModuleDeclaration; } interface ModuleBlock extends Node, Statement { statements: NodeArray; } - interface ImportEqualsDeclaration extends Declaration, Statement { + interface ImportEqualsDeclaration extends DeclarationStatement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } @@ -832,22 +912,27 @@ declare namespace ts { interface NamespaceImport extends Declaration { name: Identifier; } - interface ExportDeclaration extends Declaration, Statement { + interface ExportDeclaration extends DeclarationStatement { exportClause?: NamedExports; moduleSpecifier?: Expression; } - interface NamedImportsOrExports extends Node { - elements: NodeArray; + interface NamedImports extends Node { + elements: NodeArray; } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { + interface NamedExports extends Node { + elements: NodeArray; + } + type NamedImportsOrExports = NamedImports | NamedExports; + interface ImportSpecifier extends Declaration { propertyName?: Identifier; name: Identifier; } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, Statement { + interface ExportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } + type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + interface ExportAssignment extends DeclarationStatement { isExportEquals?: boolean; expression: Expression; } @@ -908,7 +993,7 @@ declare namespace ts { interface JSDocThisType extends JSDocType { type: JSDocType; } - interface JSDocRecordMember extends PropertyDeclaration { + interface JSDocRecordMember extends PropertySignature { name: Identifier | LiteralExpression; type?: JSDocType; } @@ -934,16 +1019,17 @@ declare namespace ts { postParameterName?: Identifier; isBracketed: boolean; } + interface AmdDependency { + path: string; + name: string; + } interface SourceFile extends Declaration { statements: NodeArray; endOfFileToken: Node; fileName: string; path: Path; text: string; - amdDependencies: { - path: string; - name: string; - }[]; + amdDependencies: AmdDependency[]; moduleName: string; referencedFiles: FileReference[]; languageVariant: LanguageVariant; @@ -1053,6 +1139,7 @@ declare namespace ts { getReturnTypeOfSignature(signature: Signature): Type; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; + getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol; getTypeAtLocation(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; @@ -1078,7 +1165,7 @@ declare namespace ts { interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; @@ -1117,10 +1204,20 @@ declare namespace ts { WriteTypeParametersOrArguments = 1, UseOnlyExternalAliasing = 2, } + enum TypePredicateKind { + This = 0, + Identifier = 1, + } interface TypePredicate { + kind: TypePredicateKind; + type: Type; + } + interface ThisTypePredicate extends TypePredicate { + _thisTypePredicateBrand: any; + } + interface IdentifierTypePredicate extends TypePredicate { parameterName: string; parameterIndex: number; - type: Type; } enum SymbolFlags { None = 0, @@ -1222,6 +1319,7 @@ declare namespace ts { ESSymbol = 16777216, ThisType = 33554432, ObjectLiteralPatternWithComputedProperties = 67108864, + PredicateType = 134217728, StringLike = 258, NumberLike = 132, ObjectType = 80896, @@ -1234,6 +1332,9 @@ declare namespace ts { symbol?: Symbol; pattern?: DestructuringPattern; } + interface PredicateType extends Type { + predicate: ThisTypePredicate | IdentifierTypePredicate; + } interface StringLiteralType extends Type { text: string; } @@ -1279,7 +1380,6 @@ declare namespace ts { declaration: SignatureDeclaration; typeParameters: TypeParameter[]; parameters: Symbol[]; - typePredicate?: TypePredicate; } enum IndexKind { String = 0, @@ -1331,6 +1431,7 @@ declare namespace ts { inlineSourceMap?: boolean; inlineSources?: boolean; jsx?: JsxEmit; + reactNamespace?: string; listFiles?: boolean; locale?: string; mapRoot?: string; @@ -1366,6 +1467,8 @@ declare namespace ts { noImplicitReturns?: boolean; noFallthroughCasesInSwitch?: boolean; forceConsistentCasingInFileNames?: boolean; + allowSyntheticDefaultImports?: boolean; + allowJs?: boolean; [option: string]: string | number | boolean; } enum ModuleKind { @@ -1409,6 +1512,7 @@ declare namespace ts { interface ModuleResolutionHost { fileExists(fileName: string): boolean; readFile(fileName: string): string; + directoryExists?(directoryName: string): boolean; } interface ResolvedModule { resolvedFileName: string; @@ -1537,6 +1641,7 @@ declare namespace ts { */ function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; function getTypeParameterOwner(d: Declaration): Declaration; + function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -1546,10 +1651,10 @@ declare namespace ts { } declare namespace ts { const version: string; - function findConfigFile(searchPath: string): string; + function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function nodeModuleNameResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; + function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -1582,7 +1687,7 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine; + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions): ParsedCommandLine; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string): { options: CompilerOptions; errors: Diagnostic[]; @@ -1590,7 +1695,7 @@ declare namespace ts { } declare namespace ts { /** The version of the language service API */ - let servicesVersion: string; + const servicesVersion: string; interface Node { getSourceFile(): SourceFile; getChildCount(sourceFile?: SourceFile): number; @@ -1659,7 +1764,7 @@ declare namespace ts { /** Releases all resources held by this script snapshot */ dispose?(): void; } - module ScriptSnapshot { + namespace ScriptSnapshot { function fromString(text: string): IScriptSnapshot; } interface PreProcessedFileInfo { @@ -1687,6 +1792,7 @@ declare namespace ts { error?(s: string): void; useCaseSensitiveFileNames?(): boolean; resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[]; + directoryExists?(directoryName: string): boolean; } interface LanguageService { cleanupSemanticCache(): void; @@ -1782,7 +1888,7 @@ declare namespace ts { fileName: string; highlightSpans: HighlightSpan[]; } - module HighlightSpanKind { + namespace HighlightSpanKind { const none: string; const definition: string; const reference: string; @@ -1824,6 +1930,7 @@ declare namespace ts { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; [s: string]: boolean | number | string; @@ -2068,7 +2175,7 @@ declare namespace ts { releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; reportStats(): string; } - module ScriptElementKind { + namespace ScriptElementKind { const unknown: string; const warning: string; const keyword: string; @@ -2099,7 +2206,7 @@ declare namespace ts { const constElement: string; const letElement: string; } - module ScriptElementKindModifier { + namespace ScriptElementKindModifier { const none: string; const publicMemberModifier: string; const privateMemberModifier: string; diff --git a/lib/typescript.js b/lib/typescript.js index 498ddc37860..1e2f51f5aae 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -195,133 +195,135 @@ var ts; SyntaxKind[SyntaxKind["UnionType"] = 158] = "UnionType"; SyntaxKind[SyntaxKind["IntersectionType"] = 159] = "IntersectionType"; SyntaxKind[SyntaxKind["ParenthesizedType"] = 160] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 161] = "ThisType"; + SyntaxKind[SyntaxKind["StringLiteralType"] = 162] = "StringLiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 161] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 162] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 163] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 163] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 164] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 165] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 164] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 165] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 166] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 167] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 168] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 169] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 170] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 171] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 172] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 173] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 174] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 175] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 176] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 177] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 178] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 179] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 180] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 181] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 182] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 183] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 184] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 185] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 186] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 188] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 189] = "AsExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 166] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 167] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 168] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 169] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 170] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 171] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 172] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 173] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 174] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 175] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 176] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 177] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 178] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 179] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 180] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 181] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 182] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 183] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 184] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 185] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 186] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 187] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 188] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 189] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 190] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 191] = "AsExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 190] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 191] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 192] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 193] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 192] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 193] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 194] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 195] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 196] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 197] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 198] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 199] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 200] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 201] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 202] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 203] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 204] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 205] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 206] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 207] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 208] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 209] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 210] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 211] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 212] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 213] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 214] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 215] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 216] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 217] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 218] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 219] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 220] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 221] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 222] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 223] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 224] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 225] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 226] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 227] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 228] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 229] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 230] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 231] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 194] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 195] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 196] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 197] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 198] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 199] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 200] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 201] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 202] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 203] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 204] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 205] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 206] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 207] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 208] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 209] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 210] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 211] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 212] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 213] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 214] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 215] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 216] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 217] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 218] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 219] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 220] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 221] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 222] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 223] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 224] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 225] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 226] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 227] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 228] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 229] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 230] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 231] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 232] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 233] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 232] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 234] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 233] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 234] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 235] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxText"] = 236] = "JsxText"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 237] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 238] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 239] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 240] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 235] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 236] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 237] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxText"] = 238] = "JsxText"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 239] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 240] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 241] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 242] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 241] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 242] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 243] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 244] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 243] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 244] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 245] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 246] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 245] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 246] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 247] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 248] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 247] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 249] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 248] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 250] = "SourceFile"; // JSDoc nodes. - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 249] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 251] = "JSDocTypeExpression"; // The * type. - SyntaxKind[SyntaxKind["JSDocAllType"] = 250] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 252] = "JSDocAllType"; // The ? type. - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 251] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 252] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 253] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 254] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 255] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 256] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 257] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 258] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 259] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 260] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 261] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 262] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 263] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 264] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 265] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 266] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 267] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 268] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 269] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 270] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 253] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 254] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 255] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 256] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 257] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 258] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 259] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 260] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 261] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 262] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 263] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 264] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 265] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 266] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 267] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 268] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 269] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 270] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 271] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 272] = "JSDocTemplateTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 271] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 273] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 272] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 274] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 56] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 68] = "LastAssignment"; @@ -331,8 +333,8 @@ var ts; SyntaxKind[SyntaxKind["LastKeyword"] = 134] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 106] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 114] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 151] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 160] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 150] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 162] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 15] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 68] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; @@ -408,10 +410,14 @@ var ts; var ParserContextFlags = ts.ParserContextFlags; (function (JsxFlags) { JsxFlags[JsxFlags["None"] = 0] = "None"; + /** An element from a named property of the JSX.IntrinsicElements interface */ JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; - JsxFlags[JsxFlags["ClassElement"] = 4] = "ClassElement"; - JsxFlags[JsxFlags["UnknownElement"] = 8] = "UnknownElement"; + /** An element backed by a class, class-like, or function value */ + JsxFlags[JsxFlags["ValueElement"] = 4] = "ValueElement"; + /** Element resolution failed */ + JsxFlags[JsxFlags["UnknownElement"] = 16] = "UnknownElement"; JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; })(ts.JsxFlags || (ts.JsxFlags = {})); var JsxFlags = ts.JsxFlags; @@ -426,7 +432,7 @@ var ts; function OperationCanceledException() { } return OperationCanceledException; - })(); + }()); ts.OperationCanceledException = OperationCanceledException; /** Return code used by getEmitOutput function to indicate status of the function */ (function (ExitStatus) { @@ -472,6 +478,11 @@ var ts; SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); var SymbolAccessibility = ts.SymbolAccessibility; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(ts.TypePredicateKind || (ts.TypePredicateKind = {})); + var TypePredicateKind = ts.TypePredicateKind; /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator * metadata */ /* @internal */ @@ -623,6 +634,7 @@ var ts; TypeFlags[TypeFlags["ESSymbol"] = 16777216] = "ESSymbol"; TypeFlags[TypeFlags["ThisType"] = 33554432] = "ThisType"; TypeFlags[TypeFlags["ObjectLiteralPatternWithComputedProperties"] = 67108864] = "ObjectLiteralPatternWithComputedProperties"; + TypeFlags[TypeFlags["PredicateType"] = 134217728] = "PredicateType"; /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 16777343] = "Intrinsic"; /* @internal */ @@ -633,7 +645,7 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 49152] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 130048] = "StructuredType"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 140509184] = "RequiresWidening"; /* @internal */ TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; })(ts.TypeFlags || (ts.TypeFlags = {})); @@ -648,6 +660,19 @@ var ts; IndexKind[IndexKind["Number"] = 1] = "Number"; })(ts.IndexKind || (ts.IndexKind = {})); var IndexKind = ts.IndexKind; + /* @internal */ + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + /// exports.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + /// module.exports = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + /// className.prototype.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + /// this.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + })(ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); + var SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; @@ -1068,9 +1093,11 @@ var ts; var count = array.length; if (count > 0) { var pos = 0; - var result = arguments.length <= 2 ? array[pos++] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos++; while (pos < count) { - result = f(result, array[pos++]); + result = f(result, array[pos]); + pos++; } return result; } @@ -1082,9 +1109,11 @@ var ts; if (array) { var pos = array.length - 1; if (pos >= 0) { - var result = arguments.length <= 2 ? array[pos--] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos--; while (pos >= 0) { - result = f(result, array[pos--]); + result = f(result, array[pos]); + pos--; } return result; } @@ -1177,6 +1206,32 @@ var ts; return result; } ts.arrayToMap = arrayToMap; + /** + * Reduce the properties of a map. + * + * @param map The map to reduce + * @param callback An aggregation function that is called for each entry in the map + * @param initial The initial value for the reduction. + */ + function reduceProperties(map, callback, initial) { + var result = initial; + if (map) { + for (var key in map) { + if (hasProperty(map, key)) { + result = callback(result, map[key], String(key)); + } + } + } + return result; + } + ts.reduceProperties = reduceProperties; + /** + * Tests whether a value is an array. + */ + function isArray(value) { + return Array.isArray ? Array.isArray(value) : value instanceof Array; + } + ts.isArray = isArray; function memoize(callback) { var value; return function () { @@ -1502,7 +1557,7 @@ var ts; } ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; function getBaseFileName(path) { - if (!path) { + if (path === undefined) { return undefined; } var i = path.lastIndexOf(ts.directorySeparator); @@ -1530,14 +1585,19 @@ var ts; /** * List of supported extensions in order of file resolution precedence. */ - ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); - function isSupportedSourceFileName(fileName) { + ts.supportedTypeScriptExtensions = [".ts", ".tsx", ".d.ts"]; + ts.supportedJavascriptExtensions = [".js", ".jsx"]; + var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); + function getSupportedExtensions(options) { + return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + ts.getSupportedExtensions = getSupportedExtensions; + function isSupportedSourceFileName(fileName, compilerOptions) { if (!fileName) { return false; } - for (var _i = 0, supportedExtensions_1 = ts.supportedExtensions; _i < supportedExtensions_1.length; _i++) { - var extension = supportedExtensions_1[_i]; + for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; } @@ -1556,22 +1616,6 @@ var ts; return path; } ts.removeFileExtension = removeFileExtension; - var backslashOrDoubleQuote = /[\"\\]/g; - var escapedCharsRegExp = /[\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" // nextLine - }; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1622,7 +1666,7 @@ var ts; } Debug.assert = assert; function fail(message) { - Debug.assert(false, message); + Debug.assert(/*expression*/ false, message); } Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); @@ -1783,7 +1827,6 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _tty = require("tty"); // average async stat takes about 30 microseconds // set chunk size to do 30 files in < 1 millisecond function createWatchedFileSet(interval, chunkSize) { @@ -1858,7 +1901,7 @@ var ts; // REVIEW: for now this implementation uses polling. // The advantage of polling is that it works reliably // on all os and with network mounted files. - // For 90 referenced files, the average time to detect + // For 90 referenced files, the average time to detect // changes is 2*msInterval (by default 5 seconds). // The overhead of this is .04 percent (1/2500) with // average pause of < 1 millisecond (and max @@ -1869,9 +1912,6 @@ var ts; // to increase the chunk size or decrease the interval // time dynamically to match the large reference set? var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } var platform = _os.platform(); // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; @@ -1965,17 +2005,13 @@ var ts; // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - if (isNode4OrLater()) { - // Note: in node the callback of fs.watch is given only the relative file name as a parameter - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { - // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { // In watchDirectory we only care about adding and removing files (when event name is @@ -2020,6 +2056,33 @@ var ts; } }; } + function getChakraSystem() { + return { + newLine: ChakraHost.newLine || "\r\n", + args: ChakraHost.args, + useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames, + write: ChakraHost.echo, + readFile: function (path, encoding) { + // encoding is automatically handled by the implementation in ChakraHost + return ChakraHost.readFile(path); + }, + writeFile: function (path, data, writeByteOrderMark) { + // If a BOM is required, emit one + if (writeByteOrderMark) { + data = "\uFEFF" + data; + } + ChakraHost.writeFile(path, data); + }, + resolvePath: ChakraHost.resolvePath, + fileExists: ChakraHost.fileExists, + directoryExists: ChakraHost.directoryExists, + createDirectory: ChakraHost.createDirectory, + getExecutingFilePath: function () { return ChakraHost.executingFile; }, + getCurrentDirectory: function () { return ChakraHost.currentDirectory; }, + readDirectory: ChakraHost.readDirectory, + exit: ChakraHost.quit + }; + } if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } @@ -2028,6 +2091,9 @@ var ts; // process.browser check excludes webpack and browserify return getNodeSystem(); } + else if (typeof ChakraHost !== "undefined") { + return getChakraSystem(); + } else { return undefined; // Unsupported host } @@ -2148,7 +2214,7 @@ var ts; Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers_not_permitted_on_index_signature_members_1145", message: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, - Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_1148", message: "Cannot compile modules unless the '--module' flag is provided." }, + Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_optio_1148", message: "Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, @@ -2235,6 +2301,10 @@ var ts; _0_modifier_cannot_be_used_with_1_modifier: { code: 1243, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_be_used_with_1_modifier_1243", message: "'{0}' modifier cannot be used with '{1}' modifier." }, Abstract_methods_can_only_appear_within_an_abstract_class: { code: 1244, category: ts.DiagnosticCategory.Error, key: "Abstract_methods_can_only_appear_within_an_abstract_class_1244", message: "Abstract methods can only appear within an abstract class." }, Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { code: 1245, category: ts.DiagnosticCategory.Error, key: "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", message: "Method '{0}' cannot have an implementation because it is marked abstract." }, + An_interface_property_cannot_have_an_initializer: { code: 1246, category: ts.DiagnosticCategory.Error, key: "An_interface_property_cannot_have_an_initializer_1246", message: "An interface property cannot have an initializer." }, + A_type_literal_property_cannot_have_an_initializer: { code: 1247, category: ts.DiagnosticCategory.Error, key: "A_type_literal_property_cannot_have_an_initializer_1247", message: "A type literal property cannot have an initializer." }, + A_class_member_cannot_have_the_0_keyword: { code: 1248, category: ts.DiagnosticCategory.Error, key: "A_class_member_cannot_have_the_0_keyword_1248", message: "A class member cannot have the '{0}' keyword." }, + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: { code: 1249, category: ts.DiagnosticCategory.Error, key: "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", message: "A decorator can only decorate a method implementation, not an overload." }, with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_an_async_function_block_1300", message: "'with' statements are not allowed in an async function block." }, await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: ts.DiagnosticCategory.Error, key: "await_expression_is_only_allowed_within_an_async_function_1308", message: "'await' expression is only allowed within an async function." }, Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: ts.DiagnosticCategory.Error, key: "Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher_1311", message: "Async functions are only available when targeting ECMAScript 6 and higher." }, @@ -2248,11 +2318,12 @@ var ts; Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module_0_has_no_exported_member_1_2305", message: "Module '{0}' has no exported member '{1}'." }, File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File_0_is_not_a_module_2306", message: "File '{0}' is not a module." }, Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot_find_module_0_2307", message: "Cannot find module '{0}'." }, + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: { code: 2308, category: ts.DiagnosticCategory.Error, key: "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", message: "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", message: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type_0_recursively_references_itself_as_a_base_type_2310", message: "Type '{0}' recursively references itself as a base type." }, A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A_class_may_only_extend_another_class_2311", message: "A class may only extend another class." }, An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An_interface_may_only_extend_a_class_or_another_interface_2312", message: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list_2313", message: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Type_parameter_0_has_a_circular_constraint: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_has_a_circular_constraint_2313", message: "Type parameter '{0}' has a circular constraint." }, Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_1_type_argument_s_2314", message: "Generic type '{0}' requires {1} type argument(s)." }, Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_generic_2315", message: "Type '{0}' is not generic." }, Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global_type_0_must_be_a_class_or_interface_type_2316", message: "Global type '{0}' must be a class or interface type." }, @@ -2262,6 +2333,7 @@ var ts; Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", message: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive_stack_depth_comparing_types_0_and_1_2321", message: "Excessive stack depth comparing types '{0}' and '{1}'." }, Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_2322", message: "Type '{0}' is not assignable to type '{1}'." }, + Cannot_redeclare_exported_variable_0: { code: 2323, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_exported_variable_0_2323", message: "Cannot redeclare exported variable '{0}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property_0_is_missing_in_type_1_2324", message: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_in_type_1_but_not_in_type_2_2325", message: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types_of_property_0_are_incompatible_2326", message: "Types of property '{0}' are incompatible." }, @@ -2332,6 +2404,7 @@ var ts; Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload_signature_is_not_compatible_with_function_implementation_2394", message: "Overload signature is not compatible with function implementation." }, Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", message: "Individual declarations in merged declaration '{0}' must be all exported or all local." }, Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", message: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Declaration_name_conflicts_with_built_in_global_identifier_0: { code: 2397, category: ts.DiagnosticCategory.Error, key: "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", message: "Declaration name conflicts with built-in global identifier '{0}'." }, Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", message: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", message: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401", message: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, @@ -2445,6 +2518,8 @@ var ts; Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", message: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." }, All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -2454,7 +2529,7 @@ var ts; A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: { code: 2526, category: ts.DiagnosticCategory.Error, key: "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", message: "A 'this' type is available only in a non-static member of a class or interface." }, The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: { code: 2527, category: ts.DiagnosticCategory.Error, key: "The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary_2527", message: "The inferred type of '{0}' references an inaccessible 'this' type. A type annotation is necessary." }, A_module_cannot_have_multiple_default_exports: { code: 2528, category: ts.DiagnosticCategory.Error, key: "A_module_cannot_have_multiple_default_exports_2528", message: "A module cannot have multiple default exports." }, - JSX_element_attributes_type_0_must_be_an_object_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_must_be_an_object_type_2600", message: "JSX element attributes type '{0}' must be an object type." }, + JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, @@ -2470,6 +2545,9 @@ var ts; Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "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: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2554,6 +2632,11 @@ var ts; Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_without_specifying_option_1_5052", message: "Option '{0}' cannot be specified without specifying option '{1}'." }, Option_0_cannot_be_specified_with_option_1: { code: 5053, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_with_option_1_5053", message: "Option '{0}' cannot be specified with option '{1}'." }, A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, + Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalide value for '--reactNamespace'. '{0}' is not a valid identifier." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003", message: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -2564,6 +2647,7 @@ var ts; Do_not_emit_outputs_if_any_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_if_any_errors_were_reported_6008", message: "Do not emit outputs if any errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)" }, Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, @@ -2619,6 +2703,8 @@ var ts; Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, + Allow_javascript_files_to_be_compiled: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6083", message: "Allow javascript files to be compiled." }, + Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -2666,7 +2752,8 @@ var ts; Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." } + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." } }; })(ts || (ts = {})); /// @@ -2906,7 +2993,8 @@ var ts; var pos = 0; var lineStart = 0; while (pos < text.length) { - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 13 /* carriageReturn */: if (text.charCodeAt(pos) === 10 /* lineFeed */) { @@ -3040,6 +3128,11 @@ var ts; ts.couldStartTrivia = couldStartTrivia; /* @internal */ function skipTrivia(text, pos, stopAfterLineBreak) { + // Using ! with a greater than test is a fast way of testing the following conditions: + // pos === undefined || pos === null || isNaN(pos) || pos < 0; + if (!(pos >= 0)) { + return pos; + } // Keep in sync with couldStartTrivia while (true) { var ch = text.charCodeAt(pos); @@ -3276,6 +3369,19 @@ var ts; ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; + /* @internal */ + function isIdentifier(name, languageVersion) { + if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { + return false; + } + for (var i = 1, n = name.length; i < n; i++) { + if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { + return false; + } + } + return true; + } + ts.isIdentifier = isIdentifier; // Creates a scanner over a (possibly unspecified) range of a piece of text. function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) { if (languageVariant === void 0) { languageVariant = 0 /* Standard */; } @@ -3398,7 +3504,8 @@ var ts; return value; } function scanString() { - var quote = text.charCodeAt(pos++); + var quote = text.charCodeAt(pos); + pos++; var result = ""; var start = pos; while (true) { @@ -3494,7 +3601,8 @@ var ts; error(ts.Diagnostics.Unexpected_end_of_text); return ""; } - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 48 /* _0 */: return "\0"; @@ -3721,7 +3829,8 @@ var ts; } return pos += 2, token = 31 /* ExclamationEqualsToken */; } - return pos++, token = 49 /* ExclamationToken */; + pos++; + return token = 49 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); @@ -3732,7 +3841,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 62 /* PercentEqualsToken */; } - return pos++, token = 40 /* PercentToken */; + pos++; + return token = 40 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { return pos += 2, token = 51 /* AmpersandAmpersandToken */; @@ -3740,11 +3850,14 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 66 /* AmpersandEqualsToken */; } - return pos++, token = 46 /* AmpersandToken */; + pos++; + return token = 46 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 17 /* OpenParenToken */; + pos++; + return token = 17 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 18 /* CloseParenToken */; + pos++; + return token = 18 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 59 /* AsteriskEqualsToken */; @@ -3755,7 +3868,8 @@ var ts; } return pos += 2, token = 38 /* AsteriskAsteriskToken */; } - return pos++, token = 37 /* AsteriskToken */; + pos++; + return token = 37 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { return pos += 2, token = 41 /* PlusPlusToken */; @@ -3763,9 +3877,11 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 57 /* PlusEqualsToken */; } - return pos++, token = 35 /* PlusToken */; + pos++; + return token = 35 /* PlusToken */; case 44 /* comma */: - return pos++, token = 24 /* CommaToken */; + pos++; + return token = 24 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { return pos += 2, token = 42 /* MinusMinusToken */; @@ -3773,7 +3889,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 58 /* MinusEqualsToken */; } - return pos++, token = 36 /* MinusToken */; + pos++; + return token = 36 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); @@ -3782,7 +3899,8 @@ var ts; if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { return pos += 3, token = 22 /* DotDotDotToken */; } - return pos++, token = 21 /* DotToken */; + pos++; + return token = 21 /* DotToken */; case 47 /* slash */: // Single-line comment if (text.charCodeAt(pos + 1) === 47 /* slash */) { @@ -3830,7 +3948,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 61 /* SlashEqualsToken */; } - return pos++, token = 39 /* SlashToken */; + pos++; + return token = 39 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -3882,9 +4001,11 @@ var ts; tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 54 /* ColonToken */; + pos++; + return token = 54 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 23 /* SemicolonToken */; + pos++; + return token = 23 /* SemicolonToken */; case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3909,7 +4030,8 @@ var ts; text.charCodeAt(pos + 2) !== 42 /* asterisk */) { return pos += 2, token = 26 /* LessThanSlashToken */; } - return pos++, token = 25 /* LessThanToken */; + pos++; + return token = 25 /* LessThanToken */; case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3929,7 +4051,8 @@ var ts; if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { return pos += 2, token = 34 /* EqualsGreaterThanToken */; } - return pos++, token = 56 /* EqualsToken */; + pos++; + return token = 56 /* EqualsToken */; case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3940,20 +4063,26 @@ var ts; return token = 7 /* ConflictMarkerTrivia */; } } - return pos++, token = 27 /* GreaterThanToken */; + pos++; + return token = 27 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 53 /* QuestionToken */; + pos++; + return token = 53 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 19 /* OpenBracketToken */; + pos++; + return token = 19 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 20 /* CloseBracketToken */; + pos++; + return token = 20 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 68 /* CaretEqualsToken */; } - return pos++, token = 48 /* CaretToken */; + pos++; + return token = 48 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 15 /* OpenBraceToken */; + pos++; + return token = 15 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { return pos += 2, token = 52 /* BarBarToken */; @@ -3961,13 +4090,17 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 67 /* BarEqualsToken */; } - return pos++, token = 47 /* BarToken */; + pos++; + return token = 47 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 16 /* CloseBraceToken */; + pos++; + return token = 16 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 50 /* TildeToken */; + pos++; + return token = 50 /* TildeToken */; case 64 /* at */: - return pos++, token = 55 /* AtToken */; + pos++; + return token = 55 /* AtToken */; case 92 /* backslash */: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -3976,7 +4109,8 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; + pos++; + return token = 0 /* Unknown */; default: if (isIdentifierStart(ch, languageVersion)) { pos++; @@ -3998,7 +4132,8 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; + pos++; + return token = 0 /* Unknown */; } } } @@ -4014,10 +4149,12 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 64 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 44 /* GreaterThanGreaterThanToken */; + pos++; + return token = 44 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 29 /* GreaterThanEqualsToken */; + pos++; + return token = 29 /* GreaterThanEqualsToken */; } } return token; @@ -4109,7 +4246,7 @@ var ts; break; } } - return token = 236 /* JsxText */; + return token = 238 /* JsxText */; } // Scans a JSX identifier; these differ from normal identifiers in that // they allow dashes @@ -4150,10 +4287,10 @@ var ts; return result; } function lookAhead(callback) { - return speculationHelper(callback, /*isLookahead:*/ true); + return speculationHelper(callback, /*isLookahead*/ true); } function tryScan(callback) { - return speculationHelper(callback, /*isLookahead:*/ false); + return speculationHelper(callback, /*isLookahead*/ false); } function setText(newText, start, length) { text = newText || ""; @@ -4244,7 +4381,7 @@ var ts; if (array1.length !== array2.length) { return false; } - for (var i = 0; i < array1.length; ++i) { + for (var i = 0; i < array1.length; i++) { var equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i]; if (!equals) { return false; @@ -4292,7 +4429,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 248 /* SourceFile */) { + while (node && node.kind !== 250 /* SourceFile */) { node = node.parent; } return node; @@ -4404,15 +4541,15 @@ var ts; return current; } switch (current.kind) { - case 248 /* SourceFile */: - case 220 /* CaseBlock */: - case 244 /* CatchClause */: - case 218 /* ModuleDeclaration */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 250 /* SourceFile */: + case 222 /* CaseBlock */: + case 246 /* CatchClause */: + case 220 /* ModuleDeclaration */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return current; - case 192 /* Block */: + case 194 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4425,9 +4562,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 211 /* VariableDeclaration */ && + declaration.kind === 213 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 244 /* CatchClause */; + declaration.parent.kind === 246 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4466,7 +4603,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4475,16 +4612,17 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 143 /* MethodDeclaration */: errorNode = node.name; break; } @@ -4512,11 +4650,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 217 /* EnumDeclaration */ && isConst(node); + return node.kind === 219 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 163 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 165 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4531,14 +4669,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 211 /* VariableDeclaration */) { + if (node.kind === 213 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 212 /* VariableDeclarationList */) { + if (node && node.kind === 214 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 193 /* VariableStatement */) { + if (node && node.kind === 195 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4553,7 +4691,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 195 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; + return node.kind === 197 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -4584,7 +4722,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (151 /* FirstTypeNode */ <= node.kind && node.kind <= 160 /* LastTypeNode */) { + if (150 /* FirstTypeNode */ <= node.kind && node.kind <= 162 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -4595,11 +4733,8 @@ var ts; case 131 /* SymbolKeyword */: return true; case 103 /* VoidKeyword */: - return node.parent.kind !== 177 /* VoidExpression */; - case 9 /* StringLiteral */: - // Specialized signatures can have string literals as their parameters' type names - return node.parent.kind === 138 /* Parameter */; - case 188 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 179 /* VoidExpression */; + case 190 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container @@ -4608,13 +4743,13 @@ var ts; if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 166 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); case 135 /* QualifiedName */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 97 /* ThisKeyword */: var parent_1 = node.parent; if (parent_1.kind === 154 /* TypeQuery */) { @@ -4626,22 +4761,22 @@ var ts; // // Calling isTypeNode would consider the qualified name A.B a type node. Only C or // A.B.C is a type node. - if (151 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 160 /* LastTypeNode */) { + if (150 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 162 /* LastTypeNode */) { return true; } switch (parent_1.kind) { - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); case 137 /* TypeParameter */: return node === parent_1.constraint; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 138 /* Parameter */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return node === parent_1.type; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 144 /* Constructor */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: @@ -4652,12 +4787,12 @@ var ts; case 148 /* ConstructSignature */: case 149 /* IndexSignature */: return node === parent_1.type; - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return node === parent_1.type; - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -4671,23 +4806,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return visitor(node); - case 220 /* CaseBlock */: - case 192 /* Block */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: + case 222 /* CaseBlock */: + case 194 /* Block */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: + case 209 /* LabeledStatement */: + case 211 /* TryStatement */: + case 246 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4697,18 +4832,18 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // 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. @@ -4735,14 +4870,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 163 /* BindingElement */: - case 247 /* EnumMember */: + case 165 /* BindingElement */: + case 249 /* EnumMember */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 246 /* ShorthandPropertyAssignment */: - case 211 /* VariableDeclaration */: + case 248 /* ShorthandPropertyAssignment */: + case 213 /* VariableDeclaration */: return true; } } @@ -4754,7 +4889,7 @@ var ts; } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 214 /* ClassDeclaration */ || node.kind === 186 /* ClassExpression */); + return node && (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4764,9 +4899,9 @@ var ts; function isFunctionLikeKind(kind) { switch (kind) { case 144 /* Constructor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: @@ -4787,8 +4922,8 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: return true; } return false; @@ -4796,26 +4931,30 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: return true; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 192 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 194 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 165 /* ObjectLiteralExpression */; + return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 167 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1 /* Identifier */; + } + ts.isIdentifierTypePredicate = isIdentifierTypePredicate; function getContainingFunction(node) { while (true) { node = node.parent; @@ -4869,14 +5008,14 @@ var ts; node = node.parent; } break; - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 218 /* ModuleDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 220 /* ModuleDeclaration */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 143 /* MethodDeclaration */: @@ -4887,34 +5026,45 @@ var ts; case 147 /* CallSignature */: case 148 /* ConstructSignature */: case 149 /* IndexSignature */: - case 217 /* EnumDeclaration */: - case 248 /* SourceFile */: + case 219 /* EnumDeclaration */: + case 250 /* SourceFile */: return node; } } } ts.getThisContainer = getThisContainer; - function getSuperContainer(node, includeFunctions) { + /** + * Given an super call\property node returns a closest node where either + * - super call\property is legal in the node and not legal in the parent node the node. + * i.e. super call is legal in constructor but not legal in the class body. + * - node is arrow function (so caller might need to call getSuperContainer in case if he needs to climb higher) + * - super call\property is definitely illegal in the node (but might be legal in some subnode) + * i.e. super property access is illegal in function declaration but can be legal in the statement list + */ + function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; - if (!node) + if (!node) { return node; + } switch (node.kind) { case 136 /* ComputedPropertyName */: - // If the grandparent node is an object literal (as opposed to a class), - // then the computed property is not a 'super' container. - // A computed property name in a class needs to be a super container - // so that we can error on it. - if (isClassLike(node.parent.parent)) { - return node; - } - // If this is a computed property, then the parent should not - // make it a super container. The parent might be a property - // in an object literal, like a method or accessor. But in order for - // such a parent to be a super container, the reference must be in - // the *body* of the container. node = node.parent; break; + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + if (!stopOnFunctions) { + continue; + } + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + return node; case 139 /* Decorator */: // Decorators are always applied outside of the body of a class or method. if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { @@ -4928,20 +5078,6 @@ var ts; node = node.parent; } break; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - if (!includeFunctions) { - continue; - } - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - return node; } } } @@ -4951,7 +5087,7 @@ var ts; switch (node.kind) { case 151 /* TypeReference */: return node.typeName; - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return node.expression; case 69 /* Identifier */: case 135 /* QualifiedName */: @@ -4962,7 +5098,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression, NewExpression, or Decorator. @@ -4971,27 +5107,27 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: // classes are valid targets return true; case 141 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 214 /* ClassDeclaration */; + return node.parent.kind === 216 /* ClassDeclaration */; case 138 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return node.parent.body && node.parent.parent.kind === 214 /* ClassDeclaration */; + return node.parent.body && node.parent.parent.kind === 216 /* ClassDeclaration */; case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 143 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. - return node.body && node.parent.kind === 214 /* ClassDeclaration */; + return node.body && node.parent.kind === 216 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: if (node.decorators) { return true; } @@ -5017,27 +5153,12 @@ var ts; return false; } ts.nodeIsDecorated = nodeIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 214 /* ClassDeclaration */: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: - return ts.forEach(node.parameters, nodeIsDecorated); - } - return false; - } - ts.childIsDecorated = childIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 166 /* PropertyAccessExpression */; + return node.kind === 168 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 167 /* ElementAccessExpression */; + return node.kind === 169 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -5047,34 +5168,34 @@ var ts; case 99 /* TrueKeyword */: case 84 /* FalseKeyword */: case 10 /* RegularExpressionLiteral */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 170 /* TaggedTemplateExpression */: - case 189 /* AsExpression */: - case 171 /* TypeAssertionExpression */: - case 172 /* ParenthesizedExpression */: - case 173 /* FunctionExpression */: - case 186 /* ClassExpression */: - case 174 /* ArrowFunction */: - case 177 /* VoidExpression */: - case 175 /* DeleteExpression */: - case 176 /* TypeOfExpression */: - case 179 /* PrefixUnaryExpression */: - case 180 /* PostfixUnaryExpression */: - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 183 /* TemplateExpression */: + case 166 /* ArrayLiteralExpression */: + case 167 /* ObjectLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 172 /* TaggedTemplateExpression */: + case 191 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 174 /* ParenthesizedExpression */: + case 175 /* FunctionExpression */: + case 188 /* ClassExpression */: + case 176 /* ArrowFunction */: + case 179 /* VoidExpression */: + case 177 /* DeleteExpression */: + case 178 /* TypeOfExpression */: + case 181 /* PrefixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: + case 183 /* BinaryExpression */: + case 184 /* ConditionalExpression */: + case 187 /* SpreadElementExpression */: + case 185 /* TemplateExpression */: case 11 /* NoSubstitutionTemplateLiteral */: - case 187 /* OmittedExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 184 /* YieldExpression */: - case 178 /* AwaitExpression */: + case 189 /* OmittedExpression */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 186 /* YieldExpression */: + case 180 /* AwaitExpression */: return true; case 135 /* QualifiedName */: while (node.parent.kind === 135 /* QualifiedName */) { @@ -5091,47 +5212,47 @@ var ts; case 97 /* ThisKeyword */: var parent_2 = node.parent; switch (parent_2.kind) { - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 247 /* EnumMember */: - case 245 /* PropertyAssignment */: - case 163 /* BindingElement */: + case 249 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 165 /* BindingElement */: return parent_2.initializer === node; - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 204 /* ReturnStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 208 /* ThrowStatement */: - case 206 /* SwitchStatement */: + case 197 /* ExpressionStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 206 /* ReturnStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 210 /* ThrowStatement */: + case 208 /* SwitchStatement */: return parent_2.expression === node; - case 199 /* ForStatement */: + case 201 /* ForStatement */: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 212 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 214 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 212 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214 /* VariableDeclarationList */) || forInStatement.expression === node; - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return node === parent_2.expression; - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return node === parent_2.expression; case 136 /* ComputedPropertyName */: return node === parent_2.expression; case 139 /* Decorator */: - case 240 /* JsxExpression */: - case 239 /* JsxSpreadAttribute */: + case 242 /* JsxExpression */: + case 241 /* JsxSpreadAttribute */: return true; - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -5155,7 +5276,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 232 /* ExternalModuleReference */; + return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5164,7 +5285,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 232 /* ExternalModuleReference */; + return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 234 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5182,53 +5303,59 @@ var ts; */ function isRequireCall(expression) { // of the form 'require("name")' - return expression.kind === 168 /* CallExpression */ && + return expression.kind === 170 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expression.arguments.length === 1 && expression.arguments[0].kind === 9 /* StringLiteral */; } ts.isRequireCall = isRequireCall; - /** - * Returns true if the node is an assignment to a property on the identifier 'exports'. - * This function does not test if the node is in a JavaScript file or not. - */ - function isExportsPropertyAssignment(expression) { - // of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary - return isInJavaScriptFile(expression) && - (expression.kind === 181 /* BinaryExpression */) && - (expression.operatorToken.kind === 56 /* EqualsToken */) && - (expression.left.kind === 166 /* PropertyAccessExpression */) && - (expression.left.expression.kind === 69 /* Identifier */) && - ((expression.left.expression).text === "exports"); + /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property + /// assignments we treat as special in the binder + function getSpecialPropertyAssignmentKind(expression) { + if (expression.kind !== 183 /* BinaryExpression */) { + return 0 /* None */; + } + var expr = expression; + if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 168 /* PropertyAccessExpression */) { + return 0 /* None */; + } + var lhs = expr.left; + if (lhs.expression.kind === 69 /* Identifier */) { + var lhsId = lhs.expression; + if (lhsId.text === "exports") { + // exports.name = expr + return 1 /* ExportsProperty */; + } + else if (lhsId.text === "module" && lhs.name.text === "exports") { + // module.exports = expr + return 2 /* ModuleExports */; + } + } + else if (lhs.expression.kind === 97 /* ThisKeyword */) { + return 4 /* ThisProperty */; + } + else if (lhs.expression.kind === 168 /* PropertyAccessExpression */) { + // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part + var innerPropertyAccess = lhs.expression; + if (innerPropertyAccess.expression.kind === 69 /* Identifier */ && innerPropertyAccess.name.text === "prototype") { + return 3 /* PrototypeProperty */; + } + } + return 0 /* None */; } - ts.isExportsPropertyAssignment = isExportsPropertyAssignment; - /** - * Returns true if the node is an assignment to the property access expression 'module.exports'. - * This function does not test if the node is in a JavaScript file or not. - */ - function isModuleExportsAssignment(expression) { - // of the form 'module.exports = expr' where 'expr' is arbitrary - return isInJavaScriptFile(expression) && - (expression.kind === 181 /* BinaryExpression */) && - (expression.operatorToken.kind === 56 /* EqualsToken */) && - (expression.left.kind === 166 /* PropertyAccessExpression */) && - (expression.left.expression.kind === 69 /* Identifier */) && - ((expression.left.expression).text === "module") && - (expression.left.name.text === "exports"); - } - ts.isModuleExportsAssignment = isModuleExportsAssignment; + ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 222 /* ImportDeclaration */) { + if (node.kind === 224 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 232 /* ExternalModuleReference */) { + if (reference.kind === 234 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 228 /* ExportDeclaration */) { + if (node.kind === 230 /* ExportDeclaration */) { return node.moduleSpecifier; } } @@ -5239,8 +5366,8 @@ var ts; case 138 /* Parameter */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 246 /* ShorthandPropertyAssignment */: - case 245 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return node.questionToken !== undefined; @@ -5250,9 +5377,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 261 /* JSDocFunctionType */ && + return node.kind === 263 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 263 /* JSDocConstructorType */; + node.parameters[0].type.kind === 265 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -5266,15 +5393,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 269 /* JSDocTypeTag */); + return getJSDocTag(node, 271 /* JSDocTypeTag */); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 268 /* JSDocReturnTag */); + return getJSDocTag(node, 270 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 270 /* JSDocTemplateTag */); + return getJSDocTag(node, 272 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -5285,7 +5412,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 267 /* JSDocParameterTag */) { + if (t.kind === 269 /* JSDocParameterTag */) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -5304,12 +5431,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32 /* JavaScriptFile */) { - if (node.type && node.type.kind === 262 /* JSDocVariadicType */) { + if (node.type && node.type.kind === 264 /* JSDocVariadicType */) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 262 /* JSDocVariadicType */; + return paramTag.typeExpression.type.kind === 264 /* JSDocVariadicType */; } } return node.dotDotDotToken !== undefined; @@ -5330,7 +5457,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 162 /* ArrayBindingPattern */ || node.kind === 161 /* ObjectBindingPattern */); + return !!node && (node.kind === 164 /* ArrayBindingPattern */ || node.kind === 163 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -5354,34 +5481,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 174 /* ArrowFunction */: - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 176 /* ArrowFunction */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: case 144 /* Constructor */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 230 /* ExportSpecifier */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 232 /* ExportSpecifier */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 145 /* GetAccessor */: - case 223 /* ImportClause */: - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 215 /* InterfaceDeclaration */: + case 225 /* ImportClause */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 217 /* InterfaceDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 218 /* ModuleDeclaration */: - case 224 /* NamespaceImport */: + case 220 /* ModuleDeclaration */: + case 226 /* NamespaceImport */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 146 /* SetAccessor */: - case 246 /* ShorthandPropertyAssignment */: - case 216 /* TypeAliasDeclaration */: + case 248 /* ShorthandPropertyAssignment */: + case 218 /* TypeAliasDeclaration */: case 137 /* TypeParameter */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return true; } return false; @@ -5389,25 +5516,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - case 210 /* DebuggerStatement */: - case 197 /* DoStatement */: - case 195 /* ExpressionStatement */: - case 194 /* EmptyStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 196 /* IfStatement */: - case 207 /* LabeledStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 193 /* VariableStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 227 /* ExportAssignment */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 212 /* DebuggerStatement */: + case 199 /* DoStatement */: + case 197 /* ExpressionStatement */: + case 196 /* EmptyStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 198 /* IfStatement */: + case 209 /* LabeledStatement */: + case 206 /* ReturnStatement */: + case 208 /* SwitchStatement */: + case 210 /* ThrowStatement */: + case 211 /* TryStatement */: + case 195 /* VariableStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 229 /* ExportAssignment */: return true; default: return false; @@ -5435,7 +5562,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 226 /* ImportSpecifier */ || parent.kind === 230 /* ExportSpecifier */) { + if (parent.kind === 228 /* ImportSpecifier */ || parent.kind === 232 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5456,9 +5583,9 @@ var ts; case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 247 /* EnumMember */: - case 245 /* PropertyAssignment */: - case 166 /* PropertyAccessExpression */: + case 249 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 168 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; case 135 /* QualifiedName */: @@ -5470,11 +5597,11 @@ var ts; return parent.kind === 154 /* TypeQuery */; } return false; - case 163 /* BindingElement */: - case 226 /* ImportSpecifier */: + case 165 /* BindingElement */: + case 228 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 230 /* ExportSpecifier */: + case 232 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -5490,12 +5617,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ || - node.kind === 223 /* ImportClause */ && !!node.name || - node.kind === 224 /* NamespaceImport */ || - node.kind === 226 /* ImportSpecifier */ || - node.kind === 230 /* ExportSpecifier */ || - node.kind === 227 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; + return node.kind === 223 /* ImportEqualsDeclaration */ || + node.kind === 225 /* ImportClause */ && !!node.name || + node.kind === 226 /* NamespaceImport */ || + node.kind === 228 /* ImportSpecifier */ || + node.kind === 232 /* ExportSpecifier */ || + node.kind === 229 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5643,7 +5770,7 @@ var ts; return node.kind === 69 /* Identifier */ && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isModifier(token) { + function isModifierKind(token) { switch (token) { case 115 /* AbstractKeyword */: case 118 /* AsyncKeyword */: @@ -5659,39 +5786,73 @@ var ts; } return false; } - ts.isModifier = isModifier; + ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); return root.kind === 138 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 163 /* BindingElement */) { + while (node.kind === 165 /* BindingElement */) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 218 /* ModuleDeclaration */ || n.kind === 248 /* SourceFile */; + return isFunctionLike(n) || n.kind === 220 /* ModuleDeclaration */ || n.kind === 250 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function cloneEntityName(node) { - if (node.kind === 69 /* Identifier */) { - var clone_1 = createSynthesizedNode(69 /* Identifier */); - clone_1.text = node.text; - return clone_1; + /** + * Creates a shallow, memberwise clone of a node. The "kind", "pos", "end", "flags", and "parent" + * properties are excluded by default, and can be provided via the "location", "flags", and + * "parent" parameters. + * @param node The node to clone. + * @param location An optional TextRange to use to supply the new position. + * @param flags The NodeFlags to use for the cloned node. + * @param parent The parent for the new node. + */ + function cloneNode(node, location, flags, parent) { + // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of + // the original node. We also need to exclude specific properties and only include own- + // properties (to skip members already defined on the shared prototype). + var clone = location !== undefined + ? ts.createNode(node.kind, location.pos, location.end) + : createSynthesizedNode(node.kind); + for (var key in node) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { + continue; + } + clone[key] = node[key]; } - else { - var clone_2 = createSynthesizedNode(135 /* QualifiedName */); - clone_2.left = cloneEntityName(node.left); - clone_2.left.parent = clone_2; - clone_2.right = cloneEntityName(node.right); - clone_2.right.parent = clone_2; - return clone_2; + if (flags !== undefined) { + clone.flags = flags; } + if (parent !== undefined) { + clone.parent = parent; + } + return clone; + } + ts.cloneNode = cloneNode; + /** + * Creates a deep clone of an EntityName, with new parent pointers. + * @param node The EntityName to clone. + * @param parent The parent for the cloned node. + */ + function cloneEntityName(node, parent) { + var clone = cloneNode(node, node, node.flags, parent); + if (isQualifiedName(clone)) { + var left = clone.left, right = clone.right; + clone.left = cloneEntityName(left, clone); + clone.right = cloneNode(right, right, right.flags, parent); + } + return clone; } ts.cloneEntityName = cloneEntityName; + function isQualifiedName(node) { + return node.kind === 135 /* QualifiedName */; + } + ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { return node.pos === -1; } @@ -5906,8 +6067,8 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, + increaseIndent: function () { indent++; }, + decreaseIndent: function () { indent--; }, getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, @@ -5921,8 +6082,10 @@ var ts; * Resolves a local path to a path which is absolute to the base of the emit */ function getExternalModuleNameFromPath(host, fileName) { - var dir = host.getCurrentDirectory(); - var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, /*isAbsolutePathAnUrl*/ false); + var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; + var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return ts.removeFileExtension(relativePath); } ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; @@ -5938,6 +6101,63 @@ var ts; return emitOutputFilePathWithoutExtension + extension; } ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getEmitScriptTarget(compilerOptions) { + return compilerOptions.target || 0 /* ES3 */; + } + ts.getEmitScriptTarget = getEmitScriptTarget; + function getEmitModuleKind(compilerOptions) { + return compilerOptions.module ? + compilerOptions.module : + getEmitScriptTarget(compilerOptions) === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + } + ts.getEmitModuleKind = getEmitModuleKind; + function forEachExpectedEmitFile(host, action, targetSourceFile) { + var options = host.getCompilerOptions(); + // Emit on each source file + if (options.outFile || options.out) { + onBundledEmit(host); + } + else { + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + if (!isDeclarationFile(sourceFile)) { + onSingleFileEmit(host, sourceFile); + } + } + } + function onSingleFileEmit(host, sourceFile) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, sourceFile.languageVariant === 1 /* JSX */ && options.jsx === 1 /* Preserve */ ? ".jsx" : ".js"); + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: !isSourceFileJavaScript(sourceFile) ? getDeclarationEmitFilePath(jsFilePath, options) : undefined + }; + action(emitFileNames, [sourceFile], /*isBundledEmit*/ false); + } + function onBundledEmit(host) { + // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified + var bundledSources = ts.filter(host.getSourceFiles(), function (sourceFile) { return !isDeclarationFile(sourceFile) && + (!isExternalModule(sourceFile) || + (getEmitModuleKind(options) && isExternalModule(sourceFile))); }); // module that can emit - note falsy value from getEmitModuleKind means the module kind that shouldn't be emitted + if (bundledSources.length) { + var jsFilePath = options.outFile || options.out; + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: getDeclarationEmitFilePath(jsFilePath, options) + }; + action(emitFileNames, bundledSources, /*isBundledEmit*/ true); + } + } + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + function getDeclarationEmitFilePath(jsFilePath, options) { + return options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; + } + } + ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); @@ -5946,7 +6166,7 @@ var ts; ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }); } ts.writeFile = writeFile; @@ -5970,18 +6190,6 @@ var ts; return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) { - // 1. in-browser single file compilation scenario - // 2. non .js file - return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; function getAllAccessorDeclarations(declarations, accessor) { var firstAccessor; var secondAccessor; @@ -6225,24 +6433,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 169 /* NewExpression */: - case 168 /* CallExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 170 /* TaggedTemplateExpression */: - case 164 /* ArrayLiteralExpression */: - case 172 /* ParenthesizedExpression */: - case 165 /* ObjectLiteralExpression */: - case 186 /* ClassExpression */: - case 173 /* FunctionExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 171 /* NewExpression */: + case 170 /* CallExpression */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 172 /* TaggedTemplateExpression */: + case 166 /* ArrayLiteralExpression */: + case 174 /* ParenthesizedExpression */: + case 167 /* ObjectLiteralExpression */: + case 188 /* ClassExpression */: + case 175 /* FunctionExpression */: case 69 /* Identifier */: case 10 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 11 /* NoSubstitutionTemplateLiteral */: - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: case 84 /* FalseKeyword */: case 93 /* NullKeyword */: case 97 /* ThisKeyword */: @@ -6259,7 +6467,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 188 /* ExpressionWithTypeArguments */ && + return node.kind === 190 /* ExpressionWithTypeArguments */ && node.parent.token === 83 /* ExtendsKeyword */ && isClassLike(node.parent.parent); } @@ -6283,15 +6491,15 @@ var ts; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { return (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node); + (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 165 /* ObjectLiteralExpression */) { + if (kind === 167 /* ObjectLiteralExpression */) { return expression.properties.length === 0; } - if (kind === 164 /* ArrayLiteralExpression */) { + if (kind === 166 /* ArrayLiteralExpression */) { return expression.elements.length === 0; } return false; @@ -6302,13 +6510,9 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; function hasJavaScriptFileExtension(fileName) { - return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); + return ts.forEach(ts.supportedJavascriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; - function allowsJsxExpressions(fileName) { - return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); - } - ts.allowsJsxExpressions = allowsJsxExpressions; /** * 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. @@ -6343,6 +6547,47 @@ var ts; } return output; } + /** + * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph + * as the fallback implementation does not check for circular references by default. + */ + ts.stringify = typeof JSON !== "undefined" && JSON.stringify + ? JSON.stringify + : stringifyFallback; + /** + * Serialize an object graph into a JSON string. + */ + function stringifyFallback(value) { + // JSON.stringify returns `undefined` here, instead of the string "undefined". + return value === undefined ? undefined : stringifyValue(value); + } + function stringifyValue(value) { + return typeof value === "string" ? "\"" + escapeString(value) + "\"" + : typeof value === "number" ? isFinite(value) ? String(value) : "null" + : typeof value === "boolean" ? value ? "true" : "false" + : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) + : "null"; + } + function cycleCheck(cb, value) { + ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); + value.__cycle = true; + var result = cb(value); + delete value.__cycle; + return result; + } + function stringifyArray(value) { + return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; + } + function stringifyElement(memo, value) { + return (memo ? memo + "," : memo) + stringifyValue(value); + } + function stringifyObject(value) { + return "{" + ts.reduceProperties(value, stringifyProperty, "") + "}"; + } + function stringifyProperty(memo, value, key) { + return value === undefined || typeof value === "function" || key === "__cycle" ? memo + : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); + } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** * Converts a string to a base-64 encoded ASCII string. @@ -6611,13 +6856,17 @@ var ts; function getTypeParameterOwner(d) { if (d && d.kind === 137 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 215 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217 /* InterfaceDeclaration */) { return current; } } } } ts.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node) { + return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 144 /* Constructor */ && ts.isClassLike(node.parent.parent); + } + ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); /// /// @@ -6627,7 +6876,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 248 /* SourceFile */) { + if (kind === 250 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -6677,7 +6926,7 @@ var ts; return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 246 /* ShorthandPropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -6687,9 +6936,9 @@ var ts; case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 247 /* PropertyAssignment */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -6713,9 +6962,9 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -6745,271 +6994,271 @@ var ts; return visitNodes(cbNodes, node.types); case 160 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 189 /* AsExpression */: + case 191 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 212 /* VariableDeclarationList */: + case 214 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return visitNode(cbNode, node.label); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 241 /* CaseClause */: + case 243 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 242 /* DefaultClause */: + case 244 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 139 /* Decorator */: return visitNode(cbNode, node.expression); - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 224 /* NamespaceImport */: + case 226 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 225 /* NamedImports */: - case 229 /* NamedExports */: + case 227 /* NamedImports */: + case 231 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 136 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 243 /* HeritageClause */: + case 245 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 232 /* ExternalModuleReference */: + case 234 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 231 /* MissingDeclaration */: + case 233 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 233 /* JsxElement */: + case 235 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 234 /* JsxSelfClosingElement */: - case 235 /* JsxOpeningElement */: + case 236 /* JsxSelfClosingElement */: + case 237 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 238 /* JsxAttribute */: + case 240 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 239 /* JsxSpreadAttribute */: + case 241 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return visitNode(cbNode, node.expression); - case 237 /* JsxClosingElement */: + case 239 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 249 /* JSDocTypeExpression */: + case 251 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 253 /* JSDocUnionType */: + case 255 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 254 /* JSDocTupleType */: + case 256 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 252 /* JSDocArrayType */: + case 254 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 256 /* JSDocNonNullableType */: + case 258 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 255 /* JSDocNullableType */: + case 257 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 257 /* JSDocRecordType */: + case 259 /* JSDocRecordType */: return visitNodes(cbNodes, node.members); - case 259 /* JSDocTypeReference */: + case 261 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 260 /* JSDocOptionalType */: + case 262 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 261 /* JSDocFunctionType */: + case 263 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 262 /* JSDocVariadicType */: + case 264 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 263 /* JSDocConstructorType */: + case 265 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 264 /* JSDocThisType */: + case 266 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 258 /* JSDocRecordMember */: + case 260 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 265 /* JSDocComment */: + case 267 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 267 /* JSDocParameterTag */: + case 269 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 268 /* JSDocReturnTag */: + case 270 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 269 /* JSDocTypeTag */: + case 271 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 270 /* JSDocTemplateTag */: + case 272 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); } } @@ -7150,6 +7399,10 @@ var ts; return result; } Parser.parseSourceFile = parseSourceFile; + function getLanguageVariant(fileName) { + // .tsx and .jsx files are treated as jsx language variant. + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx") ? 1 /* JSX */ : 0 /* Standard */; + } function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { NodeConstructor = ts.objectAllocator.getNodeConstructor(); SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); @@ -7166,7 +7419,7 @@ var ts; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 /* JSX */ : 0 /* Standard */); + scanner.setLanguageVariant(getLanguageVariant(fileName)); } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. @@ -7213,8 +7466,8 @@ var ts; // Add additional cases as necessary depending on how we see JSDoc comments used // in the wild. switch (node.kind) { - case 193 /* VariableStatement */: - case 213 /* FunctionDeclaration */: + case 195 /* VariableStatement */: + case 215 /* FunctionDeclaration */: case 138 /* Parameter */: addJSDocComment(node); } @@ -7258,14 +7511,14 @@ var ts; function createSourceFile(fileName, languageVersion) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(248 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(250 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 /* DeclarationFile */ : 0; - sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; + sourceFile.languageVariant = getLanguageVariant(sourceFile.fileName); return sourceFile; } function setContextFlag(val, flag) { @@ -7298,10 +7551,10 @@ var ts; var contextFlagsToClear = context & contextFlags; if (contextFlagsToClear) { // clear the requested context flags - setContextFlag(false, contextFlagsToClear); + setContextFlag(/*val*/ false, contextFlagsToClear); var result = func(); // restore the context flags we just cleared - setContextFlag(true, contextFlagsToClear); + setContextFlag(/*val*/ true, contextFlagsToClear); return result; } // no need to do anything special as we are not in any of the requested contexts @@ -7317,10 +7570,10 @@ var ts; var contextFlagsToSet = context & ~contextFlags; if (contextFlagsToSet) { // set the requested context flags - setContextFlag(true, contextFlagsToSet); + setContextFlag(/*val*/ true, contextFlagsToSet); var result = func(); // reset the context flags we just set - setContextFlag(false, contextFlagsToSet); + setContextFlag(/*val*/ false, contextFlagsToSet); return result; } // no need to do anything special as we are already in all of the requested contexts @@ -7335,9 +7588,6 @@ var ts; function doInYieldContext(func) { return doInsideOfContext(2 /* Yield */, func); } - function doOutsideOfYieldContext(func) { - return doOutsideOfContext(2 /* Yield */, func); - } function doInDecoratorContext(func) { return doInsideOfContext(4 /* Decorator */, func); } @@ -7350,9 +7600,6 @@ var ts; function doInYieldAndAwaitContext(func) { return doInsideOfContext(2 /* Yield */ | 8 /* Await */, func); } - function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(2 /* Yield */ | 8 /* Await */, func); - } function inContext(flags) { return (contextFlags & flags) !== 0; } @@ -7396,9 +7643,6 @@ var ts; function nextToken() { return token = scanner.scan(); } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } function reScanGreaterToken() { return token = scanner.reScanGreaterToken(); } @@ -7605,10 +7849,10 @@ var ts; return parseIdentifierName(); } function parsePropertyName() { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ true); + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ true); } function parseSimplePropertyName() { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ false); + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ false); } function isSimplePropertyName() { return token === 9 /* StringLiteral */ || token === 8 /* NumericLiteral */ || ts.tokenIsIdentifierOrKeyword(token); @@ -7629,6 +7873,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(nextTokenCanFollowModifier); } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } function nextTokenCanFollowModifier() { if (token === 74 /* ConstKeyword */) { // 'const' is only a modifier if followed by 'enum'. @@ -7648,14 +7899,10 @@ var ts; nextToken(); return canFollowModifier(); } - nextToken(); - if (scanner.hasPrecedingLineBreak()) { - return false; - } - return canFollowModifier(); + return nextTokenIsOnSameLineAndCanFollowModifier(); } function parseAnyContextualModifier() { - return ts.isModifier(token) && tryParse(nextTokenCanFollowModifier); + return ts.isModifierKind(token) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier() { return token === 19 /* OpenBracketToken */ @@ -7861,7 +8108,7 @@ var ts; function isInSomeParsingContext() { for (var kind = 0; kind < 26 /* Count */; kind++) { if (parsingContext & (1 << kind)) { - if (isListElement(kind, /* inErrorRecovery */ true) || isListTerminator(kind)) { + if (isListElement(kind, /*inErrorRecovery*/ true) || isListTerminator(kind)) { return true; } } @@ -7875,7 +8122,7 @@ var ts; var result = []; result.pos = getNodePos(); while (!isListTerminator(kind)) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { var element = parseListElement(kind, parseElement); result.push(element); continue; @@ -8020,7 +8267,7 @@ var ts; case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 141 /* PropertyDeclaration */: - case 191 /* SemicolonClassElement */: + case 193 /* SemicolonClassElement */: return true; case 143 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal @@ -8037,8 +8284,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: return true; } } @@ -8047,42 +8294,42 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: - case 193 /* VariableStatement */: - case 192 /* Block */: - case 196 /* IfStatement */: - case 195 /* ExpressionStatement */: - case 208 /* ThrowStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 194 /* EmptyStatement */: - case 209 /* TryStatement */: - case 207 /* LabeledStatement */: - case 197 /* DoStatement */: - case 210 /* DebuggerStatement */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - case 227 /* ExportAssignment */: - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 195 /* VariableStatement */: + case 194 /* Block */: + case 198 /* IfStatement */: + case 197 /* ExpressionStatement */: + case 210 /* ThrowStatement */: + case 206 /* ReturnStatement */: + case 208 /* SwitchStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 196 /* EmptyStatement */: + case 211 /* TryStatement */: + case 209 /* LabeledStatement */: + case 199 /* DoStatement */: + case 212 /* DebuggerStatement */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: + case 229 /* ExportAssignment */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 218 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 247 /* EnumMember */; + return node.kind === 249 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { @@ -8098,7 +8345,7 @@ var ts; return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 211 /* VariableDeclaration */) { + if (node.kind !== 213 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -8174,7 +8421,7 @@ var ts; result.pos = getNodePos(); var commaStart = -1; // Meaning the previous token was not a comma while (true) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { result.push(parseListElement(kind, parseElement)); commaStart = scanner.getTokenPos(); if (parseOptional(24 /* CommaToken */)) { @@ -8269,14 +8516,14 @@ var ts; // Report that we need an identifier. However, report it right after the dot, // and not on the next token. This is because the next token might actually // be an identifier and the error would be quite confusing. - return createMissingNode(69 /* Identifier */, /*reportAtCurrentToken*/ true, ts.Diagnostics.Identifier_expected); + return createMissingNode(69 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(183 /* TemplateExpression */); - template.head = parseLiteralNode(); + var template = createNode(185 /* TemplateExpression */); + template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); @@ -8288,12 +8535,12 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(190 /* TemplateSpan */); + var span = createNode(192 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 16 /* CloseBraceToken */) { reScanTemplateToken(); - literal = parseLiteralNode(); + literal = parseTemplateLiteralFragment(); } else { literal = parseExpectedToken(14 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(16 /* CloseBraceToken */)); @@ -8301,8 +8548,17 @@ var ts; span.literal = literal; return finishNode(span); } + function parseStringLiteralTypeNode() { + return parseLiteralLikeNode(162 /* StringLiteralType */, /*internName*/ true); + } function parseLiteralNode(internName) { - var node = createNode(token); + return parseLiteralLikeNode(token, internName); + } + function parseTemplateLiteralFragment() { + return parseLiteralLikeNode(token, /*internName*/ false); + } + function parseLiteralLikeNode(kind, internName) { + var node = createNode(kind); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; if (scanner.hasExtendedUnicodeEscape()) { @@ -8331,11 +8587,7 @@ var ts; function parseTypeReferenceOrTypePredicate() { var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); if (typeName.kind === 69 /* Identifier */ && token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { - nextToken(); - var node_1 = createNode(150 /* TypePredicate */, typeName.pos); - node_1.parameterName = typeName; - node_1.type = parseType(); - return finishNode(node_1); + return parseTypePredicate(typeName); } var node = createNode(151 /* TypeReference */, typeName.pos); node.typeName = typeName; @@ -8344,6 +8596,18 @@ var ts; } return finishNode(node); } + function parseTypePredicate(lhs) { + nextToken(); + var node = createNode(150 /* TypePredicate */, lhs.pos); + node.parameterName = lhs; + node.type = parseType(); + return finishNode(node); + } + function parseThisTypeNode() { + var node = createNode(161 /* ThisType */); + nextToken(); + return finishNode(node); + } function parseTypeQuery() { var node = createNode(154 /* TypeQuery */); parseExpected(101 /* TypeOfKeyword */); @@ -8386,7 +8650,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 22 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifier(token) || token === 55 /* AtToken */; + return token === 22 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token) || token === 55 /* AtToken */; } function setModifiers(node, modifiers) { if (modifiers) { @@ -8402,7 +8666,7 @@ var ts; // FormalParameter [Yield,Await]: // BindingElement[?Yield,?Await] node.name = parseIdentifierOrPattern(); - if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifierKind(token)) { // in cases like // 'use strict' // function foo(static) @@ -8523,7 +8787,7 @@ var ts; if (token === 22 /* DotDotDotToken */ || token === 20 /* CloseBracketToken */) { return true; } - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { nextToken(); if (isIdentifier()) { return true; @@ -8580,6 +8844,12 @@ var ts; property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); + if (token === 56 /* EqualsToken */) { + // Although type literal properties cannot not have initializers, we attempt + // to parse an initializer so we can report in the checker that an interface + // property or type literal property cannot have an initializer. + property.initializer = parseNonParameterInitializer(); + } parseTypeMemberSemicolon(); return finishNode(property); } @@ -8591,7 +8861,7 @@ var ts; case 19 /* OpenBracketToken */: return true; default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = lookAhead(isStartOfIndexSignatureDeclaration); if (result) { return result; @@ -8601,7 +8871,7 @@ var ts; } } function isStartOfIndexSignatureDeclaration() { - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { nextToken(); } return isIndexSignature(); @@ -8639,7 +8909,7 @@ var ts; // when incrementally parsing as the parser will produce the Index declaration // if it has the same text regardless of whether it is inside a class or an // object type. - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { return result; @@ -8713,10 +8983,18 @@ var ts; var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); case 9 /* StringLiteral */: - return parseLiteralNode(/*internName*/ true); + return parseStringLiteralTypeNode(); case 103 /* VoidKeyword */: - case 97 /* ThisKeyword */: return parseTokenNode(); + case 97 /* ThisKeyword */: { + var thisKeyword = parseThisTypeNode(); + if (token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + return parseTypePredicate(thisKeyword); + } + else { + return thisKeyword; + } + } case 101 /* TypeOfKeyword */: return parseTypeQuery(); case 15 /* OpenBraceToken */: @@ -8801,11 +9079,11 @@ var ts; // ( ... return true; } - if (isIdentifier() || ts.isModifier(token)) { + if (isIdentifier() || ts.isModifierKind(token)) { nextToken(); if (token === 54 /* ColonToken */ || token === 24 /* CommaToken */ || token === 53 /* QuestionToken */ || token === 56 /* EqualsToken */ || - isIdentifier() || ts.isModifier(token)) { + isIdentifier() || ts.isModifierKind(token)) { // ( id : // ( id , // ( id ? @@ -8906,9 +9184,6 @@ var ts; token !== 55 /* AtToken */ && isStartOfExpression(); } - function allowInAndParseExpression() { - return allowInAnd(parseExpression); - } function parseExpression() { // Expression[in]: // AssignmentExpression[in] @@ -8916,7 +9191,7 @@ var ts; // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; @@ -8924,7 +9199,7 @@ var ts; expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return expr; } @@ -9029,7 +9304,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(184 /* YieldExpression */); + var node = createNode(186 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -9049,14 +9324,14 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(174 /* ArrowFunction */, identifier.pos); + var node = createNode(176 /* ArrowFunction */, identifier.pos); var parameter = createNode(138 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ false); return finishNode(node); } @@ -9160,7 +9435,7 @@ var ts; return 1 /* True */; } // This *could* be a parenthesized arrow function. - // Return Unknown to const the caller know. + // Return Unknown to let the caller know. return 2 /* Unknown */; } else { @@ -9202,7 +9477,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(174 /* ArrowFunction */); + var node = createNode(176 /* ArrowFunction */); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256 /* Async */); // Arrow functions are never generators. @@ -9246,7 +9521,7 @@ var ts; // user meant to supply a block. For example, if the user wrote: // // a => - // const v = 0; + // let v = 0; // } // // they may be missing an open brace. Check to see if that's the case so we can @@ -9268,7 +9543,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(182 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(184 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -9389,39 +9664,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(181 /* BinaryExpression */, left.pos); + var node = createNode(183 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(189 /* AsExpression */, left.pos); + var node = createNode(191 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(179 /* PrefixUnaryExpression */); + var node = createNode(181 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(175 /* DeleteExpression */); + var node = createNode(177 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(176 /* TypeOfExpression */); + var node = createNode(178 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(177 /* VoidExpression */); + var node = createNode(179 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9437,7 +9712,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(178 /* AwaitExpression */); + var node = createNode(180 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9463,7 +9738,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 171 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 173 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -9553,7 +9828,7 @@ var ts; */ function parseIncrementExpression() { if (token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) { - var node = createNode(179 /* PrefixUnaryExpression */); + var node = createNode(181 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -9566,7 +9841,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(180 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(182 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -9670,24 +9945,37 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(166 /* PropertyAccessExpression */, expression.pos); + var node = createNode(168 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 69 /* Identifier */) { + return lhs.text === rhs.text; + } + return lhs.right.text === rhs.right.text && + tagNamesAreEquivalent(lhs.left, rhs.left); + } function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 235 /* JsxOpeningElement */) { - var node = createNode(233 /* JsxElement */, opening.pos); + if (opening.kind === 237 /* JsxOpeningElement */) { + var node = createNode(235 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); + if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { + parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName)); + } result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 236 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -9702,7 +9990,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(181 /* BinaryExpression */, result.pos); + var badNode = createNode(183 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -9714,13 +10002,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(236 /* JsxText */, scanner.getStartPos()); + var node = createNode(238 /* JsxText */, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 236 /* JsxText */: + case 238 /* JsxText */: return parseJsxText(); case 15 /* OpenBraceToken */: return parseJsxExpression(/*inExpressionContext*/ false); @@ -9737,10 +10025,13 @@ var ts; while (true) { token = scanner.reScanJsxToken(); if (token === 26 /* LessThanSlashToken */) { + // Closing tag break; } else if (token === 1 /* EndOfFileToken */) { - parseErrorAtCurrentToken(ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); + // If we hit EOF, issue the error at the tag that lacks the closing element + // rather than at the end of the file (which is useless) + parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } result.push(parseJsxChild()); @@ -9759,7 +10050,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(235 /* JsxOpeningElement */, fullStart); + node = createNode(237 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -9768,10 +10059,10 @@ var ts; parseExpected(27 /* GreaterThanToken */); } else { - parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(234 /* JsxSelfClosingElement */, fullStart); + node = createNode(236 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -9790,16 +10081,16 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(240 /* JsxExpression */); + var node = createNode(242 /* JsxExpression */); parseExpected(15 /* OpenBraceToken */); if (token !== 16 /* CloseBraceToken */) { - node.expression = parseExpression(); + node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { parseExpected(16 /* CloseBraceToken */); } else { - parseExpected(16 /* CloseBraceToken */, /*message*/ undefined, /*advance*/ false); + parseExpected(16 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); @@ -9809,7 +10100,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(238 /* JsxAttribute */); + var node = createNode(240 /* JsxAttribute */); node.name = parseIdentifierName(); if (parseOptional(56 /* EqualsToken */)) { switch (token) { @@ -9824,7 +10115,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(239 /* JsxSpreadAttribute */); + var node = createNode(241 /* JsxSpreadAttribute */); parseExpected(15 /* OpenBraceToken */); parseExpected(22 /* DotDotDotToken */); node.expression = parseExpression(); @@ -9832,20 +10123,20 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(237 /* JsxClosingElement */); + var node = createNode(239 /* JsxClosingElement */); parseExpected(26 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { parseExpected(27 /* GreaterThanToken */); } else { - parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); } function parseTypeAssertion() { - var node = createNode(171 /* TypeAssertionExpression */); + var node = createNode(173 /* TypeAssertionExpression */); parseExpected(25 /* LessThanToken */); node.type = parseType(); parseExpected(27 /* GreaterThanToken */); @@ -9856,7 +10147,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(166 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(168 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -9865,7 +10156,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(19 /* OpenBracketToken */)) { - var indexedAccess = createNode(167 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(169 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -9881,7 +10172,7 @@ var ts; continue; } if (token === 11 /* NoSubstitutionTemplateLiteral */ || token === 12 /* TemplateHead */) { - var tagExpression = createNode(170 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(172 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -9904,7 +10195,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(168 /* CallExpression */, expression.pos); + var callExpr = createNode(170 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -9912,7 +10203,7 @@ var ts; continue; } else if (token === 17 /* OpenParenToken */) { - var callExpr = createNode(168 /* CallExpression */, expression.pos); + var callExpr = createNode(170 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -10022,28 +10313,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(172 /* ParenthesizedExpression */); + var node = createNode(174 /* ParenthesizedExpression */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(185 /* SpreadElementExpression */); + var node = createNode(187 /* SpreadElementExpression */); parseExpected(22 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 /* DotDotDotToken */ ? parseSpreadElement() : - token === 24 /* CommaToken */ ? createNode(187 /* OmittedExpression */) : + token === 24 /* CommaToken */ ? createNode(189 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(164 /* ArrayLiteralExpression */); + var node = createNode(166 /* ArrayLiteralExpression */); parseExpected(19 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024 /* MultiLine */; @@ -10070,7 +10361,6 @@ var ts; } var asteriskToken = parseOptionalToken(37 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); - var nameToken = token; var propertyName = parsePropertyName(); // Disallowing of optional property assignments happens in the grammar checker. var questionToken = parseOptionalToken(53 /* QuestionToken */); @@ -10084,7 +10374,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 /* CommaToken */ || token === 16 /* CloseBraceToken */ || token === 56 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(246 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(248 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56 /* EqualsToken */); @@ -10095,7 +10385,8 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(245 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(247 /* PropertyAssignment */, fullStart); + propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(54 /* ColonToken */); @@ -10104,7 +10395,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(165 /* ObjectLiteralExpression */); + var node = createNode(167 /* ObjectLiteralExpression */); parseExpected(15 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024 /* MultiLine */; @@ -10121,9 +10412,9 @@ var ts; // function BindingIdentifier[opt](FormalParameters){ FunctionBody } var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } - var node = createNode(173 /* FunctionExpression */); + var node = createNode(175 /* FunctionExpression */); setModifiers(node, parseModifiers()); parseExpected(87 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(37 /* AsteriskToken */); @@ -10137,7 +10428,7 @@ var ts; fillSignature(54 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlock(/*allowYield*/ isGenerator, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return finishNode(node); } @@ -10145,7 +10436,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(169 /* NewExpression */); + var node = createNode(171 /* NewExpression */); parseExpected(92 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -10156,7 +10447,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(192 /* Block */); + var node = createNode(194 /* Block */); if (parseExpected(15 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -10175,23 +10466,23 @@ var ts; // arrow function. The body of the function is not in [Decorator] context. var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } var block = parseBlock(ignoreMissingOpenBrace, diagnosticMessage); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return block; } function parseEmptyStatement() { - var node = createNode(194 /* EmptyStatement */); + var node = createNode(196 /* EmptyStatement */); parseExpected(23 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(196 /* IfStatement */); + var node = createNode(198 /* IfStatement */); parseExpected(88 /* IfKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10201,7 +10492,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(197 /* DoStatement */); + var node = createNode(199 /* DoStatement */); parseExpected(79 /* DoKeyword */); node.statement = parseStatement(); parseExpected(104 /* WhileKeyword */); @@ -10216,7 +10507,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(198 /* WhileStatement */); + var node = createNode(200 /* WhileStatement */); parseExpected(104 /* WhileKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10239,21 +10530,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90 /* InKeyword */)) { - var forInStatement = createNode(200 /* ForInStatement */, pos); + var forInStatement = createNode(202 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else if (parseOptional(134 /* OfKeyword */)) { - var forOfStatement = createNode(201 /* ForOfStatement */, pos); + var forOfStatement = createNode(203 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(199 /* ForStatement */, pos); + var forStatement = createNode(201 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(23 /* SemicolonToken */); if (token !== 23 /* SemicolonToken */ && token !== 18 /* CloseParenToken */) { @@ -10271,7 +10562,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 203 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); + parseExpected(kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -10279,7 +10570,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(204 /* ReturnStatement */); + var node = createNode(206 /* ReturnStatement */); parseExpected(94 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -10288,7 +10579,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(205 /* WithStatement */); + var node = createNode(207 /* WithStatement */); parseExpected(105 /* WithKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10297,7 +10588,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(241 /* CaseClause */); + var node = createNode(243 /* CaseClause */); parseExpected(71 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(54 /* ColonToken */); @@ -10305,7 +10596,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(242 /* DefaultClause */); + var node = createNode(244 /* DefaultClause */); parseExpected(77 /* DefaultKeyword */); parseExpected(54 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -10315,12 +10606,12 @@ var ts; return token === 71 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(206 /* SwitchStatement */); + var node = createNode(208 /* SwitchStatement */); parseExpected(96 /* SwitchKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); - var caseBlock = createNode(220 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(222 /* CaseBlock */, scanner.getStartPos()); parseExpected(15 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(16 /* CloseBraceToken */); @@ -10335,7 +10626,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(208 /* ThrowStatement */); + var node = createNode(210 /* ThrowStatement */); parseExpected(98 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -10343,7 +10634,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(209 /* TryStatement */); + var node = createNode(211 /* TryStatement */); parseExpected(100 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token === 72 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -10356,7 +10647,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(244 /* CatchClause */); + var result = createNode(246 /* CatchClause */); parseExpected(72 /* CatchKeyword */); if (parseExpected(17 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -10366,7 +10657,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(210 /* DebuggerStatement */); + var node = createNode(212 /* DebuggerStatement */); parseExpected(76 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -10378,13 +10669,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 /* Identifier */ && parseOptional(54 /* ColonToken */)) { - var labeledStatement = createNode(207 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(209 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(195 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(197 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -10558,9 +10849,9 @@ var ts; case 86 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 75 /* ContinueKeyword */: - return parseBreakOrContinueStatement(202 /* ContinueStatement */); + return parseBreakOrContinueStatement(204 /* ContinueStatement */); case 70 /* BreakKeyword */: - return parseBreakOrContinueStatement(203 /* BreakStatement */); + return parseBreakOrContinueStatement(205 /* BreakStatement */); case 94 /* ReturnKeyword */: return parseReturnStatement(); case 105 /* WithKeyword */: @@ -10633,7 +10924,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(231 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(233 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10655,16 +10946,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 24 /* CommaToken */) { - return createNode(187 /* OmittedExpression */); + return createNode(189 /* OmittedExpression */); } - var node = createNode(163 /* BindingElement */); + var node = createNode(165 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(163 /* BindingElement */); + var node = createNode(165 /* BindingElement */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -10679,14 +10970,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(161 /* ObjectBindingPattern */); + var node = createNode(163 /* ObjectBindingPattern */); parseExpected(15 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(16 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(162 /* ArrayBindingPattern */); + var node = createNode(164 /* ArrayBindingPattern */); parseExpected(19 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(20 /* CloseBracketToken */); @@ -10705,7 +10996,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(211 /* VariableDeclaration */); + var node = createNode(213 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -10714,7 +11005,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(212 /* VariableDeclarationList */); + var node = createNode(214 /* VariableDeclarationList */); switch (token) { case 102 /* VarKeyword */: break; @@ -10752,7 +11043,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(193 /* VariableStatement */, fullStart); + var node = createNode(195 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -10760,7 +11051,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(213 /* FunctionDeclaration */, fullStart); + var node = createNode(215 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87 /* FunctionKeyword */); @@ -10858,7 +11149,7 @@ var ts; return true; } // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { idToken = token; // If the idToken is a class modifier (protected, private, public, and static), it is // certain that we are starting to parse class member. This allows better error recovery @@ -10919,7 +11210,7 @@ var ts; } if (!decorators) { decorators = []; - decorators.pos = scanner.getStartPos(); + decorators.pos = decoratorStart; } var decorator = createNode(139 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); @@ -10930,14 +11221,30 @@ var ts; } return decorators; } - function parseModifiers() { + /* + * There are situations in which a modifier like 'const' will appear unexpectedly, such as on a class member. + * In those situations, if we are entirely sure that 'const' is not valid on its own (such as when ASI takes effect + * and turns it into a standalone declaration), then it is better to parse it and report an error later. + * + * In such situations, 'permitInvalidConstAsModifier' should be set to true. + */ + function parseModifiers(permitInvalidConstAsModifier) { var flags = 0; var modifiers; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token; - if (!parseAnyContextualModifier()) { - break; + if (token === 74 /* ConstKeyword */ && permitInvalidConstAsModifier) { + // We need to ensure that any subsequent modifiers appear on the same line + // so that when 'const' is a standalone declaration, we don't issue an error. + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + break; + } + } + else { + if (!parseAnyContextualModifier()) { + break; + } } if (!modifiers) { modifiers = []; @@ -10970,13 +11277,13 @@ var ts; } function parseClassElement() { if (token === 23 /* SemicolonToken */) { - var result = createNode(191 /* SemicolonClassElement */); + var result = createNode(193 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var fullStart = getNodePos(); var decorators = parseDecorators(); - var modifiers = parseModifiers(); + var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; @@ -11008,10 +11315,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 186 /* ClassExpression */); + /*modifiers*/ undefined, 188 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 214 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -11036,8 +11343,8 @@ var ts; // implements is a future reserved word so // 'class implements' might mean either // - class expression with omitted name, 'implements' starts heritage clause - // - class with name 'implements' - // 'isImplementsClause' helps to disambiguate between these two cases + // - class with name 'implements' + // 'isImplementsClause' helps to disambiguate between these two cases return isIdentifier() && !isImplementsClause() ? parseIdentifier() : undefined; @@ -11053,12 +11360,9 @@ var ts; } return undefined; } - function parseHeritageClausesWorker() { - return parseList(20 /* HeritageClauses */, parseHeritageClause); - } function parseHeritageClause() { if (token === 83 /* ExtendsKeyword */ || token === 106 /* ImplementsKeyword */) { - var node = createNode(243 /* HeritageClause */); + var node = createNode(245 /* HeritageClause */); node.token = token; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -11067,7 +11371,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(188 /* ExpressionWithTypeArguments */); + var node = createNode(190 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -11081,7 +11385,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215 /* InterfaceDeclaration */, fullStart); + var node = createNode(217 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107 /* InterfaceKeyword */); @@ -11092,7 +11396,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(216 /* TypeAliasDeclaration */, fullStart); + var node = createNode(218 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132 /* TypeKeyword */); @@ -11108,13 +11412,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(247 /* EnumMember */, scanner.getStartPos()); + var node = createNode(249 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217 /* EnumDeclaration */, fullStart); + var node = createNode(219 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81 /* EnumKeyword */); @@ -11129,7 +11433,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(219 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(221 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(15 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -11140,7 +11444,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(218 /* ModuleDeclaration */, fullStart); + var node = createNode(220 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 65536 /* Namespace */; @@ -11154,7 +11458,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218 /* ModuleDeclaration */, fullStart); + var node = createNode(220 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(/*internName*/ true); @@ -11184,11 +11488,6 @@ var ts; function nextTokenIsSlash() { return nextToken() === 39 /* SlashToken */; } - function nextTokenIsCommaOrFromKeyword() { - nextToken(); - return token === 24 /* CommaToken */ || - token === 133 /* FromKeyword */; - } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(89 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); @@ -11199,7 +11498,7 @@ var ts; // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(221 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(223 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -11210,7 +11509,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(222 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(224 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -11233,7 +11532,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(223 /* ImportClause */, fullStart); + var importClause = createNode(225 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -11243,7 +11542,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(24 /* CommaToken */)) { - importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(225 /* NamedImports */); + importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(227 /* NamedImports */); } return finishNode(importClause); } @@ -11253,7 +11552,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(232 /* ExternalModuleReference */); + var node = createNode(234 /* ExternalModuleReference */); parseExpected(127 /* RequireKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -11261,21 +11560,22 @@ var ts; return finishNode(node); } function parseModuleSpecifier() { - // We allow arbitrary expressions here, even though the grammar only allows string - // literals. We check to ensure that it is only a string literal later in the grammar - // walker. - var result = parseExpression(); - // Ensure the string being required is in our 'identifier' table. This will ensure - // that features like 'find refs' will look inside this file when search for its name. - if (result.kind === 9 /* StringLiteral */) { + if (token === 9 /* StringLiteral */) { + var result = parseLiteralNode(); internIdentifier(result.text); + return result; + } + else { + // We allow arbitrary expressions here, even though the grammar only allows string + // literals. We check to ensure that it is only a string literal later in the grammar + // check pass. + return parseExpression(); } - return result; } function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(224 /* NamespaceImport */); + var namespaceImport = createNode(226 /* NamespaceImport */); parseExpected(37 /* AsteriskToken */); parseExpected(116 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -11290,14 +11590,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 225 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); + node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 227 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(230 /* ExportSpecifier */); + return parseImportOrExportSpecifier(232 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(226 /* ImportSpecifier */); + return parseImportOrExportSpecifier(228 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -11322,14 +11622,14 @@ var ts; else { node.name = identifierName; } - if (kind === 226 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 228 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228 /* ExportDeclaration */, fullStart); + var node = createNode(230 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37 /* AsteriskToken */)) { @@ -11337,7 +11637,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(229 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(231 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. @@ -11350,7 +11650,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(227 /* ExportAssignment */, fullStart); + var node = createNode(229 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56 /* EqualsToken */)) { @@ -11373,11 +11673,13 @@ var ts; // reference comment. while (true) { var kind = triviaScanner.scan(); - if (kind === 5 /* WhitespaceTrivia */ || kind === 4 /* NewLineTrivia */ || kind === 3 /* MultiLineCommentTrivia */) { - continue; - } if (kind !== 2 /* SingleLineCommentTrivia */) { - break; + if (ts.isTrivia(kind)) { + continue; + } + else { + break; + } } var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); @@ -11423,10 +11725,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 /* Export */ - || node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 232 /* ExternalModuleReference */ - || node.kind === 222 /* ImportDeclaration */ - || node.kind === 227 /* ExportAssignment */ - || node.kind === 228 /* ExportDeclaration */ + || node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */ + || node.kind === 224 /* ImportDeclaration */ + || node.kind === 229 /* ExportAssignment */ + || node.kind === 230 /* ExportDeclaration */ ? node : undefined; }); @@ -11501,7 +11803,7 @@ var ts; scanner.setText(sourceText, start, length); // Prime the first token for us to start processing. token = nextToken(); - var result = createNode(249 /* JSDocTypeExpression */); + var result = createNode(251 /* JSDocTypeExpression */); parseExpected(15 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(16 /* CloseBraceToken */); @@ -11512,12 +11814,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47 /* BarToken */) { - var unionType = createNode(253 /* JSDocUnionType */, type.pos); + var unionType = createNode(255 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56 /* EqualsToken */) { - var optionalType = createNode(260 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(262 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -11528,20 +11830,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19 /* OpenBracketToken */) { - var arrayType = createNode(252 /* JSDocArrayType */, type.pos); + var arrayType = createNode(254 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token === 53 /* QuestionToken */) { - var nullableType = createNode(255 /* JSDocNullableType */, type.pos); + var nullableType = createNode(257 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49 /* ExclamationToken */) { - var nonNullableType = createNode(256 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(258 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -11586,27 +11888,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(264 /* JSDocThisType */); + var result = createNode(266 /* JSDocThisType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(263 /* JSDocConstructorType */); + var result = createNode(265 /* JSDocConstructorType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(262 /* JSDocVariadicType */); + var result = createNode(264 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(261 /* JSDocFunctionType */); + var result = createNode(263 /* JSDocFunctionType */); nextToken(); parseExpected(17 /* OpenParenToken */); result.parameters = parseDelimitedList(22 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -11623,14 +11925,8 @@ var ts; parameter.type = parseJSDocType(); return finishNode(parameter); } - function parseJSDocOptionalType(type) { - var result = createNode(260 /* JSDocOptionalType */, type.pos); - nextToken(); - result.type = type; - return finishNode(result); - } function parseJSDocTypeReference() { - var result = createNode(259 /* JSDocTypeReference */); + var result = createNode(261 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); while (parseOptional(21 /* DotToken */)) { if (token === 25 /* LessThanToken */) { @@ -11666,7 +11962,7 @@ var ts; return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(257 /* JSDocRecordType */); + var result = createNode(259 /* JSDocRecordType */); nextToken(); result.members = parseDelimitedList(24 /* JSDocRecordMembers */, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -11674,7 +11970,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(258 /* JSDocRecordMember */); + var result = createNode(260 /* JSDocRecordMember */); result.name = parseSimplePropertyName(); if (token === 54 /* ColonToken */) { nextToken(); @@ -11683,13 +11979,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(256 /* JSDocNonNullableType */); + var result = createNode(258 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(254 /* JSDocTupleType */); + var result = createNode(256 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(25 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -11703,7 +11999,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(253 /* JSDocUnionType */); + var result = createNode(255 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18 /* CloseParenToken */); @@ -11721,7 +12017,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(250 /* JSDocAllType */); + var result = createNode(252 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -11744,11 +12040,11 @@ var ts; token === 27 /* GreaterThanToken */ || token === 56 /* EqualsToken */ || token === 47 /* BarToken */) { - var result = createNode(251 /* JSDocUnknownType */, pos); + var result = createNode(253 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(255 /* JSDocNullableType */, pos); + var result = createNode(257 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -11836,7 +12132,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(265 /* JSDocComment */, start); + var result = createNode(267 /* JSDocComment */, start); result.tags = tags; return finishNode(result, end); } @@ -11873,7 +12169,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(266 /* JSDocTag */, atToken.pos); + var result = createNode(268 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -11924,7 +12220,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(267 /* JSDocParameterTag */, atToken.pos); + var result = createNode(269 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -11934,27 +12230,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 268 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(268 /* JSDocReturnTag */, atToken.pos); + var result = createNode(270 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 269 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(269 /* JSDocTypeTag */, atToken.pos); + var result = createNode(271 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -11978,7 +12274,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(270 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(272 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -12019,7 +12315,7 @@ var ts; if (sourceFile.statements.length === 0) { // If we don't have any statements in the current source file, then there's no real // way to incrementally parse. So just do a full parse instead. - return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true); + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true); } // Make sure we're not trying to incrementally update a source file more than once. Once // we do an update the original source file is considered unusbale from that point onwards. @@ -12075,7 +12371,7 @@ var ts; // inconsistent tree. Setting the parents on the new tree should be very fast. We // will immediately bail out of walking any subtrees when we can see that their parents // are already correct. - var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true); + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true); return result; } IncrementalParser.updateSourceFile = updateSourceFile; @@ -12508,16 +12804,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 218 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 219 /* ModuleBlock */) { + else if (node.kind === 221 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -12536,7 +12832,7 @@ var ts; }); return state; } - else if (node.kind === 218 /* ModuleDeclaration */) { + else if (node.kind === 220 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -12604,6 +12900,8 @@ var ts; file.symbolCount = symbolCount; file.classifiableNames = classifiableNames; } + file = undefined; + options = undefined; parent = undefined; container = undefined; blockScopeContainer = undefined; @@ -12632,20 +12930,25 @@ var ts; if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { symbol.members = {}; } - if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; + if (symbolFlags & 107455 /* Value */) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220 /* ModuleDeclaration */)) { + // other kinds of value declarations take precedence over modules + symbol.valueDeclaration = node; + } } } // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + if (node.kind === 220 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { return "\"" + node.name.text + "\""; } if (node.name.kind === 136 /* ComputedPropertyName */) { var nameExpression = node.name.expression; - // treat computed property names where expression is string/numeric literal as just string/numeric literal + // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression.kind)) { return nameExpression.text; } @@ -12665,15 +12968,27 @@ var ts; return "__new"; case 149 /* IndexSignature */: return "__index"; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return "__export"; - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 181 /* BinaryExpression */: - // Binary expression case is for JS module 'module.exports = expr' - return "export="; - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: + case 183 /* BinaryExpression */: + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 2 /* ModuleExports */: + // module.exports = ... + return "export="; + case 1 /* ExportsProperty */: + case 4 /* ThisProperty */: + // exports.x = ... or this.y = ... + return node.left.name.text; + case 3 /* PrototypeProperty */: + // className.prototype.methodName = ... + return node.left.expression.name.text; + } + ts.Debug.fail("Unknown binary declaration kind"); + break; + case 215 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: return node.flags & 512 /* Default */ ? "default" : undefined; } } @@ -12750,7 +13065,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 232 /* ExportSpecifier */ || (node.kind === 223 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -12833,10 +13148,10 @@ var ts; var flags = node.flags; // reset all reachability check related flags on node (for incremental scenarios) flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 215 /* InterfaceDeclaration */) { + if (kind === 217 /* InterfaceDeclaration */) { seenThisKeyword = false; } - var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + var saveState = kind === 250 /* SourceFile */ || kind === 221 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -12854,7 +13169,7 @@ var ts; flags |= 1048576 /* HasExplicitReturn */; } } - if (kind === 215 /* InterfaceDeclaration */) { + if (kind === 217 /* InterfaceDeclaration */) { flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; } node.flags = flags; @@ -12879,40 +13194,40 @@ var ts; return; } switch (node.kind) { - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: bindWhileStatement(node); break; - case 197 /* DoStatement */: + case 199 /* DoStatement */: bindDoStatement(node); break; - case 199 /* ForStatement */: + case 201 /* ForStatement */: bindForStatement(node); break; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 196 /* IfStatement */: + case 198 /* IfStatement */: bindIfStatement(node); break; - case 204 /* ReturnStatement */: - case 208 /* ThrowStatement */: + case 206 /* ReturnStatement */: + case 210 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 209 /* TryStatement */: + case 211 /* TryStatement */: bindTryStatement(node); break; - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: bindSwitchStatement(node); break; - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: bindCaseBlock(node); break; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: bindLabeledStatement(node); break; default: @@ -12964,7 +13279,7 @@ var ts; popImplicitLabel(postStatementLabel, preStatementState); } function bindIfStatement(n) { - // denotes reachability state when entering 'thenStatement' part of the if statement: + // denotes reachability state when entering 'thenStatement' part of the if statement: // i.e. if condition is false then thenStatement is unreachable var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; // denotes reachability state when entering 'elseStatement': @@ -12987,7 +13302,7 @@ var ts; function bindReturnOrThrow(n) { // bind expression (don't affect reachability) bind(n.expression); - if (n.kind === 204 /* ReturnStatement */) { + if (n.kind === 206 /* ReturnStatement */) { hasExplicitReturn = true; } currentReachabilityState = 4 /* Unreachable */; @@ -12996,7 +13311,7 @@ var ts; // call bind on label (don't affect reachability) bind(n.label); // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + var isValidJump = jumpToLabel(n.label, n.kind === 205 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); if (isValidJump) { currentReachabilityState = 4 /* Unreachable */; } @@ -13022,7 +13337,7 @@ var ts; // bind expression (don't affect reachability) bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244 /* DefaultClause */; }); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); @@ -13049,37 +13364,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return 1 /* IsContainer */; case 147 /* CallSignature */: case 148 /* ConstructSignature */: case 149 /* IndexSignature */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 152 /* FunctionType */: case 153 /* ConstructorType */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 218 /* ModuleDeclaration */: - case 248 /* SourceFile */: - case 216 /* TypeAliasDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 220 /* ModuleDeclaration */: + case 250 /* SourceFile */: + case 218 /* TypeAliasDeclaration */: return 5 /* IsContainerWithLocals */; - case 244 /* CatchClause */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 220 /* CaseBlock */: + case 246 /* CatchClause */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 222 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 192 /* Block */: + case 194 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Othewise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -13116,18 +13431,18 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - case 215 /* InterfaceDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 217 /* InterfaceDeclaration */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the @@ -13144,10 +13459,10 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 216 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 218 /* TypeAliasDeclaration */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -13168,11 +13483,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 248 /* SourceFile */ ? node : node.body; - if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { + var body = node.kind === 250 /* SourceFile */ ? node : node.body; + if (body.kind === 250 /* SourceFile */ || body.kind === 221 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { + if (stat.kind === 230 /* ExportDeclaration */ || stat.kind === 229 /* ExportAssignment */) { return true; } } @@ -13256,7 +13571,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + var currentKind = prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen[identifier.text]; @@ -13278,10 +13593,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -13441,17 +13756,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 248 /* SourceFile */: - case 219 /* ModuleBlock */: + case 250 /* SourceFile */: + case 221 /* ModuleBlock */: updateStrictModeStatementList(node.statements); return; - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return; @@ -13481,45 +13796,61 @@ var ts; /* Strict mode checks */ case 69 /* Identifier */: return checkStrictModeIdentifier(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: if (ts.isInJavaScriptFile(node)) { - if (ts.isExportsPropertyAssignment(node)) { - bindExportsPropertyAssignment(node); - } - else if (ts.isModuleExportsAssignment(node)) { - bindModuleExportsAssignment(node); + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1 /* ExportsProperty */: + bindExportsPropertyAssignment(node); + break; + case 2 /* ModuleExports */: + bindModuleExportsAssignment(node); + break; + case 3 /* PrototypeProperty */: + bindPrototypePropertyAssignment(node); + break; + case 4 /* ThisProperty */: + bindThisPropertyAssignment(node); + break; + case 0 /* None */: + // Nothing to do + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } } return checkStrictModeBinaryExpression(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return checkStrictModeCatchClause(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return checkStrictModeWithStatement(node); - case 97 /* ThisKeyword */: + case 161 /* ThisType */: seenThisKeyword = true; return; + case 150 /* TypePredicate */: + return checkTypePredicate(node); case 137 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); case 138 /* Parameter */: return bindParameter(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: + case 247 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); case 147 /* CallSignature */: case 148 /* ConstructSignature */: @@ -13532,7 +13863,7 @@ var ts; // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: checkStrictModeFunctionName(node); return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); case 144 /* Constructor */: @@ -13546,46 +13877,56 @@ var ts; return bindFunctionOrConstructorType(node); case 155 /* TypeLiteral */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: checkStrictModeFunctionName(node); var bindingName = node.name ? node.name.text : "__function"; return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 168 /* CallExpression */: + case 170 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: return bindClassLikeDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Imports and exports - case 221 /* ImportEqualsDeclaration */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return bindImportClause(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return bindExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return bindExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return bindSourceFileIfExternalModule(); } } + function checkTypePredicate(node) { + var parameterName = node.parameterName, type = node.type; + if (parameterName && parameterName.kind === 69 /* Identifier */) { + checkStrictModeIdentifier(parameterName); + } + if (parameterName && parameterName.kind === 161 /* ThisType */) { + seenThisKeyword = true; + } + bind(type); + } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -13596,7 +13937,7 @@ var ts; bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 227 /* ExportAssignment */ ? node.expression : node.right; + var boundExpression = node.kind === 229 /* ExportAssignment */ ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { // Export assignment in some sort of block construct bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); @@ -13642,6 +13983,29 @@ var ts; setCommonJsModuleIndicator(node); bindExportAssignment(node); } + function bindThisPropertyAssignment(node) { + // Declare a 'member' in case it turns out the container was an ES5 class + if (container.kind === 175 /* FunctionExpression */ || container.kind === 215 /* FunctionDeclaration */) { + container.symbol.members = container.symbol.members || {}; + declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); + } + } + function bindPrototypePropertyAssignment(node) { + // We saw a node of the form 'x.prototype.y = z'. Declare a 'member' y on x if x was a function. + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var classId = node.left.expression.expression; + var funcSymbol = container.locals[classId.text]; + if (!funcSymbol || !(funcSymbol.flags & 16 /* Function */)) { + return; + } + // Set up the members collection if it doesn't exist already + if (!funcSymbol.members) { + funcSymbol.members = {}; + } + // Declare the method/property + declareSymbol(funcSymbol.members, funcSymbol, node.left, 4 /* Property */, 107455 /* PropertyExcludes */); + } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip // this check if we've already seen the module indicator @@ -13650,7 +14014,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -13725,9 +14089,7 @@ var ts; } // If this is a property-parameter, then also declare the property symbol into the // containing class. - if (node.flags & 56 /* AccessibilityModifier */ && - node.parent.kind === 144 /* Constructor */ && - ts.isClassLike(node.parent.parent)) { + if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -13797,18 +14159,18 @@ var ts; case 4 /* Unreachable */: var reportError = // report error on all statements except empty ones - (ts.isStatement(node) && node.kind !== 194 /* EmptyStatement */) || + (ts.isStatement(node) && node.kind !== 196 /* EmptyStatement */) || // report error on class declarations - node.kind === 214 /* ClassDeclaration */ || + node.kind === 216 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 220 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 219 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8 /* ReportedUnreachable */; // unreachable code is reported if // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error + // - statement is in not ambient context (statements in ambient context is already an error // so we should not report extras) AND // - node is not variable statement OR // - node is block scoped variable statement OR @@ -13817,7 +14179,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 193 /* VariableStatement */ || + (node.kind !== 195 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -13853,15 +14215,18 @@ var ts; var nextNodeId = 1; var nextMergeId = 1; function getNodeId(node) { - if (!node.id) - node.id = nextNodeId++; + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } return node.id; } ts.getNodeId = getNodeId; ts.checkTime = 0; function getSymbolId(symbol) { if (!symbol.id) { - symbol.id = nextSymbolId++; + symbol.id = nextSymbolId; + nextSymbolId++; } return symbol.id; } @@ -13887,8 +14252,10 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0 /* ES3 */; var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === 4 /* System */; var emitResolver = createResolver(); var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + undefinedSymbol.declarations = []; var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, @@ -13902,6 +14269,7 @@ var ts; // The language service will always care about the narrowed type of a symbol, because that is // the type the language says the symbol should have. getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -13918,7 +14286,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getApparentTypeOfContextualType, + getContextualType: getContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -13943,8 +14311,8 @@ var ts; var undefinedType = createIntrinsicType(32 /* Undefined */ | 2097152 /* ContainsUndefinedOrNull */, "undefined"); var nullType = createIntrinsicType(64 /* Null */ | 2097152 /* ContainsUndefinedOrNull */, "null"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var circularType = createIntrinsicType(1 /* Any */, "__circular__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var emptyUnionType = emptyObjectType; var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); emptyGenericType.instantiations = {}; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -13952,8 +14320,8 @@ var ts; // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. anyFunctionType.flags |= 8388608 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); + var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); var globals = {}; var globalESSymbolConstructorSymbol; var getGlobalPromiseConstructorSymbol; @@ -13966,9 +14334,6 @@ var ts; var globalRegExpType; var globalTemplateStringsArrayType; var globalESSymbolType; - var jsxElementType; - /** Lazily loaded, use getJsxIntrinsicElementType() */ - var jsxIntrinsicElementsType; var globalIterableType; var globalIteratorType; var globalIterableIteratorType; @@ -13985,6 +14350,7 @@ var ts; var getGlobalPromiseConstructorLikeType; var getGlobalThenableType; var jsxElementClassType; + var deferredNodes; var tupleTypes = {}; var unionTypes = {}; var intersectionTypes = {}; @@ -14019,14 +14385,23 @@ var ts; "symbol": { type: esSymbolType, flags: 16777216 /* ESSymbol */ + }, + "undefined": { + type: undefinedType, + flags: 2097152 /* ContainsUndefinedOrNull */ } }; + var jsxElementType; + /** Things we lazy load from the JSX namespace */ + var jsxTypes = {}; var JsxNames = { JSX: "JSX", IntrinsicElements: "IntrinsicElements", ElementClass: "ElementClass", ElementAttributesPropertyNameContainer: "ElementAttributesProperty", - Element: "Element" + Element: "Element", + IntrinsicAttributes: "IntrinsicAttributes", + IntrinsicClassAttributes: "IntrinsicClassAttributes" }; var subtypeRelation = {}; var assignableRelation = {}; @@ -14040,6 +14415,10 @@ var ts; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var builtinGlobals = (_a = {}, + _a[undefinedSymbol.name] = undefinedSymbol, + _a + ); initializeTypeChecker(); return checker; function getEmitResolver(sourceFile, cancellationToken) { @@ -14095,8 +14474,10 @@ var ts; return result; } function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { @@ -14121,8 +14502,12 @@ var ts; target.constEnumOnlyModule = false; } target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) + if (source.valueDeclaration && + (!target.valueDeclaration || + (target.valueDeclaration.kind === 220 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 220 /* ModuleDeclaration */))) { + // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; + } ts.forEach(source.declarations, function (node) { target.declarations.push(node); }); @@ -14174,6 +14559,22 @@ var ts; } } } + function addToSymbolTable(target, source, message) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (ts.hasProperty(target, id)) { + // Error on redeclarations + ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + } + else { + target[id] = source[id]; + } + } + } + function addDeclarationDiagnostic(id, message) { + return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; + } + } function getSymbolLinks(symbol) { if (symbol.flags & 67108864 /* Transient */) return symbol; @@ -14185,10 +14586,17 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 248 /* SourceFile */); + return ts.getAncestor(node, 250 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 248 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 250 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + } + /** Is this type one of the apparent types created from the primitive types. */ + function isPrimitiveApparentType(type) { + return type === globalStringType || + type === globalNumberType || + type === globalBooleanType || + type === globalESSymbolType; } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14207,6 +14615,22 @@ var ts; } // return undefined if we can't find a symbol. } + /** + * Get symbols that represent parameter-property-declaration as parameter and as property declaration + * @param parameter a parameterDeclaration node + * @param parameterName a name of the parameter to get the symbols for. + * @return a tuple of two symbols + */ + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + var constructoDeclaration = parameter.parent; + var classDeclaration = parameter.parent.parent; + var parameterSymbol = getSymbol(constructoDeclaration.locals, parameterName, 107455 /* Value */); + var propertySymbol = getSymbol(classDeclaration.symbol.members, parameterName, 107455 /* Value */); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { var declarationFile = ts.getSourceFileOfNode(declaration); var useFile = ts.getSourceFileOfNode(usage); @@ -14221,7 +14645,7 @@ var ts; if (declaration.pos <= usage.pos) { // declaration is before usage // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 211 /* VariableDeclaration */ || + return declaration.kind !== 213 /* VariableDeclaration */ || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } // declaration is after usage @@ -14229,14 +14653,14 @@ var ts; return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 193 /* VariableStatement */ || - declaration.parent.parent.kind === 199 /* ForStatement */) { + if (declaration.parent.parent.kind === 195 /* VariableStatement */ || + declaration.parent.parent.kind === 201 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 201 /* ForOfStatement */ || - declaration.parent.parent.kind === 200 /* ForInStatement */) { + else if (declaration.parent.parent.kind === 203 /* ForOfStatement */ || + declaration.parent.parent.kind === 202 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); @@ -14277,25 +14701,46 @@ var ts; // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - // Type parameters of a function are in scope in the entire function declaration, including the parameter - // list and return type. However, local types are only in scope in the function body. - if (!(meaning & 793056 /* Type */) || - !(result.flags & (793056 /* Type */ & ~262144 /* TypeParameter */)) || - !ts.isFunctionLike(location) || - lastLocation === location.body) { + var useResult = true; + if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { + // symbol lookup restrictions for function-like declarations + // - Type parameters of a function are in scope in the entire function declaration, including the parameter + // list and return type. However, local types are only in scope in the function body. + // - parameters are only in the scope of function body + if (meaning & result.flags & 793056 /* Type */) { + useResult = result.flags & 262144 /* TypeParameter */ + ? lastLocation === location.type || + lastLocation.kind === 138 /* Parameter */ || + lastLocation.kind === 137 /* TypeParameter */ + : false; + } + if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { + // parameters are visible only inside function body, parameter list and return type + // technically for parameter list case here we might mix parameters and variables declared in function, + // however it is detected separately when checking initializers of parameters + // to make sure that they reference no variables declared after them. + useResult = + lastLocation.kind === 138 /* Parameter */ || + (lastLocation === location.type && + result.valueDeclaration.kind === 138 /* Parameter */); + } + } + if (useResult) { break loop; } - result = undefined; + else { + result = undefined; + } } } switch (location.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 248 /* SourceFile */ || - (location.kind === 218 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { + if (location.kind === 250 /* SourceFile */ || + (location.kind === 220 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports["default"]) { @@ -14306,7 +14751,7 @@ var ts; result = undefined; } // Because of module/namespace merging, a module's exports are in scope, - // yet we never want to treat an export specifier as putting a member in scope. + // yet we never want to treat an export specifier as putting a member in scope. // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope. // Two things to note about this: // 1. We have to check this without calling getSymbol. The problem with calling getSymbol @@ -14318,7 +14763,7 @@ var ts; // which is not the desired behavior. if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 230 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExports[name], 232 /* ExportSpecifier */)) { break; } } @@ -14326,7 +14771,7 @@ var ts; break loop; } break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } @@ -14349,9 +14794,9 @@ var ts; } } break; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 64 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -14362,7 +14807,7 @@ var ts; } break loop; } - if (location.kind === 186 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 188 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -14380,7 +14825,7 @@ var ts; // case 136 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 215 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 217 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -14393,14 +14838,14 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -14482,7 +14927,7 @@ var ts; // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 211 /* VariableDeclaration */), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213 /* VariableDeclaration */), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -14503,10 +14948,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 222 /* ImportDeclaration */) { + while (node && node.kind !== 224 /* ImportDeclaration */) { node = node.parent; } return node; @@ -14516,7 +14961,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 232 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 234 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -14525,9 +14970,12 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); - if (!exportDefaultSymbol) { + if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } + else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + return resolveSymbol(moduleSymbol.exports["export="]) || resolveSymbol(moduleSymbol); + } return exportDefaultSymbol; } } @@ -14535,14 +14983,6 @@ var ts; var moduleSpecifier = node.parent.parent.moduleSpecifier; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } - function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3 /* Variable */) { - var typeAnnotation = moduleSymbol.valueDeclaration.type; - if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); - } - } - } // This function creates a synthetic symbol that combines the value side of one symbol with the // type/namespace side of another symbol. Consider this example: // @@ -14623,17 +15063,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return getTargetOfImportClause(node); - case 224 /* NamespaceImport */: + case 226 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 226 /* ImportSpecifier */: + case 228 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 230 /* ExportSpecifier */: + case 232 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -14678,11 +15118,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 227 /* ExportAssignment */) { + if (node.kind === 229 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 230 /* ExportSpecifier */) { + else if (node.kind === 232 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -14695,7 +15135,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 221 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 223 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -14714,7 +15154,7 @@ var ts; else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 221 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 223 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -14734,7 +15174,7 @@ var ts; return undefined; } } - else if (name.kind === 135 /* QualifiedName */ || name.kind === 166 /* PropertyAccessExpression */) { + else if (name.kind === 135 /* QualifiedName */ || name.kind === 168 /* PropertyAccessExpression */) { var left = name.kind === 135 /* QualifiedName */ ? name.left : name.expression; var right = name.kind === 135 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */, ignoreErrors); @@ -14760,16 +15200,12 @@ var ts; return; } var moduleReferenceLiteral = moduleReferenceExpression; - var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); // Module names are escaped in our symbol table. However, string literal values aren't. // Escape the name in the "require(...)" clause to ensure we find the right symbol. var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (moduleName === undefined) { return; } - if (moduleName.indexOf("!") >= 0) { - moduleName = moduleName.substr(0, moduleName.indexOf("!")); - } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); @@ -14817,38 +15253,66 @@ var ts; var links = getSymbolLinks(moduleSymbol); return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } - function extendExportSymbols(target, source) { + /** + * Extends one symbol table with another while collecting information on name collisions for error message generation into the `lookupTable` argument + * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables + */ + function extendExportSymbols(target, source, lookupTable, exportNode) { for (var id in source) { if (id !== "default" && !ts.hasProperty(target, id)) { target[id] = source[id]; + if (lookupTable && exportNode) { + lookupTable[id] = { + specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) + }; + } + } + else if (lookupTable && exportNode && id !== "default" && ts.hasProperty(target, id) && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { + if (!lookupTable[id].exportsWithDuplicate) { + lookupTable[id].exportsWithDuplicate = [exportNode]; + } + else { + lookupTable[id].exportsWithDuplicate.push(exportNode); + } } } } function getExportsForModule(moduleSymbol) { - var result; var visitedSymbols = []; - visit(moduleSymbol); - return result || moduleSymbol.exports; + return visit(moduleSymbol) || moduleSymbol.exports; // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. function visit(symbol) { - if (symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol)) { - visitedSymbols.push(symbol); - if (symbol !== moduleSymbol) { - if (!result) { - result = cloneSymbolTable(moduleSymbol.exports); - } - extendExportSymbols(result, symbol.exports); - } - // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; - if (exportStars) { - for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - visit(resolveExternalModuleName(node, node.moduleSpecifier)); - } - } + if (!(symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol))) { + return; } + visitedSymbols.push(symbol); + var symbols = cloneSymbolTable(symbol.exports); + // All export * declarations are collected in an __export symbol by the binder + var exportStars = symbol.exports["__export"]; + if (exportStars) { + var nestedSymbols = {}; + var lookupTable = {}; + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + var exportedSymbols = visit(resolvedModule); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + } + for (var id in lookupTable) { + var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || ts.hasProperty(symbols, id)) { + continue; + } + for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { + var node = exportsWithDuplicate_1[_b]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + } + } + extendExportSymbols(symbols, nestedSymbols); + } + return symbols; } } function getMergedSymbol(symbol) { @@ -14893,7 +15357,8 @@ var ts; } function createType(flags) { var result = new Type(checker, flags); - result.id = typeCount++; + result.id = typeCount; + typeCount++; return result; } function createIntrinsicType(kind, intrinsicName) { @@ -14956,17 +15421,17 @@ var ts; } } switch (location_1.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -15007,7 +15472,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230 /* ExportSpecifier */)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) { if (!useOnlyExternalAliasing || // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { @@ -15044,7 +15509,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -15117,8 +15582,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 218 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return (declaration.kind === 220 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || + (declaration.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15158,8 +15623,8 @@ var ts; // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 166 /* PropertyAccessExpression */ || - entityName.parent.kind === 221 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 168 /* PropertyAccessExpression */ || + entityName.parent.kind === 223 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -15193,9 +15658,9 @@ var ts; ts.releaseStringWriter(writer); return result; } - function signatureToString(signature, enclosingDeclaration, flags) { + function signatureToString(signature, enclosingDeclaration, flags, kind) { var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); var result = writer.string(); ts.releaseStringWriter(writer); return result; @@ -15217,7 +15682,7 @@ var ts; while (node.kind === 160 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -15231,10 +15696,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return "(Anonymous class)"; - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -15322,10 +15787,16 @@ var ts; function writeType(type, flags) { // Write undefined/null type as any if (type.flags & 16777343 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); + if (type.flags & 134217728 /* PredicateType */) { + buildTypePredicateDisplay(writer, type.predicate); + buildTypeDisplay(type.predicate.type, writer, enclosingDeclaration, flags, symbolStack); + } + else { + // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) + ? "any" + : type.intrinsicName); + } } else if (type.flags & 33554432 /* ThisType */) { if (inObjectTypeLiteral) { @@ -15381,11 +15852,13 @@ var ts; } if (pos < end) { writePunctuation(writer, 25 /* LessThanToken */); - writeType(typeArguments[pos++], 0 /* None */); + writeType(typeArguments[pos], 0 /* None */); + pos++; while (pos < end) { writePunctuation(writer, 24 /* CommaToken */); writeSpace(writer); - writeType(typeArguments[pos++], 0 /* None */); + writeType(typeArguments[pos], 0 /* None */); + pos++; } writePunctuation(writer, 27 /* GreaterThanToken */); } @@ -15481,7 +15954,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 248 /* SourceFile */ || declaration.parent.kind === 219 /* ModuleBlock */; + return declaration.parent.kind === 250 /* SourceFile */ || declaration.parent.kind === 221 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -15517,7 +15990,7 @@ var ts; if (flags & 64 /* InElementType */) { writePunctuation(writer, 17 /* OpenParenToken */); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (flags & 64 /* InElementType */) { writePunctuation(writer, 18 /* CloseParenToken */); } @@ -15529,7 +16002,7 @@ var ts; } writeKeyword(writer, 92 /* NewKeyword */); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (flags & 64 /* InElementType */) { writePunctuation(writer, 18 /* CloseParenToken */); } @@ -15543,15 +16016,13 @@ var ts; writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 92 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } @@ -15594,7 +16065,7 @@ var ts; if (p.flags & 536870912 /* Optional */) { writePunctuation(writer, 53 /* QuestionToken */); } - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } @@ -15682,6 +16153,17 @@ var ts; } writePunctuation(writer, 18 /* CloseParenToken */); } + function buildTypePredicateDisplay(writer, predicate) { + if (ts.isIdentifierTypePredicate(predicate)) { + writer.writeParameter(predicate.parameterName); + } + else { + writeKeyword(writer, 97 /* ThisKeyword */); + } + writeSpace(writer); + writeKeyword(writer, 124 /* IsKeyword */); + writeSpace(writer); + } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); @@ -15691,20 +16173,14 @@ var ts; writePunctuation(writer, 54 /* ColonToken */); } writeSpace(writer); - var returnType; - if (signature.typePredicate) { - writer.writeParameter(signature.typePredicate.parameterName); - writeSpace(writer); - writeKeyword(writer, 124 /* IsKeyword */); - writeSpace(writer); - returnType = signature.typePredicate.type; - } - else { - returnType = getReturnTypeOfSignature(signature); - } + var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { + if (kind === 1 /* Construct */) { + writeKeyword(writer, 92 /* NewKeyword */); + writeSpace(writer); + } if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { // Instantiated signature, write type arguments instead // This is achieved by passing in the mapper separately @@ -15729,82 +16205,36 @@ var ts; }); } function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 218 /* ModuleDeclaration */) { - if (node.name.kind === 9 /* StringLiteral */) { - return node; - } - } - else if (node.kind === 248 /* SourceFile */) { - return ts.isExternalOrCommonJsModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - // Get source File and see if it is external module and has export assigned symbol - var externalModule = getContainingExternalModule(node); - var exportAssignmentSymbol; - var resolvedExportSymbol; - if (externalModule) { - // This is export assigned symbol node - var externalModuleSymbol = getSymbolOfNode(externalModule); - exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - // if symbolOfNode is alias declaration, resolve the symbol declaration and check - if (symbolOfNode.flags & 8388608 /* Alias */) { - return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); - } - } - // Check if the symbol is used in export assignment - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608 /* Alias */)) { - // if export assigned symbol is alias declaration, resolve the alias - resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - // Container of resolvedExportSymbol is visible - return ts.forEach(resolvedExportSymbol.declarations, function (current) { - while (current) { - if (current === node) { - return true; - } - current = current.parent; - } - }); - } + if (node) { + var links = getNodeLinks(node); + if (links.isVisible === undefined) { + links.isVisible = !!determineIfDeclarationIsVisible(); } + return links.isVisible; } + return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 163 /* BindingElement */: + case 165 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // Otherwise fall through - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 213 /* FunctionDeclaration */: - case 217 /* EnumDeclaration */: - case 221 /* ImportEqualsDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 219 /* EnumDeclaration */: + case 223 /* ImportEqualsDeclaration */: var parent_4 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 2 /* Export */) && - !(node.kind !== 221 /* ImportEqualsDeclaration */ && parent_4.kind !== 248 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 223 /* ImportEqualsDeclaration */ && parent_4.kind !== 250 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible @@ -15825,7 +16255,7 @@ var ts; case 147 /* CallSignature */: case 149 /* IndexSignature */: case 138 /* Parameter */: - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: case 152 /* FunctionType */: case 153 /* ConstructorType */: case 155 /* TypeLiteral */: @@ -15838,36 +16268,29 @@ var ts; return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: return false; // Type parameters are always visible case 137 /* TypeParameter */: // Source file is always visible - case 248 /* SourceFile */: + case 250 /* SourceFile */: return true; // Export assignments do not create name bindings outside the module - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 227 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 229 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 230 /* ExportSpecifier */) { + else if (node.parent.kind === 232 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -15917,7 +16340,7 @@ var ts; return false; } resolutionTargets.push(target); - resolutionResults.push(true); + resolutionResults.push(/*items*/ true); resolutionPropertyNames.push(propertyName); return true; } @@ -15959,7 +16382,7 @@ var ts; node = ts.getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 211 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 213 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -16018,7 +16441,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 161 /* ObjectBindingPattern */) { + if (pattern.kind === 163 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { @@ -16067,10 +16490,10 @@ var ts; // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { // A variable declared in a for..in statement is always of type any - if (declaration.parent.parent.kind === 200 /* ForInStatement */) { + if (declaration.parent.parent.kind === 202 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 201 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 203 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -16104,7 +16527,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 246 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 248 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -16160,7 +16583,7 @@ var ts; return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - var elementTypes = ts.map(elements, function (e) { return e.kind === 187 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 189 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -16176,7 +16599,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 161 /* ObjectBindingPattern */ + return pattern.kind === 163 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -16198,7 +16621,13 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - return declaration.kind !== 245 /* PropertyAssignment */ ? getWidenedType(type) : type; + if (declaration.kind === 247 /* PropertyAssignment */) { + return type; + } + if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 141 /* PropertyDeclaration */ || declaration.kind === 140 /* PropertySignature */)) { + return type; + } + return getWidenedType(type); } // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; @@ -16220,20 +16649,24 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 244 /* CatchClause */) { + if (declaration.parent.kind === 246 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 227 /* ExportAssignment */) { + if (declaration.kind === 229 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle module.exports = expr - if (declaration.kind === 181 /* BinaryExpression */) { + if (declaration.kind === 183 /* BinaryExpression */) { return links.type = checkExpression(declaration.right); } - // Handle exports.p = expr - if (declaration.kind === 166 /* PropertyAccessExpression */) { - return checkExpressionCached(declaration.parent.right); + if (declaration.kind === 168 /* PropertyAccessExpression */) { + // Declarations only exist for property access expressions for certain + // special assignment kinds + if (declaration.parent.kind === 183 /* BinaryExpression */) { + // Handle exports.p = expr or this.p = expr or className.prototype.method = expr + return links.type = checkExpressionCached(declaration.parent.right); + } } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { @@ -16406,9 +16839,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 214 /* ClassDeclaration */ || node.kind === 186 /* ClassExpression */ || - node.kind === 213 /* FunctionDeclaration */ || node.kind === 173 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || node.kind === 174 /* ArrowFunction */) { + if (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */ || + node.kind === 215 /* FunctionDeclaration */ || node.kind === 175 /* FunctionExpression */ || + node.kind === 143 /* MethodDeclaration */ || node.kind === 176 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -16418,7 +16851,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 215 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -16427,8 +16860,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 214 /* ClassDeclaration */ || - node.kind === 186 /* ClassExpression */ || node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 216 /* ClassDeclaration */ || + node.kind === 188 /* ClassExpression */ || node.kind === 218 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -16492,9 +16925,6 @@ var ts; } return type.resolvedBaseConstructorType; } - function hasClassBaseType(type) { - return !!ts.forEach(getBaseTypes(type), function (t) { return !!(t.symbol.flags & 32 /* Class */); }); - } function getBaseTypes(type) { var isClass = type.symbol.flags & 32 /* Class */; var isInterface = type.symbol.flags & 64 /* Interface */; @@ -16571,7 +17001,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 217 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -16603,7 +17033,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 /* InterfaceDeclaration */) { + if (declaration.kind === 217 /* InterfaceDeclaration */) { if (declaration.flags & 262144 /* ContainsThis */) { return false; } @@ -16659,7 +17089,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 216 /* TypeAliasDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 218 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -16748,7 +17178,7 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: return true; case 156 /* ArrayType */: return isIndependentType(node.elementType); @@ -16824,14 +17254,6 @@ var ts; } } } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { - var signature = baseSignatures_1[_i]; - signatures.push(signature); - } - } - } function resolveDeclaredMembers(type) { if (!type.declaredProperties) { var symbol = type.symbol; @@ -16892,33 +17314,32 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasStringLiterals) { + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasStringLiterals = hasStringLiterals; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (!hasClassBaseType(classType)) { - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); + if (baseSignatures.length === 0) { + return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false)]; + } var baseTypeNode = getBaseTypeNodeOfClass(classType); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); var typeArgCount = typeArguments ? typeArguments.length : 0; var result = []; - for (var _i = 0, baseSignatures_2 = baseSignatures; _i < baseSignatures_2.length; _i++) { - var baseSig = baseSignatures_2[_i]; + for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { + var baseSig = baseSignatures_1[_i]; var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; if (typeParamCount === typeArgCount) { var sig = typeParamCount ? getSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); @@ -16949,7 +17370,7 @@ var ts; function findMatchingSignature(signatureList, signature, partialMatch, ignoreReturnTypes) { for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) { var s = signatureList_1[_i]; - if (compareSignatures(s, signature, partialMatch, ignoreReturnTypes, compareTypes)) { + if (compareSignaturesIdentical(s, signature, partialMatch, ignoreReturnTypes, compareTypesIdentical)) { return s; } } @@ -17052,36 +17473,29 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - var members; - var callSignatures; - var constructSignatures; - var stringIndexType; - var numberIndexType; if (type.target) { - members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false); - callSignatures = instantiateList(getSignaturesOfType(type.target, 0 /* Call */), type.mapper, instantiateSignature); - constructSignatures = instantiateList(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper, instantiateSignature); - stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0 /* String */), type.mapper); - numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1 /* Number */), type.mapper); + var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false); + var callSignatures = instantiateList(getSignaturesOfType(type.target, 0 /* Call */), type.mapper, instantiateSignature); + var constructSignatures = instantiateList(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper, instantiateSignature); + var stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0 /* String */), type.mapper); + var numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1 /* Number */), type.mapper); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else if (symbol.flags & 2048 /* TypeLiteral */) { - members = symbol.members; - callSignatures = getSignaturesOfSymbol(members["__call"]); - constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else { // Combinations of function, class, enum and module - members = emptySymbols; - callSignatures = emptyArray; - constructSignatures = emptyArray; + var members = emptySymbols; + var constructSignatures = emptyArray; if (symbol.flags & 1952 /* HasExports */) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); - } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); @@ -17094,10 +17508,16 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); } } - stringIndexType = undefined; - numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + setObjectTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexType); + // We resolve the members before computing the signatures because a signature may use + // typeof with a qualified name expression that circularly references the type we are + // in the process of resolving (see issue #6072). The temporarily empty signature list + // will never be observed because a qualified name can't reference signatures. + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { + type.callSignatures = getSignaturesOfSymbol(symbol); + } } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -17122,15 +17542,15 @@ var ts; } return type; } - // Return properties of an object type or an empty array for other types + /** Return properties of an object type or an empty array for other types */ function getPropertiesOfObjectType(type) { if (type.flags & 80896 /* ObjectType */) { return resolveStructuredTypeMembers(type).properties; } return emptyArray; } - // If the given type is an object type and that type has a property by the given name, - // return the symbol for that property.Otherwise return undefined. + /** If the given type is an object type and that type has a property by the given name, + * return the symbol for that property. Otherwise return undefined. */ function getPropertyOfObjectType(type, name) { if (type.flags & 80896 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); @@ -17201,12 +17621,15 @@ var ts; function createUnionOrIntersectionProperty(containingType, name) { var types = containingType.types; var props; + // Flags we want to propagate to the result if they exist in all source symbols + var commonFlags = (containingType.flags & 32768 /* Intersection */) ? 536870912 /* Optional */ : 0 /* None */; for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { var current = types_2[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (prop && !(getDeclarationFlagsFromSymbol(prop) & (16 /* Private */ | 32 /* Protected */))) { + commonFlags &= prop.flags; if (!props) { props = [prop]; } @@ -17235,7 +17658,10 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* SyntheticProperty */, name); + var result = createSymbol(4 /* Property */ | + 67108864 /* Transient */ | + 268435456 /* SyntheticProperty */ | + commonFlags, name); result.containingType = containingType; result.declarations = declarations; result.type = containingType.flags & 16384 /* Union */ ? getUnionType(propTypes) : getIntersectionType(propTypes); @@ -17292,22 +17718,6 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfStructuredType(getApparentType(type), kind); } - function typeHasConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & (80896 /* ObjectType */ | 16384 /* Union */)) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.constructSignatures.length > 0; - } - return false; - } - function typeHasCallOrConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & 130048 /* StructuredType */) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.callSignatures.length > 0 || resolved.constructSignatures.length > 0; - } - return false; - } function getIndexTypeOfStructuredType(type, kind) { if (type.flags & 130048 /* StructuredType */) { var resolved = resolveStructuredTypeMembers(type); @@ -17353,6 +17763,23 @@ var ts; } return false; } + function createTypePredicateFromTypePredicateNode(node) { + if (node.parameterName.kind === 69 /* Identifier */) { + var parameterName = node.parameterName; + return { + kind: 1 /* Identifier */, + parameterName: parameterName ? parameterName.text : undefined, + parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, + type: getTypeFromTypeNode(node.type) + }; + } + else { + return { + kind: 0 /* This */, + type: getTypeFromTypeNode(node.type) + }; + } + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -17366,8 +17793,14 @@ var ts; var minArgumentCount = -1; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 9 /* StringLiteral */) { + var paramSymbol = param.symbol; + // Include parameter symbol instead of property symbol in the signature + if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !ts.isBindingPattern(param.name)) { + var resolvedSymbol = resolveName(param, paramSymbol.name, 107455 /* Value */, undefined, undefined); + paramSymbol = resolvedSymbol; + } + parameters.push(paramSymbol); + if (param.type && param.type.kind === 162 /* StringLiteralType */) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -17384,20 +17817,11 @@ var ts; minArgumentCount = declaration.parameters.length; } var returnType; - var typePredicate; if (classType) { returnType = classType; } else if (declaration.type) { returnType = getTypeFromTypeNode(declaration.type); - if (declaration.type.kind === 150 /* TypePredicate */) { - var typePredicateNode = declaration.type; - typePredicate = { - parameterName: typePredicateNode.parameterName ? typePredicateNode.parameterName.text : undefined, - parameterIndex: typePredicateNode.parameterName ? getTypePredicateParameterIndex(declaration.parameters, typePredicateNode.parameterName) : undefined, - type: getTypeFromTypeNode(typePredicateNode.type) - }; - } } else { // TypeScript 1.0 spec (April 2014): @@ -17410,7 +17834,7 @@ var ts; returnType = anyType; } } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); } return links.resolvedSignature; } @@ -17423,7 +17847,7 @@ var ts; switch (node.kind) { case 152 /* FunctionType */: case 153 /* ConstructorType */: - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 144 /* Constructor */: @@ -17432,8 +17856,8 @@ var ts; case 149 /* IndexSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -17499,7 +17923,7 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); } function getErasedSignature(signature) { if (!signature.typeParameters) @@ -17509,7 +17933,7 @@ var ts; signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); } else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), /*eraseTypeParameters*/ true); } } return signature.erasedSignatureCache; @@ -17556,17 +17980,38 @@ var ts; ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + function getConstraintDeclaration(type) { + return ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint; + } + function hasConstraintReferenceTo(type, target) { + var checked; + while (type && type.flags & 512 /* TypeParameter */ && !ts.contains(checked, type)) { + if (type === target) { + return true; + } + (checked || (checked = [])).push(type); + var constraintDeclaration = getConstraintDeclaration(type); + type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); + } + return false; + } + function getConstraintOfTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint); + var constraintDeclaration = getConstraintDeclaration(typeParameter); + var constraint = getTypeFromTypeNode(constraintDeclaration); + if (hasConstraintReferenceTo(constraint, typeParameter)) { + error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + constraint = unknownType; + } + typeParameter.constraint = constraint; } } - return type.constraint === noConstraintType ? undefined : type.constraint; + return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137 /* TypeParameter */).parent); @@ -17614,50 +18059,6 @@ var ts; } return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - // bubble up to the declaration - var currentNode = typeReferenceNode; - // forEach === exists - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 137 /* TypeParameter */; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 151 /* TypeReference */ && n.typeName.kind === 69 /* Identifier */) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // symbol.declaration.parent === typeParameter.parent - // -> typeParameter and symbol.declaration originate from the same type parameter list - // -> illegal for all declarations in symbol - // forEach === exists - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent === typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); @@ -17702,13 +18103,6 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) function getTypeFromNonGenericTypeReference(node, symbol) { - if (symbol.flags & 262144 /* TypeParameter */ && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - return unknownType; - } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -17751,9 +18145,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: return declaration; } } @@ -17785,10 +18179,6 @@ var ts; if (arity === void 0) { arity = 0; } return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); } - function tryGetGlobalType(name, arity) { - if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalSymbol(name, 793056 /* Type */, /*diagnostic*/ undefined), arity); - } /** * Returns a type that is inside a namespace at the global scope, e.g. * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type @@ -17908,7 +18298,7 @@ var ts; // a named type that circularly references itself. function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { - return emptyObjectType; + return emptyUnionType; } var typeSet = []; addTypesToSet(typeSet, types, 16384 /* Union */); @@ -17980,8 +18370,7 @@ var ts; } return links.resolvedType; } - function getStringLiteralType(node) { - var text = node.text; + function getStringLiteralTypeForText(text) { if (ts.hasProperty(stringLiteralTypes, text)) { return stringLiteralTypes[text]; } @@ -17989,17 +18378,17 @@ var ts; type.text = text; return type; } - function getTypeFromStringLiteral(node) { + function getTypeFromStringLiteralTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); + links.resolvedType = getStringLiteralTypeForText(node.text); } return links.resolvedType; } function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 215 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 217 /* InterfaceDeclaration */)) { if (!(container.flags & 64 /* Static */) && (container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -18015,6 +18404,22 @@ var ts; } return links.resolvedType; } + function getPredicateType(node) { + return createPredicateType(getSymbolOfNode(node), createTypePredicateFromTypePredicateNode(node)); + } + function createPredicateType(symbol, predicate) { + var type = createType(8 /* Boolean */ | 134217728 /* PredicateType */); + type.symbol = symbol; + type.predicate = predicate; + return type; + } + function getTypeFromPredicateTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getPredicateType(node); + } + return links.resolvedType; + } function getTypeFromTypeNode(node) { switch (node.kind) { case 117 /* AnyKeyword */: @@ -18029,15 +18434,15 @@ var ts; return esSymbolType; case 103 /* VoidKeyword */: return voidType; - case 97 /* ThisKeyword */: + case 161 /* ThisType */: return getTypeFromThisTypeNode(node); - case 9 /* StringLiteral */: - return getTypeFromStringLiteral(node); + case 162 /* StringLiteralType */: + return getTypeFromStringLiteralTypeNode(node); case 151 /* TypeReference */: return getTypeFromTypeReference(node); case 150 /* TypePredicate */: - return booleanType; - case 188 /* ExpressionWithTypeArguments */: + return getTypeFromPredicateTypeNode(node); + case 190 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); case 154 /* TypeQuery */: return getTypeFromTypeQueryNode(node); @@ -18117,18 +18522,22 @@ var ts; return t; }; } - function createInferenceMapper(context) { - var mapper = function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); + function getInferenceMapper(context) { + if (!context.mapper) { + var mapper = function (t) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + context.inferences[i].isFixed = true; + return getInferredType(context, i); + } } - } - return t; - }; - mapper.context = context; - return mapper; + return t; + }; + mapper.context = context; + context.mapper = mapper; + } + return context.mapper; } function identityMapper(type) { return type; @@ -18136,33 +18545,42 @@ var ts; function combineTypeMappers(mapper1, mapper2) { return function (t) { return instantiateType(mapper1(t), mapper2); }; } - function instantiateTypeParameter(typeParameter, mapper) { + function cloneTypeParameter(typeParameter) { var result = createType(512 /* TypeParameter */); result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); + result.target = typeParameter; + return result; + } + function cloneTypePredicate(predicate, mapper) { + if (ts.isIdentifierTypePredicate(predicate)) { + return { + kind: 1 /* Identifier */, + parameterName: predicate.parameterName, + parameterIndex: predicate.parameterIndex, + type: instantiateType(predicate.type, mapper) + }; } else { - result.target = typeParameter; - result.mapper = mapper; + return { + kind: 0 /* This */, + type: instantiateType(predicate.type, mapper) + }; } - return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + // First create a fresh set of type parameters, then include a mapping from the old to the + // new type parameters in the mapper function. Finally store this mapper in the new type + // parameters such that we can use it when instantiating constraints. + freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) { + var tp = freshTypeParameters_1[_i]; + tp.mapper = mapper; + } } - if (signature.typePredicate) { - freshTypePredicate = { - parameterName: signature.typePredicate.parameterName, - parameterIndex: signature.typePredicate.parameterIndex, - type: instantiateType(signature.typePredicate.type, mapper) - }; - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); result.target = signature; result.mapper = mapper; return result; @@ -18226,6 +18644,10 @@ var ts; if (type.flags & 32768 /* Intersection */) { return getIntersectionType(instantiateList(type.types, mapper, instantiateType)); } + if (type.flags & 134217728 /* PredicateType */) { + var predicate = type.predicate; + return createPredicateType(type.symbol, cloneTypePredicate(predicate, mapper)); + } } return type; } @@ -18234,25 +18656,25 @@ var ts; function isContextSensitive(node) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return node.operatorToken.kind === 52 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return isContextSensitive(node.initializer); case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -18278,7 +18700,7 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); } - function compareTypes(source, target) { + function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { @@ -18293,10 +18715,84 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined); + /** + * See signatureRelatedTo, compareSignaturesIdentical + */ + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + // TODO (drosen): De-duplicate code between related functions. + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N + source = getErasedSignature(source); + target = getErasedSignature(target); + var sourceMax = getNumNonRestParameters(source); + var targetMax = getNumNonRestParameters(target); + var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + if (!related) { + return false; + } + } + if (!ignoreReturnTypes) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return true; + } + var sourceReturnType = getReturnTypeOfSignature(source); + // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions + if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { + if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { + return false; + } + } + return isTypeAssignableTo(sourceReturnType, targetReturnType); + } + return true; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + var erasedSource = getErasedSignature(implementation); + var erasedTarget = getErasedSignature(overload); + // First see if the return types are compatible in either direction. + var sourceReturnType = getReturnTypeOfSignature(erasedSource); + var targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType + || checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined) + || checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)) { + return isSignatureAssignableTo(erasedSource, erasedTarget, /*ignoreReturnTypes*/ true); + } + return false; + } + function getNumNonRestParameters(signature) { + var numParams = signature.parameters.length; + return signature.hasRestParameter ? + numParams - 1 : + numParams; + } + function getNumParametersToCheckForSignatureRelatability(source, sourceNonRestParamCount, target, targetNonRestParamCount) { + if (source.hasRestParameter === target.hasRestParameter) { + if (source.hasRestParameter) { + // If both have rest parameters, get the max and add 1 to + // compensate for the rest parameter. + return Math.max(sourceNonRestParamCount, targetNonRestParamCount) + 1; + } + else { + return Math.min(sourceNonRestParamCount, targetNonRestParamCount); + } + } + else { + // Return the count for whichever signature doesn't have rest parameters. + return source.hasRestParameter ? + targetNonRestParamCount : + sourceNonRestParamCount; + } } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). @@ -18370,6 +18866,11 @@ var ts; return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) return -1 /* True */; + if (source.flags & 128 /* Enum */ && target.flags & 128 /* Enum */) { + if (result = enumRelatedTo(source, target)) { + return result; + } + } if (source.flags & 256 /* StringLiteral */ && target === stringType) return -1 /* True */; if (relation === assignableRelation) { @@ -18378,6 +18879,36 @@ var ts; if (source === numberType && target.flags & 128 /* Enum */) return -1 /* True */; } + if (source.flags & 8 /* Boolean */ && target.flags & 8 /* Boolean */) { + if (source.flags & 134217728 /* PredicateType */ && target.flags & 134217728 /* PredicateType */) { + var sourcePredicate = source; + var targetPredicate = target; + if (sourcePredicate.predicate.kind !== targetPredicate.predicate.kind) { + if (reportErrors) { + reportError(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + if (sourcePredicate.predicate.kind === 1 /* Identifier */) { + var sourceIdentifierPredicate = sourcePredicate.predicate; + var targetIdentifierPredicate = targetPredicate.predicate; + if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + if (reportErrors) { + reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + } + var related = isRelatedTo(sourcePredicate.predicate.type, targetPredicate.predicate.type, reportErrors, headMessage); + if (related === 0 /* False */ && reportErrors) { + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return related; + } + return -1 /* True */; + } if (source.flags & 1048576 /* FreshObjectLiteral */) { if (hasExcessProperties(source, target, reportErrors)) { if (reportErrors) { @@ -18471,9 +19002,6 @@ var ts; } return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - return typeParameterIdenticalTo(source, target); - } if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */ || source.flags & 32768 /* Intersection */ && target.flags & 32768 /* Intersection */) { if (result = eachTypeRelatedToSomeType(source, target)) { @@ -18529,7 +19057,7 @@ var ts; var sourceTypes = source.types; for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) { var sourceType = sourceTypes_1[_i]; - var related = typeRelatedToSomeType(sourceType, target, false); + var related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false); if (!related) { return 0 /* False */; } @@ -18589,8 +19117,9 @@ var ts; if (sources.length !== targets.length && relation === identityRelation) { return 0 /* False */; } + var length = sources.length <= targets.length ? sources.length : targets.length; var result = -1 /* True */; - for (var i = 0; i < targets.length; i++) { + for (var i = 0; i < length; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0 /* False */; @@ -18599,31 +19128,24 @@ var ts; } return result; } - function typeParameterIdenticalTo(source, target) { - // covers case when both type parameters does not have constraint (both equal to noConstraintType) - if (source.constraint === target.constraint) { - return -1 /* True */; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0 /* False */; - } - return isIdenticalTo(source.constraint, target.constraint); - } // Determine if two object types are related by structure. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(apparentSource, originalSource, target, reportErrors) { + function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0 /* False */; } - var id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id; + var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - // If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate - // errors, we can use the cached value. Otherwise, recompute the relation - if (!elaborateErrors || (related === 3 /* FailedAndReported */)) { + if (elaborateErrors && related === 2 /* Failed */) { + // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported + // failure and continue computing the relation such that errors get reported. + relation[id] = 3 /* FailedAndReported */; + } + else { return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } @@ -18645,13 +19167,13 @@ var ts; maybeStack = []; expandingFlags = 0; } - sourceStack[depth] = apparentSource; + sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; maybeStack[depth][id] = 1 /* Succeeded */; depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2; @@ -18660,15 +19182,15 @@ var ts; result = 1 /* Maybe */; } else { - result = propertiesRelatedTo(apparentSource, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 0 /* Call */, reportErrors); + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 1 /* Construct */, reportErrors); + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); if (result) { - result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= stringIndexTypesRelatedTo(source, originalSource, target, reportErrors); if (result) { - result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= numberIndexTypesRelatedTo(source, originalSource, target, reportErrors); } } } @@ -18800,75 +19322,51 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length && + isAbstractConstructorType(source) && !isAbstractConstructorType(target)) { + // An abstract constructor type is not assignable to a non-abstract constructor type + // as it would otherwise be possible to new an abstract class. Note that the assignablity + // check we perform for an extends clause excludes construct signatures from the target, + // so this check never proceeds. + if (reportErrors) { + reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0 /* False */; + } var result = -1 /* True */; var saveErrorInfo = errorInfo; - if (kind === 1 /* Construct */) { - // Only want to compare the construct signatures for abstractness guarantees. - // Because the "abstractness" of a class is the same across all construct signatures - // (internally we are checking the corresponding declaration), it is enough to perform - // the check and report an error once over all pairs of source and target construct signatures. - // - // sourceSig and targetSig are (possibly) undefined. - // - // Note that in an extends-clause, targetSignatures is stripped, so the check never proceeds. - var sourceSig = sourceSignatures[0]; - var targetSig = targetSignatures[0]; - result &= abstractSignatureRelatedTo(source, sourceSig, target, targetSig); - if (result !== -1 /* True */) { - return result; - } - } outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; if (!t.hasStringLiterals || target.flags & 262144 /* FromSignature */) { - var localErrors = reportErrors; - var checkedAbstractAssignability = false; + // Only elaborate errors from the first failure + var shouldElaborateErrors = reportErrors; for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { var s = sourceSignatures_1[_a]; if (!s.hasStringLiterals || source.flags & 262144 /* FromSignature */) { - var related = signatureRelatedTo(s, t, localErrors); + var related = signatureRelatedTo(s, t, shouldElaborateErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } - // Only report errors from the first failure - localErrors = false; + shouldElaborateErrors = false; } } + // don't elaborate the primitive apparent types (like Number) + // because the actual primitives will have already been reported. + if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); + } return 0 /* False */; } } return result; - function abstractSignatureRelatedTo(source, sourceSig, target, targetSig) { - if (sourceSig && targetSig) { - var sourceDecl = source.symbol && getClassLikeDeclarationOfSymbol(source.symbol); - var targetDecl = target.symbol && getClassLikeDeclarationOfSymbol(target.symbol); - if (!sourceDecl) { - // If the source object isn't itself a class declaration, it can be freely assigned, regardless - // of whether the constructed object is abstract or not. - return -1 /* True */; - } - var sourceErasedSignature = getErasedSignature(sourceSig); - var targetErasedSignature = getErasedSignature(targetSig); - var sourceReturnType = sourceErasedSignature && getReturnTypeOfSignature(sourceErasedSignature); - var targetReturnType = targetErasedSignature && getReturnTypeOfSignature(targetErasedSignature); - var sourceReturnDecl = sourceReturnType && sourceReturnType.symbol && getClassLikeDeclarationOfSymbol(sourceReturnType.symbol); - var targetReturnDecl = targetReturnType && targetReturnType.symbol && getClassLikeDeclarationOfSymbol(targetReturnType.symbol); - var sourceIsAbstract = sourceReturnDecl && sourceReturnDecl.flags & 128 /* Abstract */; - var targetIsAbstract = targetReturnDecl && targetReturnDecl.flags & 128 /* Abstract */; - if (sourceIsAbstract && !(targetIsAbstract && targetDecl)) { - // if target isn't a class-declaration type, then it can be new'd, so we forbid the assignment. - if (reportErrors) { - reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); - } - return 0 /* False */; - } - } - return -1 /* True */; - } } + /** + * See signatureAssignableTo, signatureAssignableTo + */ function signatureRelatedTo(source, target, reportErrors) { + // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; } @@ -18905,7 +19403,7 @@ var ts; var saveErrorInfo = errorInfo; var related = isRelatedTo(s, t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(t, s, /*reportErrors*/ false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -18916,37 +19414,20 @@ var ts; } result &= related; } - if (source.typePredicate && target.typePredicate) { - var hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex; - var hasDifferentTypes; - if (hasDifferentParameterIndex || - (hasDifferentTypes = !isTypeIdenticalTo(source.typePredicate.type, target.typePredicate.type))) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return result; + } + var sourceReturnType = getReturnTypeOfSignature(source); + // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions + if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { + if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { if (reportErrors) { - var sourceParamText = source.typePredicate.parameterName; - var targetParamText = target.typePredicate.parameterName; - var sourceTypeText = typeToString(source.typePredicate.type); - var targetTypeText = typeToString(target.typePredicate.type); - if (hasDifferentParameterIndex) { - reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceParamText, targetParamText); - } - else if (hasDifferentTypes) { - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, sourceTypeText, targetTypeText); - } - reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, sourceParamText + " is " + sourceTypeText, targetParamText + " is " + targetTypeText); + reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); } return 0 /* False */; } } - else if (!source.typePredicate && target.typePredicate) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) - return result; - var sourceReturnType = getReturnTypeOfSignature(source); return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); } function signaturesIdenticalTo(source, target, kind) { @@ -18956,8 +19437,8 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - var related = compareSignatures(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); + for (var i = 0, len = sourceSignatures.length; i < len; i++) { + var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return 0 /* False */; } @@ -19016,7 +19497,7 @@ var ts; var related; if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); @@ -19042,6 +19523,38 @@ var ts; } return 0 /* False */; } + function enumRelatedTo(source, target) { + if (source.symbol.name !== target.symbol.name || + source.symbol.flags & 128 /* ConstEnum */ || + target.symbol.flags & 128 /* ConstEnum */) { + return 0 /* False */; + } + var targetEnumType = getTypeOfSymbol(target.symbol); + for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { + var property = _a[_i]; + if (property.flags & 8 /* EnumMember */) { + var targetProperty = getPropertyOfType(targetEnumType, property.name); + if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); + return 0 /* False */; + } + } + } + return -1 /* True */; + } + } + // Return true if the given type is the constructor type for an abstract class + function isAbstractConstructorType(type) { + if (type.flags & 65536 /* Anonymous */) { + var symbol = type.symbol; + if (symbol && symbol.flags & 32 /* Class */) { + var declaration = getClassLikeDeclarationOfSymbol(symbol); + if (declaration && declaration.flags & 128 /* Abstract */) { + return true; + } + } + } + return false; } // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, @@ -19065,7 +19578,7 @@ var ts; return false; } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; } function compareProperties(sourceProp, targetProp, compareTypes) { // Two members are considered identical when @@ -19108,33 +19621,30 @@ var ts; } return false; } - function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + /** + * See signatureRelatedTo, compareSignaturesIdentical + */ + function compareSignaturesIdentical(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; } if (!(isMatchingSignature(source, target, partialMatch))) { return 0 /* False */; } - var result = -1 /* True */; - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return 0 /* False */; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); - if (!related) { - return 0 /* False */; - } - result &= related; - } - } - else if (source.typeParameters || target.typeParameters) { + // Check that the two signatures have the same number of type parameters. We might consider + // also checking that any type parameter constraints match, but that would require instantiating + // the constraints with a common set of type arguments to get relatable entities in places where + // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile, + // particularly as we're comparing erased versions of the signatures below. + if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; var targetLen = target.parameters.length; for (var i = 0; i < targetLen; i++) { var s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); @@ -19262,10 +19772,13 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 6291456 /* RequiresWidening */) { + if (type.flags & 140509184 /* RequiresWidening */) { if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } + if (type.flags & 134217728 /* PredicateType */) { + return booleanType; + } if (type.flags & 524288 /* ObjectLiteral */) { return getWidenedTypeOfObjectLiteral(type); } @@ -19340,13 +19853,13 @@ var ts; ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -19393,13 +19906,7 @@ var ts; } } function createInferenceContext(typeParameters, inferUnionTypes) { - var inferences = []; - for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { - var unused = typeParameters_1[_i]; - inferences.push({ - primary: undefined, secondary: undefined, isFixed: false - }); - } + var inferences = ts.map(typeParameters, createTypeInferencesObject); return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -19407,6 +19914,13 @@ var ts; inferredTypes: new Array(typeParameters.length) }; } + function createTypeInferencesObject() { + return { + primary: undefined, + secondary: undefined, + isFixed: false + }; + } function inferTypes(context, source, target) { var sourceStack; var targetStack; @@ -19422,6 +19936,29 @@ var ts; return false; } function inferFromTypes(source, target) { + if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */ || + source.flags & 32768 /* Intersection */ && target.flags & 32768 /* Intersection */) { + // Source and target are both unions or both intersections. First, find each + // target constituent type that has an identically matching source constituent + // type, and for each such target constituent type infer from the type to itself. + // When inferring from a type to itself we effectively find all type parameter + // occurrences within that type and infer themselves as their type arguments. + var matchingTypes; + for (var _i = 0, _a = target.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (typeIdenticalToSomeType(t, source.types)) { + (matchingTypes || (matchingTypes = [])).push(t); + inferFromTypes(t, t); + } + } + // Next, to improve the quality of inferences, reduce the source and target types by + // removing the identically matched constituents. For example, when inferring from + // 'string | string[]' to 'string | T' we reduce the types to 'string[]' and 'T'. + if (matchingTypes) { + source = removeTypesFromUnionOrIntersection(source, matchingTypes); + target = removeTypesFromUnionOrIntersection(target, matchingTypes); + } + } if (target.flags & 512 /* TypeParameter */) { // If target is a type parameter, make an inference, unless the source type contains // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions). @@ -19463,6 +20000,11 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } + else if (source.flags & 134217728 /* PredicateType */ && target.flags & 134217728 /* PredicateType */) { + if (source.predicate.kind === target.predicate.kind) { + inferFromTypes(source.predicate.type, target.predicate.type); + } + } else if (source.flags & 8192 /* Tuple */ && target.flags & 8192 /* Tuple */ && source.elementTypes.length === target.elementTypes.length) { // If source and target are tuples of the same size, infer from element types var sourceTypes = source.elementTypes; @@ -19476,8 +20018,8 @@ var ts; var typeParameterCount = 0; var typeParameter; // First infer to each type in union or intersection that isn't a type parameter - for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { - var t = targetTypes_2[_i]; + for (var _b = 0, targetTypes_2 = targetTypes; _b < targetTypes_2.length; _b++) { + var t = targetTypes_2[_b]; if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -19499,16 +20041,18 @@ var ts; else if (source.flags & 49152 /* UnionOrIntersection */) { // Source is a union or intersection type, infer from each consituent type var sourceTypes = source.types; - for (var _a = 0, sourceTypes_3 = sourceTypes; _a < sourceTypes_3.length; _a++) { - var sourceType = sourceTypes_3[_a]; + for (var _c = 0, sourceTypes_3 = sourceTypes; _c < sourceTypes_3.length; _c++) { + var sourceType = sourceTypes_3[_c]; inferFromTypes(sourceType, target); } } else { source = getApparentType(source); - if (source.flags & 80896 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || - (target.flags & 65536 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */))) { - // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members + if (source.flags & 80896 /* ObjectType */ && (target.flags & 4096 /* Reference */ && target.typeArguments || + target.flags & 8192 /* Tuple */ || + target.flags & 65536 /* Anonymous */ && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */))) { + // If source is an object type, and target is a type reference with type arguments, a tuple type, + // the type of a method, or a type literal, infer from members if (isInProcess(source, target)) { return; } @@ -19554,17 +20098,7 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromTypes); - if (source.typePredicate && target.typePredicate) { - if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) { - // Return types from type predicates are treated as booleans. In order to infer types - // from type predicates we would need to infer using the type within the type predicate - // (i.e. 'Foo' from 'x is Foo'). - inferFromTypes(source.typePredicate.type, target.typePredicate.type); - } - } - else { - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } function inferFromIndexTypes(source, target, sourceKind, targetKind) { var targetIndexType = getIndexTypeOfType(target, targetKind); @@ -19576,6 +20110,29 @@ var ts; } } } + function typeIdenticalToSomeType(type, types) { + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; + if (isTypeIdenticalTo(t, type)) { + return true; + } + } + return false; + } + /** + * Return a new union or intersection type computed by removing a given set of types + * from a given union or intersection type. + */ + function removeTypesFromUnionOrIntersection(type, typesToRemove) { + var reducedTypes = []; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (!typeIdenticalToSomeType(t, typesToRemove)) { + reducedTypes.push(t); + } + } + return type.flags & 16384 /* Union */ ? getUnionType(reducedTypes, /*noSubtypeReduction*/ true) : getIntersectionType(reducedTypes); + } function getInferenceCandidates(context, index) { var inferences = context.inferences[index]; return inferences.primary || inferences.secondary || emptyArray; @@ -19599,10 +20156,16 @@ var ts; inferredType = emptyObjectType; inferenceSucceeded = true; } + context.inferredTypes[index] = inferredType; // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + if (constraint) { + var instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); + if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + context.inferredTypes[index] = inferredType = instantiatedConstraint; + } + } } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). @@ -19610,7 +20173,6 @@ var ts; // So if this failure is on preceding type parameter, this type parameter is the new failure index. context.failedTypeParameterIndex = index; } - context.inferredTypes[index] = inferredType; } return inferredType; } @@ -19620,9 +20182,6 @@ var ts; } return context.inferredTypes; } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } // EXPRESSION TYPE CHECKING function getResolvedSymbol(node) { var links = getNodeLinks(node); @@ -19649,26 +20208,6 @@ var ts; } ts.Debug.fail("should not get here"); } - // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) - // or not of the given type kind (when isOfTypeKind is false) - function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384 /* Union */) { - var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - // Above we checked if we have anything to remove, now use the opposite test to do the removal - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types - // are represented ever changes. - return getUnionType(emptyArray); - } - return type; - } function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } @@ -19687,10 +20226,7 @@ var ts; return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 56 /* FirstAssignment */ && node.operatorToken.kind <= 68 /* LastAssignment */) { - var n = node.left; - while (n.kind === 172 /* ParenthesizedExpression */) { - n = n.expression; - } + var n = skipParenthesizedNodes(node.left); if (n.kind === 69 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } @@ -19705,55 +20241,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: - case 172 /* ParenthesizedExpression */: - case 179 /* PrefixUnaryExpression */: - case 175 /* DeleteExpression */: - case 178 /* AwaitExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 180 /* PostfixUnaryExpression */: - case 184 /* YieldExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 192 /* Block */: - case 193 /* VariableStatement */: - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 204 /* ReturnStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - case 235 /* JsxOpeningElement */: - case 240 /* JsxExpression */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: + case 166 /* ArrayLiteralExpression */: + case 167 /* ObjectLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: + case 174 /* ParenthesizedExpression */: + case 181 /* PrefixUnaryExpression */: + case 177 /* DeleteExpression */: + case 180 /* AwaitExpression */: + case 178 /* TypeOfExpression */: + case 179 /* VoidExpression */: + case 182 /* PostfixUnaryExpression */: + case 186 /* YieldExpression */: + case 184 /* ConditionalExpression */: + case 187 /* SpreadElementExpression */: + case 194 /* Block */: + case 195 /* VariableStatement */: + case 197 /* ExpressionStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 206 /* ReturnStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: + case 209 /* LabeledStatement */: + case 210 /* ThrowStatement */: + case 211 /* TryStatement */: + case 246 /* CatchClause */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + case 237 /* JsxOpeningElement */: + case 242 /* JsxExpression */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -19765,59 +20301,73 @@ var ts; // Only narrow when symbol is variable of type any or an object, union, or type parameter type if (node && symbol.flags & 3 /* Variable */) { if (isTypeAny(type) || type.flags & (80896 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { + var declaration = ts.getDeclarationOfKind(symbol, 213 /* VariableDeclaration */); + var top_1 = declaration && getDeclarationContainer(declaration); + var originalType = type; + var nodeStack = []; loop: while (node.parent) { var child = node; node = node.parent; - var narrowedType = type; switch (node.kind) { - case 196 /* IfStatement */: - // In a branch of an if statement, narrow based on controlling expression - if (child !== node.expression) { - narrowedType = narrowType(type, node.expression, /*assumeTrue*/ child === node.thenStatement); - } + case 198 /* IfStatement */: + case 184 /* ConditionalExpression */: + case 183 /* BinaryExpression */: + nodeStack.push({ node: node, child: child }); break; - case 182 /* ConditionalExpression */: - // In a branch of a conditional expression, narrow based on controlling condition - if (child !== node.condition) { - narrowedType = narrowType(type, node.condition, /*assumeTrue*/ child === node.whenTrue); - } - break; - case 181 /* BinaryExpression */: - // In the right operand of an && or ||, narrow based on left operand - if (child === node.right) { - if (node.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { - narrowedType = narrowType(type, node.left, /*assumeTrue*/ true); - } - else if (node.operatorToken.kind === 52 /* BarBarToken */) { - narrowedType = narrowType(type, node.left, /*assumeTrue*/ false); - } - } - break; - case 248 /* SourceFile */: - case 218 /* ModuleDeclaration */: - case 213 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - // Stop at the first containing function or module declaration + case 250 /* SourceFile */: + case 220 /* ModuleDeclaration */: + // Stop at the first containing file or module declaration break loop; } - // Use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; + if (node === top_1) { + break; } } + var nodes; + while (nodes = nodeStack.pop()) { + var node_1 = nodes.node, child = nodes.child; + switch (node_1.kind) { + case 198 /* IfStatement */: + // In a branch of an if statement, narrow based on controlling expression + if (child !== node_1.expression) { + type = narrowType(type, node_1.expression, /*assumeTrue*/ child === node_1.thenStatement); + } + break; + case 184 /* ConditionalExpression */: + // In a branch of a conditional expression, narrow based on controlling condition + if (child !== node_1.condition) { + type = narrowType(type, node_1.condition, /*assumeTrue*/ child === node_1.whenTrue); + } + break; + case 183 /* BinaryExpression */: + // In the right operand of an && or ||, narrow based on left operand + if (child === node_1.right) { + if (node_1.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { + type = narrowType(type, node_1.left, /*assumeTrue*/ true); + } + else if (node_1.operatorToken.kind === 52 /* BarBarToken */) { + type = narrowType(type, node_1.left, /*assumeTrue*/ false); + } + } + break; + default: + ts.Debug.fail("Unreachable!"); + } + // Use original type if construct contains assignments to variable + if (type !== originalType && isVariableAssignedWithin(symbol, node_1)) { + type = originalType; + } + } + // Preserve old top-level behavior - if the branch is really an empty set, revert to prior type + if (type === emptyUnionType) { + type = originalType; + } } } return type; function narrowTypeByEquality(type, expr, assumeTrue) { // Check that we have 'typeof ' on the left and string literal on the right - if (expr.left.kind !== 176 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { + if (expr.left.kind !== 178 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { return type; } var left = expr.left; @@ -19825,31 +20375,34 @@ var ts; if (left.expression.kind !== 69 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) { return type; } - var typeInfo = primitiveTypeInfo[right.text]; if (expr.operatorToken.kind === 33 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } - if (assumeTrue) { - // Assumed result is true. If check was not for a primitive type, remove all primitive types - if (!typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ 258 /* StringLike */ | 132 /* NumberLike */ | 8 /* Boolean */ | 16777216 /* ESSymbol */, - /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Check was for a primitive type, return that primitive type if it is a subtype - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is - // union of enum types and other types. - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ false, /*allowEmptyUnionResult*/ false); + var typeInfo = primitiveTypeInfo[right.text]; + // Don't narrow `undefined` + if (typeInfo && typeInfo.type === undefinedType) { + return type; + } + // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive + if (!!(type.flags & 1 /* Any */) && typeInfo && assumeTrue) { + return typeInfo.type; + } + var flags; + if (typeInfo) { + flags = typeInfo.flags; } else { - // Assumed result is false. If check was for a primitive type, remove that primitive type - if (typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Otherwise we don't have enough information to do anything. - return type; + assumeTrue = !assumeTrue; + flags = 132 /* NumberLike */ | 258 /* StringLike */ | 16777216 /* ESSymbol */ | 8 /* Boolean */; + } + // At this point we can bail if it's not a union + if (!(type.flags & 16384 /* Union */)) { + // If the active non-union type would be removed from a union by this type guard, return an empty union + return filterUnion(type) ? type : emptyUnionType; + } + return getUnionType(ts.filter(type.types, filterUnion), /*noSubtypeReduction*/ true); + function filterUnion(type) { + return assumeTrue === !!(type.flags & flags); } } function narrowTypeByAnd(type, expr, assumeTrue) { @@ -19862,7 +20415,7 @@ var ts; // and the second operand was false. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ false), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ false) + narrowType(type, expr.right, /*assumeTrue*/ false) ]); } } @@ -19872,7 +20425,7 @@ var ts; // and the second operand was true. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ true), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ true) + narrowType(type, expr.right, /*assumeTrue*/ true) ]); } else { @@ -19913,17 +20466,17 @@ var ts; } } if (targetType) { - if (!assumeTrue) { - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); - } - return type; - } - return getNarrowedType(type, targetType); + return getNarrowedType(type, targetType, assumeTrue); } return type; } - function getNarrowedType(originalType, narrowedTypeCandidate) { + function getNarrowedType(originalType, narrowedTypeCandidate, assumeTrue) { + if (!assumeTrue) { + if (originalType.flags & 16384 /* Union */) { + return getUnionType(ts.filter(originalType.types, function (t) { return !isTypeSubtypeOf(t, narrowedTypeCandidate); })); + } + return originalType; + } // If the current type is a union type, remove all constituents that aren't assignable to target. If that produces // 0 candidates, fall back to the assignability check if (originalType.flags & 16384 /* Union */) { @@ -19943,28 +20496,62 @@ var ts; return type; } var signature = getResolvedSignature(expr); - if (signature.typePredicate && - expr.arguments[signature.typePredicate.parameterIndex] && - getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { - if (!assumeTrue) { - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, signature.typePredicate.type); })); - } - return type; + var predicateType = getReturnTypeOfSignature(signature); + if (!predicateType || !(predicateType.flags & 134217728 /* PredicateType */)) { + return type; + } + var predicate = predicateType.predicate; + if (ts.isIdentifierTypePredicate(predicate)) { + var callExpression = expr; + if (callExpression.arguments[predicate.parameterIndex] && + getSymbolAtTypePredicatePosition(callExpression.arguments[predicate.parameterIndex]) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); } - return getNarrowedType(type, signature.typePredicate.type); + } + else { + var expression = skipParenthesizedNodes(expr.expression); + return narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue); } return type; } + function narrowTypeByTypePredicateMember(type, expr, assumeTrue) { + if (type.flags & 1 /* Any */) { + return type; + } + var memberType = getTypeOfExpression(expr); + if (!(memberType.flags & 134217728 /* PredicateType */)) { + return type; + } + return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); + } + function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { + if (expression.kind === 169 /* ElementAccessExpression */ || expression.kind === 168 /* PropertyAccessExpression */) { + var accessExpression = expression; + var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); + if (possibleIdentifier.kind === 69 /* Identifier */ && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); + } + } + return type; + } + function getSymbolAtTypePredicatePosition(expr) { + expr = skipParenthesizedNodes(expr); + switch (expr.kind) { + case 69 /* Identifier */: + case 168 /* PropertyAccessExpression */: + case 135 /* QualifiedName */: + return getSymbolOfEntityNameOrPropertyAccessExpression(expr); + } + } // Narrow the given type based on the given expression having the assumed boolean value. The returned type // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 168 /* CallExpression */: + case 170 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 32 /* EqualsEqualsEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -19979,15 +20566,24 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: if (expr.operator === 49 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 169 /* ElementAccessExpression */: + case 168 /* PropertyAccessExpression */: + return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } + function skipParenthesizedNodes(expression) { + while (expression.kind === 174 /* ParenthesizedExpression */) { + expression = expression.expression; + } + return expression; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. @@ -19998,7 +20594,7 @@ var ts; // can explicitly bound arguments objects if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 174 /* ArrowFunction */) { + if (container.kind === 176 /* ArrowFunction */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -20029,7 +20625,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 244 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 246 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -20045,12 +20641,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container container = symbol.valueDeclaration; - while (container.kind !== 212 /* VariableDeclarationList */) { + while (container.kind !== 214 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 193 /* VariableStatement */) { + if (container.kind === 195 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -20085,17 +20681,17 @@ var ts; var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 174 /* ArrowFunction */) { + if (container.kind === 176 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; @@ -20121,6 +20717,21 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } + // If this is a function in a JS file, it might be a class method. Check if it's the RHS + // of a x.prototype.y = function [name]() { .... } + if (ts.isInJavaScriptFile(node) && container.kind === 175 /* FunctionExpression */) { + if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { + // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') + var className = container.parent // x.protoype.y = f + .left // x.prototype.y + .expression // x.prototype + .expression; // x + var classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { + return getInferredClassType(classSymbol); + } + } + } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { @@ -20132,55 +20743,75 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 168 /* CallExpression */ && node.parent.expression === node; - var classDeclaration = ts.getContainingClass(node); - var classType = classDeclaration && getDeclaredTypeOfSymbol(getSymbolOfNode(classDeclaration)); - var baseClassType = classType && getBaseTypes(classType)[0]; - var container = ts.getSuperContainer(node, /*includeFunctions*/ true); + var isCallExpression = node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; if (!isCallExpression) { // adjust the container reference in case if super is used inside arrow functions with arbitrary deep nesting - while (container && container.kind === 174 /* ArrowFunction */) { - container = ts.getSuperContainer(container, /*includeFunctions*/ true); + while (container && container.kind === 176 /* ArrowFunction */) { + container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } } var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; - // always set NodeCheckFlags for 'super' expression node - if (canUseSuperExpression) { - if ((container.flags & 64 /* Static */) || isCallExpression) { - nodeCheckFlag = 512 /* SuperStatic */; - } - else { - nodeCheckFlag = 256 /* SuperInstance */; - } - getNodeLinks(node).flags |= nodeCheckFlag; - if (needToCaptureLexicalThis) { - // call expressions are allowed only in constructors so they should always capture correct 'this' - // super property access expressions can also appear in arrow functions - - // in this case they should also use correct lexical this - captureLexicalThis(node.parent, container); - } - } - if (!baseClassType) { - if (!classDeclaration || !ts.getClassExtendsHeritageClauseElement(classDeclaration)) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - } - return unknownType; - } if (!canUseSuperExpression) { - if (container && container.kind === 136 /* ComputedPropertyName */) { + // issue more specific error if super is used in computed property name + // class A { foo() { return "1" }} + // class B { + // [super.foo()]() {} + // } + var current = node; + while (current && current !== container && current.kind !== 136 /* ComputedPropertyName */) { + current = current.parent; + } + if (current && current.kind === 136 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return unknownType; } + if ((container.flags & 64 /* Static */) || isCallExpression) { + nodeCheckFlag = 512 /* SuperStatic */; + } + else { + nodeCheckFlag = 256 /* SuperInstance */; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (needToCaptureLexicalThis) { + // call expressions are allowed only in constructors so they should always capture correct 'this' + // super property access expressions can also appear in arrow functions - + // in this case they should also use correct lexical this + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (languageVersion < 2 /* ES6 */) { + error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return unknownType; + } + else { + // for object literal assume that type of 'super' is 'any' + return anyType; + } + } + // at this point the only legal case for parent is ClassLikeDeclaration + var classLikeDeclaration = container.parent; + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration)); + var baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + } + return unknownType; + } if (container.kind === 144 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); @@ -20203,8 +20834,8 @@ var ts; // 'super' property access is allowed // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor - // topmost container must be something that is directly nested in the class declaration - if (container && ts.isClassLike(container.parent)) { + // topmost container must be something that is directly nested in the class declaration\object literal expression + if (ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */) { if (container.flags & 64 /* Static */) { return container.kind === 143 /* MethodDeclaration */ || container.kind === 142 /* MethodSignature */ || @@ -20327,7 +20958,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 170 /* TaggedTemplateExpression */) { + if (template.parent.kind === 172 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -20350,6 +20981,11 @@ var ts; } return type; } + else if (operator === 51 /* AmpersandAmpersandToken */ || operator === 24 /* CommaToken */) { + if (node === binaryExpression.right) { + return getContextualType(binaryExpression); + } + } return undefined; } // Apply a mapping function to a contextual type and return the resulting type. If the contextual type @@ -20362,8 +20998,8 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var current = types_7[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var current = types_8[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -20449,22 +21085,20 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForJsxExpression(expr) { - // Contextual type only applies to JSX expressions that are in attribute assignments (not in 'Children' positions) - if (expr.parent.kind === 238 /* JsxAttribute */) { - var attrib = expr.parent; - var attrsType = getJsxElementAttributesType(attrib.parent); + function getContextualTypeForJsxAttribute(attribute) { + var kind = attribute.kind; + var jsxElement = attribute.parent; + var attrsType = getJsxElementAttributesType(jsxElement); + if (attribute.kind === 240 /* JsxAttribute */) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } - else { - return getTypeOfPropertyOfType(attrsType, attrib.name.text); - } + return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - if (expr.kind === 239 /* JsxSpreadAttribute */) { - return getJsxElementAttributesType(expr.parent); + else if (attribute.kind === 241 /* JsxSpreadAttribute */) { + return attrsType; } - return undefined; + ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -20499,39 +21133,41 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 163 /* BindingElement */: + case 165 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 174 /* ArrowFunction */: - case 204 /* ReturnStatement */: + case 176 /* ArrowFunction */: + case 206 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 190 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 183 /* TemplateExpression */); + case 192 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 185 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return getContextualType(parent); - case 240 /* JsxExpression */: - case 239 /* JsxSpreadAttribute */: - return getContextualTypeForJsxExpression(parent); + case 242 /* JsxExpression */: + return getContextualType(parent); + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + return getContextualTypeForJsxAttribute(parent); } return undefined; } @@ -20547,7 +21183,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 173 /* FunctionExpression */ || node.kind === 174 /* ArrowFunction */; + return node.kind === 175 /* FunctionExpression */ || node.kind === 176 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -20573,15 +21209,15 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var current = types_8[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var current = types_9[_i]; var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { // This signature will contribute to contextual union signature signatureList = [signature]; } - else if (!compareSignatures(signatureList[0], signature, /*partialMatch*/ false, /*ignoreReturnTypes*/ true, compareTypes)) { + else if (!compareSignaturesIdentical(signatureList[0], signature, /*partialMatch*/ false, /*ignoreReturnTypes*/ true, compareTypesIdentical)) { // Signatures aren't identical, do not use return undefined; } @@ -20624,13 +21260,13 @@ var ts; // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 181 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 183 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 245 /* PropertyAssignment */) { + if (parent.kind === 247 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 164 /* ArrayLiteralExpression */) { + if (parent.kind === 166 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -20646,8 +21282,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function hasDefaultValue(node) { - return (node.kind === 163 /* BindingElement */ && !!node.initializer) || - (node.kind === 181 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); + return (node.kind === 165 /* BindingElement */ && !!node.initializer) || + (node.kind === 183 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -20656,7 +21292,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 185 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 187 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -20680,7 +21316,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 185 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 187 /* SpreadElementExpression */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -20695,7 +21331,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 162 /* ArrayBindingPattern */ || pattern.kind === 164 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 164 /* ArrayBindingPattern */ || pattern.kind === 166 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -20703,7 +21339,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 187 /* OmittedExpression */) { + if (patternElement.kind !== 189 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -20775,24 +21411,24 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 161 /* ObjectBindingPattern */ || contextualType.pattern.kind === 165 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 163 /* ObjectBindingPattern */ || contextualType.pattern.kind === 167 /* ObjectLiteralExpression */); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 245 /* PropertyAssignment */ || - memberDecl.kind === 246 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 247 /* PropertyAssignment */ || + memberDecl.kind === 248 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 245 /* PropertyAssignment */) { + if (memberDecl.kind === 247 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 143 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 246 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 248 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -20800,8 +21436,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 245 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 246 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 247 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 248 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912 /* Optional */; } @@ -20893,38 +21529,22 @@ var ts; checkJsxOpeningLikeElement(node); return jsxElementType || anyType; } - function tagNamesAreEquivalent(lhs, rhs) { - if (lhs.kind !== rhs.kind) { - return false; - } - if (lhs.kind === 69 /* Identifier */) { - return lhs.text === rhs.text; - } - return lhs.right.text === rhs.right.text && - tagNamesAreEquivalent(lhs.left, rhs.left); - } function checkJsxElement(node) { // Check attributes checkJsxOpeningLikeElement(node.openingElement); - // Check that the closing tag matches - if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { - error(node.closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNode(node.openingElement.tagName)); - } - else { - // Perform resolution on the closing tag so that rename/go to definition/etc work - getJsxElementTagSymbol(node.closingElement); - } + // Perform resolution on the closing tag so that rename/go to definition/etc work + getJsxElementTagSymbol(node.closingElement); // Check children for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: checkJsxExpression(child); break; - case 233 /* JsxElement */: + case 235 /* JsxElement */: checkJsxElement(child); break; - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } @@ -21006,12 +21626,11 @@ var ts; } return type; } - /// Returns the type JSX.IntrinsicElements. May return `unknownType` if that type is not present. - function getJsxIntrinsicElementsType() { - if (!jsxIntrinsicElementsType) { - jsxIntrinsicElementsType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.IntrinsicElements) || unknownType; + function getJsxType(name) { + if (jsxTypes[name] === undefined) { + return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; } - return jsxIntrinsicElementsType; + return jsxTypes[name]; } /// Given a JSX opening element or self-closing element, return the symbol of the property that the tag name points to if /// this is an intrinsic tag. This might be a named @@ -21020,7 +21639,6 @@ var ts; /// type or factory function. /// Otherwise, returns unknownSymbol. function getJsxElementTagSymbol(node) { - var flags = 8 /* UnknownElement */; var links = getNodeLinks(node); if (!links.resolvedSymbol) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -21032,7 +21650,7 @@ var ts; } return links.resolvedSymbol; function lookupIntrinsicTag(node) { - var intrinsicElementsType = getJsxIntrinsicElementsType(); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { // Property case var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.text); @@ -21060,7 +21678,7 @@ var ts; var valueSymbol = resolveJsxTagName(node); // Look up the value in the current scope if (valueSymbol && valueSymbol !== unknownSymbol) { - links.jsxFlags |= 4 /* ClassElement */; + links.jsxFlags |= 4 /* ValueElement */; if (valueSymbol.flags & 8388608 /* Alias */) { markAliasSymbolAsReferenced(valueSymbol); } @@ -21086,7 +21704,7 @@ var ts; function getJsxElementInstanceType(node) { // There is no such thing as an instance type for a non-class element. This // line shouldn't be hit. - ts.Debug.assert(!!(getNodeLinks(node).jsxFlags & 4 /* ClassElement */), "Should not call getJsxElementInstanceType on non-class Element"); + ts.Debug.assert(!!(getNodeLinks(node).jsxFlags & 4 /* ValueElement */), "Should not call getJsxElementInstanceType on non-class Element"); var classSymbol = getJsxElementTagSymbol(node); if (classSymbol === unknownSymbol) { // Couldn't find the class instance type. Error has already been issued @@ -21108,13 +21726,7 @@ var ts; return unknownType; } } - var returnType = getUnionType(signatures.map(getReturnTypeOfSignature)); - // Issue an error if this return type isn't assignable to JSX.ElementClass - var elemClassType = getJsxGlobalElementClassType(); - if (elemClassType) { - checkTypeRelatedTo(returnType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); - } - return returnType; + return getUnionType(signatures.map(getReturnTypeOfSignature)); } /// e.g. "props" for React.d.ts, /// or 'undefined' if ElementAttributesPropery doesn't exist (which means all @@ -21156,8 +21768,27 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedJsxType) { var sym = getJsxElementTagSymbol(node); - if (links.jsxFlags & 4 /* ClassElement */) { + if (links.jsxFlags & 4 /* ValueElement */) { + // Get the element instance type (the result of newing or invoking this tag) var elemInstanceType = getJsxElementInstanceType(node); + // Is this is a stateless function component? See if its single signature is + // assignable to the JSX Element Type + var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896 /* ObjectType */)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + // Issue an error if this return type isn't assignable to JSX.ElementClass + var elemClassType = getJsxGlobalElementClassType(); + if (elemClassType) { + checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + } if (isTypeAny(elemInstanceType)) { return links.resolvedJsxType = elemInstanceType; } @@ -21177,14 +21808,34 @@ var ts; return links.resolvedJsxType = emptyObjectType; } else if (isTypeAny(attributesType) || (attributesType === unknownType)) { + // Props is of type 'any' or unknown return links.resolvedJsxType = attributesType; } - else if (!(attributesType.flags & 80896 /* ObjectType */)) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_must_be_an_object_type, typeToString(attributesType)); + else if (attributesType.flags & 16384 /* Union */) { + // Props cannot be a union type + error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); return links.resolvedJsxType = anyType; } else { - return links.resolvedJsxType = attributesType; + // Normal case -- add in IntrinsicClassElements and IntrinsicElements + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + if (typeParams) { + if (typeParams.length === 1) { + apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); + } + } + else { + apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); + } + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return links.resolvedJsxType = apparentAttributesType; } } } @@ -21219,7 +21870,7 @@ var ts; } /// Returns all the properties of the Jsx.IntrinsicElements interface function getJsxIntrinsicTagNames() { - var intrinsics = getJsxIntrinsicElementsType(); + var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; } function checkJsxPreconditions(errorNode) { @@ -21236,14 +21887,13 @@ var ts; function checkJsxOpeningLikeElement(node) { checkGrammarJsxElement(node); checkJsxPreconditions(node); - // If we're compiling under --jsx react, the symbol 'React' should - // be marked as 'used' so we don't incorrectly elide its import. And if there - // is no 'React' symbol in scope, we should issue an error. - if (compilerOptions.jsx === 2 /* React */) { - var reactSym = resolveName(node.tagName, "React", 107455 /* Value */, ts.Diagnostics.Cannot_find_name_0, "React"); - if (reactSym) { - getSymbolLinks(reactSym).referenced = true; - } + // The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there + // is no reactNamespace symbol in scope when targeting React emit, we should issue an error. + var reactRefErr = compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; + var reactSym = resolveName(node.tagName, reactNamespace, 107455 /* Value */, reactRefErr, reactNamespace); + if (reactSym) { + getSymbolLinks(reactSym).referenced = true; } var targetAttributesType = getJsxElementAttributesType(node); var nameTable = {}; @@ -21252,11 +21902,11 @@ var ts; // thus should have their types ignored var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 238 /* JsxAttribute */) { + if (node.attributes[i].kind === 240 /* JsxAttribute */) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 239 /* JsxSpreadAttribute */); + ts.Debug.assert(node.attributes[i].kind === 241 /* JsxSpreadAttribute */); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -21303,7 +21953,7 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95 /* SuperKeyword */) { - var errorNode = node.kind === 166 /* PropertyAccessExpression */ ? + var errorNode = node.kind === 168 /* PropertyAccessExpression */ ? node.name : node.right; // TS 1.0 spec (April 2014): 4.8.2 @@ -21313,7 +21963,7 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { + if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { // `prop` refers to a *property* declared in the super class // rather than a *method*, so it does not satisfy the above criteria. error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); @@ -21400,7 +22050,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 166 /* PropertyAccessExpression */ + var left = node.kind === 168 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); @@ -21416,7 +22066,7 @@ var ts; // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 169 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -21497,7 +22147,7 @@ var ts; if (indexArgumentExpression.kind === 9 /* StringLiteral */ || indexArgumentExpression.kind === 8 /* NumericLiteral */) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 167 /* ElementAccessExpression */ || indexArgumentExpression.kind === 166 /* PropertyAccessExpression */) { + if (indexArgumentExpression.kind === 169 /* ElementAccessExpression */ || indexArgumentExpression.kind === 168 /* PropertyAccessExpression */) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -21552,7 +22202,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (node.kind !== 139 /* Decorator */) { @@ -21621,7 +22271,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 185 /* SpreadElementExpression */) { + if (arg && arg.kind === 187 /* SpreadElementExpression */) { return i; } } @@ -21633,13 +22283,13 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 183 /* TemplateExpression */) { + if (tagExpression.template.kind === 185 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -21665,7 +22315,7 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 169 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 171 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -21717,7 +22367,7 @@ var ts; } function inferTypeArguments(node, signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var inferenceMapper = createInferenceMapper(context); + var inferenceMapper = getInferenceMapper(context); // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var i = 0; i < typeParameters.length; i++) { // As an optimization, we don't have to clear (and later recompute) inferred types @@ -21744,7 +22394,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 187 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); // If the effective argument type is 'undefined', there is no synthetic type @@ -21775,14 +22425,11 @@ var ts; } getInferredTypes(context); } - function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors, headMessage) { + function checkTypeArguments(signature, typeArgumentNodes, typeArgumentTypes, reportErrors, headMessage) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; + var mapper; for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - // Do not push on this array! It has a preallocated length - typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -21792,7 +22439,11 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); typeArgumentHeadMessage = headMessage; } - typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, typeArgumentHeadMessage, errorInfo); + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + var typeArgument = typeArgumentTypes[i]; + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo); } } } @@ -21803,7 +22454,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 187 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); @@ -21811,7 +22462,7 @@ var ts; // for the argument. In that case, we should check the argument. if (argType === undefined) { argType = arg.kind === 9 /* StringLiteral */ && !reportErrors - ? getStringLiteralType(arg) + ? getStringLiteralTypeForText(arg.text) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); } // Use argument expression as error location when reporting errors @@ -21835,10 +22486,10 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 183 /* TemplateExpression */) { + if (template.kind === 185 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -21871,8 +22522,8 @@ var ts; function getEffectiveArgumentCount(node, args, signature) { if (node.kind === 139 /* Decorator */) { switch (node.parent.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; case 141 /* PropertyDeclaration */: @@ -21915,7 +22566,7 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); @@ -21960,7 +22611,7 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } @@ -21984,7 +22635,7 @@ var ts; case 69 /* Identifier */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - return getStringLiteralType(element.name); + return getStringLiteralTypeForText(element.name.text); case 136 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) { @@ -22011,7 +22662,7 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a paramter decorator - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } @@ -22060,7 +22711,7 @@ var ts; if (node.kind === 139 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { return globalTemplateStringsArrayType; } // This is not a synthetic argument, so we return 'undefined' @@ -22073,7 +22724,7 @@ var ts; function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. if (node.kind === 139 /* Decorator */ || - (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */)) { + (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -22086,7 +22737,7 @@ var ts; // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -22095,7 +22746,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 170 /* TaggedTemplateExpression */; + var isTaggedTemplate = node.kind === 172 /* TaggedTemplateExpression */; var isDecorator = node.kind === 139 /* Decorator */; var typeArguments; if (!isTaggedTemplate && !isDecorator) { @@ -22202,7 +22853,8 @@ var ts; } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], /*reportErrors*/ true, headMessage); + var typeArguments_1 = node.typeArguments; + checkTypeArguments(candidateForTypeArgumentError, typeArguments_1, ts.map(typeArguments_1, getTypeFromTypeNode), /*reportErrors*/ true, headMessage); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -22260,7 +22912,7 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { @@ -22441,8 +23093,8 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; case 138 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; @@ -22487,13 +23139,13 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 168 /* CallExpression */) { + if (node.kind === 170 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 169 /* NewExpression */) { + else if (node.kind === 171 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 172 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else if (node.kind === 139 /* Decorator */) { @@ -22505,6 +23157,13 @@ var ts; } return links.resolvedSignature; } + function getInferredClassType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.inferredClassType) { + links.inferredClassType = createAnonymousType(undefined, symbol.members, emptyArray, emptyArray, /*stringIndexType*/ undefined, /*numberIndexType*/ undefined); + } + return links.inferredClassType; + } /** * Syntactically and semantically checks a call or new expression. * @param node The call/new expression to be checked. @@ -22517,14 +23176,20 @@ var ts; if (node.expression.kind === 95 /* SuperKeyword */) { return voidType; } - if (node.kind === 169 /* NewExpression */) { + if (node.kind === 171 /* NewExpression */) { var declaration = signature.declaration; if (declaration && declaration.kind !== 144 /* Constructor */ && declaration.kind !== 148 /* ConstructSignature */ && declaration.kind !== 153 /* ConstructorType */) { - // When resolved signature is a call signature (and not a construct signature) the result type is any - if (compilerOptions.noImplicitAny) { + // When resolved signature is a call signature (and not a construct signature) the result type is any, unless + // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations + // in a JS file + var funcSymbol = checkExpression(node.expression).symbol; + if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */)) { + return getInferredClassType(funcSymbol); + } + else if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -22577,7 +23242,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { if (element.name.kind === 69 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -22642,7 +23307,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 192 /* Block */) { + if (func.body.kind !== 194 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -22755,38 +23420,53 @@ var ts; }); return aggregatedTypes; } - // TypeScript Specification 1.0 (6.3) - July 2014 - // An explicitly typed function whose return type isn't the Void or the Any type - // must have at least one return statement somewhere in its body. - // An exception to this rule is if the function implementation consists of a single 'throw' statement. + /* + *TypeScript Specification 1.0 (6.3) - July 2014 + * An explicitly typed function whose return type isn't the Void or the Any type + * must have at least one return statement somewhere in its body. + * An exception to this rule is if the function implementation consists of a single 'throw' statement. + * @param returnType - return type of the function, can be undefined if return type is not explicitly specified + */ function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { if (!produceDiagnostics) { return; } - // Functions that return 'void' or 'any' don't need any return expressions. + // Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions. if (returnType === voidType || isTypeAny(returnType)) { return; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - // also if HasImplicitReturnValue flags is not set this means that all codepaths in function body end with return of throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 192 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { + // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw + if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { return; } - if (func.flags & 1048576 /* HasExplicitReturn */) { - if (compilerOptions.noImplicitReturns) { - error(func.type, ts.Diagnostics.Not_all_code_paths_return_a_value); - } - } - else { - // This function does not conform to the specification. + var hasExplicitReturn = func.flags & 1048576 /* HasExplicitReturn */; + if (returnType && !hasExplicitReturn) { + // minimal check: function has syntactic return type annotation and no explicit return statements in the body + // this function does not conform to the specification. + // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } + else if (compilerOptions.noImplicitReturns) { + if (!returnType) { + // If return type annotation is omitted check if function has any explicit return statements. + // If it does not have any - its inferred return type is void - don't do any checks. + // Otherwise get inferred return type from function body and report error only if it is not void / anytype + var inferredReturnType = hasExplicitReturn + ? getReturnTypeOfSignature(getSignatureFromDeclaration(func)) + : voidType; + if (inferredReturnType === voidType || isTypeAny(inferredReturnType)) { + return; + } + } + error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); + } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 173 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 175 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards @@ -22826,6 +23506,7 @@ var ts; } if (!contextChecked) { checkSignatureDeclaration(node); + checkNodeDeferred(node); } } } @@ -22835,19 +23516,16 @@ var ts; } return type; } - function checkFunctionExpressionOrObjectLiteralMethodBody(node) { + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); if (isAsync) { emitAwaiter = true; } - var returnType = node.type && getTypeFromTypeNode(node.type); - var promisedType; - if (returnType && isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - if (returnType && !node.asteriskToken) { - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if (!node.asteriskToken) { + // return is not necessary in the body of generators + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { @@ -22858,7 +23536,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 192 /* Block */) { + if (node.body.kind === 194 /* Block */) { checkSourceElement(node.body); } else { @@ -22868,16 +23546,15 @@ var ts; // check assignability of the awaited type of the expression body against the promised type of // its return type annotation. var exprType = checkExpression(node.body); - if (returnType) { + if (returnOrPromisedType) { if (isAsync) { var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); - checkTypeAssignableTo(awaitedType, promisedType, node.body); + checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { - checkTypeAssignableTo(exprType, returnType, node.body); + checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } - checkFunctionAndClassExpressionBodies(node.body); } } } @@ -22911,17 +23588,17 @@ var ts; // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 166 /* PropertyAccessExpression */: { + case 168 /* PropertyAccessExpression */: { var symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.10 // A property access expression is always classified as a reference. // NOTE (not in spec): assignment to enum members should not be allowed return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: // old compiler doesn't check indexed access return true; - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -22930,11 +23607,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: { + case 168 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384 /* Const */) !== 0; } - case 167 /* ElementAccessExpression */: { + case 169 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9 /* StringLiteral */) { @@ -22944,7 +23621,7 @@ var ts; } return false; } - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -23025,8 +23702,8 @@ var ts; } if (type.flags & 49152 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var current = types_9[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var current = types_10[_i]; if (current.flags & kind) { return true; } @@ -23042,8 +23719,8 @@ var ts; } if (type.flags & 49152 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var current = types_10[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var current = types_11[_i]; if (!(current.flags & kind)) { return false; } @@ -23090,7 +23767,7 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { var name_13 = p.name; if (name_13.kind === 136 /* ComputedPropertyName */) { checkComputedPropertyName(name_13); @@ -23105,11 +23782,11 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { - if (p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { - // non-shorthand property assignments should always have initializers + // non-shorthand property assignments should always have initializers checkDestructuringAssignment(p.initializer, type); } } @@ -23131,8 +23808,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187 /* OmittedExpression */) { - if (e.kind !== 185 /* SpreadElementExpression */) { + if (e.kind !== 189 /* OmittedExpression */) { + if (e.kind !== 187 /* SpreadElementExpression */) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -23157,7 +23834,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 181 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { + if (restExpression.kind === 183 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -23171,7 +23848,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 246 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 248 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -23181,14 +23858,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 181 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 165 /* ObjectLiteralExpression */) { + if (target.kind === 167 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 164 /* ArrayLiteralExpression */) { + if (target.kind === 166 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -23205,7 +23882,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 /* EqualsToken */ && (left.kind === 165 /* ObjectLiteralExpression */ || left.kind === 164 /* ArrayLiteralExpression */)) { + if (operator === 56 /* EqualsToken */ && (left.kind === 167 /* ObjectLiteralExpression */ || left.kind === 166 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -23441,7 +24118,7 @@ var ts; function checkStringLiteralExpression(node) { var contextualType = getContextualType(node); if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { - return getStringLiteralType(node); + return getStringLiteralTypeForText(node.text); } return stringType; } @@ -23527,8 +24204,8 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 167 /* ElementAccessExpression */ && node.parent.expression === node) || + var ok = (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.expression === node) || ((node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); @@ -23556,7 +24233,7 @@ var ts; return booleanType; case 8 /* NumericLiteral */: return checkNumericLiteral(node); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: return checkStringLiteralExpression(node); @@ -23564,58 +24241,58 @@ var ts; return stringType; case 10 /* RegularExpressionLiteral */: return globalRegExpType; - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return checkCallExpression(node); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return checkClassExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return checkAssertion(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return checkDeleteExpression(node); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return checkVoidExpression(node); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return checkAwaitExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 187 /* OmittedExpression */: + case 189 /* OmittedExpression */: return undefinedType; - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return checkYieldExpression(node); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return checkJsxExpression(node); - case 233 /* JsxElement */: + case 235 /* JsxElement */: return checkJsxElement(node); - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 235 /* JsxOpeningElement */: + case 237 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -23627,11 +24304,10 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); + getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } - // TODO: Check multiple declarations are identical } function checkParameter(node) { // Grammar checking @@ -23662,8 +24338,8 @@ var ts; return false; } return node.kind === 143 /* MethodDeclaration */ || - node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */; + node.kind === 215 /* FunctionDeclaration */ || + node.kind === 175 /* FunctionExpression */; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -23677,12 +24353,12 @@ var ts; } return -1; } - function isInLegalTypePredicatePosition(node) { + function isInLegalParameterTypePredicatePosition(node) { switch (node.parent.kind) { - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: case 147 /* CallSignature */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 152 /* FunctionType */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: @@ -23690,12 +24366,24 @@ var ts; } return false; } + function isInLegalThisTypePredicatePosition(node) { + if (isInLegalParameterTypePredicatePosition(node)) { + return true; + } + switch (node.parent.kind) { + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + case 145 /* GetAccessor */: + return node === node.parent.type; + } + return false; + } function checkSignatureDeclaration(node) { // Grammar checking if (node.kind === 149 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 /* FunctionType */ || node.kind === 213 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || + else if (node.kind === 152 /* FunctionType */ || node.kind === 215 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || node.kind === 147 /* CallSignature */ || node.kind === 144 /* Constructor */ || node.kind === 148 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); @@ -23704,9 +24392,14 @@ var ts; ts.forEach(node.parameters, checkParameter); if (node.type) { if (node.type.kind === 150 /* TypePredicate */) { - var typePredicate = getSignatureFromDeclaration(node).typePredicate; + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { + return; + } + var typePredicate = returnType.predicate; var typePredicateNode = node.type; - if (isInLegalTypePredicatePosition(typePredicateNode)) { + checkSourceElement(typePredicateNode); + if (ts.isIdentifierTypePredicate(typePredicate)) { if (typePredicate.parameterIndex >= 0) { if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); @@ -23722,8 +24415,8 @@ var ts; if (hasReportedError) { break; } - if (param.name.kind === 161 /* ObjectBindingPattern */ || - param.name.kind === 162 /* ArrayBindingPattern */) { + if (param.name.kind === 163 /* ObjectBindingPattern */ || + param.name.kind === 164 /* ArrayBindingPattern */) { (function checkBindingPattern(pattern) { for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -23733,8 +24426,8 @@ var ts; hasReportedError = true; break; } - else if (element.name.kind === 162 /* ArrayBindingPattern */ || - element.name.kind === 161 /* ObjectBindingPattern */) { + else if (element.name.kind === 164 /* ArrayBindingPattern */ || + element.name.kind === 163 /* ObjectBindingPattern */) { checkBindingPattern(element.name); } } @@ -23746,9 +24439,6 @@ var ts; } } } - else { - error(typePredicateNode, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } } else { checkSourceElement(node.type); @@ -23789,7 +24479,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 215 /* InterfaceDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -23839,7 +24529,7 @@ var ts; // Grammar checking checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration - checkFunctionLikeDeclaration(node); + checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. if (node.flags & 128 /* Abstract */ && node.body) { @@ -23866,7 +24556,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 168 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; + return n.kind === 170 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -23887,7 +24577,7 @@ var ts; if (n.kind === 97 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 173 /* FunctionExpression */ && n.kind !== 213 /* FunctionDeclaration */) { + else if (n.kind !== 175 /* FunctionExpression */ && n.kind !== 215 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -23922,7 +24612,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 195 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { + if (statement.kind === 197 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -23948,6 +24638,8 @@ var ts; if (produceDiagnostics) { // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); if (node.kind === 145 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288 /* HasImplicitReturn */)) { if (node.flags & 1048576 /* HasExplicitReturn */) { @@ -23960,6 +24652,12 @@ var ts; } } } + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(node.name); + } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. @@ -23982,18 +24680,32 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - checkFunctionLikeDeclaration(node); + if (node.parent.kind !== 167 /* ObjectLiteralExpression */) { + checkSourceElement(node.body); + } + else { + checkNodeDeferred(node); + } + } + function checkAccessorDeferred(node) { + checkSourceElement(node.body); } function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArguments) { + function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var typeArguments; + var mapper; var result = true; for (var i = 0; i < typeParameters.length; i++) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { + if (!typeArguments) { + typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + mapper = createTypeMapper(typeParameters, typeArguments); + } var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; @@ -24059,7 +24771,7 @@ var ts; var signaturesToCheck; // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. // Use declaring type to obtain full list of signatures. - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 215 /* InterfaceDeclaration */) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217 /* InterfaceDeclaration */) { ts.Debug.assert(signatureDeclarationNode.kind === 147 /* CallSignature */ || signatureDeclarationNode.kind === 148 /* ConstructSignature */); var signatureKind = signatureDeclarationNode.kind === 147 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -24071,7 +24783,7 @@ var ts; } for (var _i = 0, signaturesToCheck_1 = signaturesToCheck; _i < signaturesToCheck_1.length; _i++) { var otherSignature = signaturesToCheck_1[_i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature, /*ignoreReturnTypes*/ false)) { return; } } @@ -24081,9 +24793,9 @@ var ts; var flags = ts.getCombinedNodeFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 215 /* InterfaceDeclaration */ && - n.parent.kind !== 214 /* ClassDeclaration */ && - n.parent.kind !== 186 /* ClassExpression */ && + if (n.parent.kind !== 217 /* InterfaceDeclaration */ && + n.parent.kind !== 216 /* ClassDeclaration */ && + n.parent.kind !== 188 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 4 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -24164,16 +24876,23 @@ var ts; seen = c === node; } }); - if (subsequentNode) { + // We may be here because of some extra junk between overloads that could not be parsed into a valid node. + // In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here. + if (subsequentNode && subsequentNode.pos === node.end) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */); - ts.Debug.assert((node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */)); - var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode_1, diagnostic); + var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && + (node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */); + // we can get here in two cases + // 1. mixed static and instance class members + // 2. something with the same name was defined before the set of overloads that prevents them from merging + // here we'll report error only for the first case since for second we should already report error in binder + if (reportError) { + var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + error(errorNode_1, diagnostic); + } return; } else if (ts.nodeIsPresent(subsequentNode.body)) { @@ -24206,7 +24925,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 215 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 217 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -24217,7 +24936,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 213 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { + if (node.kind === 215 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -24288,7 +25007,7 @@ var ts; // The implementation is completely unrelated to the specialized signature, yet we do not check this. for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { var signature = signatures_3[_a]; - if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + if (!signature.hasStringLiterals && !isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } @@ -24357,16 +25076,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return d.name.kind === 9 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -24587,6 +25306,8 @@ var ts; error(node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName); return unknownType; } + // If the Promise constructor, resolved locally, is an alias symbol we should mark it as referenced. + checkReturnTypeAnnotationAsExpression(node); // Validate the promise constructor type. var promiseConstructorType = getTypeOfSymbol(promiseConstructor); if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) { @@ -24594,10 +25315,10 @@ var ts; } // Verify there is no local declaration that could collide with the promise constructor. var promiseName = ts.getEntityNameFromTypeNode(node.type); - var root = getFirstIdentifier(promiseName); - var rootSymbol = getSymbol(node.locals, root.text, 107455 /* Value */); + var promiseNameOrNamespaceRoot = getFirstIdentifier(promiseName); + var rootSymbol = getSymbol(node.locals, promiseNameOrNamespaceRoot.text, 107455 /* Value */); if (rootSymbol) { - error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, root.text, getFullyQualifiedName(promiseConstructor)); + error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, promiseNameOrNamespaceRoot.text, getFullyQualifiedName(promiseConstructor)); return unknownType; } // Get and return the awaited type of the return type. @@ -24614,7 +25335,7 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); @@ -24662,23 +25383,10 @@ var ts; * an expression if it is a type reference to a type with a value declaration. */ function checkTypeAnnotationAsExpression(node) { - switch (node.kind) { - case 141 /* PropertyDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 138 /* Parameter */: - checkTypeNodeAsExpression(node.type); - break; - case 143 /* MethodDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 145 /* GetAccessor */: - checkTypeNodeAsExpression(node.type); - break; - case 146 /* SetAccessor */: - checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node)); - break; - } + checkTypeNodeAsExpression(node.type); + } + function checkReturnTypeAnnotationAsExpression(node) { + checkTypeNodeAsExpression(node.type); } /** Checks the type annotation of the parameters of a function/method or the constructor of a class as expressions */ function checkParameterTypeAnnotationsAsExpressions(node) { @@ -24704,17 +25412,18 @@ var ts; if (compilerOptions.emitDecoratorMetadata) { // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; case 143 /* MethodDeclaration */: - checkParameterTypeAnnotationsAsExpressions(node); - // fall-through - case 146 /* SetAccessor */: case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + checkParameterTypeAnnotationsAsExpressions(node); + checkReturnTypeAnnotationAsExpression(node); + break; case 141 /* PropertyDeclaration */: case 138 /* Parameter */: checkTypeAnnotationAsExpression(node); @@ -24729,13 +25438,13 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || checkGrammarForGenerator(node); + checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); } } - function checkFunctionLikeDeclaration(node) { + function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); @@ -24756,7 +25465,13 @@ var ts; // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + // Since the javascript won't do semantic analysis like typescript, + // if the javascript file comes before the typescript file and both contain same name functions, + // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. + var firstDeclaration = ts.forEach(localSymbol.declarations, + // Get first non javascript function declaration + function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration : undefined; }); // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -24770,13 +25485,9 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { - var returnType = getTypeFromTypeNode(node.type); - var promisedType; - if (isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + if (!node.asteriskToken) { + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -24794,13 +25505,10 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 192 /* Block */) { + if (node.kind === 194 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 219 /* ModuleBlock */) { - checkFunctionAndClassExpressionBodies(node); - } } function checkCollisionWithArgumentsInGeneratedCode(node) { // no rest parameters \ declaration context \ overload - no codegen impact @@ -24884,12 +25592,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 218 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -24924,7 +25632,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 211 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 213 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -24934,17 +25642,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 212 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 193 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 195 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 192 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 219 /* ModuleBlock */ || - container.kind === 218 /* ModuleDeclaration */ || - container.kind === 248 /* SourceFile */); + (container.kind === 194 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 221 /* ModuleBlock */ || + container.kind === 220 /* ModuleDeclaration */ || + container.kind === 250 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -25002,7 +25710,7 @@ var ts; checkExpressionCached(node.initializer); } } - if (node.kind === 163 /* BindingElement */) { + if (node.kind === 165 /* BindingElement */) { // check computed properties inside property names of binding elements if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); @@ -25048,7 +25756,7 @@ var ts; if (node.kind !== 141 /* PropertyDeclaration */ && node.kind !== 140 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 211 /* VariableDeclaration */ || node.kind === 163 /* BindingElement */) { + if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -25071,7 +25779,7 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 165 /* ObjectLiteralExpression */) { + if (node.modifiers && node.parent.kind === 167 /* ObjectLiteralExpression */) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -25092,7 +25800,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 194 /* EmptyStatement */) { + if (node.thenStatement.kind === 196 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -25112,12 +25820,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -25137,14 +25845,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); // There may be a destructuring assignment on the left side - if (varExpr.kind === 164 /* ArrayLiteralExpression */ || varExpr.kind === 165 /* ObjectLiteralExpression */) { + if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -25173,7 +25881,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -25187,7 +25895,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 164 /* ArrayLiteralExpression */ || varExpr.kind === 165 /* ObjectLiteralExpression */) { + if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */)) { @@ -25383,7 +26091,13 @@ var ts; ts.Debug.assert(languageVersion < 2 /* ES6 */); // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the remaining type is the same as the initial type. - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258 /* StringLike */, /*isTypeOfKind*/ true, /*allowEmptyUnionResult*/ true); + var arrayType = arrayOrStringType; + if (arrayOrStringType.flags & 16384 /* Union */) { + arrayType = getUnionType(ts.filter(arrayOrStringType.types, function (t) { return !(t.flags & 258 /* StringLike */); })); + } + else if (arrayOrStringType.flags & 258 /* StringLike */) { + arrayType = emptyUnionType; + } var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { @@ -25457,7 +26171,7 @@ var ts; error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } - else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || signature.typePredicate) { + else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || returnType.flags & 134217728 /* PredicateType */) { if (ts.isAsyncFunctionLike(func)) { var promisedType = getPromisedType(returnType); var awaitedType = checkAwaitedType(exprType, node.expression, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -25494,7 +26208,7 @@ var ts; var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 242 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 244 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -25506,17 +26220,17 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 241 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 243 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014):5.9 // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. var caseType = checkExpression(caseClause.expression); + var expressionTypeIsAssignableToCaseType = // Permit 'number[] | "foo"' to be asserted to 'string'. - if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) { - return; - } - if (!isTypeAssignableTo(expressionType, caseType)) { - // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails + (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) || + isTypeAssignableTo(expressionType, caseType); + if (!expressionTypeIsAssignableToCaseType) { + // 'expressionType is not assignable to caseType', try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined); } } @@ -25531,7 +26245,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 207 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 209 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -25688,8 +26402,12 @@ var ts; } function checkClassExpression(node) { checkClassLikeDeclaration(node); + checkNodeDeferred(node); return getTypeOfSymbol(getSymbolOfNode(node)); } + function checkClassExpressionDeferred(node) { + ts.forEach(node.members, checkSourceElement); + } function checkClassDeclaration(node) { if (!node.name && !(node.flags & 512 /* Default */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); @@ -25814,7 +26532,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(derivedClassDecl.flags & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 186 /* ClassExpression */) { + if (derivedClassDecl.kind === 188 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -25932,7 +26650,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 215 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -26006,7 +26724,8 @@ var ts; error(member.name, ts.Diagnostics.Enum_member_must_have_initializer); } if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; + getNodeLinks(member).enumMemberValue = autoValue; + autoValue++; } } nodeLinks.flags |= 8192 /* EnumValuesComputed */; @@ -26041,7 +26760,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -26052,7 +26771,7 @@ var ts; case 50 /* TildeToken */: return ~value_1; } return undefined; - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -26077,11 +26796,11 @@ var ts; return undefined; case 8 /* NumericLiteral */: return +e.text; - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return evalConstant(e.expression); case 69 /* Identifier */: - case 167 /* ElementAccessExpression */: - case 166 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 168 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -26094,7 +26813,7 @@ var ts; } else { var expression; - if (e.kind === 167 /* ElementAccessExpression */) { + if (e.kind === 169 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -26112,7 +26831,7 @@ var ts; if (current.kind === 69 /* Identifier */) { break; } - else if (current.kind === 166 /* PropertyAccessExpression */) { + else if (current.kind === 168 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -26183,7 +26902,7 @@ var ts; var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 217 /* EnumDeclaration */) { + if (declaration.kind !== 219 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -26206,8 +26925,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 214 /* ClassDeclaration */ || - (declaration.kind === 213 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 216 /* ClassDeclaration */ || + (declaration.kind === 215 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -26263,7 +26982,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 214 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 216 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -26286,7 +27005,7 @@ var ts; if (node.kind === 135 /* QualifiedName */) { node = node.left; } - else if (node.kind === 166 /* PropertyAccessExpression */) { + else if (node.kind === 168 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -26302,9 +27021,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 219 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 248 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 228 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; + if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 230 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -26327,7 +27046,7 @@ var ts; (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 230 /* ExportSpecifier */ ? + var message = node.kind === 232 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -26354,7 +27073,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -26411,8 +27130,8 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 219 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 248 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; + if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -26426,7 +27145,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 248 /* SourceFile */ && node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 218 /* ModuleDeclaration */) { + if (node.parent.kind !== 250 /* SourceFile */ && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 220 /* ModuleDeclaration */) { return grammarErrorOnFirstToken(node, errorMessage); } } @@ -26441,8 +27160,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 248 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 218 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { + var container = node.parent.kind === 250 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 220 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -26468,15 +27187,6 @@ var ts; } } } - function getModuleStatements(node) { - if (node.kind === 248 /* SourceFile */) { - return node.statements; - } - if (node.kind === 218 /* ModuleDeclaration */ && node.body.kind === 219 /* ModuleBlock */) { - return node.body.statements; - } - return emptyArray; - } function hasExportedMembers(moduleSymbol) { for (var id in moduleSymbol.exports) { if (id !== "export=") { @@ -26494,13 +27204,43 @@ var ts; var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } + // Checks for export * conflicts + var exports = getExportsOfModule(moduleSymbol); + for (var id in exports) { + if (id === "__export") { + continue; + } + var _a = exports[id], declarations = _a.declarations, flags = _a.flags; + // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. (TS Exceptions: namespaces, function overloads, enums, and interfaces) + if (!(flags & (1536 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) && (flags & 524288 /* TypeAlias */ ? declarations.length - 1 : declarations.length) > 1) { + var exportedDeclarations = ts.filter(declarations, isNotOverload); + if (exportedDeclarations.length > 1) { + for (var _i = 0, exportedDeclarations_1 = exportedDeclarations; _i < exportedDeclarations_1.length; _i++) { + var declaration = exportedDeclarations_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); + } + } + } + } links.exportsChecked = true; } + function isNotOverload(declaration) { + return declaration.kind !== 215 /* FunctionDeclaration */ || !!declaration.body; + } } function checkTypePredicate(node) { - if (!isInLegalTypePredicatePosition(node)) { + var parameterName = node.parameterName; + if (parameterName.kind === 69 /* Identifier */ && !isInLegalParameterTypePredicatePosition(node)) { error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); } + else if (parameterName.kind === 161 /* ThisType */) { + if (!isInLegalThisTypePredicatePosition(node)) { + error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); + } + else { + getTypeFromThisTypeNode(parameterName); + } + } } function checkSourceElement(node) { if (!node) { @@ -26511,10 +27251,10 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessivly // hitting the cancellation token on every node we check. switch (kind) { - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -26558,71 +27298,71 @@ var ts; return checkUnionOrIntersectionType(node); case 160 /* ParenthesizedType */: return checkSourceElement(node.type); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return checkBlock(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return checkVariableStatement(node); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return checkExpressionStatement(node); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return checkIfStatement(node); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return checkDoStatement(node); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return checkWhileStatement(node); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return checkForStatement(node); - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return checkForInStatement(node); - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return checkForOfStatement(node); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return checkReturnStatement(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return checkWithStatement(node); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return checkSwitchStatement(node); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return checkLabeledStatement(node); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return checkThrowStatement(node); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return checkTryStatement(node); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 163 /* BindingElement */: + case 165 /* BindingElement */: return checkBindingElement(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return checkClassDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return checkImportDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return checkExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return checkExportAssignment(node); - case 194 /* EmptyStatement */: + case 196 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 231 /* MissingDeclaration */: + case 233 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -26635,102 +27375,29 @@ var ts; // Here, performing a full type check of the body of the function expression whilst in the process of // determining the type of foo would cause foo to be given type any because of the recursive reference. // Delaying the type check of the body ensures foo has been assigned a type. - function checkFunctionAndClassExpressionBodies(node) { - switch (node.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - checkFunctionExpressionOrObjectLiteralMethodBody(node); - break; - case 186 /* ClassExpression */: - ts.forEach(node.members, checkSourceElement); - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - ts.forEach(node.decorators, checkFunctionAndClassExpressionBodies); - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - if (ts.isObjectLiteralMethod(node)) { - checkFunctionExpressionOrObjectLiteralMethodBody(node); - } - break; - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - break; - case 205 /* WithStatement */: - checkFunctionAndClassExpressionBodies(node.expression); - break; - case 139 /* Decorator */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 163 /* BindingElement */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 245 /* PropertyAssignment */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 170 /* TaggedTemplateExpression */: - case 183 /* TemplateExpression */: - case 190 /* TemplateSpan */: - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: - case 172 /* ParenthesizedExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 178 /* AwaitExpression */: - case 175 /* DeleteExpression */: - case 179 /* PrefixUnaryExpression */: - case 180 /* PostfixUnaryExpression */: - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 184 /* YieldExpression */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 193 /* VariableStatement */: - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 220 /* CaseBlock */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: - case 211 /* VariableDeclaration */: - case 212 /* VariableDeclarationList */: - case 214 /* ClassDeclaration */: - case 243 /* HeritageClause */: - case 188 /* ExpressionWithTypeArguments */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 227 /* ExportAssignment */: - case 248 /* SourceFile */: - case 240 /* JsxExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - case 235 /* JsxOpeningElement */: - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; + function checkNodeDeferred(node) { + if (deferredNodes) { + deferredNodes.push(node); + } + } + function checkDeferredNodes() { + for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { + var node = deferredNodes_1[_i]; + switch (node.kind) { + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + checkAccessorDeferred(node); + break; + case 188 /* ClassExpression */: + checkClassExpressionDeferred(node); + break; + } } } function checkSourceFile(node) { @@ -26756,9 +27423,12 @@ var ts; emitExtends = false; emitDecorate = false; emitParam = false; + emitAwaiter = false; potentialThisCollisions.length = 0; + deferredNodes = []; ts.forEach(node.statements, checkSourceElement); - checkFunctionAndClassExpressionBodies(node); + checkDeferredNodes(); + deferredNodes = undefined; if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -26818,7 +27488,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 205 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 207 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -26841,25 +27511,25 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } // fall through; this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -26868,7 +27538,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -26918,10 +27588,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 137 /* TypeParameter */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: return true; } } @@ -26935,19 +27605,19 @@ var ts; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 166 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 168 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 188 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 190 /* ExpressionWithTypeArguments */; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { while (nodeOnRightSide.parent.kind === 135 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 221 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 223 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 227 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 229 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -26959,11 +27629,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 227 /* ExportAssignment */) { + if (entityName.parent.kind === 229 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 166 /* PropertyAccessExpression */) { + if (entityName.kind !== 168 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -26975,7 +27645,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 188 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 190 /* ExpressionWithTypeArguments */) { meaning = 793056 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -26988,9 +27658,9 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 235 /* JsxOpeningElement */) || - (entityName.parent.kind === 234 /* JsxSelfClosingElement */) || - (entityName.parent.kind === 237 /* JsxClosingElement */)) { + else if ((entityName.parent.kind === 237 /* JsxOpeningElement */) || + (entityName.parent.kind === 236 /* JsxSelfClosingElement */) || + (entityName.parent.kind === 239 /* JsxClosingElement */)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -27004,7 +27674,7 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 166 /* PropertyAccessExpression */) { + else if (entityName.kind === 168 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); @@ -27026,7 +27696,7 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 238 /* JsxAttribute */) { + else if (entityName.parent.kind === 240 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } if (entityName.parent.kind === 150 /* TypePredicate */) { @@ -27046,12 +27716,12 @@ var ts; } if (node.kind === 69 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 227 /* ExportAssignment */ + return node.parent.kind === 229 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 163 /* BindingElement */ && - node.parent.parent.kind === 161 /* ObjectBindingPattern */ && + else if (node.parent.kind === 165 /* BindingElement */ && + node.parent.parent.kind === 163 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -27062,13 +27732,15 @@ var ts; } switch (node.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97 /* ThisKeyword */: case 95 /* SuperKeyword */: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; + case 161 /* ThisType */: + return getTypeFromTypeNode(node).symbol; case 121 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; @@ -27080,14 +27752,14 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 222 /* ImportDeclaration */ || node.parent.kind === 228 /* ExportDeclaration */) && + ((node.parent.kind === 224 /* ImportDeclaration */ || node.parent.kind === 230 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Fall through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 167 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -27104,7 +27776,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 246 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 248 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */); } return undefined; @@ -27207,6 +27879,30 @@ var ts; function isArgumentsLocalBinding(node) { return getReferencedValueSymbol(node) === argumentsSymbol; } + function moduleExportsSomeValue(moduleReferenceExpression) { + var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol) { + // module not found - be conservative + return true; + } + var hasExportAssignment = getExportAssignmentSymbol(moduleSymbol) !== undefined; + // if module has export assignment then 'resolveExternalModuleSymbol' will return resolved symbol for export assignment + // otherwise it will return moduleSymbol itself + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + var symbolLinks = getSymbolLinks(moduleSymbol); + if (symbolLinks.exportsSomeValue === undefined) { + // for export assignments - check if resolved symbol for RHS is itself a value + // otherwise - check if at least one export is value + symbolLinks.exportsSomeValue = hasExportAssignment + ? !!(moduleSymbol.flags & 107455 /* Value */) + : ts.forEachValue(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks.exportsSomeValue; + function isValue(s) { + s = resolveSymbol(s); + return s && !!(s.flags & 107455 /* Value */); + } + } // When resolved as an expression identifier, if the given node references an exported entity, return the declaration // node of the exported entity's container. Otherwise, return undefined. function getReferencedExportContainer(node) { @@ -27224,11 +27920,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 248 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 250 /* SourceFile */) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 218 /* ModuleDeclaration */ || n.kind === 217 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 220 /* ModuleDeclaration */ || n.kind === 219 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -27243,11 +27939,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 192 /* Block */: - case 220 /* CaseBlock */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 194 /* Block */: + case 222 /* CaseBlock */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return true; } return false; @@ -27277,22 +27973,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return node.expression && node.expression.kind === 69 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 248 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 250 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -27354,7 +28050,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 247 /* EnumMember */) { + if (node.kind === 249 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -27446,17 +28142,6 @@ var ts; var symbol = getReferencedValueSymbol(reference); return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; } - function instantiateSingleCallFunctionType(functionType, typeArguments) { - if (functionType === unknownType) { - return unknownType; - } - var signature = getSingleCallSignature(functionType); - if (!signature) { - return unknownType; - } - var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); - return getOrCreateTypeFromSignature(instantiatedSignature); - } function createResolver() { return { getReferencedExportContainer: getReferencedExportContainer, @@ -27480,6 +28165,7 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, + moduleExportsSomeValue: moduleExportsSomeValue, isArgumentsLocalBinding: isArgumentsLocalBinding, getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; @@ -27490,7 +28176,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 248 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 250 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -27503,10 +28189,11 @@ var ts; mergeSymbolTable(globals, file.locals); } }); + // Setup global builtins + addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; // Initialize special types globalArrayType = getGlobalType("Array", /*arity*/ 1); globalObjectType = getGlobalType("Object"); @@ -27575,7 +28262,12 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + if (node.kind === 143 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } + else { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + } } else if (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); @@ -27595,30 +28287,30 @@ var ts; case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 149 /* IndexSignature */: - case 218 /* ModuleDeclaration */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - case 227 /* ExportAssignment */: + case 220 /* ModuleDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: + case 229 /* ExportAssignment */: case 138 /* Parameter */: break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118 /* AsyncKeyword */) && - node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 193 /* VariableStatement */: - case 216 /* TypeAliasDeclaration */: - if (node.modifiers && node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 195 /* VariableStatement */: + case 218 /* TypeAliasDeclaration */: + if (node.modifiers && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74 /* ConstKeyword */) && - node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -27633,6 +28325,11 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 74 /* ConstKeyword */: + if (node.kind !== 219 /* EnumDeclaration */ && node.parent.kind === 216 /* ClassDeclaration */) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74 /* ConstKeyword */)); + } + break; case 112 /* PublicKeyword */: case 111 /* ProtectedKeyword */: case 110 /* PrivateKeyword */: @@ -27657,7 +28354,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128 /* Abstract */) { @@ -27677,7 +28374,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 138 /* Parameter */) { @@ -27702,7 +28399,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } else if (node.kind === 138 /* Parameter */) { @@ -27717,13 +28414,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } else if (node.kind === 138 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 219 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4 /* Ambient */; @@ -27733,11 +28430,11 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 214 /* ClassDeclaration */) { + if (node.kind !== 216 /* ClassDeclaration */) { if (node.kind !== 143 /* MethodDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 214 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { + if (!(node.parent.kind === 216 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64 /* Static */) { @@ -27782,7 +28479,7 @@ var ts; } return; } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { + else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 138 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { @@ -27798,9 +28495,9 @@ var ts; } switch (node.kind) { case 143 /* MethodDeclaration */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: if (!node.asteriskToken) { return false; } @@ -27866,7 +28563,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 174 /* ArrowFunction */) { + if (node.kind === 176 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -27934,7 +28631,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 187 /* OmittedExpression */) { + if (arg.kind === 189 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -28012,14 +28709,14 @@ var ts; return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 181 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { + if (computedPropertyName.expression.kind === 183 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */ || + ts.Debug.assert(node.kind === 215 /* FunctionDeclaration */ || + node.kind === 175 /* FunctionExpression */ || node.kind === 143 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -28043,20 +28740,25 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; + var _loop_1 = function(prop) { var name_16 = prop.name; - if (prop.kind === 187 /* OmittedExpression */ || + if (prop.kind === 189 /* OmittedExpression */ || name_16.kind === 136 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name_16); - continue; + return "continue"; } - if (prop.kind === 246 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 248 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error - return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); + return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } + // Modifiers are never allowed on properties except for 'async' on a method declaration + ts.forEach(prop.modifiers, function (mod) { + if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 143 /* MethodDeclaration */) { + grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); + } + }); // ECMA-262 11.1.5 Object Initialiser // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true // a.This production is contained in strict code and IsDataDescriptor(previous) is true and @@ -28066,7 +28768,7 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */) { + if (prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_16.kind === 8 /* NumericLiteral */) { @@ -28092,27 +28794,33 @@ var ts; else { var existingKind = seen[name_16.text]; if (currentKind === Property && existingKind === Property) { - continue; + return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { seen[name_16.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } + }; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + var state_1 = _loop_1(prop); + if (typeof state_1 === "object") return state_1.value + if (state_1 === "continue") continue; } } function checkGrammarJsxElement(node) { var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 239 /* JsxSpreadAttribute */) { + if (attr.kind === 241 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; @@ -28124,7 +28832,7 @@ var ts; return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 240 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 242 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -28133,24 +28841,35 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 212 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 214 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var declarations = variableList.declarations; + // declarations.length can be zero if there is an error in variable declaration in for-of or for-in + // See http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements for details + // For example: + // var let = 10; + // for (let of [1,2,3]) {} // this is invalid ES6 syntax + // for (let in [1,2,3]) {} // this is invalid ES6 syntax + // We will then want to skip on grammar checking on variableList declaration + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } - var firstDeclaration = variableList.declarations[0]; + var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -28211,7 +28930,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 165 /* ObjectLiteralExpression */) { + if (node.parent.kind === 167 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -28235,7 +28954,7 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 215 /* InterfaceDeclaration */) { + else if (node.parent.kind === 217 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } else if (node.parent.kind === 155 /* TypeLiteral */) { @@ -28249,11 +28968,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 202 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 204 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -28261,8 +28980,8 @@ var ts; return false; } break; - case 206 /* SwitchStatement */: - if (node.kind === 203 /* BreakStatement */ && !node.label) { + case 208 /* SwitchStatement */: + if (node.kind === 205 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -28277,13 +28996,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 203 /* BreakStatement */ + var message = node.kind === 205 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 203 /* BreakStatement */ + var message = node.kind === 205 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -28295,7 +29014,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 162 /* ArrayBindingPattern */ || node.name.kind === 161 /* ObjectBindingPattern */) { + if (node.name.kind === 164 /* ArrayBindingPattern */ || node.name.kind === 163 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -28305,7 +29024,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 200 /* ForInStatement */ && node.parent.parent.kind !== 201 /* ForOfStatement */) { + if (node.parent.parent.kind !== 202 /* ForInStatement */ && node.parent.parent.kind !== 203 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -28322,7 +29041,7 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 /* ES6 */ && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); // 1. LexicalDeclaration : LetOrConst BindingList ; // It is a Syntax Error if the BoundNames of BindingList contains "let". // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding @@ -28333,7 +29052,7 @@ var ts; } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 69 /* Identifier */) { - if (name.text === "let") { + if (name.originalKeywordKind === 108 /* LetKeyword */) { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } @@ -28341,7 +29060,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -28358,15 +29077,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return false; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -28381,23 +29100,6 @@ var ts; } } } - function isIntegerLiteral(expression) { - if (expression.kind === 179 /* PrefixUnaryExpression */) { - var unaryExpression = expression; - if (unaryExpression.operator === 35 /* PlusToken */ || unaryExpression.operator === 36 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 8 /* NumericLiteral */) { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); - } - return false; - } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -28422,10 +29124,6 @@ var ts; return true; } } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 /* Identifier */ && - (node.text === "eval" || node.text === "arguments"); - } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -28443,15 +29141,21 @@ var ts; return true; } } - else if (node.parent.kind === 215 /* InterfaceDeclaration */) { + else if (node.parent.kind === 217 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); + } } else if (node.parent.kind === 155 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } } if (ts.isInAmbientContext(node) && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -28470,12 +29174,12 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 215 /* InterfaceDeclaration */ || - node.kind === 216 /* TypeAliasDeclaration */ || - node.kind === 222 /* ImportDeclaration */ || - node.kind === 221 /* ImportEqualsDeclaration */ || - node.kind === 228 /* ExportDeclaration */ || - node.kind === 227 /* ExportAssignment */ || + if (node.kind === 217 /* InterfaceDeclaration */ || + node.kind === 218 /* TypeAliasDeclaration */ || + node.kind === 224 /* ImportDeclaration */ || + node.kind === 223 /* ImportEqualsDeclaration */ || + node.kind === 230 /* ExportDeclaration */ || + node.kind === 229 /* ExportAssignment */ || (node.flags & 4 /* Ambient */) || (node.flags & (2 /* Export */ | 512 /* Default */))) { return false; @@ -28485,7 +29189,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 193 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 195 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -28511,7 +29215,7 @@ var ts; // to prevent noisyness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 192 /* Block */ || node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + if (node.parent.kind === 194 /* Block */ || node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -28536,21 +29240,293 @@ var ts; return true; } } + var _a; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); /// /* @internal */ var ts; +(function (ts) { + var nullSourceMapWriter; + function getNullSourceMapWriter() { + if (nullSourceMapWriter === undefined) { + nullSourceMapWriter = { + getSourceMapData: function () { return undefined; }, + setSourceFile: function (sourceFile) { }, + emitStart: function (range) { }, + emitEnd: function (range) { }, + emitPos: function (pos) { }, + getText: function () { return undefined; }, + getSourceMappingURL: function () { return undefined; }, + initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, + reset: function () { } + }; + } + return nullSourceMapWriter; + } + ts.getNullSourceMapWriter = getNullSourceMapWriter; + function createSourceMapWriter(host, writer) { + var compilerOptions = host.getCompilerOptions(); + var currentSourceFile; + var sourceMapDir; // The directory in which sourcemap will be + // Current source map file and its index in the sources list + var sourceMapSourceIndex; + // Last recorded and encoded spans + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan; + var lastEncodedNameIndex; + // Source map data + var sourceMapData; + return { + getSourceMapData: function () { return sourceMapData; }, + setSourceFile: setSourceFile, + emitPos: emitPos, + emitStart: emitStart, + emitEnd: emitEnd, + getText: getText, + getSourceMappingURL: getSourceMappingURL, + initialize: initialize, + reset: reset + }; + function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + if (sourceMapData) { + reset(); + } + currentSourceFile = undefined; + // Current source map file and its index in the sources list + sourceMapSourceIndex = -1; + // Last recorded and encoded spans + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + lastEncodedNameIndex = 0; + // Initialize source map data + sourceMapData = { + sourceMapFilePath: sourceMapFilePath, + jsSourceMappingURL: !compilerOptions.inlineSourceMap ? ts.getBaseFileName(ts.normalizeSlashes(sourceMapFilePath)) : undefined, + sourceMapFile: ts.getBaseFileName(ts.normalizeSlashes(filePath)), + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined, + sourceMapDecodedMappings: [] + }; + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // relative paths of the sources list in the sourcemap + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (!isBundledEmit) { + ts.Debug.assert(sourceFiles.length === 1); + // For modules or multiple emit files the mapRoot will have directory structure like the sources + // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + // The relative paths are relative to the common directory + sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap + host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(filePath)); + } + } + function reset() { + currentSourceFile = undefined; + sourceMapDir = undefined; + sourceMapSourceIndex = undefined; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = undefined; + lastEncodedNameIndex = undefined; + sourceMapData = undefined; + } + // Encoding for sourcemap span + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Line/Comma delimiters + if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { + // Emit comma to separate the entry + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + // Emit line delimiters + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + // 1. Relative Column 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + // 2. Relative sourceIndex + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + // 3. Relative sourceLine 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + // 4. Relative sourceColumn 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + // 5. Relative namePosition 0 based + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + } + function emitPos(pos) { + if (pos === -1) { + return; + } + var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + // Convert the location to be one-based. + sourceLinePos.line++; + sourceLinePos.character++; + var emittedLine = writer.getLine(); + var emittedColumn = writer.getColumn(); + // If this location wasn't recorded or the location in source is going backwards, record the span + if (!lastRecordedSourceMapSpan || + lastRecordedSourceMapSpan.emittedLine !== emittedLine || + lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || + (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && + (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || + (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + // Encode the last recordedSpan before assigning new + encodeLastRecordedSourceMapSpan(); + // New span + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + sourceIndex: sourceMapSourceIndex + }; + } + else { + // Take the new pos instead since there is no change in emittedLine and column since last location + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; + } + } + function emitStart(range) { + var rangeHasDecorators = !!range.decorators; + emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + } + function emitEnd(range) { + emitPos(range.end); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + // Add the file to tsFilePaths + // If sourceroot option: Use the relative path corresponding to the common directory path + // otherwise source locations relative to map file location + var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; + var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSourceFile.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); + sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + if (sourceMapSourceIndex === -1) { + sourceMapSourceIndex = sourceMapData.sourceMapSources.length; + sourceMapData.sourceMapSources.push(source); + // The one that can be used from program to get the actual source file + sourceMapData.inputSourceFileNames.push(sourceFile.fileName); + if (compilerOptions.inlineSources) { + sourceMapData.sourceMapSourcesContent.push(sourceFile.text); + } + } + } + function getText() { + encodeLastRecordedSourceMapSpan(); + return ts.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings, + sourcesContent: sourceMapData.sourceMapSourcesContent + }); + } + function getSourceMappingURL() { + if (compilerOptions.inlineSourceMap) { + // Encode the sourceMap into the sourceMap url + var base64SourceMapText = ts.convertToBase64(getText()); + return sourceMapData.jsSourceMappingURL = "data:application/json;base64," + base64SourceMapText; + } + else { + return sourceMapData.jsSourceMappingURL; + } + } + } + ts.createSourceMapWriter = createSourceMapWriter; + var base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + function base64FormatEncode(inValue) { + if (inValue < 64) { + return base64Chars.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + function base64VLQFormatEncode(inValue) { + // Add a new least significant bit that has the sign of the value. + // if negative number the least significant bit that gets added to the number has value 1 + // else least significant bit value that gets added is 0 + // eg. -1 changes to binary : 01 [1] => 3 + // +1 changes to binary : 01 [0] => 2 + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + // Encode 5 bits at a time starting from least significant bits + var encodedStr = ""; + do { + var currentDigit = inValue & 31; // 11111 + inValue = inValue >> 5; + if (inValue > 0) { + // There are still more digits to decode, set the msb (6th bit) + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } +})(ts || (ts = {})); +/// +/* @internal */ +var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + var declarationDiagnostics = ts.createDiagnosticCollection(); + ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName); + function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + var declarationFilePath = _a.declarationFilePath; + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit); + } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -28568,103 +29544,79 @@ var ts; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var noDeclare = !root; + var noDeclare; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; // Contains the reference paths that needs to go in the declaration file. // Collecting this separately because reference paths need to be first thing in the declaration file // and we could be collecting these paths from multiple files into single one with --out option var referencePathsOutput = ""; - if (root) { - // Emitting just a single file, so emit references in this file only + // Emit references corresponding to each file + var emittedReferencedFiles = []; + var addedGlobalFileReference = false; + var allSourcesModuleElementDeclarationEmitInfo = []; + ts.forEach(sourceFiles, function (sourceFile) { + // Dont emit for javascript file + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + // Check what references need to be added if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - // All the references that are not going to be part of same file - if (referencedFile && ((referencedFile.flags & 4096 /* DeclarationFile */) || - ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + // Emit reference in dts, if the file reference was not already emitted + if (referencedFile && !ts.contains(emittedReferencedFiles, referencedFile)) { + // Add a reference to generated dts file, + // global file reference is added only + // - if it is not bundled emit (because otherwise it would be self reference) + // - and it is not already added + if (writeReferencePath(referencedFile, !isBundledEmit && !addedGlobalFileReference)) { addedGlobalFileReference = true; } + emittedReferencedFiles.push(referencedFile); } }); } - emitSourceFile(root); + if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { + noDeclare = false; + emitSourceFile(sourceFile); + } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + } // create asynchronous output for the importDeclarations if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 224 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 0); + ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + increaseIndent(); + } writeImportDeclaration(aliasEmitInfo.node); aliasEmitInfo.asynchronousOutput = writer.getText(); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + decreaseIndent(); + } } }); setWriter(oldWriter); + allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; } - } - else { - // Emit references corresponding to this file - var emittedReferencedFiles = []; - var prevModuleElementDeclarationEmitInfo = []; - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - // If the reference file is a declaration file, emit that reference - if (referencedFile && (ts.isDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - } - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - noDeclare = false; - emitSourceFile(sourceFile); - } - else if (ts.isExternalModule(sourceFile)) { - noDeclare = true; - write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); - writeLine(); - increaseIndent(); - emitSourceFile(sourceFile); - decreaseIndent(); - write("}"); - writeLine(); - // create asynchronous output for the importDeclarations - if (moduleElementDeclarationEmitInfo.length) { - var oldWriter = writer; - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); - createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 1); - increaseIndent(); - writeImportDeclaration(aliasEmitInfo.node); - aliasEmitInfo.asynchronousOutput = writer.getText(); - decreaseIndent(); - } - }); - setWriter(oldWriter); - } - prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); - moduleElementDeclarationEmitInfo = []; - } - }); - moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); - } + }); return { reportedDeclarationError: reportedDeclarationError, - moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -28707,10 +29659,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 211 /* VariableDeclaration */) { + if (declaration.kind === 213 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 225 /* NamedImports */ || declaration.kind === 226 /* ImportSpecifier */ || declaration.kind === 223 /* ImportClause */) { + else if (declaration.kind === 227 /* NamedImports */ || declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 225 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -28728,7 +29680,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 222 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 224 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -28738,12 +29690,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 218 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 218 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -28766,10 +29718,10 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } } } @@ -28779,7 +29731,8 @@ var ts; } function reportInaccessibleThisError() { if (errorNameNode) { - diagnostics.push(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); } } function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { @@ -28850,10 +29803,10 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 97 /* ThisKeyword */: - case 9 /* StringLiteral */: + case 161 /* ThisType */: + case 162 /* StringLiteralType */: return writeTextOfNode(currentText, type); - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); case 151 /* TypeReference */: return emitTypeReference(type); @@ -28896,13 +29849,13 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 221 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 223 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 166 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 168 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -28980,7 +29933,8 @@ var ts; } var count = 0; while (true) { - var name_18 = baseName + "_" + (++count); + count++; + var name_18 = baseName + "_" + count; if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } @@ -29026,10 +29980,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 221 /* ImportEqualsDeclaration */ || - (node.parent.kind === 248 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 223 /* ImportEqualsDeclaration */ || + (node.parent.kind === 250 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -29039,7 +29993,7 @@ var ts; }); } else { - if (node.kind === 222 /* ImportDeclaration */) { + if (node.kind === 224 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -29057,23 +30011,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return writeVariableStatement(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return writeClassDeclaration(node); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -29081,7 +30035,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 248 /* SourceFile */) { + if (node.parent.kind === 250 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -29089,7 +30043,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 215 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 217 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -29124,7 +30078,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + emitExternalModuleSpecifier(node); write(");"); } writer.writeLine(); @@ -29138,7 +30092,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 224 /* NamespaceImport */) { + if (namedBindings.kind === 226 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -29166,7 +30120,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -29178,13 +30132,22 @@ var ts; } write(" from "); } - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); write(";"); writer.writeLine(); } - function emitExternalModuleSpecifier(moduleSpecifier) { - if (moduleSpecifier.kind === 9 /* StringLiteral */ && (!root) && (compilerOptions.out || compilerOptions.outFile)) { - var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + function emitExternalModuleSpecifier(parent) { + var moduleSpecifier; + if (parent.kind === 223 /* ImportEqualsDeclaration */) { + var node = parent; + moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); + } + else { + var node = parent; + moduleSpecifier = node.moduleSpecifier; + } + if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { write("\""); write(moduleName); @@ -29221,7 +30184,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); } write(";"); writer.writeLine(); @@ -29236,7 +30199,7 @@ var ts; write("module "); } writeTextOfNode(currentText, node.name); - while (node.body.kind !== 219 /* ModuleBlock */) { + while (node.body.kind !== 221 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -29331,10 +30294,10 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 148 /* ConstructSignature */: @@ -29348,14 +30311,14 @@ var ts; if (node.parent.flags & 64 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -29389,7 +30352,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + if (node.parent.parent.kind === 216 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -29473,7 +30436,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 211 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 213 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -29495,7 +30458,7 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 211 /* VariableDeclaration */) { + if (node.kind === 213 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29511,7 +30474,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29543,7 +30506,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { elements.push(element); } } @@ -29685,13 +30648,13 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } else if (node.kind === 143 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } @@ -29712,6 +30675,8 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; // Construct signature or constructor type write new Signature if (node.kind === 148 /* ConstructSignature */ || node.kind === 153 /* ConstructorType */) { write("new "); @@ -29723,8 +30688,6 @@ var ts; else { write("("); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; // Parameters emitCommaList(node.parameters, emitParameterDeclaration); if (node.kind === 149 /* IndexSignature */) { @@ -29780,7 +30743,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -29794,7 +30757,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -29872,7 +30835,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29885,7 +30848,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29897,12 +30860,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 161 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 163 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 162 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 164 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -29913,15 +30876,7 @@ var ts; } } function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.kind === 187 /* OmittedExpression */) { + if (bindingElement.kind === 189 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -29930,7 +30885,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 163 /* BindingElement */) { + else if (bindingElement.kind === 165 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -29969,20 +30924,20 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: - case 218 /* ModuleDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 215 /* InterfaceDeclaration */: - case 214 /* ClassDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: + case 215 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 217 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return emitExportDeclaration(node); case 144 /* Constructor */: case 143 /* MethodDeclaration */: @@ -29998,35 +30953,57 @@ var ts; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return emitPropertyDeclaration(node); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return emitExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return emitSourceFile(node); } } - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 4096 /* DeclarationFile */ - ? referencedFile.fileName // Declaration file, use declaration file name - : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) - ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file - : ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; // Global out file - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ false); - referencePathsOutput += "/// " + newLine; + /** + * Adds the reference to referenced file, returns true if global file reference was emitted + * @param referencedFile + * @param addBundledFileReference Determines if global file reference corresponding to bundled file should be emitted or not + */ + function writeReferencePath(referencedFile, addBundledFileReference) { + var declFileName; + var addedBundledEmitReference = false; + if (ts.isDeclarationFile(referencedFile)) { + // Declaration file, use declaration file name + declFileName = referencedFile.fileName; + } + else { + // Get the declaration file path + ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile); + } + if (declFileName) { + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); + referencePathsOutput += "/// " + newLine; + } + return addedBundledEmitReference; + function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) { + // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path + if (isBundledEmit && !addBundledFileReference) { + return; + } + ts.Debug.assert(!!emitFileNames.declarationFilePath || ts.isSourceFileJavaScript(referencedFile), "Declaration file is not present only for javascript files"); + declFileName = emitFileNames.declarationFilePath || emitFileNames.jsFilePath; + addedBundledEmitReference = isBundledEmit; + } } } /* @internal */ - function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - // TODO(shkamat): Should we not write any declaration file if any of them can produce error, - // or should we just not write this file like we are doing now - if (!emitDeclarationResult.reportedDeclarationError) { + function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit); + var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; + if (!emitSkipped) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM); } + return emitSkipped; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; @@ -30045,14 +31022,11 @@ var ts; ts.writeDeclarationFile = writeDeclarationFile; })(ts || (ts = {})); /// +/// /// /* @internal */ var ts; (function (ts) { - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function getResolvedExternalModuleName(host, file) { return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); } @@ -30345,43 +31319,17 @@ var ts; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; - var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var modulekind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - var diagnostics = []; + var emitterDiagnostics = ts.createDiagnosticCollection(); + var emitSkipped = false; var newLine = host.getNewLine(); - var jsxDesugaring = host.getCompilerOptions().jsx !== 1 /* Preserve */; - var shouldEmitJsx = function (s) { return (s.languageVariant === 1 /* JSX */ && !jsxDesugaring); }; - var outFile = compilerOptions.outFile || compilerOptions.out; var emitJavaScript = createFileEmitter(); - if (targetSourceFile === undefined) { - if (outFile) { - emitFile(outFile); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - } - } - else { - // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) - if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { - emitFile(outFile); - } - } - // Sort and make the unique list of diagnostics - diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); + ts.forEachExpectedEmitFile(host, emitFile, targetSourceFile); return { - emitSkipped: false, - diagnostics: diagnostics, + emitSkipped: emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), sourceMaps: sourceMapDataList }; function isUniqueLocalName(name, container) { @@ -30429,6 +31377,8 @@ var ts; function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; + var sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? ts.createSourceMapWriter(host, writer) : ts.getNullSourceMapWriter(); + var setSourceFile = sourceMap.setSourceFile, emitStart = sourceMap.emitStart, emitEnd = sourceMap.emitEnd, emitPos = sourceMap.emitPos; var currentSourceFile; var currentText; var currentLineMap; @@ -30451,40 +31401,18 @@ var ts; var decorateEmitted; var paramEmitted; var awaiterEmitted; - var tempFlags; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; var exportEquals; - var hasExportStars; - /** Write emitted output to disk */ - var writeEmittedFiles = writeJavaScriptFile; + var hasExportStarsToExportValues; var detachedCommentsInfo; - var writeComment = ts.writeCommentRange; - /** Emit a node */ - var emit = emitNodeWithCommentsAndWithoutSourcemap; - /** Called just before starting emit of a node */ - var emitStart = function (node) { }; - /** Called once the emit of the node is done */ - var emitEnd = function (node) { }; - /** Emit the text for the given token that comes after startPos - * This by default writes the text provided with the given tokenKind - * but if optional emitFn callback is provided the text is emitted using the callback instead of default text - * @param tokenKind the kind of the token to search and emit - * @param startPos the position in the source to start searching for the token - * @param emitFn if given will be invoked to emit the text instead of actual token emit */ - var emitToken = emitTokenText; - /** Called to before starting the lexical scopes as in function/class in the emitted code because of node - * @param scopeDeclaration node that starts the lexical scope - * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - /** Called after coming out of the scope */ - var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; - /** The root file passed to the emit function (if present) */ - var root; + /** Is the file being emitted into its own file */ + var isOwnFileEmit; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, @@ -30504,15 +31432,32 @@ var ts; _b ); return doEmit; - function doEmit(jsFilePath, rootFile) { + function doEmit(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + generatedNameSet = {}; + nodeToGeneratedName = []; + isOwnFileEmit = !isBundledEmit; + // Emit helpers from all the files + if (isBundledEmit && modulekind) { + ts.forEach(sourceFiles, emitEmitHelpers); + } + // Do not call emit directly. It does not set the currentSourceFile. + ts.forEach(sourceFiles, emitSourceFile); + writeLine(); + var sourceMappingURL = sourceMap.getSourceMappingURL(); + if (sourceMappingURL) { + write("//# sourceMappingURL=" + sourceMappingURL); + } + writeEmittedFiles(writer.getText(), jsFilePath, sourceMapFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); // reset the state + sourceMap.reset(); writer.reset(); currentSourceFile = undefined; currentText = undefined; currentLineMap = undefined; exportFunctionForFile = undefined; - generatedNameSet = {}; - nodeToGeneratedName = []; + generatedNameSet = undefined; + nodeToGeneratedName = undefined; computedPropertyNamesToGeneratedNames = undefined; convertedLoopState = undefined; extendsEmitted = false; @@ -30525,32 +31470,12 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = undefined; + hasExportStarsToExportValues = undefined; detachedCommentsInfo = undefined; sourceMapData = undefined; isEs6Module = false; renamedDependencies = undefined; isCurrentFileExternalModule = false; - root = rootFile; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(jsFilePath, root); - } - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - if (modulekind) { - ts.forEach(host.getSourceFiles(), emitEmitHelpers); - } - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { - emitSourceFile(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); } function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -30561,7 +31486,8 @@ var ts; renamedDependencies = sourceFile.renamedDependencies; currentFileIdentifiers = sourceFile.identifiers; isCurrentFileExternalModule = ts.isExternalModule(sourceFile); - emit(sourceFile); + setSourceFile(sourceFile); + emitNodeWithCommentsAndWithoutSourcemap(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && @@ -30630,17 +31556,17 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return makeUniqueName(node.text); - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 222 /* ImportDeclaration */: - case 228 /* ExportDeclaration */: + case 224 /* ImportDeclaration */: + case 230 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: - case 227 /* ExportAssignment */: + case 215 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: + case 229 /* ExportAssignment */: return generateNameForExportDefault(); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return generateNameForClassExpression(); } } @@ -30648,338 +31574,15 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps(jsFilePath, root) { - var sourceMapDir; // The directory in which sourcemap will be - // Current source map file and its index in the sources list - var sourceMapSourceIndex = -1; - // Names and its index map - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; + /** Write emitted output to disk */ + function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark) { + if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { + ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), /*writeByteOrderMark*/ false); } - // Last recorded and encoded spans - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - // Encoding for sourcemap span - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - // Line/Comma delimiters - if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { - // Emit comma to separate the entry - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - // Emit line delimiters - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - // 1. Relative Column 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - // 2. Relative sourceIndex - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - // 3. Relative sourceLine 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - // 4. Relative sourceColumn 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - // 5. Relative namePosition 0 based - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - // Add a new least significant bit that has the sign of the value. - // if negative number the least significant bit that gets added to the number has value 1 - // else least significant bit value that gets added is 0 - // eg. -1 changes to binary : 01 [1] => 3 - // +1 changes to binary : 01 [0] => 2 - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - // Encode 5 bits at a time starting from least significant bits - var encodedStr = ""; - do { - var currentDigit = inValue & 31; // 11111 - inValue = inValue >> 5; - if (inValue > 0) { - // There are still more digits to decode, set the msb (6th bit) - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } + if (sourceMapDataList) { + sourceMapDataList.push(sourceMap.getSourceMapData()); } - function recordSourceMapSpan(pos) { - var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); - // Convert the location to be one-based. - sourceLinePos.line++; - sourceLinePos.character++; - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - // If this location wasn't recorded or the location in source is going backwards, record the span - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine !== emittedLine || - lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - // Encode the last recordedSpan before assigning new - encodeLastRecordedSourceMapSpan(); - // New span - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - // Take the new pos instead since there is no change in emittedLine and column since last location - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentText, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - // Add the file to tsFilePaths - // If sourceroot option: Use the relative path corresponding to the common directory path - // otherwise source locations relative to map file location - var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - // The one that can be used from program to get the actual source file - sourceMapData.inputSourceFileNames.push(node.fileName); - if (compilerOptions.inlineSources) { - if (!sourceMapData.sourceMapSourcesContent) { - sourceMapData.sourceMapSourcesContent = []; - } - sourceMapData.sourceMapSourcesContent.push(node.text); - } - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - // Child scopes are always shown with a dot (even if they have no name), - // unless it is a computed property. Then it is shown with brackets, - // but the brackets are included in the name. - var name_21 = node.name; - if (!name_21 || name_21.kind !== 136 /* ComputedPropertyName */) { - scopeName = "." + scopeName; - } - scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - // The scope was already given a name use it - recordScopeNameStart(scopeName); - } - else if (node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 142 /* MethodSignature */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */ || - node.kind === 218 /* ModuleDeclaration */ || - node.kind === 214 /* ClassDeclaration */ || - node.kind === 217 /* EnumDeclaration */) { - // Declaration and has associated name use it - if (node.name) { - var name_22 = node.name; - // For computed property names, the text will include the brackets - scopeName = name_22.kind === 136 /* ComputedPropertyName */ - ? ts.getTextOfNode(name_22) - : node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - // Block just use the name from upper level scope - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { - if (typeof JSON !== "undefined") { - var map_1 = { - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }; - if (sourcesContent !== undefined) { - map_1.sourcesContent = sourcesContent; - } - return JSON.stringify(map_1); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); - sourceMapDataList.push(sourceMapData); - var sourceMapUrl; - if (compilerOptions.inlineSourceMap) { - // Encode the sourceMap into the sourceMap url - var base64SourceMapText = ts.convertToBase64(sourceMapText); - sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; - } - else { - // Write source map file - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, /*writeByteOrderMark*/ false); - sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; - } - // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); - } - // Initialize source map data - var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapSourcesContent: undefined, - sourceMapDecodedMappings: [] - }; - // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the - // relative paths of the sources list in the sourcemap - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - // For modules or multiple emit files the mapRoot will have directory structure like the sources - // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - // The relative paths are relative to the common directory - sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), // get the relative sourceMapDir path based on jsFilePath - ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap - host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithSourceMap(node) { - if (node) { - if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); - } - if (node.kind !== 248 /* SourceFile */) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); - } - } - } - function emitNodeWithCommentsAndWithSourcemap(node) { - emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithCommentsAndWithSourcemap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { - ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, emitterDiagnostics, jsFilePath, emitOutput, writeByteOrderMark); } // Create a temporary variable with a unique unused name. function createTempVariable(flags) { @@ -31011,7 +31614,15 @@ var ts; write(";"); } } - function emitTokenText(tokenKind, startPos, emitFn) { + /** Emit the text for the given token that comes after startPos + * This by default writes the text provided with the given tokenKind + * but if optional emitFn callback is provided the text is emitted using the callback instead of default text + * @param tokenKind the kind of the token to search and emit + * @param startPos the position in the source to start searching for the token + * @param emitFn if given will be invoked to emit the text instead of actual token emit */ + function emitToken(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(currentText, startPos); + emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); @@ -31019,7 +31630,9 @@ var ts; else { write(tokenString); } - return startPos + tokenString.length; + var tokenEndPos = tokenStartPos + tokenString.length; + emitPos(tokenEndPos); + return tokenEndPos; } function emitOptional(prefix, node) { if (node) { @@ -31036,11 +31649,6 @@ var ts; write(")"); } } - function emitTrailingCommaIfPresent(nodeList) { - if (nodeList.hasTrailingComma) { - write(","); - } - } function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); @@ -31113,7 +31721,7 @@ var ts; } function emitCommaList(nodes) { if (nodes) { - emitList(nodes, 0, nodes.length, /*multiline*/ false, /*trailingComma*/ false); + emitList(nodes, 0, nodes.length, /*multiLine*/ false, /*trailingComma*/ false); } } function emitLines(nodes) { @@ -31228,10 +31836,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 183 /* TemplateExpression */) { + if (node.template.kind === 185 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 181 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 183 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 24 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -31266,7 +31874,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 172 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 174 /* ParenthesizedExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { // If this is the first span and the head was not emitted, then this templateSpan's @@ -31308,11 +31916,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return parent.expression === template; - case 170 /* TaggedTemplateExpression */: - case 172 /* ParenthesizedExpression */: + case 172 /* TaggedTemplateExpression */: + case 174 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -31333,7 +31941,7 @@ var ts; // TODO (drosen): Note that we need to account for the upcoming 'yield' and // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 37 /* AsteriskToken */: case 39 /* SlashToken */: @@ -31345,8 +31953,8 @@ var ts; default: return -1 /* LessThan */; } - case 184 /* YieldExpression */: - case 182 /* ConditionalExpression */: + case 186 /* YieldExpression */: + case 184 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -31374,13 +31982,13 @@ var ts; /// these emit into an object literal property name, we don't need to be worried /// about keywords, just non-identifier characters function emitAttributeName(name) { - if (/[A-Za-z_]+[\w*]/.test(name.text)) { - write("\""); + if (/^[A-Za-z_]\w*$/.test(name.text)) { emit(name); - write("\""); } else { + write("\""); emit(name); + write("\""); } } /// Emit an name/value pair for an attribute (e.g. "x: 3") @@ -31396,7 +32004,7 @@ var ts; } function emitJsxElement(openingNode, children) { var syntheticReactRef = ts.createSynthesizedNode(69 /* Identifier */); - syntheticReactRef.text = "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; // Call React.createElement(tag, ... emitLeadingComments(openingNode); @@ -31413,12 +32021,12 @@ var ts; // Either emit one big object literal (no spread attribs), or // a call to React.__spread var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 239 /* JsxSpreadAttribute */; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 241 /* JsxSpreadAttribute */; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 239 /* JsxSpreadAttribute */) { + if (attrs[i_1].kind === 241 /* JsxSpreadAttribute */) { // If this is the first argument, we need to emit a {} as the first argument if (i_1 === 0) { write("{}, "); @@ -31433,7 +32041,7 @@ var ts; emit(attrs[i_1].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 238 /* JsxAttribute */); + ts.Debug.assert(attrs[i_1].kind === 240 /* JsxAttribute */); if (haveOpenedObjectLiteral) { write(", "); } @@ -31467,11 +32075,11 @@ var ts; if (children) { for (var i = 0; i < children.length; i++) { // Don't emit empty expressions - if (children[i].kind === 240 /* JsxExpression */ && !(children[i].expression)) { + if (children[i].kind === 242 /* JsxExpression */ && !(children[i].expression)) { continue; } // Don't emit empty strings - if (children[i].kind === 236 /* JsxText */) { + if (children[i].kind === 238 /* JsxText */) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -31489,11 +32097,11 @@ var ts; write(")"); // closes "React.createElement(" emitTrailingComments(openingNode); } - if (node.kind === 233 /* JsxElement */) { + if (node.kind === 235 /* JsxElement */) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); emitJsxElement(node); } } @@ -31515,11 +32123,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 239 /* JsxSpreadAttribute */) { + if (attribs[i].kind === 241 /* JsxSpreadAttribute */) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 238 /* JsxAttribute */); + ts.Debug.assert(attribs[i].kind === 240 /* JsxAttribute */); emitJsxAttribute(attribs[i]); } } @@ -31527,11 +32135,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 234 /* JsxSelfClosingElement */)) { + if (node.attributes.length > 0 || (node.kind === 236 /* JsxSelfClosingElement */)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 234 /* JsxSelfClosingElement */) { + if (node.kind === 236 /* JsxSelfClosingElement */) { write("/>"); } else { @@ -31550,11 +32158,11 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 233 /* JsxElement */) { + if (node.kind === 235 /* JsxElement */) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); emitJsxOpeningOrSelfClosingElement(node); } } @@ -31562,7 +32170,7 @@ var ts; // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 163 /* BindingElement */); + ts.Debug.assert(node.kind !== 165 /* BindingElement */); if (node.kind === 9 /* StringLiteral */) { emitLiteral(node); } @@ -31610,59 +32218,60 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 164 /* ArrayLiteralExpression */: - case 189 /* AsExpression */: - case 181 /* BinaryExpression */: - case 168 /* CallExpression */: - case 241 /* CaseClause */: + case 166 /* ArrayLiteralExpression */: + case 191 /* AsExpression */: + case 183 /* BinaryExpression */: + case 170 /* CallExpression */: + case 243 /* CaseClause */: case 136 /* ComputedPropertyName */: - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: case 139 /* Decorator */: - case 175 /* DeleteExpression */: - case 197 /* DoStatement */: - case 167 /* ElementAccessExpression */: - case 227 /* ExportAssignment */: - case 195 /* ExpressionStatement */: - case 188 /* ExpressionWithTypeArguments */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 196 /* IfStatement */: - case 234 /* JsxSelfClosingElement */: - case 235 /* JsxOpeningElement */: - case 239 /* JsxSpreadAttribute */: - case 240 /* JsxExpression */: - case 169 /* NewExpression */: - case 172 /* ParenthesizedExpression */: - case 180 /* PostfixUnaryExpression */: - case 179 /* PrefixUnaryExpression */: - case 204 /* ReturnStatement */: - case 246 /* ShorthandPropertyAssignment */: - case 185 /* SpreadElementExpression */: - case 206 /* SwitchStatement */: - case 170 /* TaggedTemplateExpression */: - case 190 /* TemplateSpan */: - case 208 /* ThrowStatement */: - case 171 /* TypeAssertionExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 184 /* YieldExpression */: + case 177 /* DeleteExpression */: + case 199 /* DoStatement */: + case 169 /* ElementAccessExpression */: + case 229 /* ExportAssignment */: + case 197 /* ExpressionStatement */: + case 190 /* ExpressionWithTypeArguments */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 198 /* IfStatement */: + case 239 /* JsxClosingElement */: + case 236 /* JsxSelfClosingElement */: + case 237 /* JsxOpeningElement */: + case 241 /* JsxSpreadAttribute */: + case 242 /* JsxExpression */: + case 171 /* NewExpression */: + case 174 /* ParenthesizedExpression */: + case 182 /* PostfixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: + case 206 /* ReturnStatement */: + case 248 /* ShorthandPropertyAssignment */: + case 187 /* SpreadElementExpression */: + case 208 /* SwitchStatement */: + case 172 /* TaggedTemplateExpression */: + case 192 /* TemplateSpan */: + case 210 /* ThrowStatement */: + case 173 /* TypeAssertionExpression */: + case 178 /* TypeOfExpression */: + case 179 /* VoidExpression */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 186 /* YieldExpression */: return true; - case 163 /* BindingElement */: - case 247 /* EnumMember */: + case 165 /* BindingElement */: + case 249 /* EnumMember */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return parent.initializer === node; - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return parent.expression === node; - case 174 /* ArrowFunction */: - case 173 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 175 /* FunctionExpression */: return parent.body === node; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return parent.moduleReference === node; case 135 /* QualifiedName */: return parent.left === node; @@ -31676,7 +32285,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 248 /* SourceFile */) { + if (container.kind === 250 /* SourceFile */) { // Identifier references module export if (modulekind !== 5 /* ES6 */ && modulekind !== 4 /* System */) { write("exports."); @@ -31692,17 +32301,17 @@ var ts; if (modulekind !== 5 /* ES6 */) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 223 /* ImportClause */) { + if (declaration.kind === 225 /* ImportClause */) { // Identifier references default import write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 /* ES3 */ ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 226 /* ImportSpecifier */) { + else if (declaration.kind === 228 /* ImportSpecifier */) { // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); + var name_21 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -31733,10 +32342,10 @@ var ts; if (languageVersion < 2 /* ES6 */) { var parent_6 = node.parent; switch (parent_6.kind) { - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 211 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 213 /* VariableDeclaration */: return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); } } @@ -31746,8 +32355,8 @@ var ts; if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { // in converted loop body arguments cannot be used directly. - var name_24 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_24); + var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_22); return; } } @@ -31771,6 +32380,9 @@ var ts; if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); } + else if (convertedLoopState) { + write(convertedLoopState.thisName || (convertedLoopState.thisName = makeUniqueName("this"))); + } else { write("this"); } @@ -31844,10 +32456,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 181 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 183 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 182 /* ConditionalExpression */ && node.parent.condition === node) { + else if (node.parent.kind === 184 /* ConditionalExpression */ && node.parent.condition === node) { return true; } return false; @@ -31855,11 +32467,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69 /* Identifier */: - case 164 /* ArrayLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 172 /* ParenthesizedExpression */: + case 166 /* ArrayLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 174 /* ParenthesizedExpression */: // This list is not exhaustive and only includes those cases that are relevant // to the check in emitArrayLiteral. More cases can be added as needed. return false; @@ -31879,17 +32491,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 185 /* SpreadElementExpression */) { + if (e.kind === 187 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 164 /* ArrayLiteralExpression */) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166 /* ArrayLiteralExpression */) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 185 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 187 /* SpreadElementExpression */) { i++; } write("["); @@ -31912,7 +32524,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 185 /* SpreadElementExpression */; + return node.kind === 187 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -31921,7 +32533,7 @@ var ts; } else if (languageVersion >= 2 /* ES6 */ || !ts.forEach(elements, isSpreadElementExpression)) { write("["); - emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces:*/ false); + emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces*/ false); write("]"); } else { @@ -31941,7 +32553,7 @@ var ts; // then try to preserve the original shape of the object literal. // Otherwise just try to preserve the formatting. if (numElements === properties.length) { - emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= 1 /* ES5 */, /* spacesBetweenBraces */ true); + emitLinePreservingList(node, properties, /*allowTrailingComma*/ languageVersion >= 1 /* ES5 */, /*spacesBetweenBraces*/ true); } else { var multiLine = (node.flags & 1024 /* MultiLine */) !== 0; @@ -32034,10 +32646,10 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 245 /* PropertyAssignment */) { + if (property.kind === 247 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 246 /* ShorthandPropertyAssignment */) { + else if (property.kind === 248 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } else if (property.kind === 143 /* MethodDeclaration */) { @@ -32090,21 +32702,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(181 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(183 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(166 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(168 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(167 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(169 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -32112,7 +32724,7 @@ var ts; function parenthesizeForAccess(expr) { // When diagnosing whether the expression needs parentheses, the decision should be based // on the innermost expression in a chain of nested type assertions. - while (expr.kind === 171 /* TypeAssertionExpression */ || expr.kind === 189 /* AsExpression */) { + while (expr.kind === 173 /* TypeAssertionExpression */ || expr.kind === 191 /* AsExpression */) { expr = expr.expression; } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary @@ -32124,11 +32736,11 @@ var ts; // 1.x -> not the same as (1).x // if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 169 /* NewExpression */ && + expr.kind !== 171 /* NewExpression */ && expr.kind !== 8 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(172 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(174 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -32163,7 +32775,7 @@ var ts; // Return true if identifier resolves to an exported member of a namespace function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 248 /* SourceFile */; + return container && container.kind !== 250 /* SourceFile */; } function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here @@ -32193,7 +32805,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 166 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 168 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -32204,7 +32816,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 166 /* PropertyAccessExpression */ || node.kind === 167 /* ElementAccessExpression */ + return node.kind === 168 /* PropertyAccessExpression */ || node.kind === 169 /* ElementAccessExpression */ ? resolver.getConstantValue(node) : undefined; } @@ -32296,6 +32908,9 @@ var ts; case 135 /* QualifiedName */: emitQualifiedNameAsExpression(node, useFallback); break; + default: + emitNodeWithoutSourceMap(node); + break; } } function emitIndexedAccess(node) { @@ -32308,10 +32923,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 185 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 187 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 172 /* ParenthesizedExpression */ || node.kind === 171 /* TypeAssertionExpression */ || node.kind === 189 /* AsExpression */) { + while (node.kind === 174 /* ParenthesizedExpression */ || node.kind === 173 /* TypeAssertionExpression */ || node.kind === 191 /* AsExpression */) { node = node.expression; } return node; @@ -32332,13 +32947,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 166 /* PropertyAccessExpression */) { + if (expr.kind === 168 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 167 /* ElementAccessExpression */) { + else if (expr.kind === 169 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -32383,7 +32998,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 166 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; + superCall = node.expression.kind === 168 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -32425,7 +33040,7 @@ var ts; write(".bind.apply("); emit(target); write(", [void 0].concat("); - emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiline*/ false, /*trailingComma*/ false, /*useConcat*/ false); + emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*trailingComma*/ false, /*useConcat*/ false); write(")))"); write("()"); } @@ -32452,12 +33067,12 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 174 /* ArrowFunction */) { - if (node.expression.kind === 171 /* TypeAssertionExpression */ || node.expression.kind === 189 /* AsExpression */) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176 /* ArrowFunction */) { + if (node.expression.kind === 173 /* TypeAssertionExpression */ || node.expression.kind === 191 /* AsExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind === 171 /* TypeAssertionExpression */ || operand.kind === 189 /* AsExpression */) { + while (operand.kind === 173 /* TypeAssertionExpression */ || operand.kind === 191 /* AsExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -32468,15 +33083,15 @@ var ts; // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() // new (A()) should be emitted as new (A()) and not new A() // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () - if (operand.kind !== 179 /* PrefixUnaryExpression */ && - operand.kind !== 177 /* VoidExpression */ && - operand.kind !== 176 /* TypeOfExpression */ && - operand.kind !== 175 /* DeleteExpression */ && - operand.kind !== 180 /* PostfixUnaryExpression */ && - operand.kind !== 169 /* NewExpression */ && - !(operand.kind === 168 /* CallExpression */ && node.parent.kind === 169 /* NewExpression */) && - !(operand.kind === 173 /* FunctionExpression */ && node.parent.kind === 168 /* CallExpression */) && - !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 166 /* PropertyAccessExpression */)) { + if (operand.kind !== 181 /* PrefixUnaryExpression */ && + operand.kind !== 179 /* VoidExpression */ && + operand.kind !== 178 /* TypeOfExpression */ && + operand.kind !== 177 /* DeleteExpression */ && + operand.kind !== 182 /* PostfixUnaryExpression */ && + operand.kind !== 171 /* NewExpression */ && + !(operand.kind === 170 /* CallExpression */ && node.parent.kind === 171 /* NewExpression */) && + !(operand.kind === 175 /* FunctionExpression */ && node.parent.kind === 170 /* CallExpression */) && + !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 168 /* PropertyAccessExpression */)) { emit(operand); return; } @@ -32505,14 +33120,15 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 /* Identifier */ || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 211 /* VariableDeclaration */ || node.parent.kind === 163 /* BindingElement */); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 /* VariableDeclaration */ || node.parent.kind === 165 /* BindingElement */); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, /*isExported*/ true); } function emitPrefixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + var exportChanged = (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); if (exportChanged) { // emit // ++x @@ -32535,7 +33151,7 @@ var ts; // the resulting expression a prefix increment operation. And in the second, it will make the resulting // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. - if (node.operand.kind === 179 /* PrefixUnaryExpression */) { + if (node.operand.kind === 181 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 35 /* PlusToken */ && (operand.operator === 35 /* PlusToken */ || operand.operator === 41 /* PlusPlusToken */)) { write(" "); @@ -32591,10 +33207,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 248 /* SourceFile */) { + if (current.kind === 250 /* SourceFile */) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2 /* Export */) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 219 /* ModuleBlock */) { + else if (ts.isFunctionLike(current) || current.kind === 221 /* ModuleBlock */) { return false; } else { @@ -32614,8 +33230,8 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(167 /* ElementAccessExpression */, /*startsOnNewLine*/ false); - var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldEmitCommaBeforeAssignment*/ false); + synthesizedLHS = ts.createSynthesizedNode(169 /* ElementAccessExpression */, /*startsOnNewLine*/ false); + var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 /* NumericLiteral */ && leftHandSideExpression.argumentExpression.kind !== 9 /* StringLiteral */) { @@ -32631,8 +33247,8 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(166 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); - var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + synthesizedLHS = ts.createSynthesizedNode(168 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); + var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; synthesizedLHS.name = leftHandSideExpression.name; @@ -32659,8 +33275,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 56 /* EqualsToken */ && - (node.left.kind === 165 /* ObjectLiteralExpression */ || node.left.kind === 164 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 195 /* ExpressionStatement */); + (node.left.kind === 167 /* ObjectLiteralExpression */ || node.left.kind === 166 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 197 /* ExpressionStatement */); } else { var exportChanged = node.operatorToken.kind >= 56 /* FirstAssignment */ && @@ -32725,7 +33341,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 192 /* Block */) { + if (node && node.kind === 194 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -32739,22 +33355,20 @@ var ts; } emitToken(15 /* OpenBraceToken */, node.pos); increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 219 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 218 /* ModuleDeclaration */); + if (node.kind === 221 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 220 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 219 /* ModuleBlock */) { + if (node.kind === 221 /* ModuleBlock */) { emitTempDeclarations(/*newLine*/ true); } decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.statements.end); - scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 192 /* Block */) { + if (node.kind === 194 /* Block */) { write(" "); emit(node); } @@ -32766,7 +33380,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 174 /* ArrowFunction */); + emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 176 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -32779,7 +33393,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 196 /* IfStatement */) { + if (node.elseStatement.kind === 198 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -32794,12 +33408,12 @@ var ts; function emitDoStatementWorker(node, loop) { write("do"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } - if (node.statement.kind === 192 /* Block */) { + if (node.statement.kind === 194 /* Block */) { write(" "); } else { @@ -32817,10 +33431,10 @@ var ts; emit(node.expression); write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } /** @@ -32834,7 +33448,7 @@ var ts; return false; } if (convertedLoopState && (ts.getCombinedNodeFlags(decl) & 24576 /* BlockScoped */) === 0) { - // we are inside a converted loop - this can only happen in downlevel scenarios + // we are inside a converted loop - this can only happen in downlevel scenarios // record names for all variable declarations for (var _a = 0, _b = decl.declarations; _a < _b.length; _a++) { var varDecl = _b[_a]; @@ -32898,7 +33512,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 207 /* LabeledStatement */) { + if (node.parent.kind === 209 /* LabeledStatement */) { // if parent of the loop was labeled statement - attach the label to loop skipping converted loop body emitLabelAndColon(node.parent); } @@ -32909,10 +33523,10 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + if (node.initializer.kind === 214 /* VariableDeclarationList */) { loopInitializer = node.initializer; } break; @@ -32926,7 +33540,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 192 /* Block */; + var bodyIsBlock = node.statement.kind === 194 /* Block */; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -32945,6 +33559,11 @@ var ts; // use the same name in all nested loops convertedLoopState.argumentsName = convertedOuterLoopState.argumentsName; } + if (convertedOuterLoopState.thisName) { + // outer loop has already used 'this' so we've already have some name to alias it + // use the same name in all nested loops + convertedLoopState.thisName = convertedOuterLoopState.thisName; + } if (convertedOuterLoopState.hoistedLocalVariables) { // we've already collected some non-block scoped variable declarations in enclosing loop // use the same storage in nested loop @@ -32971,6 +33590,21 @@ var ts; writeLine(); } } + if (convertedLoopState.thisName) { + // if alias for this is set + if (convertedOuterLoopState) { + // pass it to outer converted loop + convertedOuterLoopState.thisName = convertedLoopState.thisName; + } + else { + // this is top level converted loop so we need to create an alias for 'this' here + // NOTE: + // if converted loops were all nested in arrow function then we'll always emit '_this' so convertedLoopState.thisName will not be set. + // If it is set this means that all nested loops are not nested in arrow function and it is safe to capture 'this'. + write("var " + convertedLoopState.thisName + " = this;"); + writeLine(); + } + } if (convertedLoopState.hoistedLocalVariables) { // if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later if (convertedOuterLoopState) { @@ -33027,7 +33661,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 192 /* Block */) { + else if (node.statement.kind === 194 /* Block */) { emitLines(node.statement.statements); } else { @@ -33097,8 +33731,8 @@ var ts; } write("switch(" + loopResultVariable + ") {"); increaseIndent(); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /* isBreak */ true, loopResultVariable, outerLoop); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /* isBreak */ false, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /*isBreak*/ true, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /*isBreak*/ false, loopResultVariable, outerLoop); decreaseIndent(); writeLine(); write("}"); @@ -33113,7 +33747,7 @@ var ts; write("case \"" + labelMarker + "\": "); // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue - // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do + // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { if (isBreak) { write("break "); @@ -33137,7 +33771,7 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); if (startIsEmitted) { @@ -33156,14 +33790,14 @@ var ts; emitOptional(" ", node.incrementor); write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 201 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 203 /* ForOfStatement */) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -33174,7 +33808,7 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); @@ -33184,7 +33818,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 200 /* ForInStatement */) { + if (node.kind === 202 /* ForInStatement */) { write(" in "); } else { @@ -33193,15 +33827,12 @@ var ts; emit(node.expression); emitToken(18 /* CloseParenToken */, node.expression.end); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } - function emitDownLevelForOfStatement(node) { - emitLoop(node, emitDownLevelForOfStatementWorker); - } function emitDownLevelForOfStatementWorker(node, loop) { // The following ES6 code: // @@ -33277,7 +33908,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -33307,7 +33938,7 @@ var ts; // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 56 /* EqualsToken */, rhsIterationValue, /*startsOnNewLine*/ false); - if (node.initializer.kind === 164 /* ArrayLiteralExpression */ || node.initializer.kind === 165 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 166 /* ArrayLiteralExpression */ || node.initializer.kind === 167 /* ObjectLiteralExpression */) { // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); @@ -33320,10 +33951,10 @@ var ts; write(";"); if (loop) { writeLine(); - emitConvertedLoopCall(loop, /* emitAsBlock */ false); + emitConvertedLoopCall(loop, /*emitAsBlock*/ false); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ false); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ false); } writeLine(); decreaseIndent(); @@ -33335,12 +33966,12 @@ var ts; // it is possible if either // - break\continue is statement labeled and label is located inside the converted loop // - break\continue is non-labeled and located in non-converted loop\switch statement - var jump = node.kind === 203 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 205 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 203 /* BreakStatement */) { + if (node.kind === 205 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; write("return \"break\";"); } @@ -33351,20 +33982,20 @@ var ts; } else { var labelMarker; - if (node.kind === 203 /* BreakStatement */) { + if (node.kind === 205 /* BreakStatement */) { labelMarker = "break-" + node.label.text; - setLabeledJump(convertedLoopState, /* isBreak */ true, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } else { labelMarker = "continue-" + node.label.text; - setLabeledJump(convertedLoopState, /* isBreak */ false, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ false, node.label.text, labelMarker); } write("return \"" + labelMarker + "\";"); } return; } } - emitToken(node.kind === 203 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -33430,7 +34061,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 241 /* CaseClause */) { + if (node.kind === 243 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -33499,7 +34130,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 218 /* ModuleDeclaration */); + } while (node && node.kind !== 220 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -33524,22 +34155,22 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(177 /* VoidExpression */); + var result = ts.createSynthesizedNode(179 /* VoidExpression */); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 248 /* SourceFile */) { - ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 227 /* ExportAssignment */); + if (node.parent.kind === 250 /* SourceFile */) { + ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 229 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { if (!isEs6Module) { - if (languageVersion === 1 /* ES5 */) { + if (languageVersion !== 0 /* ES3 */) { // default value of configurable, enumerable, writable are `false`. write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); } - else if (languageVersion === 0 /* ES3 */) { + else { write("exports.__esModule = true;"); writeLine(); } @@ -33636,7 +34267,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 211 /* VariableDeclaration */ || name.parent.kind === 163 /* BindingElement */); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 /* VariableDeclaration */ || name.parent.kind === 165 /* BindingElement */); if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } @@ -33670,7 +34301,7 @@ var ts; // Also temporary variables should be explicitly allocated for source level declarations when module target is system // because actual variable declarations are hoisted var canDefineTempVariablesInPlace = false; - if (root.kind === 211 /* VariableDeclaration */) { + if (root.kind === 213 /* VariableDeclaration */) { var isExported = ts.getCombinedNodeFlags(root) & 2 /* Export */; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; @@ -33678,7 +34309,7 @@ var ts; else if (root.kind === 138 /* Parameter */) { canDefineTempVariablesInPlace = true; } - if (root.kind === 181 /* BinaryExpression */) { + if (root.kind === 183 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -33707,14 +34338,14 @@ var ts; // we need to generate a temporary variable value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(181 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(183 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(182 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(184 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -33731,7 +34362,7 @@ var ts; var index; var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, /* reuseIdentifierExpression */ false); + index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -33744,7 +34375,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(168 /* CallExpression */); + var call = ts.createSynthesizedNode(170 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(69 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -33761,9 +34392,9 @@ var ts; } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { var propName = p.name; - var target_1 = p.kind === 246 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; + var target_1 = p.kind === 248 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); } } @@ -33777,8 +34408,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187 /* OmittedExpression */) { - if (e.kind !== 185 /* SpreadElementExpression */) { + if (e.kind !== 189 /* OmittedExpression */) { + if (e.kind !== 187 /* SpreadElementExpression */) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -33788,20 +34419,20 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 246 /* ShorthandPropertyAssignment */) { + if (target.kind === 248 /* ShorthandPropertyAssignment */) { if (target.objectAssignmentInitializer) { value = createDefaultValueCheck(value, target.objectAssignmentInitializer); } target = target.name; } - else if (target.kind === 181 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + else if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 165 /* ObjectLiteralExpression */) { + if (target.kind === 167 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 164 /* ArrayLiteralExpression */) { + else if (target.kind === 166 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -33819,14 +34450,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 172 /* ParenthesizedExpression */) { + if (root.parent.kind !== 174 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 172 /* ParenthesizedExpression */) { + if (root.parent.kind !== 174 /* ParenthesizedExpression */) { write(")"); } } @@ -33853,12 +34484,12 @@ var ts; } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 161 /* ObjectBindingPattern */) { + if (pattern.kind === 163 /* ObjectBindingPattern */) { // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 187 /* OmittedExpression */) { + else if (element.kind !== 189 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -33898,8 +34529,8 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 8192 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isLetDefinedInLoop && - node.parent.parent.kind !== 200 /* ForInStatement */ && - node.parent.parent.kind !== 201 /* ForOfStatement */) { + node.parent.parent.kind !== 202 /* ForInStatement */ && + node.parent.parent.kind !== 203 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -33917,7 +34548,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 187 /* OmittedExpression */) { + if (node.kind === 189 /* OmittedExpression */) { return; } var name = node.name; @@ -33929,7 +34560,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 211 /* VariableDeclaration */ && node.parent.kind !== 163 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 213 /* VariableDeclaration */ && node.parent.kind !== 165 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -33937,7 +34568,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2 /* Export */) && modulekind === 5 /* ES6 */ && - node.parent.kind === 248 /* SourceFile */; + node.parent.kind === 250 /* SourceFile */; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -33988,12 +34619,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_25 = createTempVariable(0 /* Auto */); + var name_23 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_25); - emit(name_25); + tempParameters.push(name_23); + emit(name_23); } else { emit(node.name); @@ -34103,7 +34734,7 @@ var ts; emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 174 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 176 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -34114,13 +34745,13 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 173 /* FunctionExpression */) { + if (node.kind === 175 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) - return !!node.name || languageVersion < 2 /* ES6 */; + return !!node.name || modulekind !== 5 /* ES6 */; } } function emitFunctionDeclaration(node) { @@ -34129,20 +34760,29 @@ var ts; } // TODO (yuisu) : we should not have special cases to condition emitting comments // but have one place to fix check for these conditions. - if (node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */ && - node.parent && node.parent.kind !== 245 /* PropertyAssignment */ && - node.parent.kind !== 168 /* CallExpression */) { - // 1. Methods will emit the comments as part of emitting method declaration + var kind = node.kind, parent = node.parent; + if (kind !== 143 /* MethodDeclaration */ && + kind !== 142 /* MethodSignature */ && + parent && + parent.kind !== 247 /* PropertyAssignment */ && + parent.kind !== 170 /* CallExpression */ && + parent.kind !== 166 /* ArrayLiteralExpression */) { + // 1. Methods will emit comments at their assignment declaration sites. + // // 2. If the function is a property of object literal, emitting leading-comments - // is done by emitNodeWithoutSourceMap which then call this function. - // In particular, we would like to avoid emit comments twice in following case: - // For example: + // is done by emitNodeWithoutSourceMap which then call this function. + // In particular, we would like to avoid emit comments twice in following case: + // // var obj = { // id: // /*comment*/ () => void // } + // // 3. If the function is an argument in call expression, emitting of comments will be - // taken care of in emit list of arguments inside of emitCallexpression + // taken care of in emit list of arguments inside of 'emitCallExpression'. + // + // 4. If the function is in an array literal, 'emitLinePreservingList' will take care + // of leading comments. emitLeadingComments(node); } emitStart(node); @@ -34165,11 +34805,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 /* ES6 */ && node.kind === 213 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { + if (modulekind !== 5 /* ES6 */ && kind === 215 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */) { + if (kind !== 143 /* MethodDeclaration */ && kind !== 142 /* MethodSignature */) { emitTrailingComments(node); } } @@ -34202,7 +34842,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 174 /* ArrowFunction */; + var isArrowFunction = node.kind === 176 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -34285,17 +34925,16 @@ var ts; } write(" __awaiter(this"); if (hasLexicalArguments) { - write(", arguments"); + write(", arguments, "); } else { - write(", void 0"); + write(", void 0, "); } if (promiseConstructor) { - write(", "); - emitNodeWithoutSourceMap(promiseConstructor); + emitEntityNameAsExpression(promiseConstructor, /*useFallback*/ false); } else { - write(", Promise"); + write("Promise"); } // Emit the call to __awaiter. if (hasLexicalArguments) { @@ -34322,7 +34961,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 192 /* Block */) { + if (node.body.kind === 194 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -34348,7 +34987,7 @@ var ts; emitSignatureParameters(node); } var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync && languageVersion === 2 /* ES6 */) { + if (isAsync) { emitAsyncFunctionBodyForES6(node); } else { @@ -34381,14 +35020,13 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 171 /* TypeAssertionExpression */) { + while (current.kind === 173 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 165 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 167 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); increaseIndent(); var outPos = writer.getTextPos(); emitDetachedCommentsAndUpdateCommentsInfo(node.body); @@ -34411,8 +35049,10 @@ var ts; increaseIndent(); writeLine(); emitLeadingComments(node.body); + emitStart(body); write("return "); emit(body); + emitEnd(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(/*newLine*/ true); @@ -34422,11 +35062,9 @@ var ts; emitStart(node.body); write("}"); emitEnd(node.body); - scopeEmitEnd(); } function emitBlockFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedCommentsAndUpdateCommentsInfo(body.statements); @@ -34455,14 +35093,13 @@ var ts; decreaseIndent(); } emitToken(16 /* CloseBraceToken */, body.statements.end); - scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 195 /* ExpressionStatement */) { + if (statement && statement.kind === 197 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 168 /* CallExpression */) { + if (expr && expr.kind === 170 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 95 /* SuperKeyword */) { return statement; @@ -34548,7 +35185,7 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 191 /* SemicolonClassElement */) { + if (member.kind === 193 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -34645,7 +35282,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 191 /* SemicolonClassElement */) { + else if (member.kind === 193 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -34719,7 +35356,6 @@ var ts; } var startIndex = 0; write(" {"); - scopeEmitStart(node, "constructor"); increaseIndent(); if (ctor) { // Emit all the directive prologues (like "use strict"). These have to come before @@ -34754,7 +35390,7 @@ var ts; emitEnd(baseTypeElement); } } - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -34769,7 +35405,6 @@ var ts; } decreaseIndent(); emitToken(16 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { emitTrailingComments(ctor); @@ -34794,7 +35429,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { if (thisNodeIsDecorated) { // To preserve the correct runtime semantics when decorators are applied to the class, // the emit needs to follow one of the following rules: @@ -34870,8 +35505,8 @@ var ts; // // This keeps the expression as an expression, while ensuring that the static parts // of it have been initialized by the time it is used. - var staticProperties = getInitializedProperties(node, /*static:*/ true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 186 /* ClassExpression */; + var staticProperties = getInitializedProperties(node, /*isStatic*/ true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -34884,7 +35519,7 @@ var ts; // emit name if // - node has a name // - this is default export with static initializers - if ((node.name || (node.flags & 512 /* Default */ && staticProperties.length > 0)) && !thisNodeIsDecorated) { + if ((node.name || (node.flags & 512 /* Default */ && (staticProperties.length > 0 || modulekind !== 5 /* ES6 */))) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -34895,14 +35530,12 @@ var ts; } write(" {"); increaseIndent(); - scopeEmitStart(node); writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. // For a decorated class, we need to assign its name (if it has one). This is because we emit // the class as a class expression to avoid the double-binding of the identifier: @@ -34924,7 +35557,7 @@ var ts; var property = staticProperties_1[_a]; write(","); writeLine(); - emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true); + emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true); } write(","); writeLine(); @@ -34937,27 +35570,37 @@ var ts; emitPropertyDeclarations(node, staticProperties); emitDecoratorsOfClass(node); } - // If this is an exported class, but not on the top level (i.e. on an internal - // module), export it - if (!isES6ExportedDeclaration(node) && (node.flags & 2 /* Export */)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!(node.flags & 2 /* Export */)) { + return; } - else if (isES6ExportedDeclaration(node) && (node.flags & 512 /* Default */) && thisNodeIsDecorated) { - // if this is a top level default export of decorated class, write the export after the declaration. - writeLine(); - write("export default "); - emitDeclarationName(node); - write(";"); + if (modulekind !== 5 /* ES6 */) { + emitExportMemberAssignment(node); + } + else { + // If this is an exported class, but not on the top level (i.e. on an internal + // module), export it + if (node.flags & 512 /* Default */) { + // if this is a top level default export of decorated class, write the export after the declaration. + if (thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + else if (node.parent.kind !== 250 /* SourceFile */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { // source file level classes in system modules are hoisted so 'var's for them are already defined if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); @@ -34982,7 +35625,6 @@ var ts; tempParameters = undefined; computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); - scopeEmitStart(node); if (baseTypeNode) { writeLine(); emitStart(baseTypeNode); @@ -34994,7 +35636,7 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -35013,18 +35655,17 @@ var ts; decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); emitStart(node); - write(")("); + write("("); if (baseTypeNode) { emit(baseTypeNode.expression); } - write(")"); - if (node.kind === 214 /* ClassDeclaration */) { + write("))"); + if (node.kind === 216 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { emitExportMemberAssignment(node); } } @@ -35042,9 +35683,9 @@ var ts; function emitDecoratorsOfConstructor(node) { var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + var firstParameterDecorator = constructor && ts.forEach(constructor.parameters, function (parameter) { return parameter.decorators; }); // skip decoration of the constructor if neither it nor its parameters are decorated - if (!decorators && !hasDecoratedParameters) { + if (!decorators && !firstParameterDecorator) { return; } // Emit the call to __decorate. Given the class: @@ -35058,25 +35699,24 @@ var ts; // C = __decorate([dec], C); // writeLine(); - emitStart(node); + emitStart(node.decorators || firstParameterDecorator); emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + } emitSerializedTypeMetadata(node, /*leadingComma*/ argumentsWritten >= 0); decreaseIndent(); writeLine(); write("], "); emitDeclarationName(node); - write(");"); - emitEnd(node); + write(")"); + emitEnd(node.decorators || firstParameterDecorator); + write(";"); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { @@ -35090,10 +35730,6 @@ var ts; if (!ts.nodeCanBeDecorated(member)) { continue; } - // skip a member if it or any of its parameters are not decorated - if (!ts.nodeOrChildIsDecorated(member)) { - continue; - } // skip an accessor declaration if it is not the first accessor var decorators = void 0; var functionLikeMember = void 0; @@ -35117,6 +35753,11 @@ var ts; functionLikeMember = member; } } + var firstParameterDecorator = functionLikeMember && ts.forEach(functionLikeMember.parameters, function (parameter) { return parameter.decorators; }); + // skip a member if it or any of its parameters are not decorated + if (!decorators && !firstParameterDecorator) { + continue; + } // Emit the call to __decorate. Given the following: // // class C { @@ -35148,26 +35789,22 @@ var ts; // ], C.prototype, "prop"); // writeLine(); - emitStart(member); + emitStart(decorators || firstParameterDecorator); write("__decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + } emitSerializedTypeMetadata(member, argumentsWritten > 0); decreaseIndent(); writeLine(); write("], "); - emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); - emitEnd(member.name); if (languageVersion > 0 /* ES3 */) { if (member.kind !== 141 /* PropertyDeclaration */) { // We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly. @@ -35180,8 +35817,9 @@ var ts; write(", void 0"); } } - write(");"); - emitEnd(member); + write(")"); + emitEnd(decorators || firstParameterDecorator); + write(";"); writeLine(); } } @@ -35194,15 +35832,13 @@ var ts; if (ts.nodeIsDecorated(parameter)) { var decorators = parameter.decorators; argumentsWritten += emitList(decorators, 0, decorators.length, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ leadingComma, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); write("__param(" + parameterIndex + ", "); emit(decorator.expression); write(")"); - emitEnd(decorator); }); leadingComma = true; } - ++parameterIndex; + parameterIndex++; } } return argumentsWritten; @@ -35235,7 +35871,7 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: case 143 /* MethodDeclaration */: case 146 /* SetAccessor */: return true; @@ -35255,7 +35891,7 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: write("Function"); return; case 141 /* PropertyDeclaration */: @@ -35299,7 +35935,7 @@ var ts; write("Boolean"); return; case 130 /* StringKeyword */: - case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: write("String"); return; case 128 /* NumberKeyword */: @@ -35316,6 +35952,7 @@ var ts; case 158 /* UnionType */: case 159 /* IntersectionType */: case 117 /* AnyKeyword */: + case 161 /* ThisType */: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -35331,8 +35968,7 @@ var ts; location = location.parent; } // Clone the type name and parent it to a location outside of the current declaration. - var typeName = ts.cloneEntityName(node.typeName); - typeName.parent = location; + var typeName = ts.cloneEntityName(node.typeName, location); var result = resolver.getTypeReferenceSerializationKind(typeName); switch (result) { case ts.TypeReferenceSerializationKind.Unknown: @@ -35389,7 +36025,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -35484,9 +36120,10 @@ var ts; } if (!shouldHoistDeclarationInSystemJsModule(node)) { // do not emit var if variable was already hoisted - if (!(node.flags & 2 /* Export */) || isES6ExportedDeclaration(node)) { + var isES6ExportedEnum = isES6ExportedDeclaration(node); + if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219 /* EnumDeclaration */))) { emitStart(node); - if (isES6ExportedDeclaration(node)) { + if (isES6ExportedEnum) { write("export "); } write("var "); @@ -35503,12 +36140,10 @@ var ts; emitEnd(node.name); write(") {"); increaseIndent(); - scopeEmitStart(node); emitLines(node.members); decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); write(")("); emitModuleMemberName(node); write(" || ("); @@ -35568,7 +36203,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 218 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -35579,6 +36214,9 @@ var ts; function isModuleMergedWithES6Class(node) { return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 32768 /* LexicalModuleMergesWithClass */); } + function isFirstDeclarationOfKind(node, declarations, kind) { + return !ts.forEach(declarations, function (declaration) { return declaration.kind === kind && declaration.pos < node.pos; }); + } function emitModuleDeclaration(node) { // Emit only if this module is non-ambient. var shouldEmit = shouldEmitModuleDeclaration(node); @@ -35588,15 +36226,18 @@ var ts; var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + var isES6ExportedNamespace = isES6ExportedDeclaration(node); + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* ModuleDeclaration */)) { + emitStart(node); + if (isES6ExportedNamespace) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); } emitStart(node); write("(function ("); @@ -35604,7 +36245,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 219 /* ModuleBlock */) { + if (node.body.kind === 221 /* ModuleBlock */) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -35620,7 +36261,6 @@ var ts; else { write("{"); increaseIndent(); - scopeEmitStart(node); emitCaptureThisForNodeIfNecessary(node); writeLine(); emit(node.body); @@ -35628,7 +36268,6 @@ var ts; writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; emitToken(16 /* CloseBraceToken */, moduleBlock.statements.end); - scopeEmitEnd(); } write(")("); // write moduleDecl = containingModule.m only if it is not exported es6 module member @@ -35682,16 +36321,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 222 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 224 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -35719,7 +36358,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -35745,7 +36384,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 221 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; + var isExportedImport = node.kind === 223 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2 /* AMD */) { emitLeadingComments(node); @@ -35764,7 +36403,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 222 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 224 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -35882,15 +36521,17 @@ var ts; } else { // export * from "foo" - writeLine(); - write("__export("); - if (modulekind !== 2 /* AMD */) { - emitRequire(ts.getExternalModuleName(node)); + if (hasExportStarsToExportValues && resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + writeLine(); + write("__export("); + if (modulekind !== 2 /* AMD */) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); } - else { - write(generatedName); - } - write(");"); } emitEnd(node); } @@ -35941,8 +36582,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 213 /* FunctionDeclaration */ && - expression.kind !== 214 /* ClassDeclaration */) { + if (expression.kind !== 215 /* FunctionDeclaration */ && + expression.kind !== 216 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -35975,11 +36616,11 @@ var ts; externalImports = []; exportSpecifiers = {}; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, /*checkChildren*/ true)) { // import "mod" @@ -35989,18 +36630,20 @@ var ts; externalImports.push(node); } break; - case 221 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 232 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 223 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 234 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" - externalImports.push(node); - hasExportStars = true; + if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } } else if (resolver.isValueAliasDeclaration(node)) { // export { x, y } from "mod" where at least one export is a value symbol @@ -36011,12 +36654,12 @@ var ts; // export { x, y } for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_26 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_26] || (exportSpecifiers[name_26] = [])).push(specifier); + var name_24 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); } } break; - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -36026,7 +36669,7 @@ var ts; } } function emitExportStarHelper() { - if (hasExportStars) { + if (hasExportStarsToExportValues) { writeLine(); write("function __export(m) {"); increaseIndent(); @@ -36042,14 +36685,20 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 222 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 224 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 228 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 230 /* ExportDeclaration */ && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } - function getExternalModuleNameText(importNode) { + function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { + if (emitRelativePathAsModuleName) { + var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_25) { + return "\"" + name_25 + "\""; + } + } var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 9 /* StringLiteral */) { return tryRenameExternalModule(moduleName) || getLiteralText(moduleName); @@ -36065,8 +36714,8 @@ var ts; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; // do not create variable declaration for exports and imports that lack import clause - var skipNode = importNode.kind === 228 /* ExportDeclaration */ || - (importNode.kind === 222 /* ImportDeclaration */ && !importNode.importClause); + var skipNode = importNode.kind === 230 /* ExportDeclaration */ || + (importNode.kind === 224 /* ImportDeclaration */ && !importNode.importClause); if (skipNode) { continue; } @@ -36088,7 +36737,7 @@ var ts; // should always win over entries with similar names that were added via star exports // to support this we store names of local/indirect exported entries in a set. // this set is used to filter names brought by star expors. - if (!hasExportStars) { + if (!hasExportStarsToExportValues) { // local names set is needed only in presence of star exports return undefined; } @@ -36099,7 +36748,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 228 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 230 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -36115,7 +36764,7 @@ var ts; increaseIndent(); var started = false; if (exportedDeclarations) { - for (var i = 0; i < exportedDeclarations.length; ++i) { + for (var i = 0; i < exportedDeclarations.length; i++) { // write name of exported declaration, i.e 'export var x...' writeExportedName(exportedDeclarations[i]); } @@ -36131,7 +36780,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 228 /* ExportDeclaration */) { + if (externalImport.kind !== 230 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -36217,14 +36866,14 @@ var ts; writeLine(); write("var "); var seen = {}; - for (var i = 0; i < hoistedVars.length; ++i) { + for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_27 = local.kind === 69 /* Identifier */ + var name_26 = local.kind === 69 /* Identifier */ ? local : local.name; - if (name_27) { + if (name_26) { // do not emit duplicate entries (in case of declaration merging) in the list of hoisted variables - var text = ts.unescapeIdentifier(name_27.text); + var text = ts.unescapeIdentifier(name_26.text); if (ts.hasProperty(seen, text)) { continue; } @@ -36235,7 +36884,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 214 /* ClassDeclaration */ || local.kind === 218 /* ModuleDeclaration */ || local.kind === 217 /* EnumDeclaration */) { + if (local.kind === 216 /* ClassDeclaration */ || local.kind === 220 /* ModuleDeclaration */ || local.kind === 219 /* EnumDeclaration */) { emitDeclarationName(local); } else { @@ -36269,21 +36918,21 @@ var ts; if (node.flags & 4 /* Ambient */) { return; } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 217 /* EnumDeclaration */) { + if (node.kind === 219 /* EnumDeclaration */) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36292,7 +36941,7 @@ var ts; } return; } - if (node.kind === 218 /* ModuleDeclaration */) { + if (node.kind === 220 /* ModuleDeclaration */) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36301,17 +36950,17 @@ var ts; } return; } - if (node.kind === 211 /* VariableDeclaration */ || node.kind === 163 /* BindingElement */) { + if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { if (shouldHoistVariable(node, /*checkIfSourceFileLevelDecl*/ false)) { - var name_28 = node.name; - if (name_28.kind === 69 /* Identifier */) { + var name_27 = node.name; + if (name_27.kind === 69 /* Identifier */) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_28); + hoistedVars.push(name_27); } else { - ts.forEachChild(name_28, visit); + ts.forEachChild(name_27, visit); } } return; @@ -36342,7 +36991,7 @@ var ts; // if block scoped variables are nested in some another block then // no other functions can use them except ones that are defined at least in the same block return (ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 248 /* SourceFile */; + ts.getEnclosingBlockScopeContainer(node).kind === 250 /* SourceFile */; } function isCurrentFileSystemExternalModule() { return modulekind === 4 /* System */ && isCurrentFileExternalModule; @@ -36402,7 +37051,7 @@ var ts; } function emitSetters(exportStarFunction, dependencyGroups) { write("setters:["); - for (var i = 0; i < dependencyGroups.length; ++i) { + for (var i = 0; i < dependencyGroups.length; i++) { if (i !== 0) { write(","); } @@ -36417,21 +37066,21 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // fall-through - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== ""); writeLine(); // save import into the local write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -36444,7 +37093,7 @@ var ts; write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; ++i_2) { + for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { if (i_2 !== 0) { write(","); writeLine(); @@ -36461,6 +37110,8 @@ var ts; write("});"); } else { + // collectExternalModuleInfo prefilters star exports to keep only ones that export values + // this means that check 'resolver.moduleExportsSomeValue' is redundant and can be omitted here writeLine(); // export * from 'foo' // emit as: @@ -36481,17 +37132,17 @@ var ts; write("execute: function() {"); increaseIndent(); writeLine(); - for (var i = startIndex; i < node.statements.length; ++i) { + for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { // - function declarations are not emitted because they were already hoisted // - import declarations are not emitted since they are already handled in setters // - export declarations with module specifiers are not emitted since they were already written in setters // - export declarations without module specifiers are emitted preserving the order - case 213 /* FunctionDeclaration */: - case 222 /* ImportDeclaration */: + case 215 /* FunctionDeclaration */: + case 224 /* ImportDeclaration */: continue; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -36500,7 +37151,7 @@ var ts; } } continue; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { // - import equals declarations that import external modules are not emitted continue; @@ -36540,8 +37191,8 @@ var ts; write("["); var groupIndices = {}; var dependencyGroups = []; - for (var i = 0; i < externalImports.length; ++i) { - var text = getExternalModuleNameText(externalImports[i]); + for (var i = 0; i < externalImports.length; i++) { + var text = getExternalModuleNameText(externalImports[i], emitRelativePathAsModuleName); if (ts.hasProperty(groupIndices, text)) { // deduplicate/group entries in dependency list by the dependency name var groupIndex = groupIndices[text]; @@ -36555,18 +37206,12 @@ var ts; if (i !== 0) { write(", "); } - if (emitRelativePathAsModuleName) { - var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); - if (name_29) { - text = "\"" + name_29 + "\""; - } - } write(text); } write("], function(" + exportFunctionForFile + ") {"); writeLine(); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitSystemModuleBody(node, dependencyGroups, startIndex); @@ -36596,13 +37241,7 @@ var ts; for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; // Find the name of the external module - var externalModuleName = getExternalModuleNameText(importNode); - if (emitRelativePathAsModuleName) { - var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_30) { - externalModuleName = "\"" + name_30 + "\""; - } - } + var externalModuleName = getExternalModuleNameText(importNode, emitRelativePathAsModuleName); // Find the name of the module alias, if there is one var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { @@ -36662,7 +37301,7 @@ var ts; writeModuleName(node, emitRelativePathAsModuleName); emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36673,7 +37312,7 @@ var ts; write("});"); } function emitCommonJSModule(node) { - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false, /*ensureUseStrict*/ true); emitEmitHelpers(node); collectExternalModuleInfo(node); emitExportStarHelper(); @@ -36693,7 +37332,7 @@ var ts; writeLines(" }\n})("); emitAMDFactoryHeader(dependencyNames); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36707,7 +37346,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); @@ -36770,7 +37409,9 @@ var ts; // Replace entities like   result = result.replace(/&(\w+);/g, function (s, m) { if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + var ch = String.fromCharCode(entities[m]); + // " needs to be escaped + return ch === "\"" ? "\\\"" : ch; } else { return s; @@ -36822,24 +37463,41 @@ var ts; } } } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { + function isUseStrictPrologue(node) { + return !!node.expression.text.match(/use strict/); + } + function ensureUseStrictPrologue(startWithNewLine, writeUseStrict) { + if (writeUseStrict) { + if (startWithNewLine) { + writeLine(); + } + write("\"use strict\";"); + } + } + function emitDirectivePrologues(statements, startWithNewLine, ensureUseStrict) { + var foundUseStrict = false; + for (var i = 0; i < statements.length; i++) { if (ts.isPrologueDirective(statements[i])) { + if (isUseStrictPrologue(statements[i])) { + foundUseStrict = true; + } if (startWithNewLine || i > 0) { writeLine(); } emit(statements[i]); } else { + ensureUseStrictPrologue(startWithNewLine || i > 0, !foundUseStrict && ensureUseStrict); // return index of the first non prologue directive return i; } } + ensureUseStrictPrologue(startWithNewLine, !foundUseStrict && ensureUseStrict); return statements.length; } function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); - for (var i = 0; i < lines.length; ++i) { + for (var i = 0; i < lines.length; i++) { var line = lines[i]; if (line.length) { writeLine(); @@ -36879,7 +37537,7 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + if (isOwnFileEmit || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; emitModule(node); } @@ -36893,7 +37551,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36901,6 +37559,9 @@ var ts; } emitLeadingComments(node.endOfFileToken); } + function emit(node) { + emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); + } function emitNodeWithCommentsAndWithoutSourcemap(node) { emitNodeConsideringCommentsOption(node, emitNodeWithoutSourceMap); } @@ -36923,6 +37584,13 @@ var ts; } } } + function emitNodeWithSourceMap(node) { + if (node) { + emitStart(node); + emitNodeWithoutSourceMap(node); + emitEnd(node); + } + } function emitNodeWithoutSourceMap(node) { if (node) { emitJavaScriptWorker(node); @@ -36932,24 +37600,24 @@ var ts; switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow // the specialized methods for each to handle the comments on the nodes. - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 227 /* ExportAssignment */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 229 /* ExportAssignment */: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -36961,9 +37629,9 @@ var ts; // then we don't want to emit comments when we emit the body. It will have already // been taken care of when we emitted the 'return' statement for the function // expression body. - if (node.kind !== 192 /* Block */ && + if (node.kind !== 194 /* Block */ && node.parent && - node.parent.kind === 174 /* ArrowFunction */ && + node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -37002,142 +37670,142 @@ var ts; case 13 /* TemplateMiddle */: case 14 /* TemplateTail */: return emitLiteral(node); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return emitTemplateExpression(node); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return emitTemplateSpan(node); - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: return emitJsxElement(node); - case 236 /* JsxText */: + case 238 /* JsxText */: return emitJsxText(node); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return emitJsxExpression(node); case 135 /* QualifiedName */: return emitQualifiedName(node); - case 161 /* ObjectBindingPattern */: + case 163 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 162 /* ArrayBindingPattern */: + case 164 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 163 /* BindingElement */: + case 165 /* BindingElement */: return emitBindingElement(node); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 246 /* ShorthandPropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); case 136 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 168 /* CallExpression */: + case 170 /* CallExpression */: return emitCallExpression(node); - case 169 /* NewExpression */: + case 171 /* NewExpression */: return emitNewExpression(node); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return emit(node.expression); - case 189 /* AsExpression */: + case 191 /* AsExpression */: return emit(node.expression); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return emitParenExpression(node); - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return emitDeleteExpression(node); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return emitVoidExpression(node); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return emitAwaitExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return emitBinaryExpression(node); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return emitConditionalExpression(node); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return emitYieldExpression(node); - case 187 /* OmittedExpression */: + case 189 /* OmittedExpression */: return; - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return emitBlock(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return emitVariableStatement(node); - case 194 /* EmptyStatement */: + case 196 /* EmptyStatement */: return write(";"); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return emitExpressionStatement(node); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return emitIfStatement(node); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return emitDoStatement(node); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return emitWhileStatement(node); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return emitForStatement(node); - case 201 /* ForOfStatement */: - case 200 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 202 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return emitReturnStatement(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return emitWithStatement(node); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return emitSwitchStatement(node); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return emitLabeledStatement(node); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return emitThrowStatement(node); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return emitTryStatement(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return emitCatchClause(node); - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return emitClassExpression(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return emitClassDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return emitEnumMember(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return emitImportDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return emitExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return emitExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return emitSourceFileNode(node); } } @@ -37176,7 +37844,7 @@ var ts; function getLeadingCommentsToEmit(node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 248 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 250 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -37191,7 +37859,7 @@ var ts; function getTrailingCommentsToEmit(node) { // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 248 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 250 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -37200,10 +37868,10 @@ var ts; * Emit comments associated with node that will not be emitted into JS file */ function emitCommentsOnNotEmittedNode(node) { - emitLeadingCommentsWorker(node, /*isEmittedNode:*/ false); + emitLeadingCommentsWorker(node, /*isEmittedNode*/ false); } function emitLeadingComments(node) { - return emitLeadingCommentsWorker(node, /*isEmittedNode:*/ true); + return emitLeadingCommentsWorker(node, /*isEmittedNode*/ true); } function emitLeadingCommentsWorker(node, isEmittedNode) { if (compilerOptions.removeComments) { @@ -37228,7 +37896,7 @@ var ts; } ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { @@ -37280,18 +37948,31 @@ var ts; } } } + function writeComment(text, lineMap, writer, comment, newLine) { + emitPos(comment.pos); + ts.writeCommentRange(text, lineMap, writer, comment, newLine); + emitPos(comment.end); + } function emitShebang() { var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); + writeLine(); } } var _a, _b; } - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (compilerOptions.declaration) { - ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); + function emitFile(_a, sourceFiles, isBundledEmit) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; + // Make sure not to write js File and source map file if any of them cannot be written + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + emitJavaScript(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + else { + emitSkipped = true; + } + if (declarationFilePath) { + emitSkipped = ts.writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) || emitSkipped; } } } @@ -37309,10 +37990,10 @@ var ts; /** The version of the TypeScript compiler release */ var emptyArray = []; ts.version = "1.8.0"; - function findConfigFile(searchPath) { + function findConfigFile(searchPath, fileExists) { var fileName = "tsconfig.json"; while (true) { - if (ts.sys.fileExists(fileName)) { + if (fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -37336,21 +38017,22 @@ var ts; ? compilerOptions.moduleResolution : compilerOptions.module === 1 /* CommonJS */ ? 2 /* NodeJs */ : 1 /* Classic */; switch (moduleResolution) { - case 2 /* NodeJs */: return nodeModuleNameResolver(moduleName, containingFile, host); + case 2 /* NodeJs */: return nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); case 1 /* Classic */: return classicNameResolver(moduleName, containingFile, compilerOptions, host); } } ts.resolveModuleName = resolveModuleName; - function nodeModuleNameResolver(moduleName, containingFile, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { var containingDirectory = ts.getDirectoryPath(containingFile); + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -37360,11 +38042,21 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + /* @internal */ + function directoryProbablyExists(directoryName, host) { + // if host does not support 'directoryExists' assume that directory will exist + return !host.directoryExists || host.directoryExists(directoryName); + } + ts.directoryProbablyExists = directoryProbablyExists; + /** + * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary + * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. + */ + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; - if (host.fileExists(fileName)) { + if (!onlyRecordFailures && host.fileExists(fileName)) { return fileName; } else { @@ -37373,9 +38065,10 @@ var ts; } } } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); - if (host.fileExists(packageJsonPath)) { + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host); + if (directoryExists && host.fileExists(packageJsonPath)) { var jsonContent; try { var jsonText = host.readFile(packageJsonPath); @@ -37385,8 +38078,9 @@ var ts; // gracefully handle if readFile fails or returns not JSON jsonContent = { typings: undefined }; } - if (jsonContent.typings) { - var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + if (typeof jsonContent.typings === "string") { + var path = ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)); + var result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(ts.getDirectoryPath(path), host), host); if (result) { return result; } @@ -37396,7 +38090,7 @@ var ts; // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -37405,12 +38099,14 @@ var ts; var baseName = ts.getBaseFileName(directory); if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); + // Load only typescript files irrespective of allowJs option if loading from node modules + var result = loadNodeModuleFromFile(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -37436,10 +38132,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; - var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(extensions, function (extension) { + referencedSourceFile = ts.forEach(supportedExtensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { // resolve .tsx files only if jsx support is enabled // 'logical not' handles both undefined and None cases @@ -37540,14 +38236,15 @@ var ts; getCanonicalFileName: getCanonicalFileName, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return ts.sys.fileExists(fileName); }, - readFile: function (fileName) { return ts.sys.readFile(fileName); } + readFile: function (fileName) { return ts.sys.readFile(fileName); }, + directoryExists: function (directoryName) { return ts.sys.directoryExists(directoryName); } }; } ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -37585,8 +38282,11 @@ var ts; var noDiagnosticsTypeChecker; var classifiableNames; var skipDefaultLib = options.noLib; + var supportedExtensions = ts.getSupportedExtensions(options); var start = new Date().getTime(); host = host || createCompilerHost(options); + // Map storing if there is emit blocking diagnostics for given input + var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) @@ -37603,24 +38303,23 @@ var ts; (oldOptions.noResolve !== options.noResolve) || (oldOptions.target !== options.target) || (oldOptions.noLib !== options.noLib) || - (oldOptions.jsx !== options.jsx)) { + (oldOptions.jsx !== options.jsx) || + (oldOptions.allowJs !== options.allowJs)) { oldProgram = undefined; } } if (!tryReuseStructureFromOldProgram()) { - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false); }); // Do not process the default library if: // - The '--noLib' flag is used. // - A 'no-default-lib' reference comment is encountered in // processing the root files. if (!skipDefaultLib) { - processRootFile(host.getDefaultLibFileName(options), true); + processRootFile(host.getDefaultLibFileName(options), /*isDefaultLib*/ true); } } - verifyCompilerOptions(); // unconditionally set oldProgram to undefined to prevent it from being captured in closure oldProgram = undefined; - ts.programTime += new Date().getTime() - start; program = { getRootFileNames: function () { return rootNames; }, getSourceFile: getSourceFile, @@ -37634,7 +38333,7 @@ var ts; getTypeChecker: getTypeChecker, getClassifiableNames: getClassifiableNames, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: getCommonSourceDirectory, emit: emit, getCurrentDirectory: function () { return currentDirectory; }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, @@ -37643,7 +38342,27 @@ var ts; getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; } }; + verifyCompilerOptions(); + ts.programTime += new Date().getTime() - start; return program; + function getCommonSourceDirectory() { + if (typeof commonSourceDirectory === "undefined") { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + // If a rootDir is specified and is valid use it as the commonSourceDirectory + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path + commonSourceDirectory += ts.directorySeparator; + } + } + return commonSourceDirectory; + } function getClassifiableNames() { if (!classifiableNames) { // Initialize a checker so that all our files are bound. @@ -37699,7 +38418,7 @@ var ts; var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct - for (var i = 0; i < moduleNames.length; ++i) { + for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; var oldResolution = ts.getResolvedModule(oldSourceFile, moduleNames[i]); var resolutionChanged = oldResolution @@ -37724,7 +38443,7 @@ var ts; newSourceFiles.push(newSourceFile); } // update fileName -> file mapping - for (var i = 0, len = newSourceFiles.length; i < len; ++i) { + for (var i = 0, len = newSourceFiles.length; i < len; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -37745,7 +38464,8 @@ var ts; getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }), + isEmitBlocked: isEmitBlocked }; } function getDiagnosticsProducingTypeChecker() { @@ -37758,12 +38478,18 @@ var ts; var _this = this; return runWithCancellationToken(function () { return emitWorker(_this, sourceFile, writeFileCallback, cancellationToken); }); } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); + } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken) { // If the noEmitOnError flag is set, then check if we have any errors so far. If so, // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we // get any preEmit diagnostics, not just the ones - if (options.noEmitOnError && getPreEmitDiagnostics(program, /*sourceFile:*/ undefined, cancellationToken).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + if (options.noEmitOnError) { + var preEmitDiagnostics = getPreEmitDiagnostics(program, /*sourceFile:*/ undefined, cancellationToken); + if (preEmitDiagnostics.length > 0) { + return { diagnostics: preEmitDiagnostics, sourceMaps: undefined, emitSkipped: true }; + } } // Create the emit resolver outside of the "emitTime" tracking code below. That way // any cost associated with it (like type checking) are appropriate associated with @@ -37833,12 +38559,164 @@ var ts; var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile, cancellationToken); + // For JavaScript files, we don't want to report the normal typescript semantic errors. + // Instead, we just report errors for using TypeScript-only constructs from within a + // JavaScript file. + var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? + getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) : + typeChecker.getDiagnostics(sourceFile, cancellationToken); var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile); }); } + function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return runWithCancellationToken(function () { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 223 /* ImportEqualsDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 229 /* ExportAssignment */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 216 /* ClassDeclaration */: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 245 /* HeritageClause */: + var heritageClause = node; + if (heritageClause.token === 106 /* ImplementsKeyword */) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 217 /* InterfaceDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 220 /* ModuleDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 218 /* TypeAliasDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 195 /* VariableStatement */: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 213 /* VariableDeclaration */: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 170 /* CallExpression */: + case 171 /* NewExpression */: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start_2 = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_2, expression.typeArguments.end - start_2, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 138 /* Parameter */: + var parameter = node; + if (parameter.modifiers) { + var start_3 = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_3, parameter.modifiers.end - start_3, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 141 /* PropertyDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 219 /* EnumDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 173 /* TypeAssertionExpression */: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 139 /* Decorator */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start_4 = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_4, typeParameters.end - start_4, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { + var modifier = modifiers_1[_i]; + switch (modifier.kind) { + case 112 /* PublicKeyword */: + case 110 /* PrivateKeyword */: + case 111 /* ProtectedKeyword */: + case 122 /* DeclareKeyword */: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + // These are all legal modifiers. + case 113 /* StaticKeyword */: + case 82 /* ExportKeyword */: + case 74 /* ConstKeyword */: + case 77 /* DefaultKeyword */: + case 115 /* AbstractKeyword */: + } + } + } + return false; + } + }); + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return runWithCancellationToken(function () { if (!ts.isDeclarationFile(sourceFile)) { @@ -37880,16 +38758,16 @@ var ts; var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /* allowRelativeModuleNames */ true, /* collectOnlyRequireCalls */ false); + collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); } file.imports = imports || emptyArray; return; function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { if (!collectOnlyRequireCalls) { switch (node.kind) { - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; @@ -37901,7 +38779,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An AmbientExternalModuleDeclaration declares an external module. @@ -37912,7 +38790,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 12.1.6 // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules // only through top - level external module names. Relative external module names are not permitted. - collect(node, /* allowRelativeModuleNames */ false, collectOnlyRequireCalls); + collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); }); } break; @@ -37923,7 +38801,7 @@ var ts; (imports || (imports = [])).push(node.arguments[0]); } else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /* collectOnlyRequireCalls */ true); }); + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true); }); } } } @@ -37932,9 +38810,9 @@ var ts; var diagnosticArgument; var diagnostic; if (hasExtension(fileName)) { - if (!options.allowNonTsExtensions && !ts.forEach(ts.supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { + if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1; - diagnosticArgument = [fileName, "'" + ts.supportedExtensions.join("', '") + "'"]; + diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"]; } else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) { diagnostic = ts.Diagnostics.File_0_not_found; @@ -37952,7 +38830,7 @@ var ts; diagnostic = ts.Diagnostics.File_0_not_found; diagnosticArgument = [fileName]; } - else if (!ts.forEach(ts.supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { + else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { diagnostic = ts.Diagnostics.File_0_not_found; fileName += ".ts"; diagnosticArgument = [fileName]; @@ -37977,12 +38855,12 @@ var ts; } } // Get source file from normalized fileName - function findSourceFile(fileName, normalizedAbsolutePath, isDefaultLib, refFile, refPos, refEnd) { - if (filesByName.contains(normalizedAbsolutePath)) { - var file_1 = filesByName.get(normalizedAbsolutePath); + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + if (filesByName.contains(path)) { + var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path // NOTE: this only makes sense for case-insensitive file systems - if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== normalizedAbsolutePath) { + if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } return file_1; @@ -37996,17 +38874,17 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); - filesByName.set(normalizedAbsolutePath, file); + filesByName.set(path, file); if (file) { - file.path = normalizedAbsolutePath; + file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case - var existingFile = filesByNameIgnoreCase.get(normalizedAbsolutePath); + var existingFile = filesByNameIgnoreCase.get(path); if (existingFile) { reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd); } else { - filesByNameIgnoreCase.set(normalizedAbsolutePath, file); + filesByNameIgnoreCase.set(path, file); } } skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib; @@ -38028,7 +38906,7 @@ var ts; function processReferencedFiles(file, basePath) { ts.forEach(file.referencedFiles, function (ref) { var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName); - processSourceFile(referencedFileName, /* isDefaultLib */ false, file, ref.pos, ref.end); + processSourceFile(referencedFileName, /*isDefaultLib*/ false, file, ref.pos, ref.end); }); } function getCanonicalFileName(fileName) { @@ -38040,15 +38918,17 @@ var ts; file.resolvedModules = {}; var moduleNames = ts.map(file.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; ++i) { + for (var i = 0; i < file.imports.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); if (resolution && !options.noResolve) { - var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /* isDefaultLib */ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); + var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { + // Since currently irrespective of allowJs, we only look for supportedTypeScript extension external module files, + // this check is ok. Otherwise this would be never true for javascript file if (!ts.isExternalModule(importedFile)) { - var start_2 = ts.getTokenPosOfNode(file.imports[i], file); - fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_2, file.imports[i].end - start_2, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); + var start_5 = ts.getTokenPosOfNode(file.imports[i], file); + fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } else if (importedFile.referencedFiles.length) { var firstRef = importedFile.referencedFiles[0]; @@ -38066,7 +38946,7 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var commonPathComponents; - ts.forEach(files, function (sourceFile) { + var failed = ts.forEach(files, function (sourceFile) { // Each file contributes into common source file path if (ts.isDeclarationFile(sourceFile)) { return; @@ -38079,10 +38959,10 @@ var ts; return; } for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; + // Failed to find any common path component + return true; } // New common path found that is 0 -> i-1 commonPathComponents.length = i; @@ -38094,6 +38974,10 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + // A common path can not be found when paths span multiple drives on windows, for example + if (failed) { + return ""; + } if (!commonPathComponents) { return currentDirectory; } @@ -38103,8 +38987,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var sourceFile = sourceFiles_2[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -38138,14 +39022,14 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")); } - if (options.sourceRoot) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap")); - } } if (options.inlineSources) { if (!options.sourceMap && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); } + if (options.sourceRoot) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources")); + } } if (options.out && options.outFile) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile")); @@ -38155,10 +39039,9 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap")); } - if (options.sourceRoot) { + if (options.sourceRoot && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap")); } - return; } var languageVersion = options.target || 0 /* ES3 */; var outFile = options.outFile || options.out; @@ -38176,7 +39059,7 @@ var ts; else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); + programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file)); } // Cannot specify module gen target of es6 when below es6 if (options.module === 5 /* ES6 */ && languageVersion < 2 /* ES6 */) { @@ -38191,19 +39074,11 @@ var ts; if (options.outDir || options.sourceRoot || options.mapRoot) { - if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { - // If a rootDir is specified and is valid use it as the commonSourceDirectory - commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); - } - else { - // Compute the commonSourceDirectory from the input files - commonSourceDirectory = computeCommonSourceDirectory(files); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { - // Make sure directory path ends with directory separator so this string can directly - // used to replace with "" to get the relative path of the source file and the relative path doesn't - // start with / making it rooted path - commonSourceDirectory += ts.directorySeparator; + // Precalculate and cache the common source directory + var dir = getCommonSourceDirectory(); + // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure + if (options.outDir && dir === "" && ts.forEach(files, function (file) { return ts.getRootLength(file.fileName) > 1; })) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); } } if (options.noEmit) { @@ -38220,10 +39095,47 @@ var ts; programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration")); } } + else if (options.allowJs && options.declaration) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + if (options.reactNamespace && !ts.isIdentifier(options.reactNamespace, languageVersion)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace)); + } + // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files + if (!options.noEmit) { + var emitHost = getEmitHost(); + var emitFilesSeen = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); + ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + // Verify that all the emit files are unique and don't overwrite input files + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); + // Report error if the output overwrites input file + if (filesByName.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + } + // Report error if multiple files write into same file + if (emitFilesSeen.contains(emitFilePath)) { + // Already seen the same emit file - report error + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + } + else { + emitFilesSeen.set(emitFilePath, true); + } + } + } + } + function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) { + hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true); + programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName)); } } ts.createProgram = createProgram; @@ -38284,6 +39196,11 @@ var ts; description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, error: ts.Diagnostics.Argument_for_jsx_must_be_preserve_or_react }, + { + name: "reactNamespace", + type: "string", + description: ts.Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, { name: "listFiles", type: "boolean" @@ -38509,6 +39426,16 @@ var ts; name: "forceConsistentCasingInFileNames", type: "boolean", description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "allowJs", + type: "boolean", + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled } ]; var optionNameMapCache; @@ -38543,7 +39470,8 @@ var ts; function parseStrings(args) { var i = 0; while (i < args.length) { - var s = args[i++]; + var s = args[i]; + i++; if (s.charCodeAt(0) === 64 /* at */) { parseResponseFile(s.slice(1)); } @@ -38561,20 +39489,23 @@ var ts; } switch (opt.type) { case "number": - options[opt.name] = parseInt(args[i++]); + options[opt.name] = parseInt(args[i]); + i++; break; case "boolean": options[opt.name] = true; break; case "string": - options[opt.name] = args[i++] || ""; + options[opt.name] = args[i] || ""; + i++; break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: - var map_2 = opt.type; - var key = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(map_2, key)) { - options[opt.name] = map_2[key]; + var map_1 = opt.type; + var key = (args[i] || "").toLowerCase(); + i++; + if (ts.hasProperty(map_1, key)) { + options[opt.name] = map_1[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -38687,8 +39618,10 @@ var ts; * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json, host, basePath) { - var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), options = _a.options, errors = _a.errors; + function parseJsonConfigFileContent(json, host, basePath, existingOptions) { + if (existingOptions === void 0) { existingOptions = {}; } + var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), optionsFromJsonConfigFile = _a.options, errors = _a.errors; + var options = ts.extend(existingOptions, optionsFromJsonConfigFile); return { options: options, fileNames: getFileNames(), @@ -38705,23 +39638,31 @@ var ts; } } else { + var filesSeen = {}; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; - var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); - for (var i = 0; i < sysFiles.length; i++) { - var name_31 = sysFiles[i]; - if (ts.fileExtensionIs(name_31, ".d.ts")) { - var baseName = name_31.substr(0, name_31.length - ".d.ts".length); - if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_31); + var supportedExtensions = ts.getSupportedExtensions(options); + ts.Debug.assert(ts.indexOf(supportedExtensions, ".ts") < ts.indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick"); + // Get files of supported extensions in their order of resolution + for (var _i = 0, supportedExtensions_1 = supportedExtensions; _i < supportedExtensions_1.length; _i++) { + var extension = supportedExtensions_1[_i]; + var filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); + for (var _a = 0, filesInDirWithExtension_1 = filesInDirWithExtension; _a < filesInDirWithExtension_1.length; _a++) { + var fileName = filesInDirWithExtension_1[_a]; + // .ts extension would read the .d.ts extension files too but since .d.ts is lower priority extension, + // lets pick them when its turn comes up + if (extension === ".ts" && ts.fileExtensionIs(fileName, ".d.ts")) { + continue; } - } - else if (ts.fileExtensionIs(name_31, ".ts")) { - if (!ts.contains(sysFiles, name_31 + "x")) { - fileNames.push(name_31); + // If this is one of the output extension (which would be .d.ts and .js if we are allowing compilation of js files) + // do not include this file if we included .ts or .tsx file with same base name as it could be output of the earlier compilation + if (extension === ".d.ts" || (options.allowJs && ts.contains(ts.supportedJavascriptExtensions, extension))) { + var baseName = fileName.substr(0, fileName.length - extension.length); + if (ts.hasProperty(filesSeen, baseName + ".ts") || ts.hasProperty(filesSeen, baseName + ".tsx")) { + continue; + } } - } - else { - fileNames.push(name_31); + filesSeen[fileName] = true; + fileNames.push(fileName); } } } @@ -38845,7 +39786,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 174 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 176 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -38857,7 +39798,7 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 192 /* Block */: + case 194 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_7 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); @@ -38865,18 +39806,18 @@ var ts; // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collaps the block, but consider its hint span // to be the entire span of the parent. - if (parent_7.kind === 197 /* DoStatement */ || - parent_7.kind === 200 /* ForInStatement */ || - parent_7.kind === 201 /* ForOfStatement */ || - parent_7.kind === 199 /* ForStatement */ || - parent_7.kind === 196 /* IfStatement */ || - parent_7.kind === 198 /* WhileStatement */ || - parent_7.kind === 205 /* WithStatement */ || - parent_7.kind === 244 /* CatchClause */) { + if (parent_7.kind === 199 /* DoStatement */ || + parent_7.kind === 202 /* ForInStatement */ || + parent_7.kind === 203 /* ForOfStatement */ || + parent_7.kind === 201 /* ForStatement */ || + parent_7.kind === 198 /* IfStatement */ || + parent_7.kind === 200 /* WhileStatement */ || + parent_7.kind === 207 /* WithStatement */ || + parent_7.kind === 246 /* CatchClause */) { addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 209 /* TryStatement */) { + if (parent_7.kind === 211 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent_7; if (tryStatement.tryBlock === n) { @@ -38903,23 +39844,23 @@ var ts; break; } // Fallthrough. - case 219 /* ModuleBlock */: { + case 221 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 165 /* ObjectLiteralExpression */: - case 220 /* CaseBlock */: { + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 222 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 19 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -38949,12 +39890,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_32 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_32); + for (var name_28 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_28); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); if (!matches) { continue; } @@ -38967,14 +39908,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_32); + matches = patternMatcher.getMatches(containers, name_28); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -39013,7 +39954,7 @@ var ts; containers.unshift(text); } else if (declaration.name.kind === 136 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { // Don't know how to add this. @@ -39033,12 +39974,12 @@ var ts; } return true; } - if (expression.kind === 166 /* PropertyAccessExpression */) { + if (expression.kind === 168 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); } return false; } @@ -39047,7 +39988,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. if (declaration.name.kind === 136 /* ComputedPropertyName */) { - if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion:*/ false)) { + if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } } @@ -39108,7 +40049,7 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + function getNavigationBarItems(sourceFile, compilerOptions) { // If the source file has any child items, then it included in the tree // and takes lexical ownership of all other top-level items. var hasGlobalNode = false; @@ -39120,17 +40061,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // If we have a module declared as A.B.C, it is more "intuitive" // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 218 /* ModuleDeclaration */); + } while (current.kind === 220 /* ModuleDeclaration */); // fall through - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -39141,21 +40082,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -39167,7 +40108,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -39176,21 +40117,21 @@ var ts; } } break; - case 163 /* BindingElement */: - case 211 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 213 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 213 /* FunctionDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 215 /* FunctionDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: childNodes.push(node); break; } @@ -39238,17 +40179,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -39259,12 +40200,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 213 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 215 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 192 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 194 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 213 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -39341,7 +40282,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 149 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 147 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -39350,18 +40291,18 @@ var ts; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: var variableDeclarationNode; - var name_33; - if (node.kind === 163 /* BindingElement */) { - name_33 = node.name; + var name_29; + if (node.kind === 165 /* BindingElement */) { + name_29 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 211 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 213 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -39369,24 +40310,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_33 = node.name; + name_29 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); } case 144 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 230 /* ExportSpecifier */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: + case 232 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -39416,17 +40357,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: return createSourceFileItem(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return createClassItem(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return createEnumItem(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return createModuleItem(node); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -39438,7 +40379,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 218 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -39450,7 +40391,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 192 /* Block */) { + if (node.body && node.body.kind === 194 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -39504,13 +40445,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 218 /* ModuleDeclaration */) { + while (node.body.kind === 220 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 248 /* SourceFile */ + return node.kind === 250 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -39542,12 +40483,11 @@ var ts; } function createPatternMatcher(pattern) { // We'll often see the same candidate string many times when searching (For example, when - // we see the name of a module that is used everywhere, or the name of an overload). As - // such, we cache the information we compute about the candidate for the life of this + // we see the name of a module that is used everywhere, or the name of an overload). As + // such, we cache the information we compute about the candidate for the life of this // pattern matcher so we don't have to compute it multiple times. var stringToWordSpans = {}; pattern = pattern.trim(); - var fullPatternSegment = createSegment(pattern); var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { @@ -39587,7 +40527,7 @@ var ts; // So far so good. Now break up the container for the candidate and check if all // the dotted parts match up correctly. var totalMatch = candidateMatch; - for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { + for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) { var segment = dotSeparatedSegments[i]; var containerName = candidateContainers[j]; var containerMatch = matchSegment(containerName, segment); @@ -39626,7 +40566,7 @@ var ts; if (index > 0) { // c) If the part is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of some // word part. That way we don't match something like 'Class' when the user types 'a'. @@ -39666,8 +40606,8 @@ var ts; if (isLowercase) { // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? // We could check every character boundary start of the candidate for the pattern. However, that's - // an m * n operation in the wost case. Instead, find the first instance of the pattern - // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to + // an m * n operation in the wost case. Instead, find the first instance of the pattern + // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to // filter the list based on a substring that starts on a capital letter and also with a lowercase one. // (Pattern: fogbar, Candidate: quuxfogbarFogBar). if (chunk.text.length < candidate.length) { @@ -39719,7 +40659,7 @@ var ts; // // c) If the word is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of // some word part. That way we don't match something like 'Class' when the user @@ -39733,7 +40673,7 @@ var ts; // e) If the word was not entirely lowercase, then attempt a camel cased match as // well. // - // f) The word is all lower case. Is it a case insensitive substring of the candidate starting + // f) The word is all lower case. Is it a case insensitive substring of the candidate starting // on a part boundary of the candidate? // // Only if all words have some sort of match is the pattern considered matched. @@ -39783,7 +40723,7 @@ var ts; // Note: we may have more pattern parts than candidate parts. This is because multiple // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U - // and I will both match in UI. + // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; var firstMatch = undefined; @@ -39812,13 +40752,13 @@ var ts; // Consider the case of matching SiUI against SimpleUIElement. The candidate parts // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to - // still keep matching pattern parts against that candidate part. + // still keep matching pattern parts against that candidate part. for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { // We've already gotten one pattern part match in this candidate. We will // only continue trying to consumer pattern parts if the last part and this - // part are both upper case. + // part are both upper case. if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; @@ -39848,42 +40788,6 @@ var ts; } } ts.createPatternMatcher = createPatternMatcher; - // Helper function to compare two matches to determine which is better. Matches are first - // ordered by kind (so all prefix matches always beat all substring matches). Then, if the - // match is a camel case match, the relative weights of the match are used to determine - // which is better (with a greater weight being better). Then if the match is of the same - // type, then a case sensitive match is considered better than an insensitive one. - function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); - } - function comparePunctuation(result1, result2) { - // Consider a match to be better if it was successful without stripping punctuation - // versus a match that had to strip punctuation to succeed. - if (result1.punctuationStripped !== result2.punctuationStripped) { - return result1.punctuationStripped ? 1 : -1; - } - return 0; - } - function compareCase(result1, result2) { - if (result1.isCaseSensitive !== result2.isCaseSensitive) { - return result1.isCaseSensitive ? -1 : 1; - } - return 0; - } - function compareType(result1, result2) { - return result1.kind - result2.kind; - } - function compareCamelCase(result1, result2) { - if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { - // Swap the values here. If result1 has a higher weight, then we want it to come - // first. - return result2.camelCaseWeight - result1.camelCaseWeight; - } - return 0; - } function createSegment(text) { return { totalTextChunk: createTextChunk(text), @@ -39902,7 +40806,7 @@ var ts; if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toUpperCase(); @@ -39915,19 +40819,11 @@ var ts; if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toLowerCase(); } - function containsUpperCaseLetter(string) { - for (var i = 0, n = string.length; i < n; i++) { - if (isUpperCaseLetter(string.charCodeAt(i))) { - return true; - } - } - return false; - } function startsWith(string, search) { for (var i = 0, n = search.length; i < n; i++) { if (string.charCodeAt(i) !== search.charCodeAt(i)) { @@ -39964,7 +40860,7 @@ var ts; if (ch < 127 /* maxAsciiCharacter */) { return ch; } - // TODO: find a way to compute this for any unicode characters in a + // TODO: find a way to compute this for any unicode characters in a // non-allocating manner. return String.fromCharCode(ch).toLowerCase().charCodeAt(0); } @@ -39982,9 +40878,10 @@ var ts; for (var i = 0; i < pattern.length; i++) { var ch = pattern.charCodeAt(i); if (isWordChar(ch)) { - if (wordLength++ === 0) { + if (wordLength === 0) { wordStart = i; } + wordLength++; } else { if (wordLength > 0) { @@ -40115,7 +41012,7 @@ var ts; var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); // See if the casing indicates we're starting a new word. Note: if we're breaking on // words, then just seeing an upper case character isn't enough. Instead, it has to - // be uppercase and the previous character can't be uppercase. + // be uppercase and the previous character can't be uppercase. // // For example, breaking "AddMetadata" on words would make: Add Metadata // @@ -40305,7 +41202,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 168 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 170 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -40313,7 +41210,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 69 /* Identifier */ ? expression - : expression.kind === 166 /* PropertyAccessExpression */ + : expression.kind === 168 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -40346,7 +41243,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 168 /* CallExpression */ || node.parent.kind === 169 /* NewExpression */) { + if (node.parent.kind === 170 /* CallExpression */ || node.parent.kind === 171 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -40399,25 +41296,25 @@ var ts; }; } } - else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 172 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); } } - else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 172 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 190 /* TemplateSpan */ && node.parent.parent.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 192 /* TemplateSpan */ && node.parent.parent.parent.kind === 172 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 14 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -40535,7 +41432,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 183 /* TemplateExpression */) { + if (template.kind === 185 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -40544,7 +41441,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 248 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 250 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -40744,25 +41641,25 @@ var ts; return false; } switch (n.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 165 /* ObjectLiteralExpression */: - case 161 /* ObjectBindingPattern */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 163 /* ObjectBindingPattern */: case 155 /* TypeLiteral */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 220 /* CaseBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: + case 222 /* CaseBlock */: return nodeEndsWith(n, 16 /* CloseBraceToken */, sourceFile); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 169 /* NewExpression */: + case 171 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 168 /* CallExpression */: - case 172 /* ParenthesizedExpression */: + case 170 /* CallExpression */: + case 174 /* ParenthesizedExpression */: case 160 /* ParenthesizedType */: return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); case 152 /* FunctionType */: @@ -40771,13 +41668,13 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 148 /* ConstructSignature */: case 147 /* CallSignature */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -40787,19 +41684,19 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 18 /* CloseParenToken */, sourceFile); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 196 /* IfStatement */: + case 198 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23 /* SemicolonToken */); - case 164 /* ArrayLiteralExpression */: - case 162 /* ArrayBindingPattern */: - case 167 /* ElementAccessExpression */: + case 166 /* ArrayLiteralExpression */: + case 164 /* ArrayBindingPattern */: + case 169 /* ElementAccessExpression */: case 136 /* ComputedPropertyName */: case 157 /* TupleType */: return nodeEndsWith(n, 20 /* CloseBracketToken */, sourceFile); @@ -40808,16 +41705,16 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 197 /* DoStatement */: + case 199 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 104 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { @@ -40826,25 +41723,25 @@ var ts; return isCompletedNode(n.statement, sourceFile); case 154 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 176 /* TypeOfExpression */: - case 175 /* DeleteExpression */: - case 177 /* VoidExpression */: - case 184 /* YieldExpression */: - case 185 /* SpreadElementExpression */: + case 178 /* TypeOfExpression */: + case 177 /* DeleteExpression */: + case 179 /* VoidExpression */: + case 186 /* YieldExpression */: + case 187 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -40900,7 +41797,7 @@ var ts; // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { // find syntax list that covers the span of the node - if (c.kind === 271 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 273 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -41006,7 +41903,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 236 /* JsxText */) { + if (isToken(n) || n.kind === 238 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41014,7 +41911,7 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 236 /* JsxText */) { + if (isToken(n) || n.kind === 238 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41028,10 +41925,10 @@ var ts; // if no - position is in the node itself so we should recurse in it. // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 236 /* JsxText */)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 238 /* JsxText */)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 236 /* JsxText */ && start === child.end); // whitespace only JsxText + (child.kind === 238 /* JsxText */ && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -41043,8 +41940,8 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 248 /* SourceFile */); - // Here we know that none of child token nodes embrace the position, + ts.Debug.assert(startNode !== undefined || n.kind === 250 /* SourceFile */); + // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' @@ -41065,7 +41962,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && token.kind === 9 /* StringLiteral */ && position > token.getStart(); + return token && (token.kind === 9 /* StringLiteral */ || token.kind === 162 /* StringLiteralType */) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -41169,10 +42066,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 /* TypeReference */ || node.kind === 168 /* CallExpression */) { + if (node.kind === 151 /* TypeReference */ || node.kind === 170 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 214 /* ClassDeclaration */ || node.kind === 215 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 216 /* ClassDeclaration */ || node.kind === 217 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -41195,6 +42092,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 /* StringLiteral */ + || kind === 162 /* StringLiteralType */ || kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(kind)) { return true; @@ -41431,7 +42329,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 226 /* ImportSpecifier */ || location.parent.kind === 230 /* ExportSpecifier */) && + (location.parent.kind === 228 /* ImportSpecifier */ || location.parent.kind === 232 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -41488,6 +42386,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, + getCurrentLeadingTrivia: function () { return leadingTrivia; }, lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { ts.Debug.assert(scanner !== undefined); @@ -41553,10 +42452,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 238 /* JsxAttribute */: - case 235 /* JsxOpeningElement */: - case 237 /* JsxClosingElement */: - case 234 /* JsxSelfClosingElement */: + case 240 /* JsxAttribute */: + case 237 /* JsxOpeningElement */: + case 239 /* JsxClosingElement */: + case 236 /* JsxSelfClosingElement */: return node.kind === 69 /* Identifier */; } } @@ -41763,7 +42662,7 @@ var ts; return false; }; return FormattingContext; - })(); + }()); formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41802,7 +42701,7 @@ var ts; "flag=" + this.Flag + "]"; }; return Rule; - })(); + }()); formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41849,7 +42748,7 @@ var ts; return new RuleDescriptor(left, right); }; return RuleDescriptor; - })(); + }()); formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41891,7 +42790,7 @@ var ts; return result; }; return RuleOperation; - })(); + }()); formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41926,7 +42825,7 @@ var ts; }; RuleOperationContext.Any = new RuleOperationContext(); return RuleOperationContext; - })(); + }()); formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42030,6 +42929,7 @@ var ts; // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); // Lambda expressions + this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 34 /* EqualsGreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(34 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Optional parameters and let args this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(22 /* DotDotDotToken */, 69 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); @@ -42055,72 +42955,68 @@ var ts; this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(118 /* AsyncKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(118 /* AsyncKeyword */, 87 /* FunctionKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // template string - this.SpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // These rules are higher in priority than user-configurable rules. - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - 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, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, - this.SpaceBetweenTagAndTemplateString, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, - // TypeScript-specific rules - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket, - this.NoSpaceAfterTypeAssertion, - this.SpaceBeforeAt, - this.NoSpaceAfterAt, - this.SpaceAfterDecorator, - ]; + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, + 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, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, + this.NoSpaceBetweenTagAndTemplateString, + // TypeScript-specific rules + this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceBeforeArrow, this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket, + this.NoSpaceAfterTypeAssertion, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, + ]; // These rules are lower in priority than user-configurable rules. - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, this.SpaceAfterTryFinally + ]; /// /// Rules controlled by user options /// // Insert space after comma delimiter - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNextTokenNotCloseBracket), 2 /* Space */)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Insert space before and after binary operators this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); @@ -42152,15 +43048,20 @@ var ts; this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenBracketToken */, 20 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space after opening and before closing template string braces + this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Insert space after function keyword for anonymous functions this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87 /* FunctionKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87 /* FunctionKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_34 in o) { - if (o[name_34] === rule) { - return name_34; + for (var name_30 in o) { + if (o[name_30] === rule) { + return name_30; } } throw new Error("Unknown rule"); @@ -42169,39 +43070,39 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 199 /* ForStatement */; + return context.contextNode.kind === 201 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 189 /* AsExpression */: + case 183 /* BinaryExpression */: + case 184 /* ConditionalExpression */: + case 191 /* AsExpression */: case 150 /* TypePredicate */: case 158 /* UnionType */: case 159 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 163 /* BindingElement */: + case 165 /* BindingElement */: // equals in type X = ... - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: // equal in p = 0; case 138 /* Parameter */: - case 247 /* EnumMember */: + case 249 /* EnumMember */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return context.currentTokenSpan.kind === 56 /* EqualsToken */ || context.nextTokenSpan.kind === 56 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return context.currentTokenSpan.kind === 90 /* InKeyword */ || context.nextTokenSpan.kind === 90 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return context.currentTokenSpan.kind === 134 /* OfKeyword */ || context.nextTokenSpan.kind === 134 /* OfKeyword */; } return false; @@ -42210,7 +43111,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 182 /* ConditionalExpression */; + return context.contextNode.kind === 184 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -42254,17 +43155,17 @@ var ts; return true; } switch (node.kind) { - case 192 /* Block */: - case 220 /* CaseBlock */: - case 165 /* ObjectLiteralExpression */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 222 /* CaseBlock */: + case 167 /* ObjectLiteralExpression */: + case 221 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: @@ -42272,75 +43173,75 @@ var ts; case 146 /* SetAccessor */: ///case SyntaxKind.MethodSignature: case 147 /* CallSignature */: - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: case 144 /* Constructor */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 213 /* FunctionDeclaration */ || context.contextNode.kind === 173 /* FunctionExpression */; + return context.contextNode.kind === 215 /* FunctionDeclaration */ || context.contextNode.kind === 175 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: case 155 /* TypeLiteral */: - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 214 /* ClassDeclaration */: - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: - case 192 /* Block */: - case 244 /* CatchClause */: - case 219 /* ModuleBlock */: - case 206 /* SwitchStatement */: + case 216 /* ClassDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: + case 194 /* Block */: + case 246 /* CatchClause */: + case 221 /* ModuleBlock */: + case 208 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 196 /* IfStatement */: - case 206 /* SwitchStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: - case 209 /* TryStatement */: - case 197 /* DoStatement */: - case 205 /* WithStatement */: + case 198 /* IfStatement */: + case 208 /* SwitchStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 211 /* TryStatement */: + case 199 /* DoStatement */: + case 207 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 244 /* CatchClause */: + case 246 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 165 /* ObjectLiteralExpression */; + return context.contextNode.kind === 167 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 168 /* CallExpression */; + return context.contextNode.kind === 170 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 169 /* NewExpression */; + return context.contextNode.kind === 171 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -42348,8 +43249,11 @@ var ts; Rules.IsPreviousTokenNotComma = function (context) { return context.currentTokenSpan.kind !== 24 /* CommaToken */; }; + Rules.IsNextTokenNotCloseBracket = function (context) { + return context.nextTokenSpan.kind !== 20 /* CloseBracketToken */; + }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 174 /* ArrowFunction */; + return context.contextNode.kind === 176 /* ArrowFunction */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -42370,14 +43274,14 @@ var ts; return node.kind === 139 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 212 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 214 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 218 /* ModuleDeclaration */; + return context.contextNode.kind === 220 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { return context.contextNode.kind === 155 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; @@ -42388,20 +43292,20 @@ var ts; } switch (parent.kind) { case 151 /* TypeReference */: - case 171 /* TypeAssertionExpression */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 173 /* TypeAssertionExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 147 /* CallSignature */: case 148 /* ConstructSignature */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 188 /* ExpressionWithTypeArguments */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 190 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -42412,16 +43316,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 171 /* TypeAssertionExpression */; + return context.contextNode.kind === 173 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 177 /* VoidExpression */; + return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 179 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 184 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 186 /* YieldExpression */ && context.contextNode.expression !== undefined; }; return Rules; - })(); + }()); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42489,7 +43393,7 @@ var ts; return null; }; return RulesMap; - })(); + }()); formatting.RulesMap = RulesMap; var MaskBitSize = 5; var Mask = 0x1f; @@ -42541,7 +43445,7 @@ var ts; this.rulesInsertionIndexBitmap = temp; }; return RulesBucketConstructionState; - })(); + }()); formatting.RulesBucketConstructionState = RulesBucketConstructionState; var RulesBucket = (function () { function RulesBucket() { @@ -42576,7 +43480,7 @@ var ts; state.IncreaseInsertionIndex(position); }; return RulesBucket; - })(); + }()); formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42604,7 +43508,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenRangeAccess; - })(); + }()); Shared.TokenRangeAccess = TokenRangeAccess; var TokenValuesAccess = (function () { function TokenValuesAccess(tks) { @@ -42617,7 +43521,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenValuesAccess; - })(); + }()); Shared.TokenValuesAccess = TokenValuesAccess; var TokenSingleValueAccess = (function () { function TokenSingleValueAccess(token) { @@ -42630,7 +43534,7 @@ var ts; return tokenValue === this.token; }; return TokenSingleValueAccess; - })(); + }()); Shared.TokenSingleValueAccess = TokenSingleValueAccess; var TokenAllAccess = (function () { function TokenAllAccess() { @@ -42649,7 +43553,7 @@ var ts; return "[allTokens]"; }; return TokenAllAccess; - })(); + }()); Shared.TokenAllAccess = TokenAllAccess; var TokenRange = (function () { function TokenRange(tokenAccess) { @@ -42691,7 +43595,7 @@ var ts; TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); TokenRange.TypeNames = TokenRange.FromTokens([69 /* Identifier */, 128 /* NumberKeyword */, 130 /* StringKeyword */, 120 /* BooleanKeyword */, 131 /* SymbolKeyword */, 103 /* VoidKeyword */, 117 /* AnyKeyword */]); return TokenRange; - })(); + }()); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -42777,6 +43681,14 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeCloseBracket); rules.push(this.globalRules.NoSpaceBetweenBrackets); } + if (options.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces) { + rules.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail); + } + else { + rules.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail); + } if (options.InsertSpaceAfterSemicolonInForStatements) { rules.push(this.globalRules.SpaceAfterSemicolonInFor); } @@ -42802,7 +43714,7 @@ var ts; return rules; }; return RulesProvider; - })(); + }()); formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42903,17 +43815,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 192 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 248 /* SourceFile */: - case 192 /* Block */: - case 219 /* ModuleBlock */: + return body && body.kind === 194 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 250 /* SourceFile */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -43011,17 +43923,17 @@ var ts; */ function getOwnOrInheritedDelta(n, options, sourceFile) { var previousLine = -1 /* Unknown */; - var childKind = 0 /* Unknown */; + var child; while (n) { var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; if (previousLine !== -1 /* Unknown */ && line !== previousLine) { break; } - if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { + if (formatting.SmartIndenter.shouldIndentChildNode(n, child)) { return options.IndentSize; } previousLine = line; - childKind = n.kind; + child = n; n = n.parent; } return 0; @@ -43051,6 +43963,13 @@ var ts; var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } + if (!formattingScanner.isOnToken()) { + var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (leadingTrivia) { + processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + trimTrailingWhitespacesForRemainingRange(); + } + } formattingScanner.close(); return edits; // local functions @@ -43062,7 +43981,8 @@ var ts; * to inherited indentation from its predecessors. */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { - if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || + ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { if (inheritedIndentation !== -1 /* Unknown */) { return inheritedIndentation; } @@ -43079,32 +43999,7 @@ var ts; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { var indentation = inheritedIndentation; - if (indentation === -1 /* Unknown */) { - if (isSomeBlock(node.kind)) { - // blocks should be indented in - // - other blocks - // - source file - // - switch\default clauses - if (isSomeBlock(parent.kind) || - parent.kind === 248 /* SourceFile */ || - parent.kind === 241 /* CaseClause */ || - parent.kind === 242 /* DefaultClause */) { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - else { - indentation = parentDynamicIndentation.getIndentation(); - } - } - else { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); - } - else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - } - } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; + var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { // if node is located on the same line with the parent // - inherit indentation from the parent @@ -43112,7 +44007,15 @@ var ts; indentation = startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta(node) + delta); + } + else if (indentation === -1 /* Unknown */) { + if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + } } return { indentation: indentation, @@ -43124,10 +44027,10 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 214 /* ClassDeclaration */: return 73 /* ClassKeyword */; - case 215 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; - case 213 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; - case 217 /* EnumDeclaration */: return 217 /* EnumDeclaration */; + case 216 /* ClassDeclaration */: return 73 /* ClassKeyword */; + case 217 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; + case 215 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; + case 219 /* EnumDeclaration */: return 219 /* EnumDeclaration */; case 145 /* GetAccessor */: return 123 /* GetKeyword */; case 146 /* SetAccessor */: return 129 /* SetKeyword */; case 143 /* MethodDeclaration */: @@ -43142,7 +44045,7 @@ var ts; } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { - getIndentationForComment: function (kind, tokenIndentation) { + getIndentationForComment: function (kind, tokenIndentation, container) { switch (kind) { // preceding comment to the token that closes the indentation scope inherits the indentation from the scope // .. { @@ -43151,11 +44054,11 @@ var ts; case 16 /* CloseBraceToken */: case 20 /* CloseBracketToken */: case 18 /* CloseParenToken */: - return indentation + delta; + return indentation + getEffectiveDelta(delta, container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; }, - getIndentationForToken: function (line, kind) { + getIndentationForToken: function (line, kind, container) { if (nodeStartLine !== line && node.decorators) { if (kind === getFirstNonDecoratorTokenOfNode(node)) { // if this token is the first token following the list of decorators, we do not need to indent @@ -43176,20 +44079,20 @@ var ts; return indentation; default: // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + delta : indentation; + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; } }, getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getDelta: function (child) { return getEffectiveDelta(delta, child); }, recomputeIndentation: function (lineAdded) { - if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { if (lineAdded) { indentation += options.IndentSize; } else { indentation -= options.IndentSize; } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { + if (formatting.SmartIndenter.shouldIndentChildNode(node)) { delta = options.IndentSize; } else { @@ -43198,6 +44101,10 @@ var ts; } } }; + function getEffectiveDelta(delta, child) { + // Delta value should be zero when the node explicitly prevents indentation of the child node + return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { @@ -43269,7 +44176,7 @@ var ts; // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules var tokenInfo = formattingScanner.readTokenInfo(child); ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } var effectiveParentStartLine = child.kind === 139 /* Decorator */ ? childStartLine : undecoratedParentStartLine; @@ -43323,7 +44230,7 @@ var ts; } } } - function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation, container) { ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); var indentToken = false; @@ -43358,10 +44265,10 @@ var ts; } if (indentToken) { var tokenIndentation = (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) ? - dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind) : + dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container) : -1 /* Unknown */; if (currentTokenInfo.leadingTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation); + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); var indentNextTokenOrTrivia = true; for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; @@ -43450,9 +44357,7 @@ var ts; } } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = - (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && - rule.Flag !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = !(rule.Operation.Action & 8 /* Delete */) && rule.Flag !== 1 /* CanDeleteNewLines */; } else { trimTrailingWhitespaces = true; @@ -43535,16 +44440,36 @@ var ts; if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } - var pos = lineEndPosition; - while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== lineEndPosition) { - ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); - recordDelete(pos + 1, lineEndPosition - pos); + var whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + ts.Debug.assert(whitespaceStart === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); } } } + /** + * @param start The position of the first character in range + * @param end The position of the last character in range + */ + function getTrailingWhitespaceStartPosition(start, end) { + var pos = end; + while (pos >= start && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + /** + * Trimming will be done for lines after the previous range + */ + function trimTrailingWhitespacesForRemainingRange() { + var startPosition = previousRange ? previousRange.end : originalRange.pos; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; + trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); + } function newTextChange(start, len, newText) { return { span: ts.createTextSpan(start, len), newText: newText }; } @@ -43598,8 +44523,8 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return true; } return false; @@ -43607,11 +44532,11 @@ var ts; function getOpenTokenForList(node, list) { switch (node.kind) { case 144 /* Constructor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (node.typeParameters === list) { return 25 /* LessThanToken */; } @@ -43619,8 +44544,8 @@ var ts; return 17 /* OpenParenToken */; } break; - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -43744,7 +44669,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 181 /* BinaryExpression */) { + if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 183 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -43758,7 +44683,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -43825,7 +44750,7 @@ var ts; } } // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent, current) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } current = parent; @@ -43863,7 +44788,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 248 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 250 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -43896,7 +44821,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 196 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 198 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -43914,13 +44839,13 @@ var ts; return node.parent.typeArguments; } break; - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return node.parent.properties; - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return node.parent.elements; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 147 /* CallSignature */: @@ -43935,8 +44860,8 @@ var ts; } break; } - case 169 /* NewExpression */: - case 168 /* CallExpression */: { + case 171 /* NewExpression */: + case 170 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -43966,8 +44891,8 @@ var ts; if (node.kind === 18 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 168 /* CallExpression */ || - node.parent.kind === 169 /* NewExpression */) && + if (node.parent && (node.parent.kind === 170 /* CallExpression */ || + node.parent.kind === 171 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -43985,10 +44910,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: node = node.expression; break; default: @@ -44052,34 +44977,35 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 195 /* ExpressionStatement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 164 /* ArrayLiteralExpression */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 165 /* ObjectLiteralExpression */: + case 197 /* ExpressionStatement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 166 /* ArrayLiteralExpression */: + case 194 /* Block */: + case 221 /* ModuleBlock */: + case 167 /* ObjectLiteralExpression */: case 155 /* TypeLiteral */: case 157 /* TupleType */: - case 220 /* CaseBlock */: - case 242 /* DefaultClause */: - case 241 /* CaseClause */: - case 172 /* ParenthesizedExpression */: - case 166 /* PropertyAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 193 /* VariableStatement */: - case 211 /* VariableDeclaration */: - case 227 /* ExportAssignment */: - case 204 /* ReturnStatement */: - case 182 /* ConditionalExpression */: - case 162 /* ArrayBindingPattern */: - case 161 /* ObjectBindingPattern */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: + case 222 /* CaseBlock */: + case 244 /* DefaultClause */: + case 243 /* CaseClause */: + case 174 /* ParenthesizedExpression */: + case 168 /* PropertyAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 195 /* VariableStatement */: + case 213 /* VariableDeclaration */: + case 229 /* ExportAssignment */: + case 206 /* ReturnStatement */: + case 184 /* ConditionalExpression */: + case 164 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 237 /* JsxOpeningElement */: + case 236 /* JsxSelfClosingElement */: + case 242 /* JsxExpression */: case 142 /* MethodSignature */: case 147 /* CallSignature */: case 148 /* ConstructSignature */: @@ -44087,34 +45013,43 @@ var ts; case 152 /* FunctionType */: case 153 /* ConstructorType */: case 160 /* ParenthesizedType */: - case 170 /* TaggedTemplateExpression */: - case 178 /* AwaitExpression */: + case 172 /* TaggedTemplateExpression */: + case 180 /* AwaitExpression */: + case 227 /* NamedImports */: return true; } return false; } - function shouldIndentChildNode(parent, child) { - if (nodeContentIsAlwaysIndented(parent)) { - return true; - } - switch (parent) { - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 196 /* IfStatement */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + /* @internal */ + function nodeWillIndentChild(parent, child, indentByDefault) { + var childKind = child ? child.kind : 0 /* Unknown */; + switch (parent.kind) { + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 198 /* IfStatement */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - return child !== 192 /* Block */; - default: - return false; + return childKind !== 194 /* Block */; + case 235 /* JsxElement */: + return childKind !== 239 /* JsxClosingElement */; } + // No explicit rule for given nodes so the result will follow the default value argument + return indentByDefault; + } + SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; + /* + Function returns true when the parent node should indent the given child by an explicit rule + */ + function shouldIndentChildNode(parent, child) { + return nodeContentIsAlwaysIndented(parent.kind) || nodeWillIndentChild(parent, child, false); } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); @@ -44157,7 +45092,7 @@ var ts; return undefined; }; return StringScriptSnapshot; - })(); + }()); function fromString(text) { return new StringScriptSnapshot(text); } @@ -44256,7 +45191,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(271 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); + var list = createNode(273 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -44333,7 +45268,7 @@ var ts; return child.kind < 135 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; return NodeObject; - })(); + }()); var SymbolObject = (function () { function SymbolObject(flags, name) { this.flags = flags; @@ -44355,7 +45290,7 @@ var ts; return this.documentationComment; }; return SymbolObject; - })(); + }()); function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { var documentationComment = []; var docComments = getJsDocCommentsSeparatedByNewLines(); @@ -44373,7 +45308,7 @@ var ts; // Make sure we are collecting doc comment from declaration once, // In case of union property there might be same declaration multiple times // which only varies in type parameter - // Eg. let a: Array | Array; a.length + // Eg. const a: Array | Array; a.length // The property length will have two declarations of property length coming // from Array - Array and Array if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { @@ -44388,15 +45323,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 218 /* ModuleDeclaration */ && declaration.body.kind === 218 /* ModuleDeclaration */) { + if (declaration.kind === 220 /* ModuleDeclaration */ && declaration.body.kind === 220 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 218 /* ModuleDeclaration */ && declaration.parent.kind === 218 /* ModuleDeclaration */) { + while (declaration.kind === 220 /* ModuleDeclaration */ && declaration.parent.kind === 220 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 211 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -44444,7 +45379,8 @@ var ts; } function pushDocCommentLineText(docComments, text, blankLineCount) { // Add the empty lines in between texts - while (blankLineCount--) { + while (blankLineCount) { + blankLineCount--; docComments.push(ts.textPart("")); } docComments.push(ts.textPart(text)); @@ -44670,7 +45606,7 @@ var ts; : undefined; }; return TypeObject; - })(); + }()); var SignatureObject = (function () { function SignatureObject(checker) { this.checker = checker; @@ -44696,7 +45632,7 @@ var ts; return this.documentationComment; }; return SignatureObject; - })(); + }()); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { @@ -44742,7 +45678,7 @@ var ts; } if (declaration.name.kind === 136 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 166 /* PropertyAccessExpression */) { + if (expr.kind === 168 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -44762,7 +45698,7 @@ var ts; } function visit(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: var functionDeclaration = node; @@ -44784,31 +45720,31 @@ var ts; ts.forEachChild(node, visit); } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: - case 218 /* ModuleDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 230 /* ExportSpecifier */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 232 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 155 /* TypeLiteral */: addDeclaration(node); // fall through case 144 /* Constructor */: - case 193 /* VariableStatement */: - case 212 /* VariableDeclarationList */: - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 219 /* ModuleBlock */: + case 195 /* VariableStatement */: + case 214 /* VariableDeclarationList */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: + case 221 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } @@ -44819,25 +45755,25 @@ var ts; break; } // fall through - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 247 /* EnumMember */: + case 249 /* EnumMember */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: addDeclaration(node); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -44849,7 +45785,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -44862,12 +45798,12 @@ var ts; } }; return SourceFileObject; - })(NodeObject); + }(NodeObject)); var TextChange = (function () { function TextChange() { } return TextChange; - })(); + }()); ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { @@ -44957,7 +45893,7 @@ var ts; // enum E ScriptElementKind.enumElement = "enum"; // Inside module and script only - // let v = .. + // const v = .. ScriptElementKind.variableElement = "var"; // Inside function ScriptElementKind.localVariableElement = "local var"; @@ -45026,7 +45962,7 @@ var ts; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; - })(); + }()); ts.ClassificationTypeNames = ClassificationTypeNames; (function (ClassificationType) { ClassificationType[ClassificationType["comment"] = 1] = "comment"; @@ -45065,16 +46001,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 173 /* FunctionExpression */) { + if (declaration.kind === 175 /* FunctionExpression */) { return true; } - if (declaration.kind !== 211 /* VariableDeclaration */ && declaration.kind !== 213 /* FunctionDeclaration */) { + if (declaration.kind !== 213 /* VariableDeclaration */ && declaration.kind !== 215 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { // Reached source file or module block - if (parent_8.kind === 248 /* SourceFile */ || parent_8.kind === 219 /* ModuleBlock */) { + if (parent_8.kind === 250 /* SourceFile */ || parent_8.kind === 221 /* ModuleBlock */) { return false; } } @@ -45157,7 +46093,7 @@ var ts; return file && file.scriptSnapshot; }; return HostCache; - })(); + }()); var SyntaxTreeCache = (function () { function SyntaxTreeCache(host) { this.host = host; @@ -45172,7 +46108,7 @@ var ts; var sourceFile; if (this.currentFileName !== fileName) { // This is a new file, just parse it - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, /*setNodeParents:*/ true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, /*setNodeParents*/ true); } else if (this.currentFileVersion !== version) { // This is the same file, just a newer version. Incrementally parse the file. @@ -45189,7 +46125,7 @@ var ts; return this.currentSourceFile; }; return SyntaxTreeCache; - })(); + }()); function setSourceFileFields(sourceFile, scriptSnapshot, version) { sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; @@ -45234,7 +46170,7 @@ var ts; sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); outputText = text; } }, @@ -45244,7 +46180,8 @@ var ts; getCurrentDirectory: function () { return ""; }, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return fileName === inputFileName; }, - readFile: function (fileName) { return ""; } + readFile: function (fileName) { return ""; }, + directoryExists: function (directoryExists) { return true; } }; var program = ts.createProgram([inputFileName], options, compilerHost); var diagnostics; @@ -45326,7 +46263,7 @@ var ts; } } // Otherwise, just create a new source file. - return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents:*/ true); + return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; function createGetCanonicalFileName(useCaseSensitivefileNames) { @@ -45342,7 +46279,7 @@ var ts; var buckets = {}; var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { - return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx; + return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -45353,7 +46290,7 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; entries.forEachValue(function (key, entry) { @@ -45369,13 +46306,13 @@ var ts; sourceFiles: sourceFiles }; }); - return JSON.stringify(bucketInfoArray, null, 2); + return JSON.stringify(bucketInfoArray, undefined, 2); } function acquireDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring:*/ true); + return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ true); } function updateDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring:*/ false); + return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ false); } function acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, acquiring) { var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ true); @@ -45384,7 +46321,7 @@ var ts; if (!entry) { ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); // Have never seen this file with these settings. Create a new source file for it. - var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents:*/ false); + var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false); entry = { sourceFile: sourceFile, languageServiceRefCount: 0, @@ -45411,7 +46348,7 @@ var ts; return entry.sourceFile; } function releaseDocument(fileName, compilationSettings) { - var bucket = getBucketForCompilationSettings(compilationSettings, false); + var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false); ts.Debug.assert(bucket !== undefined); var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = bucket.get(path); @@ -45507,7 +46444,7 @@ var ts; } } else if (token === 56 /* EqualsToken */) { - if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } } @@ -45599,7 +46536,7 @@ var ts; if (token === 69 /* Identifier */ || ts.isKeyword(token)) { token = scanner.scan(); if (token === 56 /* EqualsToken */) { - if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } } @@ -45686,7 +46623,7 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/* skipCurrentToken */ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { continue; } else { @@ -45705,7 +46642,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 207 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 209 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -45714,12 +46651,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 /* Identifier */ && - (node.parent.kind === 203 /* BreakStatement */ || node.parent.kind === 202 /* ContinueStatement */) && + (node.parent.kind === 205 /* BreakStatement */ || node.parent.kind === 204 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 /* Identifier */ && - node.parent.kind === 207 /* LabeledStatement */ && + node.parent.kind === 209 /* LabeledStatement */ && node.parent.label === node; } /** @@ -45727,7 +46664,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 207 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 209 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -45741,22 +46678,22 @@ var ts; return node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 168 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 169 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 218 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 220 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 /* Identifier */ && @@ -45765,22 +46702,22 @@ var ts; /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { return (node.kind === 69 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - (node.parent.kind === 245 /* PropertyAssignment */ || node.parent.kind === 246 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 247 /* PropertyAssignment */ || node.parent.kind === 248 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 247 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 249 /* EnumMember */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return node.parent.name === node; - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -45854,17 +46791,17 @@ var ts; return undefined; } switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 218 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: return node; } } @@ -45872,18 +46809,18 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 218 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 214 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 215 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 216 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 217 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 211 /* VariableDeclaration */: + case 220 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 216 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 217 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 218 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 219 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 213 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 213 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 215 /* FunctionDeclaration */: return ScriptElementKind.functionElement; case 145 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; case 146 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; case 143 /* MethodDeclaration */: @@ -45897,13 +46834,13 @@ var ts; case 147 /* CallSignature */: return ScriptElementKind.callSignatureElement; case 144 /* Constructor */: return ScriptElementKind.constructorImplementationElement; case 137 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 247 /* EnumMember */: return ScriptElementKind.variableElement; + case 249 /* EnumMember */: return ScriptElementKind.variableElement; case 138 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 223 /* ImportClause */: - case 230 /* ExportSpecifier */: - case 224 /* NamespaceImport */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 225 /* ImportClause */: + case 232 /* ExportSpecifier */: + case 226 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -45922,7 +46859,7 @@ var ts; } }; return CancellationTokenObject; - })(); + }()); function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -45985,7 +46922,8 @@ var ts; (oldSettings.target !== newSettings.target || oldSettings.module !== newSettings.module || oldSettings.noResolve !== newSettings.noResolve || - oldSettings.jsx !== newSettings.jsx); + oldSettings.jsx !== newSettings.jsx || + oldSettings.allowJs !== newSettings.allowJs); // Now create a new compiler var compilerHost = { getSourceFile: getOrCreateSourceFile, @@ -46005,6 +46943,10 @@ var ts; // stub missing host functionality var entry = hostCache.getOrCreateEntry(fileName); return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + }, + directoryExists: function (directoryName) { + ts.Debug.assert(!host.resolveModuleNames); + return ts.directoryProbablyExists(directoryName, host); } }; if (host.resolveModuleNames) { @@ -46074,8 +47016,11 @@ var ts; return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } function sourceFileUpToDate(sourceFile) { + if (!sourceFile) { + return false; + } var path = sourceFile.path || ts.toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName); - return sourceFile && sourceFile.version === hostCache.getVersion(path); + return sourceFile.version === hostCache.getVersion(path); } function programUpToDate() { // If we haven't create a program yet, then it is not up-to-date @@ -46124,12 +47069,6 @@ var ts; function getSemanticDiagnostics(fileName) { synchronizeHostData(); var targetSourceFile = getValidSourceFile(fileName); - // For JavaScript files, we don't want to report the normal typescript semantic errors. - // Instead, we just report errors for using TypeScript-only constructs from within a - // JavaScript file. - if (ts.isSourceFileJavaScript(targetSourceFile)) { - return getJavaScriptSemanticDiagnostics(targetSourceFile); - } // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. // Therefore only get diagnostics for given file. var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); @@ -46140,151 +47079,6 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } - function getJavaScriptSemanticDiagnostics(sourceFile) { - var diagnostics = []; - walk(sourceFile); - return diagnostics; - function walk(node) { - if (!node) { - return false; - } - switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); - return true; - case 227 /* ExportAssignment */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); - return true; - case 214 /* ClassDeclaration */: - var classDeclaration = node; - if (checkModifiers(classDeclaration.modifiers) || - checkTypeParameters(classDeclaration.typeParameters)) { - return true; - } - break; - case 243 /* HeritageClause */: - var heritageClause = node; - if (heritageClause.token === 106 /* ImplementsKeyword */) { - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 215 /* InterfaceDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 218 /* ModuleDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 216 /* TypeAliasDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); - return true; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: - case 213 /* FunctionDeclaration */: - var functionDeclaration = node; - if (checkModifiers(functionDeclaration.modifiers) || - checkTypeParameters(functionDeclaration.typeParameters) || - checkTypeAnnotation(functionDeclaration.type)) { - return true; - } - break; - case 193 /* VariableStatement */: - var variableStatement = node; - if (checkModifiers(variableStatement.modifiers)) { - return true; - } - break; - case 211 /* VariableDeclaration */: - var variableDeclaration = node; - if (checkTypeAnnotation(variableDeclaration.type)) { - return true; - } - break; - case 168 /* CallExpression */: - case 169 /* NewExpression */: - var expression = node; - if (expression.typeArguments && expression.typeArguments.length > 0) { - var start = expression.typeArguments.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 138 /* Parameter */: - var parameter = node; - if (parameter.modifiers) { - var start = parameter.modifiers.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); - return true; - } - if (parameter.questionToken) { - diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, '?')); - return true; - } - if (parameter.type) { - diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 141 /* PropertyDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 217 /* EnumDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 171 /* TypeAssertionExpression */: - var typeAssertionExpression = node; - diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); - return true; - case 139 /* Decorator */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); - return true; - } - return ts.forEachChild(node, walk); - } - function checkTypeParameters(typeParameters) { - if (typeParameters) { - var start = typeParameters.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkTypeAnnotation(type) { - if (type) { - diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkModifiers(modifiers) { - if (modifiers) { - for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { - var modifier = modifiers_1[_i]; - switch (modifier.kind) { - case 112 /* PublicKeyword */: - case 110 /* PrivateKeyword */: - case 111 /* ProtectedKeyword */: - case 122 /* DeclareKeyword */: - diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); - return true; - // These are all legal modifiers. - case 113 /* StaticKeyword */: - case 82 /* ExportKeyword */: - case 74 /* ConstKeyword */: - case 77 /* DefaultKeyword */: - case 115 /* AbstractKeyword */: - } - } - } - return false; - } - } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); @@ -46301,7 +47095,7 @@ var ts; // First check of the displayName is not external module; if it is an external module, it is not valid entry if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there) + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) return undefined; } } @@ -46324,20 +47118,14 @@ var ts; // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. if (performCharacterChecks) { - if (!ts.isIdentifierStart(name.charCodeAt(0), target)) { + if (!ts.isIdentifier(name, target)) { return undefined; } - for (var i = 1, n = name.length; i < n; i++) { - if (!ts.isIdentifierPart(name.charCodeAt(i), target)) { - return undefined; - } - } } return name; } function getCompletionData(fileName, position) { var typeChecker = program.getTypeChecker(); - var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; @@ -46349,7 +47137,7 @@ var ts; var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. + // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { isJsDocTagName = true; @@ -46364,9 +47152,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { - case 269 /* JSDocTypeTag */: - case 267 /* JSDocParameterTag */: - case 268 /* JSDocReturnTag */: + case 271 /* JSDocTypeTag */: + case 269 /* JSDocParameterTag */: + case 270 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -46378,7 +47166,7 @@ var ts; return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName }; } if (!insideJsDocTagExpression) { - // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal + // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); return undefined; @@ -46393,9 +47181,9 @@ var ts; // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| // Skip this partial identifier and adjust the contextToken to the token that precedes it. if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_3 = new Date().getTime(); + var start_6 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_3)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_6)); } // Find the node where completion is requested on. // Also determine whether we are trying to complete with members of that node @@ -46413,7 +47201,7 @@ var ts; } var parent_9 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_9.kind === 166 /* PropertyAccessExpression */) { + if (parent_9.kind === 168 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } @@ -46432,7 +47220,7 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 237 /* JsxClosingElement */) { + else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 239 /* JsxClosingElement */) { isStartingCloseTag = true; } } @@ -46475,7 +47263,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 166 /* PropertyAccessExpression */) { + if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -46531,7 +47319,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 234 /* JsxSelfClosingElement */) || (jsxContainer.kind === 235 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 236 /* JsxSelfClosingElement */) || (jsxContainer.kind === 237 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { @@ -46603,15 +47391,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 236 /* JsxText */) { + if (contextToken.kind === 238 /* JsxText */) { return true; } if (contextToken.kind === 27 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 235 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 237 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 237 /* JsxClosingElement */ || contextToken.parent.kind === 234 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 233 /* JsxElement */; + if (contextToken.parent.kind === 239 /* JsxClosingElement */ || contextToken.parent.kind === 236 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 235 /* JsxElement */; } } return false; @@ -46621,36 +47409,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 168 /* CallExpression */ // func( a, | + return containingNodeKind === 170 /* CallExpression */ // func( a, | || containingNodeKind === 144 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 169 /* NewExpression */ // new C(a, | - || containingNodeKind === 164 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 181 /* BinaryExpression */ // let x = (a, | + || containingNodeKind === 171 /* NewExpression */ // new C(a, | + || containingNodeKind === 166 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 183 /* BinaryExpression */ // const x = (a, | || containingNodeKind === 152 /* FunctionType */; // var x: (s: string, list| case 17 /* OpenParenToken */: - return containingNodeKind === 168 /* CallExpression */ // func( | + return containingNodeKind === 170 /* CallExpression */ // func( | || containingNodeKind === 144 /* Constructor */ // constructor( | - || containingNodeKind === 169 /* NewExpression */ // new C(a| - || containingNodeKind === 172 /* ParenthesizedExpression */ // let x = (a| + || containingNodeKind === 171 /* NewExpression */ // new C(a| + || containingNodeKind === 174 /* ParenthesizedExpression */ // const x = (a| || containingNodeKind === 160 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 19 /* OpenBracketToken */: - return containingNodeKind === 164 /* ArrayLiteralExpression */ // [ | + return containingNodeKind === 166 /* ArrayLiteralExpression */ // [ | || containingNodeKind === 149 /* IndexSignature */ // [ | : string ] || containingNodeKind === 136 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 125 /* ModuleKeyword */: // module | case 126 /* NamespaceKeyword */: return true; case 21 /* DotToken */: - return containingNodeKind === 218 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 220 /* ModuleDeclaration */; // module A.| case 15 /* OpenBraceToken */: - return containingNodeKind === 214 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 216 /* ClassDeclaration */; // class A{ | case 56 /* EqualsToken */: - return containingNodeKind === 211 /* VariableDeclaration */ // let x = a| - || containingNodeKind === 181 /* BinaryExpression */; // x = a| + return containingNodeKind === 213 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 183 /* BinaryExpression */; // x = a| case 12 /* TemplateHead */: - return containingNodeKind === 183 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 185 /* TemplateExpression */; // `aa ${| case 13 /* TemplateMiddle */: - return containingNodeKind === 190 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 192 /* TemplateSpan */; // `aa ${10} dd ${| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: @@ -46668,15 +47456,16 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 /* StringLiteral */ + || contextToken.kind === 162 /* StringLiteralType */ || contextToken.kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(contextToken.kind)) { - var start_4 = contextToken.getStart(); + var start_7 = contextToken.getStart(); var end = contextToken.getEnd(); // To be "in" one of these literals, the position has to be: // 1. entirely within the token text. // 2. at the end position of an unterminated token. // 3. at the end of a regular expression (due to trailing flags like '/foo/g'). - if (start_4 < position && position < end) { + if (start_7 < position && position < end) { return true; } if (position === end) { @@ -46697,14 +47486,14 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 165 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 167 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 161 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 163 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -46750,9 +47539,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 225 /* NamedImports */ ? - 222 /* ImportDeclaration */ : - 228 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 227 /* NamedImports */ ? + 224 /* ImportDeclaration */ : + 230 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -46775,10 +47564,10 @@ var ts; function tryGetObjectLikeCompletionContainer(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 15 /* OpenBraceToken */: // let x = { | + case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 165 /* ObjectLiteralExpression */ || parent_10.kind === 161 /* ObjectBindingPattern */)) { + if (parent_10 && (parent_10.kind === 167 /* ObjectLiteralExpression */ || parent_10.kind === 163 /* ObjectBindingPattern */)) { return parent_10; } break; @@ -46796,8 +47585,8 @@ var ts; case 15 /* OpenBraceToken */: // import { | case 24 /* CommaToken */: switch (contextToken.parent.kind) { - case 225 /* NamedImports */: - case 229 /* NamedExports */: + case 227 /* NamedImports */: + case 231 /* NamedExports */: return contextToken.parent; } } @@ -46811,12 +47600,12 @@ var ts; case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - if (parent_11 && (parent_11.kind === 234 /* JsxSelfClosingElement */ || parent_11.kind === 235 /* JsxOpeningElement */)) { + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + if (parent_11 && (parent_11.kind === 236 /* JsxSelfClosingElement */ || parent_11.kind === 237 /* JsxOpeningElement */)) { return parent_11; } - else if (parent_11.kind === 238 /* JsxAttribute */) { + else if (parent_11.kind === 240 /* JsxAttribute */) { return parent_11.parent; } break; @@ -46824,18 +47613,18 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_11 && ((parent_11.kind === 238 /* JsxAttribute */) || (parent_11.kind === 239 /* JsxSpreadAttribute */))) { + if (parent_11 && ((parent_11.kind === 240 /* JsxAttribute */) || (parent_11.kind === 241 /* JsxSpreadAttribute */))) { return parent_11.parent; } break; case 16 /* CloseBraceToken */: if (parent_11 && - parent_11.kind === 240 /* JsxExpression */ && + parent_11.kind === 242 /* JsxExpression */ && parent_11.parent && - (parent_11.parent.kind === 238 /* JsxAttribute */)) { + (parent_11.parent.kind === 240 /* JsxAttribute */)) { return parent_11.parent.parent; } - if (parent_11 && parent_11.kind === 239 /* JsxSpreadAttribute */) { + if (parent_11 && parent_11.kind === 241 /* JsxSpreadAttribute */) { return parent_11.parent; } break; @@ -46845,9 +47634,9 @@ var ts; } function isFunction(kind) { switch (kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 213 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: @@ -46866,54 +47655,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 211 /* VariableDeclaration */ || - containingNodeKind === 212 /* VariableDeclarationList */ || - containingNodeKind === 193 /* VariableStatement */ || - containingNodeKind === 217 /* EnumDeclaration */ || + return containingNodeKind === 213 /* VariableDeclaration */ || + containingNodeKind === 214 /* VariableDeclarationList */ || + containingNodeKind === 195 /* VariableStatement */ || + containingNodeKind === 219 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 214 /* ClassDeclaration */ || - containingNodeKind === 186 /* ClassExpression */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 162 /* ArrayBindingPattern */ || - containingNodeKind === 216 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 216 /* ClassDeclaration */ || + containingNodeKind === 188 /* ClassExpression */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 164 /* ArrayBindingPattern */ || + containingNodeKind === 218 /* TypeAliasDeclaration */; // type Map, K, | case 21 /* DotToken */: - return containingNodeKind === 162 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 164 /* ArrayBindingPattern */; // var [.| case 54 /* ColonToken */: - return containingNodeKind === 163 /* BindingElement */; // var {x :html| + return containingNodeKind === 165 /* BindingElement */; // var {x :html| case 19 /* OpenBracketToken */: - return containingNodeKind === 162 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 164 /* ArrayBindingPattern */; // var [x| case 17 /* OpenParenToken */: - return containingNodeKind === 244 /* CatchClause */ || + return containingNodeKind === 246 /* CatchClause */ || isFunction(containingNodeKind); case 15 /* OpenBraceToken */: - return containingNodeKind === 217 /* EnumDeclaration */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 155 /* TypeLiteral */; // let x : { | + return containingNodeKind === 219 /* EnumDeclaration */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 155 /* TypeLiteral */; // const x : { | case 23 /* SemicolonToken */: return containingNodeKind === 140 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 215 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 155 /* TypeLiteral */); // let x : { a; | + (contextToken.parent.parent.kind === 217 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 155 /* TypeLiteral */); // const x : { a; | case 25 /* LessThanToken */: - return containingNodeKind === 214 /* ClassDeclaration */ || - containingNodeKind === 186 /* ClassExpression */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 216 /* TypeAliasDeclaration */ || + return containingNodeKind === 216 /* ClassDeclaration */ || + containingNodeKind === 188 /* ClassExpression */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 218 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 113 /* StaticKeyword */: return containingNodeKind === 141 /* PropertyDeclaration */; case 22 /* DotDotDotToken */: return containingNodeKind === 138 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 162 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 164 /* ArrayBindingPattern */); // var [...z| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: return containingNodeKind === 138 /* Parameter */; case 116 /* AsKeyword */: - return containingNodeKind === 226 /* ImportSpecifier */ || - containingNodeKind === 230 /* ExportSpecifier */ || - containingNodeKind === 224 /* NamespaceImport */; + return containingNodeKind === 228 /* ImportSpecifier */ || + containingNodeKind === 232 /* ExportSpecifier */ || + containingNodeKind === 226 /* NamespaceImport */; case 73 /* ClassKeyword */: case 81 /* EnumKeyword */: case 107 /* InterfaceKeyword */: @@ -46973,8 +47762,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_35 = element.propertyName || element.name; - exisingImportsOrExports[name_35.text] = true; + var name_31 = element.propertyName || element.name; + exisingImportsOrExports[name_31.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -46995,9 +47784,10 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 245 /* PropertyAssignment */ && - m.kind !== 246 /* ShorthandPropertyAssignment */ && - m.kind !== 163 /* BindingElement */) { + if (m.kind !== 247 /* PropertyAssignment */ && + m.kind !== 248 /* ShorthandPropertyAssignment */ && + m.kind !== 165 /* BindingElement */ && + m.kind !== 143 /* MethodDeclaration */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -47005,7 +47795,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 163 /* BindingElement */ && m.propertyName) { + if (m.kind === 165 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 69 /* Identifier */) { existingName = m.propertyName.text; @@ -47035,7 +47825,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 238 /* JsxAttribute */) { + if (attr.kind === 240 /* JsxAttribute */) { seenNames[attr.name.text] = true; } } @@ -47074,10 +47864,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_36 in nameTable) { - if (!uniqueNames[name_36]) { - uniqueNames[name_36] = name_36; - var displayName = getCompletionEntryDisplayName(name_36, target, /*performCharacterChecks:*/ true); + for (var name_32 in nameTable) { + if (!uniqueNames[name_32]) { + uniqueNames[name_32] = name_32; + var displayName = getCompletionEntryDisplayName(name_32, target, /*performCharacterChecks*/ true); if (displayName) { var entry = { name: displayName, @@ -47105,7 +47895,7 @@ var ts; // Try to get a valid display name for this symbol, if we could not find one, then ignore it. // We would like to only show things that can be added after a dot, so for instance numeric properties can // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true, location); + var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks*/ true, location); if (!displayName) { return undefined; } @@ -47154,7 +47944,7 @@ var ts; // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false, location_2) === entryName ? s : undefined; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks*/ false, location_2) === entryName ? s : undefined; }); if (symbol) { var _a = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind; return { @@ -47183,7 +47973,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 186 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; @@ -47248,7 +48038,7 @@ var ts; }); if (!unionPropertyKind) { // If this was union of all methods, - //make sure it has call signatures before we can label it as method + // make sure it has call signatures before we can label it as method var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; @@ -47285,7 +48075,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 166 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 168 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -47294,7 +48084,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 168 /* CallExpression */ || location.kind === 169 /* NewExpression */) { + if (location.kind === 170 /* CallExpression */ || location.kind === 171 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -47307,7 +48097,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 169 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 171 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -47341,16 +48131,16 @@ var ts; case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); + displayParts.push(ts.punctuationPart(54 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); + displayParts.push(ts.keywordPart(92 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - if (!(type.flags & ts.TypeFlags.Anonymous)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); + if (!(type.flags & 65536 /* Anonymous */)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); } - addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); + addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); break; default: // Just signature @@ -47386,7 +48176,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 186 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -47430,7 +48220,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 218 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 220 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 69 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 126 /* NamespaceKeyword */ : 125 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -47453,35 +48243,37 @@ var ts; } else { // Method/function type parameter - var container = ts.getContainingFunction(location); - if (container) { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).parent; - var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 148 /* ConstructSignature */) { - displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */); + ts.Debug.assert(declaration !== undefined); + declaration = declaration.parent; + if (declaration) { + if (ts.isFunctionLikeKind(declaration.kind)) { + var signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === 148 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + displayParts.push(ts.spacePart()); + } + else if (declaration.kind !== 147 /* CallSignature */ && declaration.name) { + addFullSymbolName(declaration.symbol); + } + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); + } + else { + // Type alias type parameter + // For example + // type list = T[]; // Both T will go through same code path + displayParts.push(ts.keywordPart(132 /* TypeKeyword */)); displayParts.push(ts.spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } - else if (signatureDeclaration.kind !== 147 /* CallSignature */ && signatureDeclaration.name) { - addFullSymbolName(signatureDeclaration.symbol); - } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); - } - else { - // Type aliash type parameter - // For example - // type list = T[]; // Both T will go through same code path - var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).parent; - displayParts.push(ts.keywordPart(132 /* TypeKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(declaration.symbol); - writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } } } if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 247 /* EnumMember */) { + if (declaration.kind === 249 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -47497,7 +48289,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 221 /* ImportEqualsDeclaration */) { + if (declaration.kind === 223 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -47630,9 +48422,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: case 97 /* ThisKeyword */: + case 161 /* ThisType */: case 95 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -47712,7 +48505,7 @@ var ts; var definition; ts.forEach(signatureDeclarations, function (d) { if ((selectConstructors && d.kind === 144 /* Constructor */) || - (!selectConstructors && (d.kind === 213 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { + (!selectConstructors && (d.kind === 215 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -47781,7 +48574,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 246 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 248 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -47857,10 +48650,11 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 /* Identifier */ || node.kind === 97 /* ThisKeyword */ || + node.kind === 161 /* ThisType */ || node.kind === 95 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - var referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false); return convertReferencedSymbols(referencedSymbols); } return undefined; @@ -47910,58 +48704,58 @@ var ts; switch (node.kind) { case 88 /* IfKeyword */: case 80 /* ElseKeyword */: - if (hasKind(node.parent, 196 /* IfStatement */)) { + if (hasKind(node.parent, 198 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 94 /* ReturnKeyword */: - if (hasKind(node.parent, 204 /* ReturnStatement */)) { + if (hasKind(node.parent, 206 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 98 /* ThrowKeyword */: - if (hasKind(node.parent, 208 /* ThrowStatement */)) { + if (hasKind(node.parent, 210 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 72 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 209 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 211 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100 /* TryKeyword */: case 85 /* FinallyKeyword */: - if (hasKind(parent(node), 209 /* TryStatement */)) { + if (hasKind(parent(node), 211 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96 /* SwitchKeyword */: - if (hasKind(node.parent, 206 /* SwitchStatement */)) { + if (hasKind(node.parent, 208 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71 /* CaseKeyword */: case 77 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 206 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 208 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70 /* BreakKeyword */: case 75 /* ContinueKeyword */: - if (hasKind(node.parent, 203 /* BreakStatement */) || hasKind(node.parent, 202 /* ContinueStatement */)) { + if (hasKind(node.parent, 205 /* BreakStatement */) || hasKind(node.parent, 204 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86 /* ForKeyword */: - if (hasKind(node.parent, 199 /* ForStatement */) || - hasKind(node.parent, 200 /* ForInStatement */) || - hasKind(node.parent, 201 /* ForOfStatement */)) { + if (hasKind(node.parent, 201 /* ForStatement */) || + hasKind(node.parent, 202 /* ForInStatement */) || + hasKind(node.parent, 203 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104 /* WhileKeyword */: case 79 /* DoKeyword */: - if (hasKind(node.parent, 198 /* WhileStatement */) || hasKind(node.parent, 197 /* DoStatement */)) { + if (hasKind(node.parent, 200 /* WhileStatement */) || hasKind(node.parent, 199 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -47977,8 +48771,8 @@ var ts; } break; default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 193 /* VariableStatement */)) { + if (ts.isModifierKind(node.kind) && node.parent && + (ts.isDeclaration(node.parent) || node.parent.kind === 195 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -47994,10 +48788,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 208 /* ThrowStatement */) { + if (node.kind === 210 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 209 /* TryStatement */) { + else if (node.kind === 211 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -48025,12 +48819,12 @@ var ts; var child = throwStatement; while (child.parent) { var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 248 /* SourceFile */) { + if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250 /* SourceFile */) { return parent_12; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_12.kind === 209 /* TryStatement */) { + if (parent_12.kind === 211 /* TryStatement */) { var tryStatement = parent_12; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -48045,7 +48839,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 203 /* BreakStatement */ || node.kind === 202 /* ContinueStatement */) { + if (node.kind === 205 /* BreakStatement */ || node.kind === 204 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -48060,16 +48854,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 206 /* SwitchStatement */: - if (statement.kind === 202 /* ContinueStatement */) { + case 208 /* SwitchStatement */: + if (statement.kind === 204 /* ContinueStatement */) { continue; } // Fall through. - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: - case 197 /* DoStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 199 /* DoStatement */: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -48088,24 +48882,24 @@ var ts; var container = declaration.parent; // Make sure we only highlight the keyword when it makes sense to do so. if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 214 /* ClassDeclaration */ || - container.kind === 186 /* ClassExpression */ || + if (!(container.kind === 216 /* ClassDeclaration */ || + container.kind === 188 /* ClassExpression */ || (declaration.kind === 138 /* Parameter */ && hasKind(container, 144 /* Constructor */)))) { return undefined; } } else if (modifier === 113 /* StaticKeyword */) { - if (!(container.kind === 214 /* ClassDeclaration */ || container.kind === 186 /* ClassExpression */)) { + if (!(container.kind === 216 /* ClassDeclaration */ || container.kind === 188 /* ClassExpression */)) { return undefined; } } else if (modifier === 82 /* ExportKeyword */ || modifier === 122 /* DeclareKeyword */) { - if (!(container.kind === 219 /* ModuleBlock */ || container.kind === 248 /* SourceFile */)) { + if (!(container.kind === 221 /* ModuleBlock */ || container.kind === 250 /* SourceFile */)) { return undefined; } } else if (modifier === 115 /* AbstractKeyword */) { - if (!(container.kind === 214 /* ClassDeclaration */ || declaration.kind === 214 /* ClassDeclaration */)) { + if (!(container.kind === 216 /* ClassDeclaration */ || declaration.kind === 216 /* ClassDeclaration */)) { return undefined; } } @@ -48117,8 +48911,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 219 /* ModuleBlock */: - case 248 /* SourceFile */: + case 221 /* ModuleBlock */: + case 250 /* SourceFile */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */) { nodes = declaration.members.concat(declaration); @@ -48130,8 +48924,8 @@ var ts; case 144 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -48214,7 +49008,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 197 /* DoStatement */) { + if (loopNode.kind === 199 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104 /* WhileKeyword */)) { @@ -48235,13 +49029,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -48295,7 +49089,7 @@ var ts; function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 192 /* Block */))) { + if (!(func && hasKind(func.body, 194 /* Block */))) { return undefined; } var keywords = []; @@ -48311,7 +49105,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 196 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 198 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -48324,7 +49118,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 196 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 198 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -48400,11 +49194,11 @@ var ts; return convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); return convertReferences(referencedSymbols); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); // Only include referenced symbols that have a valid definition. return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); } @@ -48417,8 +49211,8 @@ var ts; } if (node.kind !== 69 /* Identifier */ && // TODO (drosen): This should be enabled in a later release - currently breaks rename. - //node.kind !== SyntaxKind.ThisKeyword && - //node.kind !== SyntaxKind.SuperKeyword && + // node.kind !== SyntaxKind.ThisKeyword && + // node.kind !== SyntaxKind.SuperKeyword && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; @@ -48441,7 +49235,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97 /* ThisKeyword */) { + if (node.kind === 97 /* ThisKeyword */ || node.kind === 161 /* ThisType */) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95 /* SuperKeyword */) { @@ -48475,8 +49269,8 @@ var ts; } else { var internedName = getInternedName(symbol, node, declarations); - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; cancellationToken.throwIfCancellationRequested(); var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { @@ -48504,7 +49298,7 @@ var ts; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 226 /* ImportSpecifier */ || declaration.kind === 230 /* ExportSpecifier */; + return declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 232 /* ExportSpecifier */; }); } function getInternedName(symbol, location, declarations) { @@ -48531,14 +49325,14 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 173 /* FunctionExpression */ || valueDeclaration.kind === 186 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 175 /* FunctionExpression */ || valueDeclaration.kind === 188 /* ClassExpression */)) { return valueDeclaration; } // If this is private property or method, the scope is the containing class if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 214 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 216 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -48551,7 +49345,7 @@ var ts; if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) { return undefined; } - var scope = undefined; + var scope; var declarations = symbol.getDeclarations(); if (declarations) { for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { @@ -48564,7 +49358,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 248 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -48730,7 +49524,7 @@ var ts; } } function getReferencesForSuperKeyword(superKeyword) { - var searchSpaceNode = ts.getSuperContainer(superKeyword, /*includeFunctions*/ false); + var searchSpaceNode = ts.getSuperContainer(superKeyword, /*stopOnFunctions*/ false); if (!searchSpaceNode) { return undefined; } @@ -48759,7 +49553,7 @@ var ts; if (!node || node.kind !== 95 /* SuperKeyword */) { return; } - var container = ts.getSuperContainer(node, /*includeFunctions*/ false); + var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. @@ -48789,13 +49583,13 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -48804,7 +49598,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 248 /* SourceFile */) { + if (searchSpaceNode.kind === 250 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -48830,13 +49624,13 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 97 /* ThisKeyword */) { + if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 161 /* ThisType */)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } @@ -48847,16 +49641,16 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 248 /* SourceFile */: - if (container.kind === 248 /* SourceFile */ && !ts.isExternalModule(container)) { + case 250 /* SourceFile */: + if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -48883,8 +49677,8 @@ var ts; * property name and variable declaration of the identifier. * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service * should show both 'name' in 'obj' and 'name' in variable declaration - * let name = "Foo"; - * let obj = { name }; + * const name = "Foo"; + * const obj = { name }; * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration * will be included correctly. @@ -48894,6 +49688,14 @@ var ts; result.push(shorthandValueSymbol); } } + // If the symbol.valueDeclaration is a property parameter declaration, + // we should include both parameter declaration symbol and property declaration symbol + // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals. + // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 /* Parameter */ && + ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { + result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + } // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { @@ -48910,11 +49712,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 214 /* ClassDeclaration */) { + if (declaration.kind === 216 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 215 /* InterfaceDeclaration */) { + else if (declaration.kind === 217 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -48975,19 +49777,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_37 = node.text; + var name_33 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_37); + var unionProperty = contextualType.getProperty(name_33); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_37); + var symbol = t.getProperty(name_33); if (symbol) { result_4.push(symbol); } @@ -48996,7 +49798,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_37); + var symbol_1 = contextualType.getProperty(name_33); if (symbol_1) { return [symbol_1]; } @@ -49054,10 +49856,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 180 /* PostfixUnaryExpression */ || parent.kind === 179 /* PrefixUnaryExpression */) { + if (parent.kind === 182 /* PostfixUnaryExpression */ || parent.kind === 181 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 181 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 183 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 56 /* FirstAssignment */ <= operator && operator <= 68 /* LastAssignment */; } @@ -49069,9 +49871,6 @@ var ts; synchronizeHostData(); return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } - function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); - } function getEmitOutput(fileName) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -49092,32 +49891,32 @@ var ts; function getMeaningFromDeclaration(node) { switch (node.kind) { case 138 /* Parameter */: - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: - case 247 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: + case 249 /* EnumMember */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 244 /* CatchClause */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 246 /* CatchClause */: return 1 /* Value */; case 137 /* TypeParameter */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: case 155 /* TypeLiteral */: return 2 /* Type */; - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (node.name.kind === 9 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -49127,15 +49926,15 @@ var ts; else { return 4 /* Namespace */; } - case 225 /* NamedImports */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 222 /* ImportDeclaration */: - case 227 /* ExportAssignment */: - case 228 /* ExportDeclaration */: + case 227 /* NamedImports */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportDeclaration */: + case 229 /* ExportAssignment */: + case 230 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 248 /* SourceFile */: + case 250 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -49145,8 +49944,9 @@ var ts; node = node.parent; } return node.parent.kind === 151 /* TypeReference */ || - (node.parent.kind === 188 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node); + (node.parent.kind === 190 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + (node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node)) || + node.kind === 161 /* ThisType */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -49154,16 +49954,16 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 166 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 166 /* PropertyAccessExpression */) { + if (root.parent.kind === 168 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 168 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 188 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 243 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 190 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 245 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 214 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || - (decl.kind === 215 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); + return (decl.kind === 216 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || + (decl.kind === 217 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); } return false; } @@ -49191,13 +49991,13 @@ var ts; // import a = |b.c|.d; // Namespace if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 221 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 223 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 227 /* ExportAssignment */) { + if (node.parent.kind === 229 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -49237,14 +50037,16 @@ var ts; return; } switch (node.kind) { - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: case 84 /* FalseKeyword */: case 99 /* TrueKeyword */: case 93 /* NullKeyword */: case 95 /* SuperKeyword */: case 97 /* ThisKeyword */: + case 161 /* ThisType */: case 69 /* Identifier */: break; // Cant create the text span @@ -49261,7 +50063,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 218 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 220 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -49285,7 +50087,7 @@ var ts; } function getNavigationBarItems(fileName) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.NavigationBar.getNavigationBarItems(sourceFile); + return ts.NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings()); } function getSemanticClassifications(fileName, span) { return convertClassifications(getEncodedSemanticClassifications(fileName, span)); @@ -49302,10 +50104,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -49359,7 +50161,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 218 /* ModuleDeclaration */ && + return declaration.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -49433,8 +50235,8 @@ var ts; var spanStart = span.start; var spanLength = span.length; // Make a scanner we can get trivia from. - var triviaScanner = ts.createScanner(2 /* Latest */, /*skipTrivia:*/ false, sourceFile.languageVariant, sourceFile.text); - var mergeConflictScanner = ts.createScanner(2 /* Latest */, /*skipTrivia:*/ false, sourceFile.languageVariant, sourceFile.text); + var triviaScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + var mergeConflictScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); var result = []; processElement(sourceFile); return { spans: result, endOfLineState: 0 /* None */ }; @@ -49517,16 +50319,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 267 /* JSDocParameterTag */: + case 269 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 270 /* JSDocTemplateTag */: + case 272 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 269 /* JSDocTypeTag */: + case 271 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 268 /* JSDocReturnTag */: + case 270 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -49617,16 +50419,16 @@ var ts; if (token) { if (tokenKind === 56 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 211 /* VariableDeclaration */ || + if (token.parent.kind === 213 /* VariableDeclaration */ || token.parent.kind === 141 /* PropertyDeclaration */ || token.parent.kind === 138 /* Parameter */) { return 5 /* operator */; } } - if (token.parent.kind === 181 /* BinaryExpression */ || - token.parent.kind === 179 /* PrefixUnaryExpression */ || - token.parent.kind === 180 /* PostfixUnaryExpression */ || - token.parent.kind === 182 /* ConditionalExpression */) { + if (token.parent.kind === 183 /* BinaryExpression */ || + token.parent.kind === 181 /* PrefixUnaryExpression */ || + token.parent.kind === 182 /* PostfixUnaryExpression */ || + token.parent.kind === 184 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -49635,7 +50437,7 @@ var ts; else if (tokenKind === 8 /* NumericLiteral */) { return 4 /* numericLiteral */; } - else if (tokenKind === 9 /* StringLiteral */) { + else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 162 /* StringLiteralType */) { return 6 /* stringLiteral */; } else if (tokenKind === 10 /* RegularExpressionLiteral */) { @@ -49649,7 +50451,7 @@ var ts; else if (tokenKind === 69 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } @@ -49659,17 +50461,17 @@ var ts; return 15 /* typeParameterName */; } return; - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } @@ -49679,17 +50481,17 @@ var ts; return 17 /* parameterName */; } return; - case 235 /* JsxOpeningElement */: + case 237 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } return; - case 237 /* JsxClosingElement */: + case 239 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } return; - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } @@ -49818,7 +50620,6 @@ var ts; * be performed. */ function getDocCommentTemplateAtPosition(fileName, position) { - var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Check if in a context where we don't want to perform any insertion if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) { @@ -49837,19 +50638,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 144 /* Constructor */: - case 214 /* ClassDeclaration */: - case 193 /* VariableStatement */: + case 216 /* ClassDeclaration */: + case 195 /* VariableStatement */: break findOwner; - case 248 /* SourceFile */: + case 250 /* SourceFile */: return undefined; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 218 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 220 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -49891,7 +50692,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 193 /* VariableStatement */) { + if (commentOwner.kind === 195 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -49909,14 +50710,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 172 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 174 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return rightHandSide.parameters; - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 144 /* Constructor */) { @@ -50065,12 +50866,17 @@ var ts; if (declarations && declarations.length > 0) { // Disallow rename for elements that are defined in the standard TypeScript library. var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); + var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); if (defaultLibFileName) { for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { var current = declarations_10[_i]; var sourceFile_2 = current.getSourceFile(); + // TODO (drosen): When is there no source file? + if (!sourceFile_2) { + continue; + } var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)); - if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + if (canonicalName === canonicalDefaultLibName) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); } } @@ -50080,10 +50886,10 @@ var ts; if (kind) { return { canRename: true, - localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) }; @@ -50168,7 +50974,7 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 232 /* ExternalModuleReference */ || + node.parent.kind === 234 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -50181,7 +50987,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 167 /* ElementAccessExpression */ && + node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -50310,7 +51116,7 @@ var ts; // (and a newline). That way when we lex we'll think we're still in a multiline comment. switch (lexState) { case 3 /* InDoubleQuoteStringLiteral */: - text = '"\\\n' + text; + text = "\"\\\n" + text; offset = 3; break; case 2 /* InSingleQuoteStringLiteral */: @@ -50440,7 +51246,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9 /* StringLiteral */) { + if (token === 9 /* StringLiteral */ || token === 162 /* StringLiteralType */) { // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { @@ -50579,6 +51385,7 @@ var ts; case 8 /* NumericLiteral */: return 4 /* numericLiteral */; case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: return 6 /* stringLiteral */; case 10 /* RegularExpressionLiteral */: return 7 /* regularExpressionLiteral */; @@ -50645,7 +51452,7 @@ var ts; } var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { // Get previous token if the token is returned starts on new line // eg: let x =10; |--- cursor is here // let y = 10; @@ -50664,14 +51471,20 @@ var ts; // Get the span in the node based on its syntax return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { - return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + var start = startNode.decorators ? + ts.skipTrivia(sourceFile.text, startNode.decorators.end) : + startNode.getStart(sourceFile); + return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { - if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart()).line) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); } return spanInNode(otherwiseOnNode); } + function spanInNodeArray(nodeArray) { + return ts.createTextSpanFromBounds(ts.skipTrivia(sourceFile.text, nodeArray.pos), nodeArray.end); + } function spanInPreviousNode(node) { return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); } @@ -50681,125 +51494,131 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 199 /* ForStatement */) { + if (node.parent.kind === 139 /* Decorator */) { + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + } + if (node.parent.kind === 201 /* ForStatement */) { // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 181 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { + if (node.parent.kind === 183 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind === 174 /* ArrowFunction */ && node.parent.body === node) { + if (node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } } switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return spanInVariableDeclaration(node); case 138 /* Parameter */: return spanInParameterDeclaration(node); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 144 /* Constructor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: return spanInBlock(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return spanInBlock(node.block); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 197 /* DoStatement */: + case 199 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 196 /* IfStatement */: + case 198 /* IfStatement */: // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return spanInForStatement(node); - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 209 /* TryStatement */: + case 211 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: // span on complete node return textSpan(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: // span in statement return spanInNode(node.statement); + case 139 /* Decorator */: + return spanInNodeArray(node.parent.decorators); // No breakpoint in interface, type alias - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: return undefined; // Tokens: case 23 /* SemicolonToken */: @@ -50829,11 +51648,11 @@ var ts; return spanInNextNode(node); default: // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 245 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 247 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 171 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 173 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } // return type of function go to previous token @@ -50846,12 +51665,12 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 200 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 201 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 202 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 203 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 193 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 199 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -50905,7 +51724,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2 /* Export */) || - (functionDeclaration.parent.kind === 214 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); + (functionDeclaration.parent.kind === 216 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -50928,18 +51747,18 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 198 /* WhileStatement */: - case 196 /* IfStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 198 /* IfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 199 /* ForStatement */: + case 201 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement @@ -50947,7 +51766,7 @@ var ts; } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 212 /* VariableDeclarationList */) { + if (forStatement.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -50967,13 +51786,13 @@ var ts; // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -50981,24 +51800,24 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 217 /* EnumDeclaration */: - case 214 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 244 /* CatchClause */: + case 246 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -51012,7 +51831,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Go to while keyword and do action instead return spanInPreviousNode(node); } @@ -51022,17 +51841,17 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 144 /* Constructor */: - case 198 /* WhileStatement */: - case 197 /* DoStatement */: - case 199 /* ForStatement */: + case 200 /* WhileStatement */: + case 199 /* DoStatement */: + case 201 /* ForStatement */: return spanInPreviousNode(node); // Default to parent node default: @@ -51041,19 +51860,19 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 245 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 247 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 171 /* TypeAssertionExpression */) { + if (node.parent.kind === 173 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } @@ -51082,6 +51901,9 @@ var ts; /// /* @internal */ var debugObjectHost = this; +// We need to use 'null' to interface with the managed side. +/* tslint:disable:no-null */ +/* tslint:disable:no-in-operator */ /* @internal */ var ts; (function (ts) { @@ -51093,7 +51915,6 @@ var ts; var ScriptSnapshotShimAdapter = (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { this.scriptSnapshotShim = scriptSnapshotShim; - this.lineStartPositions = null; } ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { return this.scriptSnapshotShim.getText(start, end); @@ -51119,7 +51940,7 @@ var ts; } }; return ScriptSnapshotShimAdapter; - })(); + }()); var LanguageServiceShimHostAdapter = (function () { function LanguageServiceShimHostAdapter(shimHost) { var _this = this; @@ -51137,6 +51958,9 @@ var ts; }); }; } + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } LanguageServiceShimHostAdapter.prototype.log = function (s) { if (this.loggingEnabled) { @@ -51174,11 +51998,6 @@ var ts; return this.files = JSON.parse(encoded); }; LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - if (this.files && this.files.indexOf(fileName) < 0) { - return undefined; - } var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); }; @@ -51206,17 +52025,10 @@ var ts; return this.shimHost.getCurrentDirectory(); }; LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - try { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - catch (e) { - return ""; - } + return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); }; return LanguageServiceShimHostAdapter; - })(); + }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; /** A cancellation that throttles calls to the host */ var ThrottledCancellationToken = (function () { @@ -51238,23 +52050,17 @@ var ts; return false; }; return ThrottledCancellationToken; - })(); + }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { + var _this = this; this.shimHost = shimHost; + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension, exclude) { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - // Also consider removing the optional designation for - // the exclude param at this time. - var encoded; - try { - encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); - } - catch (e) { - encoded = this.shimHost.readDirectory(rootDir, extension); - } + var encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); return JSON.parse(encoded); }; CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) { @@ -51264,18 +52070,19 @@ var ts; return this.shimHost.readFile(fileName); }; return CoreServicesShimHostAdapter; - })(); + }()); ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; function simpleForwardCall(logger, actionDescription, action, logPerformance) { + var start; if (logPerformance) { logger.log(actionDescription); - var start = Date.now(); + start = Date.now(); } var result = action(); if (logPerformance) { var end = Date.now(); logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { + if (typeof result === "string") { var str = result; if (str.length > 128) { str = str.substring(0, 128) + "..."; @@ -51308,7 +52115,7 @@ var ts; this.factory.unregisterShim(this); }; return ShimBase; - })(); + }()); function realizeDiagnostics(diagnostics, newLine) { return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); } @@ -51357,9 +52164,7 @@ var ts; * Update the list of scripts known to the compiler */ LanguageServiceShimObject.prototype.refresh = function (throwOnError) { - this.forwardJSONCall("refresh(" + throwOnError + ")", function () { - return null; - }); + this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; }); }; LanguageServiceShimObject.prototype.cleanupSemanticCache = function () { var _this = this; @@ -51374,33 +52179,25 @@ var ts; }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { var _this = this; @@ -51430,10 +52227,7 @@ var ts; */ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { - var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); + return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); }); }; /// NAMEORDOTTEDNAMESPAN /** @@ -51442,10 +52236,7 @@ var ts; */ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { var _this = this; - return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { - var spanInfo = _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); + return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); }); }; /** * STATEMENTSPAN @@ -51453,18 +52244,12 @@ var ts; */ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { - var spanInfo = _this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); + return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); }); }; /// SIGNATUREHELP LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); + return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); }); }; /// GOTO DEFINITION /** @@ -51473,9 +52258,7 @@ var ts; */ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); }); }; /// GOTO Type /** @@ -51484,29 +52267,20 @@ var ts; */ LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getTypeDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { - return _this.languageService.getRenameInfo(fileName, position); - }); + return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); }); }; LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { - return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); }; /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { - var textRanges = _this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); + return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); }); }; /// GET SMART INDENT LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { @@ -51519,21 +52293,15 @@ var ts; /// GET REFERENCES LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getReferencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { var _this = this; - return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { - return _this.languageService.findReferences(fileName, position); - }); + return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); }); }; LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getOccurrencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { var _this = this; @@ -51552,41 +52320,32 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { - var completion = _this.languageService.getCompletionsAtPosition(fileName, position); - return completion; - }); + return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); }); }; /** Get a string based representation of a completion list entry details */ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { var _this = this; - return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { - var details = _this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); + return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; + return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; + return _this.languageService.getFormattingEditsForDocument(fileName, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; + return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); }); }; LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) { @@ -51597,45 +52356,27 @@ var ts; /** Return a list of symbols that are interesting to navigate to */ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { var _this = this; - return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { - var items = _this.languageService.getNavigateToItems(searchValue, maxResultCount); - return items; - }); + return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount); }); }; LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) { var _this = this; - return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { - var items = _this.languageService.getNavigationBarItems(fileName); - return items; - }); + return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); }); }; LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) { var _this = this; - return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { - var items = _this.languageService.getOutliningSpans(fileName); - return items; - }); + return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); }); }; LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) { var _this = this; - return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { - var items = _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); + return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); }); }; /// Emit LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { var _this = this; - return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { - var output = _this.languageService.getEmitOutput(fileName); - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - output.emitOutputStatus = output.emitSkipped ? 1 : 0; - return output; - }); + return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); }); }; return LanguageServiceShimObject; - })(ShimBase); + }(ShimBase)); function convertClassifications(classifications) { return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; } @@ -51654,17 +52395,17 @@ var ts; /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - var items = classification.entries; var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; + for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) { + var item = _a[_i]; + result += item.length + "\n"; + result += item.classification + "\n"; } result += classification.finalLexState; return result; }; return ClassifierShimObject; - })(ShimBase); + }(ShimBase)); var CoreServicesShimObject = (function (_super) { __extends(CoreServicesShimObject, _super); function CoreServicesShimObject(factory, logger, host) { @@ -51723,24 +52464,22 @@ var ts; return { options: {}, files: [], - errors: [realizeDiagnostic(result.error, '\r\n')] + errors: [realizeDiagnostic(result.error, "\r\n")] }; } var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); return { options: configFile.options, files: configFile.fileNames, - errors: realizeDiagnostics(configFile.errors, '\r\n') + errors: realizeDiagnostics(configFile.errors, "\r\n") }; }); }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { - return this.forwardJSONCall("getDefaultCompilationSettings()", function () { - return ts.getDefaultCompilerOptions(); - }); + return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); }); }; return CoreServicesShimObject; - })(ShimBase); + }(ShimBase)); var TypeScriptServicesFactory = (function () { function TypeScriptServicesFactory() { this._shims = []; @@ -51802,12 +52541,14 @@ var ts; throw new Error("Invalid operation"); }; return TypeScriptServicesFactory; - })(); + }()); ts.TypeScriptServicesFactory = TypeScriptServicesFactory; if (typeof module !== "undefined" && module.exports) { module.exports = ts; } })(ts || (ts = {})); +/* tslint:enable:no-in-operator */ +/* tslint:enable:no-null */ /// TODO: this is used by VS, clean this up on both sides of the interface /* @internal */ var TypeScript; @@ -51817,5 +52558,9 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +/* tslint:disable:no-unused-variable */ +// 'toolsVersion' gets consumed by the managed side, so it's not unused. +// TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "1.6"; +var toolsVersion = "1.8"; +/* tslint:enable:no-unused-variable */ diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index af9a8bffe35..797f9ec728c 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -194,118 +194,120 @@ declare namespace ts { UnionType = 158, IntersectionType = 159, ParenthesizedType = 160, - ObjectBindingPattern = 161, - ArrayBindingPattern = 162, - BindingElement = 163, - ArrayLiteralExpression = 164, - ObjectLiteralExpression = 165, - PropertyAccessExpression = 166, - ElementAccessExpression = 167, - CallExpression = 168, - NewExpression = 169, - TaggedTemplateExpression = 170, - TypeAssertionExpression = 171, - ParenthesizedExpression = 172, - FunctionExpression = 173, - ArrowFunction = 174, - DeleteExpression = 175, - TypeOfExpression = 176, - VoidExpression = 177, - AwaitExpression = 178, - PrefixUnaryExpression = 179, - PostfixUnaryExpression = 180, - BinaryExpression = 181, - ConditionalExpression = 182, - TemplateExpression = 183, - YieldExpression = 184, - SpreadElementExpression = 185, - ClassExpression = 186, - OmittedExpression = 187, - ExpressionWithTypeArguments = 188, - AsExpression = 189, - TemplateSpan = 190, - SemicolonClassElement = 191, - Block = 192, - VariableStatement = 193, - EmptyStatement = 194, - ExpressionStatement = 195, - IfStatement = 196, - DoStatement = 197, - WhileStatement = 198, - ForStatement = 199, - ForInStatement = 200, - ForOfStatement = 201, - ContinueStatement = 202, - BreakStatement = 203, - ReturnStatement = 204, - WithStatement = 205, - SwitchStatement = 206, - LabeledStatement = 207, - ThrowStatement = 208, - TryStatement = 209, - DebuggerStatement = 210, - VariableDeclaration = 211, - VariableDeclarationList = 212, - FunctionDeclaration = 213, - ClassDeclaration = 214, - InterfaceDeclaration = 215, - TypeAliasDeclaration = 216, - EnumDeclaration = 217, - ModuleDeclaration = 218, - ModuleBlock = 219, - CaseBlock = 220, - ImportEqualsDeclaration = 221, - ImportDeclaration = 222, - ImportClause = 223, - NamespaceImport = 224, - NamedImports = 225, - ImportSpecifier = 226, - ExportAssignment = 227, - ExportDeclaration = 228, - NamedExports = 229, - ExportSpecifier = 230, - MissingDeclaration = 231, - ExternalModuleReference = 232, - JsxElement = 233, - JsxSelfClosingElement = 234, - JsxOpeningElement = 235, - JsxText = 236, - JsxClosingElement = 237, - JsxAttribute = 238, - JsxSpreadAttribute = 239, - JsxExpression = 240, - CaseClause = 241, - DefaultClause = 242, - HeritageClause = 243, - CatchClause = 244, - PropertyAssignment = 245, - ShorthandPropertyAssignment = 246, - EnumMember = 247, - SourceFile = 248, - JSDocTypeExpression = 249, - JSDocAllType = 250, - JSDocUnknownType = 251, - JSDocArrayType = 252, - JSDocUnionType = 253, - JSDocTupleType = 254, - JSDocNullableType = 255, - JSDocNonNullableType = 256, - JSDocRecordType = 257, - JSDocRecordMember = 258, - JSDocTypeReference = 259, - JSDocOptionalType = 260, - JSDocFunctionType = 261, - JSDocVariadicType = 262, - JSDocConstructorType = 263, - JSDocThisType = 264, - JSDocComment = 265, - JSDocTag = 266, - JSDocParameterTag = 267, - JSDocReturnTag = 268, - JSDocTypeTag = 269, - JSDocTemplateTag = 270, - SyntaxList = 271, - Count = 272, + ThisType = 161, + StringLiteralType = 162, + ObjectBindingPattern = 163, + ArrayBindingPattern = 164, + BindingElement = 165, + ArrayLiteralExpression = 166, + ObjectLiteralExpression = 167, + PropertyAccessExpression = 168, + ElementAccessExpression = 169, + CallExpression = 170, + NewExpression = 171, + TaggedTemplateExpression = 172, + TypeAssertionExpression = 173, + ParenthesizedExpression = 174, + FunctionExpression = 175, + ArrowFunction = 176, + DeleteExpression = 177, + TypeOfExpression = 178, + VoidExpression = 179, + AwaitExpression = 180, + PrefixUnaryExpression = 181, + PostfixUnaryExpression = 182, + BinaryExpression = 183, + ConditionalExpression = 184, + TemplateExpression = 185, + YieldExpression = 186, + SpreadElementExpression = 187, + ClassExpression = 188, + OmittedExpression = 189, + ExpressionWithTypeArguments = 190, + AsExpression = 191, + TemplateSpan = 192, + SemicolonClassElement = 193, + Block = 194, + VariableStatement = 195, + EmptyStatement = 196, + ExpressionStatement = 197, + IfStatement = 198, + DoStatement = 199, + WhileStatement = 200, + ForStatement = 201, + ForInStatement = 202, + ForOfStatement = 203, + ContinueStatement = 204, + BreakStatement = 205, + ReturnStatement = 206, + WithStatement = 207, + SwitchStatement = 208, + LabeledStatement = 209, + ThrowStatement = 210, + TryStatement = 211, + DebuggerStatement = 212, + VariableDeclaration = 213, + VariableDeclarationList = 214, + FunctionDeclaration = 215, + ClassDeclaration = 216, + InterfaceDeclaration = 217, + TypeAliasDeclaration = 218, + EnumDeclaration = 219, + ModuleDeclaration = 220, + ModuleBlock = 221, + CaseBlock = 222, + ImportEqualsDeclaration = 223, + ImportDeclaration = 224, + ImportClause = 225, + NamespaceImport = 226, + NamedImports = 227, + ImportSpecifier = 228, + ExportAssignment = 229, + ExportDeclaration = 230, + NamedExports = 231, + ExportSpecifier = 232, + MissingDeclaration = 233, + ExternalModuleReference = 234, + JsxElement = 235, + JsxSelfClosingElement = 236, + JsxOpeningElement = 237, + JsxText = 238, + JsxClosingElement = 239, + JsxAttribute = 240, + JsxSpreadAttribute = 241, + JsxExpression = 242, + CaseClause = 243, + DefaultClause = 244, + HeritageClause = 245, + CatchClause = 246, + PropertyAssignment = 247, + ShorthandPropertyAssignment = 248, + EnumMember = 249, + SourceFile = 250, + JSDocTypeExpression = 251, + JSDocAllType = 252, + JSDocUnknownType = 253, + JSDocArrayType = 254, + JSDocUnionType = 255, + JSDocTupleType = 256, + JSDocNullableType = 257, + JSDocNonNullableType = 258, + JSDocRecordType = 259, + JSDocRecordMember = 260, + JSDocTypeReference = 261, + JSDocOptionalType = 262, + JSDocFunctionType = 263, + JSDocVariadicType = 264, + JSDocConstructorType = 265, + JSDocThisType = 266, + JSDocComment = 267, + JSDocTag = 268, + JSDocParameterTag = 269, + JSDocReturnTag = 270, + JSDocTypeTag = 271, + JSDocTemplateTag = 272, + SyntaxList = 273, + Count = 274, FirstAssignment = 56, LastAssignment = 68, FirstReservedWord = 70, @@ -314,8 +316,8 @@ declare namespace ts { LastKeyword = 134, FirstFutureReservedWord = 106, LastFutureReservedWord = 114, - FirstTypeNode = 151, - LastTypeNode = 160, + FirstTypeNode = 150, + LastTypeNode = 162, FirstPunctuation = 15, LastPunctuation = 68, FirstToken = 0, @@ -359,10 +361,14 @@ declare namespace ts { } enum JsxFlags { None = 0, + /** An element from a named property of the JSX.IntrinsicElements interface */ IntrinsicNamedElement = 1, + /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ IntrinsicIndexedElement = 2, - ClassElement = 4, - UnknownElement = 8, + /** An element backed by a class, class-like, or function value */ + ValueElement = 4, + /** Element resolution failed */ + UnknownElement = 16, IntrinsicElement = 3, } interface Node extends TextRange { @@ -375,9 +381,11 @@ declare namespace ts { interface NodeArray extends Array, TextRange { hasTrailingComma?: boolean; } - interface ModifiersArray extends NodeArray { + interface ModifiersArray extends NodeArray { flags: number; } + interface Modifier extends Node { + } interface Identifier extends PrimaryExpression { text: string; originalKeywordKind?: SyntaxKind; @@ -393,6 +401,9 @@ declare namespace ts { _declarationBrand: any; name?: DeclarationName; } + interface DeclarationStatement extends Declaration, Statement { + name?: Identifier; + } interface ComputedPropertyName extends Node { expression: Expression; } @@ -405,10 +416,15 @@ declare namespace ts { expression?: Expression; } interface SignatureDeclaration extends Declaration { + name?: PropertyName; typeParameters?: NodeArray; parameters: NodeArray; type?: TypeNode; } + interface CallSignatureDeclaration extends SignatureDeclaration, TypeElement { + } + interface ConstructSignatureDeclaration extends SignatureDeclaration, TypeElement { + } interface VariableDeclaration extends Declaration { parent?: VariableDeclarationList; name: Identifier | BindingPattern; @@ -431,18 +447,25 @@ declare namespace ts { name: Identifier | BindingPattern; initializer?: Expression; } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; + interface PropertySignature extends TypeElement { + name: PropertyName; questionToken?: Node; type?: TypeNode; initializer?: Expression; } + interface PropertyDeclaration extends ClassElement { + questionToken?: Node; + name: PropertyName; + type?: TypeNode; + initializer?: Expression; + } interface ObjectLiteralElement extends Declaration { _objectLiteralBrandBrand: any; + name?: PropertyName; } interface PropertyAssignment extends ObjectLiteralElement { _propertyAssignmentBrand: any; - name: DeclarationName; + name: PropertyName; questionToken?: Node; initializer: Expression; } @@ -460,9 +483,16 @@ declare namespace ts { type?: TypeNode; initializer?: Expression; } + interface PropertyLikeDeclaration extends Declaration { + name: PropertyName; + } interface BindingPattern extends Node { elements: NodeArray; } + interface ObjectBindingPattern extends BindingPattern { + } + interface ArrayBindingPattern extends BindingPattern { + } /** * Several node kinds share function-like features such as a signature, * a name, and a body. These nodes should extend FunctionLikeDeclaration. @@ -477,45 +507,61 @@ declare namespace ts { questionToken?: Node; body?: Block | Expression; } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { + interface FunctionDeclaration extends FunctionLikeDeclaration, DeclarationStatement { name?: Identifier; - body?: Block; + body?: FunctionBody; + } + interface MethodSignature extends SignatureDeclaration, TypeElement { + name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; + name: PropertyName; + body?: FunctionBody; } interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; + body?: FunctionBody; } interface SemicolonClassElement extends ClassElement { _semicolonClassElementBrand: any; } interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; - body: Block; + name: PropertyName; + body: FunctionBody; } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { + interface GetAccessorDeclaration extends AccessorDeclaration { + } + interface SetAccessorDeclaration extends AccessorDeclaration { + } + interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement { _indexSignatureDeclarationBrand: any; } interface TypeNode extends Node { _typeNodeBrand: any; } + interface ThisTypeNode extends TypeNode { + _thisTypeNodeBrand: any; + } interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { _functionOrConstructorTypeNodeBrand: any; } + interface FunctionTypeNode extends FunctionOrConstructorTypeNode { + } + interface ConstructorTypeNode extends FunctionOrConstructorTypeNode { + } interface TypeReferenceNode extends TypeNode { typeName: EntityName; typeArguments?: NodeArray; } interface TypePredicateNode extends TypeNode { - parameterName: Identifier; + parameterName: Identifier | ThisTypeNode; type: TypeNode; } interface TypeQueryNode extends TypeNode { exprName: EntityName; } interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; + members: NodeArray; } interface ArrayTypeNode extends TypeNode { elementType: TypeNode; @@ -533,13 +579,18 @@ declare namespace ts { interface ParenthesizedTypeNode extends TypeNode { type: TypeNode; } - interface StringLiteral extends LiteralExpression, TypeNode { + interface StringLiteralTypeNode extends LiteralLikeNode, TypeNode { + _stringLiteralTypeBrand: any; + } + interface StringLiteral extends LiteralExpression { _stringLiteralBrand: any; } interface Expression extends Node { _expressionBrand: any; contextualType?: Type; } + interface OmittedExpression extends Expression { + } interface UnaryExpression extends Expression { _unaryExpressionBrand: any; } @@ -594,25 +645,34 @@ declare namespace ts { colonToken: Node; whenFalse: Expression; } + type FunctionBody = Block; + type ConciseBody = FunctionBody | Expression; interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { name?: Identifier; - body: Block | Expression; + body: FunctionBody; } interface ArrowFunction extends Expression, FunctionLikeDeclaration { equalsGreaterThanToken: Node; + body: ConciseBody; } - interface LiteralExpression extends PrimaryExpression { + interface LiteralLikeNode extends Node { text: string; isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; } + interface LiteralExpression extends LiteralLikeNode, PrimaryExpression { + _literalExpressionBrand: any; + } + interface TemplateLiteralFragment extends LiteralLikeNode { + _templateLiteralFragmentBrand: any; + } interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; + head: TemplateLiteralFragment; templateSpans: NodeArray; } interface TemplateSpan extends Node { expression: Expression; - literal: LiteralExpression; + literal: TemplateLiteralFragment; } interface ParenthesizedExpression extends PrimaryExpression { expression: Expression; @@ -694,6 +754,14 @@ declare namespace ts { interface Statement extends Node { _statementBrand: any; } + interface EmptyStatement extends Statement { + } + interface DebuggerStatement extends Statement { + } + interface MissingDeclaration extends DeclarationStatement, ClassElement, ObjectLiteralElement, TypeElement { + name?: Identifier; + } + type BlockLike = SourceFile | Block | ModuleBlock | CaseClause; interface Block extends Statement { statements: NodeArray; } @@ -730,9 +798,13 @@ declare namespace ts { initializer: VariableDeclarationList | Expression; expression: Expression; } - interface BreakOrContinueStatement extends Statement { + interface BreakStatement extends Statement { label?: Identifier; } + interface ContinueStatement extends Statement { + label?: Identifier; + } + type BreakOrContinueStatement = BreakStatement | ContinueStatement; interface ReturnStatement extends Statement { expression?: Expression; } @@ -748,7 +820,7 @@ declare namespace ts { clauses: NodeArray; } interface CaseClause extends Node { - expression?: Expression; + expression: Expression; statements: NodeArray; } interface DefaultClause extends Node { @@ -777,24 +849,31 @@ declare namespace ts { heritageClauses?: NodeArray; members: NodeArray; } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { + interface ClassDeclaration extends ClassLikeDeclaration, DeclarationStatement { + name?: Identifier; } interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { } interface ClassElement extends Declaration { _classElementBrand: any; + name?: PropertyName; } - interface InterfaceDeclaration extends Declaration, Statement { + interface TypeElement extends Declaration { + _typeElementBrand: any; + name?: PropertyName; + questionToken?: Node; + } + interface InterfaceDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; heritageClauses?: NodeArray; - members: NodeArray; + members: NodeArray; } interface HeritageClause extends Node { token: SyntaxKind; types?: NodeArray; } - interface TypeAliasDeclaration extends Declaration, Statement { + interface TypeAliasDeclaration extends DeclarationStatement { name: Identifier; typeParameters?: NodeArray; type: TypeNode; @@ -803,18 +882,19 @@ declare namespace ts { name: DeclarationName; initializer?: Expression; } - interface EnumDeclaration extends Declaration, Statement { + interface EnumDeclaration extends DeclarationStatement { name: Identifier; members: NodeArray; } - interface ModuleDeclaration extends Declaration, Statement { + type ModuleBody = ModuleBlock | ModuleDeclaration; + interface ModuleDeclaration extends DeclarationStatement { name: Identifier | LiteralExpression; body: ModuleBlock | ModuleDeclaration; } interface ModuleBlock extends Node, Statement { statements: NodeArray; } - interface ImportEqualsDeclaration extends Declaration, Statement { + interface ImportEqualsDeclaration extends DeclarationStatement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } @@ -832,22 +912,27 @@ declare namespace ts { interface NamespaceImport extends Declaration { name: Identifier; } - interface ExportDeclaration extends Declaration, Statement { + interface ExportDeclaration extends DeclarationStatement { exportClause?: NamedExports; moduleSpecifier?: Expression; } - interface NamedImportsOrExports extends Node { - elements: NodeArray; + interface NamedImports extends Node { + elements: NodeArray; } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { + interface NamedExports extends Node { + elements: NodeArray; + } + type NamedImportsOrExports = NamedImports | NamedExports; + interface ImportSpecifier extends Declaration { propertyName?: Identifier; name: Identifier; } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, Statement { + interface ExportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } + type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + interface ExportAssignment extends DeclarationStatement { isExportEquals?: boolean; expression: Expression; } @@ -908,7 +993,7 @@ declare namespace ts { interface JSDocThisType extends JSDocType { type: JSDocType; } - interface JSDocRecordMember extends PropertyDeclaration { + interface JSDocRecordMember extends PropertySignature { name: Identifier | LiteralExpression; type?: JSDocType; } @@ -934,16 +1019,17 @@ declare namespace ts { postParameterName?: Identifier; isBracketed: boolean; } + interface AmdDependency { + path: string; + name: string; + } interface SourceFile extends Declaration { statements: NodeArray; endOfFileToken: Node; fileName: string; path: Path; text: string; - amdDependencies: { - path: string; - name: string; - }[]; + amdDependencies: AmdDependency[]; moduleName: string; referencedFiles: FileReference[]; languageVariant: LanguageVariant; @@ -1053,6 +1139,7 @@ declare namespace ts { getReturnTypeOfSignature(signature: Signature): Type; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; + getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol; getTypeAtLocation(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; @@ -1078,7 +1165,7 @@ declare namespace ts { interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; @@ -1117,10 +1204,20 @@ declare namespace ts { WriteTypeParametersOrArguments = 1, UseOnlyExternalAliasing = 2, } + enum TypePredicateKind { + This = 0, + Identifier = 1, + } interface TypePredicate { + kind: TypePredicateKind; + type: Type; + } + interface ThisTypePredicate extends TypePredicate { + _thisTypePredicateBrand: any; + } + interface IdentifierTypePredicate extends TypePredicate { parameterName: string; parameterIndex: number; - type: Type; } enum SymbolFlags { None = 0, @@ -1222,6 +1319,7 @@ declare namespace ts { ESSymbol = 16777216, ThisType = 33554432, ObjectLiteralPatternWithComputedProperties = 67108864, + PredicateType = 134217728, StringLike = 258, NumberLike = 132, ObjectType = 80896, @@ -1234,6 +1332,9 @@ declare namespace ts { symbol?: Symbol; pattern?: DestructuringPattern; } + interface PredicateType extends Type { + predicate: ThisTypePredicate | IdentifierTypePredicate; + } interface StringLiteralType extends Type { text: string; } @@ -1279,7 +1380,6 @@ declare namespace ts { declaration: SignatureDeclaration; typeParameters: TypeParameter[]; parameters: Symbol[]; - typePredicate?: TypePredicate; } enum IndexKind { String = 0, @@ -1331,6 +1431,7 @@ declare namespace ts { inlineSourceMap?: boolean; inlineSources?: boolean; jsx?: JsxEmit; + reactNamespace?: string; listFiles?: boolean; locale?: string; mapRoot?: string; @@ -1366,6 +1467,8 @@ declare namespace ts { noImplicitReturns?: boolean; noFallthroughCasesInSwitch?: boolean; forceConsistentCasingInFileNames?: boolean; + allowSyntheticDefaultImports?: boolean; + allowJs?: boolean; [option: string]: string | number | boolean; } enum ModuleKind { @@ -1409,6 +1512,7 @@ declare namespace ts { interface ModuleResolutionHost { fileExists(fileName: string): boolean; readFile(fileName: string): string; + directoryExists?(directoryName: string): boolean; } interface ResolvedModule { resolvedFileName: string; @@ -1537,6 +1641,7 @@ declare namespace ts { */ function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; function getTypeParameterOwner(d: Declaration): Declaration; + function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -1546,10 +1651,10 @@ declare namespace ts { } declare namespace ts { const version: string; - function findConfigFile(searchPath: string): string; + function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; - function nodeModuleNameResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; + function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -1582,7 +1687,7 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine; + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions): ParsedCommandLine; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string): { options: CompilerOptions; errors: Diagnostic[]; @@ -1590,7 +1695,7 @@ declare namespace ts { } declare namespace ts { /** The version of the language service API */ - let servicesVersion: string; + const servicesVersion: string; interface Node { getSourceFile(): SourceFile; getChildCount(sourceFile?: SourceFile): number; @@ -1659,7 +1764,7 @@ declare namespace ts { /** Releases all resources held by this script snapshot */ dispose?(): void; } - module ScriptSnapshot { + namespace ScriptSnapshot { function fromString(text: string): IScriptSnapshot; } interface PreProcessedFileInfo { @@ -1687,6 +1792,7 @@ declare namespace ts { error?(s: string): void; useCaseSensitiveFileNames?(): boolean; resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[]; + directoryExists?(directoryName: string): boolean; } interface LanguageService { cleanupSemanticCache(): void; @@ -1782,7 +1888,7 @@ declare namespace ts { fileName: string; highlightSpans: HighlightSpan[]; } - module HighlightSpanKind { + namespace HighlightSpanKind { const none: string; const definition: string; const reference: string; @@ -1824,6 +1930,7 @@ declare namespace ts { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; [s: string]: boolean | number | string; @@ -2068,7 +2175,7 @@ declare namespace ts { releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; reportStats(): string; } - module ScriptElementKind { + namespace ScriptElementKind { const unknown: string; const warning: string; const keyword: string; @@ -2099,7 +2206,7 @@ declare namespace ts { const constElement: string; const letElement: string; } - module ScriptElementKindModifier { + namespace ScriptElementKindModifier { const none: string; const publicMemberModifier: string; const privateMemberModifier: string; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 498ddc37860..1e2f51f5aae 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -195,133 +195,135 @@ var ts; SyntaxKind[SyntaxKind["UnionType"] = 158] = "UnionType"; SyntaxKind[SyntaxKind["IntersectionType"] = 159] = "IntersectionType"; SyntaxKind[SyntaxKind["ParenthesizedType"] = 160] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 161] = "ThisType"; + SyntaxKind[SyntaxKind["StringLiteralType"] = 162] = "StringLiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 161] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 162] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 163] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 163] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 164] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 165] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 164] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 165] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 166] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 167] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 168] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 169] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 170] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 171] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 172] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 173] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 174] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 175] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 176] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 177] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 178] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 179] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 180] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 181] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 182] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 183] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 184] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 185] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 186] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 188] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 189] = "AsExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 166] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 167] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 168] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 169] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 170] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 171] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 172] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 173] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 174] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 175] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 176] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 177] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 178] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 179] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 180] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 181] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 182] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 183] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 184] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 185] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 186] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 187] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 188] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 189] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 190] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 191] = "AsExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 190] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 191] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 192] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 193] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 192] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 193] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 194] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 195] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 196] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 197] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 198] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 199] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 200] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 201] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 202] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 203] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 204] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 205] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 206] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 207] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 208] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 209] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 210] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 211] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 212] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 213] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 214] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 215] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 216] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 217] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 218] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 219] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 220] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 221] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 222] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 223] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 224] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 225] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 226] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 227] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 228] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 229] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 230] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 231] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 194] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 195] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 196] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 197] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 198] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 199] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 200] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 201] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 202] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 203] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 204] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 205] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 206] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 207] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 208] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 209] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 210] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 211] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 212] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 213] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 214] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 215] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 216] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 217] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 218] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 219] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 220] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 221] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 222] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 223] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 224] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 225] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 226] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 227] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 228] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 229] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 230] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 231] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 232] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 233] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 232] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 234] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 233] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 234] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 235] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxText"] = 236] = "JsxText"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 237] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 238] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 239] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 240] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 235] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 236] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 237] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxText"] = 238] = "JsxText"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 239] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 240] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 241] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 242] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 241] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 242] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 243] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 244] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 243] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 244] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 245] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 246] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 245] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 246] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 247] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 248] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 247] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 249] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 248] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 250] = "SourceFile"; // JSDoc nodes. - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 249] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 251] = "JSDocTypeExpression"; // The * type. - SyntaxKind[SyntaxKind["JSDocAllType"] = 250] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 252] = "JSDocAllType"; // The ? type. - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 251] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 252] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 253] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 254] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 255] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 256] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 257] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 258] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 259] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 260] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 261] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 262] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 263] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 264] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 265] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 266] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 267] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 268] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 269] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 270] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 253] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 254] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 255] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 256] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 257] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 258] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 259] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 260] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 261] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 262] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 263] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 264] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 265] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 266] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 267] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 268] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 269] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 270] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 271] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 272] = "JSDocTemplateTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 271] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 273] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 272] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 274] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 56] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 68] = "LastAssignment"; @@ -331,8 +333,8 @@ var ts; SyntaxKind[SyntaxKind["LastKeyword"] = 134] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 106] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 114] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 151] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 160] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 150] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 162] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 15] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 68] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; @@ -408,10 +410,14 @@ var ts; var ParserContextFlags = ts.ParserContextFlags; (function (JsxFlags) { JsxFlags[JsxFlags["None"] = 0] = "None"; + /** An element from a named property of the JSX.IntrinsicElements interface */ JsxFlags[JsxFlags["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ JsxFlags[JsxFlags["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; - JsxFlags[JsxFlags["ClassElement"] = 4] = "ClassElement"; - JsxFlags[JsxFlags["UnknownElement"] = 8] = "UnknownElement"; + /** An element backed by a class, class-like, or function value */ + JsxFlags[JsxFlags["ValueElement"] = 4] = "ValueElement"; + /** Element resolution failed */ + JsxFlags[JsxFlags["UnknownElement"] = 16] = "UnknownElement"; JsxFlags[JsxFlags["IntrinsicElement"] = 3] = "IntrinsicElement"; })(ts.JsxFlags || (ts.JsxFlags = {})); var JsxFlags = ts.JsxFlags; @@ -426,7 +432,7 @@ var ts; function OperationCanceledException() { } return OperationCanceledException; - })(); + }()); ts.OperationCanceledException = OperationCanceledException; /** Return code used by getEmitOutput function to indicate status of the function */ (function (ExitStatus) { @@ -472,6 +478,11 @@ var ts; SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); var SymbolAccessibility = ts.SymbolAccessibility; + (function (TypePredicateKind) { + TypePredicateKind[TypePredicateKind["This"] = 0] = "This"; + TypePredicateKind[TypePredicateKind["Identifier"] = 1] = "Identifier"; + })(ts.TypePredicateKind || (ts.TypePredicateKind = {})); + var TypePredicateKind = ts.TypePredicateKind; /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator * metadata */ /* @internal */ @@ -623,6 +634,7 @@ var ts; TypeFlags[TypeFlags["ESSymbol"] = 16777216] = "ESSymbol"; TypeFlags[TypeFlags["ThisType"] = 33554432] = "ThisType"; TypeFlags[TypeFlags["ObjectLiteralPatternWithComputedProperties"] = 67108864] = "ObjectLiteralPatternWithComputedProperties"; + TypeFlags[TypeFlags["PredicateType"] = 134217728] = "PredicateType"; /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 16777343] = "Intrinsic"; /* @internal */ @@ -633,7 +645,7 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 49152] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 130048] = "StructuredType"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 6291456] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 140509184] = "RequiresWidening"; /* @internal */ TypeFlags[TypeFlags["PropagatingFlags"] = 14680064] = "PropagatingFlags"; })(ts.TypeFlags || (ts.TypeFlags = {})); @@ -648,6 +660,19 @@ var ts; IndexKind[IndexKind["Number"] = 1] = "Number"; })(ts.IndexKind || (ts.IndexKind = {})); var IndexKind = ts.IndexKind; + /* @internal */ + (function (SpecialPropertyAssignmentKind) { + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["None"] = 0] = "None"; + /// exports.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ExportsProperty"] = 1] = "ExportsProperty"; + /// module.exports = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ModuleExports"] = 2] = "ModuleExports"; + /// className.prototype.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["PrototypeProperty"] = 3] = "PrototypeProperty"; + /// this.name = expr + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; + })(ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); + var SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; @@ -1068,9 +1093,11 @@ var ts; var count = array.length; if (count > 0) { var pos = 0; - var result = arguments.length <= 2 ? array[pos++] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos++; while (pos < count) { - result = f(result, array[pos++]); + result = f(result, array[pos]); + pos++; } return result; } @@ -1082,9 +1109,11 @@ var ts; if (array) { var pos = array.length - 1; if (pos >= 0) { - var result = arguments.length <= 2 ? array[pos--] : initial; + var result = arguments.length <= 2 ? array[pos] : initial; + pos--; while (pos >= 0) { - result = f(result, array[pos--]); + result = f(result, array[pos]); + pos--; } return result; } @@ -1177,6 +1206,32 @@ var ts; return result; } ts.arrayToMap = arrayToMap; + /** + * Reduce the properties of a map. + * + * @param map The map to reduce + * @param callback An aggregation function that is called for each entry in the map + * @param initial The initial value for the reduction. + */ + function reduceProperties(map, callback, initial) { + var result = initial; + if (map) { + for (var key in map) { + if (hasProperty(map, key)) { + result = callback(result, map[key], String(key)); + } + } + } + return result; + } + ts.reduceProperties = reduceProperties; + /** + * Tests whether a value is an array. + */ + function isArray(value) { + return Array.isArray ? Array.isArray(value) : value instanceof Array; + } + ts.isArray = isArray; function memoize(callback) { var value; return function () { @@ -1502,7 +1557,7 @@ var ts; } ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; function getBaseFileName(path) { - if (!path) { + if (path === undefined) { return undefined; } var i = path.lastIndexOf(ts.directorySeparator); @@ -1530,14 +1585,19 @@ var ts; /** * List of supported extensions in order of file resolution precedence. */ - ts.supportedExtensions = [".ts", ".tsx", ".d.ts"]; - ts.supportedJsExtensions = ts.supportedExtensions.concat(".js", ".jsx"); - function isSupportedSourceFileName(fileName) { + ts.supportedTypeScriptExtensions = [".ts", ".tsx", ".d.ts"]; + ts.supportedJavascriptExtensions = [".js", ".jsx"]; + var allSupportedExtensions = ts.supportedTypeScriptExtensions.concat(ts.supportedJavascriptExtensions); + function getSupportedExtensions(options) { + return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions; + } + ts.getSupportedExtensions = getSupportedExtensions; + function isSupportedSourceFileName(fileName, compilerOptions) { if (!fileName) { return false; } - for (var _i = 0, supportedExtensions_1 = ts.supportedExtensions; _i < supportedExtensions_1.length; _i++) { - var extension = supportedExtensions_1[_i]; + for (var _i = 0, _a = getSupportedExtensions(compilerOptions); _i < _a.length; _i++) { + var extension = _a[_i]; if (fileExtensionIs(fileName, extension)) { return true; } @@ -1556,22 +1616,6 @@ var ts; return path; } ts.removeFileExtension = removeFileExtension; - var backslashOrDoubleQuote = /[\"\\]/g; - var escapedCharsRegExp = /[\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" // nextLine - }; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1622,7 +1666,7 @@ var ts; } Debug.assert = assert; function fail(message) { - Debug.assert(false, message); + Debug.assert(/*expression*/ false, message); } Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); @@ -1783,7 +1827,6 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _tty = require("tty"); // average async stat takes about 30 microseconds // set chunk size to do 30 files in < 1 millisecond function createWatchedFileSet(interval, chunkSize) { @@ -1858,7 +1901,7 @@ var ts; // REVIEW: for now this implementation uses polling. // The advantage of polling is that it works reliably // on all os and with network mounted files. - // For 90 referenced files, the average time to detect + // For 90 referenced files, the average time to detect // changes is 2*msInterval (by default 5 seconds). // The overhead of this is .04 percent (1/2500) with // average pause of < 1 millisecond (and max @@ -1869,9 +1912,6 @@ var ts; // to increase the chunk size or decrease the interval // time dynamically to match the large reference set? var watchedFileSet = createWatchedFileSet(); - function isNode4OrLater() { - return parseInt(process.version.charAt(1)) >= 4; - } var platform = _os.platform(); // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; @@ -1965,17 +2005,13 @@ var ts; // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - if (isNode4OrLater()) { - // Note: in node the callback of fs.watch is given only the relative file name as a parameter - return _fs.watch(fileName, function (eventName, relativeFileName) { return callback(fileName); }); - } var watchedFile = watchedFileSet.addFile(fileName, callback); return { close: function () { return watchedFileSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { - // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { // In watchDirectory we only care about adding and removing files (when event name is @@ -2020,6 +2056,33 @@ var ts; } }; } + function getChakraSystem() { + return { + newLine: ChakraHost.newLine || "\r\n", + args: ChakraHost.args, + useCaseSensitiveFileNames: !!ChakraHost.useCaseSensitiveFileNames, + write: ChakraHost.echo, + readFile: function (path, encoding) { + // encoding is automatically handled by the implementation in ChakraHost + return ChakraHost.readFile(path); + }, + writeFile: function (path, data, writeByteOrderMark) { + // If a BOM is required, emit one + if (writeByteOrderMark) { + data = "\uFEFF" + data; + } + ChakraHost.writeFile(path, data); + }, + resolvePath: ChakraHost.resolvePath, + fileExists: ChakraHost.fileExists, + directoryExists: ChakraHost.directoryExists, + createDirectory: ChakraHost.createDirectory, + getExecutingFilePath: function () { return ChakraHost.executingFile; }, + getCurrentDirectory: function () { return ChakraHost.currentDirectory; }, + readDirectory: ChakraHost.readDirectory, + exit: ChakraHost.quit + }; + } if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } @@ -2028,6 +2091,9 @@ var ts; // process.browser check excludes webpack and browserify return getNodeSystem(); } + else if (typeof ChakraHost !== "undefined") { + return getChakraSystem(); + } else { return undefined; // Unsupported host } @@ -2148,7 +2214,7 @@ var ts; Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers_not_permitted_on_index_signature_members_1145", message: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." }, Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." }, - Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_1148", message: "Cannot compile modules unless the '--module' flag is provided." }, + Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_optio_1148", message: "Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" }, @@ -2235,6 +2301,10 @@ var ts; _0_modifier_cannot_be_used_with_1_modifier: { code: 1243, category: ts.DiagnosticCategory.Error, key: "_0_modifier_cannot_be_used_with_1_modifier_1243", message: "'{0}' modifier cannot be used with '{1}' modifier." }, Abstract_methods_can_only_appear_within_an_abstract_class: { code: 1244, category: ts.DiagnosticCategory.Error, key: "Abstract_methods_can_only_appear_within_an_abstract_class_1244", message: "Abstract methods can only appear within an abstract class." }, Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { code: 1245, category: ts.DiagnosticCategory.Error, key: "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", message: "Method '{0}' cannot have an implementation because it is marked abstract." }, + An_interface_property_cannot_have_an_initializer: { code: 1246, category: ts.DiagnosticCategory.Error, key: "An_interface_property_cannot_have_an_initializer_1246", message: "An interface property cannot have an initializer." }, + A_type_literal_property_cannot_have_an_initializer: { code: 1247, category: ts.DiagnosticCategory.Error, key: "A_type_literal_property_cannot_have_an_initializer_1247", message: "A type literal property cannot have an initializer." }, + A_class_member_cannot_have_the_0_keyword: { code: 1248, category: ts.DiagnosticCategory.Error, key: "A_class_member_cannot_have_the_0_keyword_1248", message: "A class member cannot have the '{0}' keyword." }, + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: { code: 1249, category: ts.DiagnosticCategory.Error, key: "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", message: "A decorator can only decorate a method implementation, not an overload." }, with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: ts.DiagnosticCategory.Error, key: "with_statements_are_not_allowed_in_an_async_function_block_1300", message: "'with' statements are not allowed in an async function block." }, await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: ts.DiagnosticCategory.Error, key: "await_expression_is_only_allowed_within_an_async_function_1308", message: "'await' expression is only allowed within an async function." }, Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: ts.DiagnosticCategory.Error, key: "Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher_1311", message: "Async functions are only available when targeting ECMAScript 6 and higher." }, @@ -2248,11 +2318,12 @@ var ts; Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module_0_has_no_exported_member_1_2305", message: "Module '{0}' has no exported member '{1}'." }, File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File_0_is_not_a_module_2306", message: "File '{0}' is not a module." }, Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot_find_module_0_2307", message: "Cannot find module '{0}'." }, + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: { code: 2308, category: ts.DiagnosticCategory.Error, key: "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", message: "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", message: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type_0_recursively_references_itself_as_a_base_type_2310", message: "Type '{0}' recursively references itself as a base type." }, A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A_class_may_only_extend_another_class_2311", message: "A class may only extend another class." }, An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An_interface_may_only_extend_a_class_or_another_interface_2312", message: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list_2313", message: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Type_parameter_0_has_a_circular_constraint: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_has_a_circular_constraint_2313", message: "Type parameter '{0}' has a circular constraint." }, Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic_type_0_requires_1_type_argument_s_2314", message: "Generic type '{0}' requires {1} type argument(s)." }, Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_generic_2315", message: "Type '{0}' is not generic." }, Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global_type_0_must_be_a_class_or_interface_type_2316", message: "Global type '{0}' must be a class or interface type." }, @@ -2262,6 +2333,7 @@ var ts; Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", message: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive_stack_depth_comparing_types_0_and_1_2321", message: "Excessive stack depth comparing types '{0}' and '{1}'." }, Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_assignable_to_type_1_2322", message: "Type '{0}' is not assignable to type '{1}'." }, + Cannot_redeclare_exported_variable_0: { code: 2323, category: ts.DiagnosticCategory.Error, key: "Cannot_redeclare_exported_variable_0_2323", message: "Cannot redeclare exported variable '{0}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property_0_is_missing_in_type_1_2324", message: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property_0_is_private_in_type_1_but_not_in_type_2_2325", message: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types_of_property_0_are_incompatible_2326", message: "Types of property '{0}' are incompatible." }, @@ -2332,6 +2404,7 @@ var ts; Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload_signature_is_not_compatible_with_function_implementation_2394", message: "Overload signature is not compatible with function implementation." }, Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", message: "Individual declarations in merged declaration '{0}' must be all exported or all local." }, Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", message: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Declaration_name_conflicts_with_built_in_global_identifier_0: { code: 2397, category: ts.DiagnosticCategory.Error, key: "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", message: "Declaration name conflicts with built-in global identifier '{0}'." }, Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", message: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", message: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401", message: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, @@ -2445,6 +2518,8 @@ var ts; Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", message: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." }, All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, + A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -2454,7 +2529,7 @@ var ts; A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: { code: 2526, category: ts.DiagnosticCategory.Error, key: "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", message: "A 'this' type is available only in a non-static member of a class or interface." }, The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary: { code: 2527, category: ts.DiagnosticCategory.Error, key: "The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary_2527", message: "The inferred type of '{0}' references an inaccessible 'this' type. A type annotation is necessary." }, A_module_cannot_have_multiple_default_exports: { code: 2528, category: ts.DiagnosticCategory.Error, key: "A_module_cannot_have_multiple_default_exports_2528", message: "A module cannot have multiple default exports." }, - JSX_element_attributes_type_0_must_be_an_object_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_must_be_an_object_type_2600", message: "JSX element attributes type '{0}' must be an object type." }, + JSX_element_attributes_type_0_may_not_be_a_union_type: { code: 2600, category: ts.DiagnosticCategory.Error, key: "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", message: "JSX element attributes type '{0}' may not be a union type." }, The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: { code: 2601, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", message: "The return type of a JSX element constructor must return an object type." }, JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: { code: 2602, category: ts.DiagnosticCategory.Error, key: "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", message: "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist." }, Property_0_in_type_1_is_not_assignable_to_type_2: { code: 2603, category: ts.DiagnosticCategory.Error, key: "Property_0_in_type_1_is_not_assignable_to_type_2_2603", message: "Property '{0}' in type '{1}' is not assignable to type '{2}'" }, @@ -2470,6 +2545,9 @@ var ts; Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654", message: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." }, Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: { code: 2656, category: ts.DiagnosticCategory.Error, key: "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656", message: "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition." }, JSX_expressions_must_have_one_parent_element: { code: 2657, category: ts.DiagnosticCategory.Error, key: "JSX_expressions_must_have_one_parent_element_2657", message: "JSX expressions must have one parent element" }, + Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "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: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2554,6 +2632,11 @@ var ts; Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_without_specifying_option_1_5052", message: "Option '{0}' cannot be specified without specifying option '{1}'." }, Option_0_cannot_be_specified_with_option_1: { code: 5053, category: ts.DiagnosticCategory.Error, key: "Option_0_cannot_be_specified_with_option_1_5053", message: "Option '{0}' cannot be specified with option '{1}'." }, A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: ts.DiagnosticCategory.Error, key: "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", message: "A 'tsconfig.json' file is already defined at: '{0}'." }, + Cannot_write_file_0_because_it_would_overwrite_input_file: { code: 5055, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", message: "Cannot write file '{0}' because it would overwrite input file." }, + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: { code: 5056, category: ts.DiagnosticCategory.Error, key: "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", message: "Cannot write file '{0}' because it would be overwritten by multiple input files." }, + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: { code: 5057, category: ts.DiagnosticCategory.Error, key: "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", message: "Cannot find a tsconfig.json file at the specified directory: '{0}'" }, + The_specified_path_does_not_exist_Colon_0: { code: 5058, category: ts.DiagnosticCategory.Error, key: "The_specified_path_does_not_exist_Colon_0_5058", message: "The specified path does not exist: '{0}'" }, + Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier: { code: 5059, category: ts.DiagnosticCategory.Error, key: "Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", message: "Invalide value for '--reactNamespace'. '{0}' is not a valid identifier." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003", message: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -2564,6 +2647,7 @@ var ts; Do_not_emit_outputs_if_any_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_if_any_errors_were_reported_6008", message: "Do not emit outputs if any errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." }, + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)" }, Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." }, @@ -2619,6 +2703,8 @@ var ts; Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify_JSX_code_generation_Colon_preserve_or_react_6080", message: "Specify JSX code generation: 'preserve' or 'react'" }, Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument_for_jsx_must_be_preserve_or_react_6081", message: "Argument for '--jsx' must be 'preserve' or 'react'." }, Only_amd_and_system_modules_are_supported_alongside_0: { code: 6082, category: ts.DiagnosticCategory.Error, key: "Only_amd_and_system_modules_are_supported_alongside_0_6082", message: "Only 'amd' and 'system' modules are supported alongside --{0}." }, + Allow_javascript_files_to_be_compiled: { code: 6083, category: ts.DiagnosticCategory.Message, key: "Allow_javascript_files_to_be_compiled_6083", message: "Allow javascript files to be compiled." }, + Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit: { code: 6084, category: ts.DiagnosticCategory.Message, key: "Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit_6084", message: "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit" }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." }, @@ -2666,7 +2752,8 @@ var ts; Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: ts.DiagnosticCategory.Error, key: "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", message: "Cannot use JSX unless the '--jsx' flag is provided." }, A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", message: "A constructor cannot contain a 'super' call when its class extends 'null'" }, An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17006, category: ts.DiagnosticCategory.Error, key: "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", message: "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." } + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." }, + JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." } }; })(ts || (ts = {})); /// @@ -2906,7 +2993,8 @@ var ts; var pos = 0; var lineStart = 0; while (pos < text.length) { - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 13 /* carriageReturn */: if (text.charCodeAt(pos) === 10 /* lineFeed */) { @@ -3040,6 +3128,11 @@ var ts; ts.couldStartTrivia = couldStartTrivia; /* @internal */ function skipTrivia(text, pos, stopAfterLineBreak) { + // Using ! with a greater than test is a fast way of testing the following conditions: + // pos === undefined || pos === null || isNaN(pos) || pos < 0; + if (!(pos >= 0)) { + return pos; + } // Keep in sync with couldStartTrivia while (true) { var ch = text.charCodeAt(pos); @@ -3276,6 +3369,19 @@ var ts; ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; + /* @internal */ + function isIdentifier(name, languageVersion) { + if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { + return false; + } + for (var i = 1, n = name.length; i < n; i++) { + if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { + return false; + } + } + return true; + } + ts.isIdentifier = isIdentifier; // Creates a scanner over a (possibly unspecified) range of a piece of text. function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) { if (languageVariant === void 0) { languageVariant = 0 /* Standard */; } @@ -3398,7 +3504,8 @@ var ts; return value; } function scanString() { - var quote = text.charCodeAt(pos++); + var quote = text.charCodeAt(pos); + pos++; var result = ""; var start = pos; while (true) { @@ -3494,7 +3601,8 @@ var ts; error(ts.Diagnostics.Unexpected_end_of_text); return ""; } - var ch = text.charCodeAt(pos++); + var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 48 /* _0 */: return "\0"; @@ -3721,7 +3829,8 @@ var ts; } return pos += 2, token = 31 /* ExclamationEqualsToken */; } - return pos++, token = 49 /* ExclamationToken */; + pos++; + return token = 49 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); @@ -3732,7 +3841,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 62 /* PercentEqualsToken */; } - return pos++, token = 40 /* PercentToken */; + pos++; + return token = 40 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { return pos += 2, token = 51 /* AmpersandAmpersandToken */; @@ -3740,11 +3850,14 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 66 /* AmpersandEqualsToken */; } - return pos++, token = 46 /* AmpersandToken */; + pos++; + return token = 46 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 17 /* OpenParenToken */; + pos++; + return token = 17 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 18 /* CloseParenToken */; + pos++; + return token = 18 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 59 /* AsteriskEqualsToken */; @@ -3755,7 +3868,8 @@ var ts; } return pos += 2, token = 38 /* AsteriskAsteriskToken */; } - return pos++, token = 37 /* AsteriskToken */; + pos++; + return token = 37 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { return pos += 2, token = 41 /* PlusPlusToken */; @@ -3763,9 +3877,11 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 57 /* PlusEqualsToken */; } - return pos++, token = 35 /* PlusToken */; + pos++; + return token = 35 /* PlusToken */; case 44 /* comma */: - return pos++, token = 24 /* CommaToken */; + pos++; + return token = 24 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { return pos += 2, token = 42 /* MinusMinusToken */; @@ -3773,7 +3889,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 58 /* MinusEqualsToken */; } - return pos++, token = 36 /* MinusToken */; + pos++; + return token = 36 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); @@ -3782,7 +3899,8 @@ var ts; if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { return pos += 3, token = 22 /* DotDotDotToken */; } - return pos++, token = 21 /* DotToken */; + pos++; + return token = 21 /* DotToken */; case 47 /* slash */: // Single-line comment if (text.charCodeAt(pos + 1) === 47 /* slash */) { @@ -3830,7 +3948,8 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 61 /* SlashEqualsToken */; } - return pos++, token = 39 /* SlashToken */; + pos++; + return token = 39 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -3882,9 +4001,11 @@ var ts; tokenValue = scanNumber(); return token = 8 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 54 /* ColonToken */; + pos++; + return token = 54 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 23 /* SemicolonToken */; + pos++; + return token = 23 /* SemicolonToken */; case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3909,7 +4030,8 @@ var ts; text.charCodeAt(pos + 2) !== 42 /* asterisk */) { return pos += 2, token = 26 /* LessThanSlashToken */; } - return pos++, token = 25 /* LessThanToken */; + pos++; + return token = 25 /* LessThanToken */; case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3929,7 +4051,8 @@ var ts; if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { return pos += 2, token = 34 /* EqualsGreaterThanToken */; } - return pos++, token = 56 /* EqualsToken */; + pos++; + return token = 56 /* EqualsToken */; case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -3940,20 +4063,26 @@ var ts; return token = 7 /* ConflictMarkerTrivia */; } } - return pos++, token = 27 /* GreaterThanToken */; + pos++; + return token = 27 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 53 /* QuestionToken */; + pos++; + return token = 53 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 19 /* OpenBracketToken */; + pos++; + return token = 19 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 20 /* CloseBracketToken */; + pos++; + return token = 20 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 68 /* CaretEqualsToken */; } - return pos++, token = 48 /* CaretToken */; + pos++; + return token = 48 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 15 /* OpenBraceToken */; + pos++; + return token = 15 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { return pos += 2, token = 52 /* BarBarToken */; @@ -3961,13 +4090,17 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 67 /* BarEqualsToken */; } - return pos++, token = 47 /* BarToken */; + pos++; + return token = 47 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 16 /* CloseBraceToken */; + pos++; + return token = 16 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 50 /* TildeToken */; + pos++; + return token = 50 /* TildeToken */; case 64 /* at */: - return pos++, token = 55 /* AtToken */; + pos++; + return token = 55 /* AtToken */; case 92 /* backslash */: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -3976,7 +4109,8 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; + pos++; + return token = 0 /* Unknown */; default: if (isIdentifierStart(ch, languageVersion)) { pos++; @@ -3998,7 +4132,8 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; + pos++; + return token = 0 /* Unknown */; } } } @@ -4014,10 +4149,12 @@ var ts; if (text.charCodeAt(pos + 1) === 61 /* equals */) { return pos += 2, token = 64 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 44 /* GreaterThanGreaterThanToken */; + pos++; + return token = 44 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 29 /* GreaterThanEqualsToken */; + pos++; + return token = 29 /* GreaterThanEqualsToken */; } } return token; @@ -4109,7 +4246,7 @@ var ts; break; } } - return token = 236 /* JsxText */; + return token = 238 /* JsxText */; } // Scans a JSX identifier; these differ from normal identifiers in that // they allow dashes @@ -4150,10 +4287,10 @@ var ts; return result; } function lookAhead(callback) { - return speculationHelper(callback, /*isLookahead:*/ true); + return speculationHelper(callback, /*isLookahead*/ true); } function tryScan(callback) { - return speculationHelper(callback, /*isLookahead:*/ false); + return speculationHelper(callback, /*isLookahead*/ false); } function setText(newText, start, length) { text = newText || ""; @@ -4244,7 +4381,7 @@ var ts; if (array1.length !== array2.length) { return false; } - for (var i = 0; i < array1.length; ++i) { + for (var i = 0; i < array1.length; i++) { var equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i]; if (!equals) { return false; @@ -4292,7 +4429,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 248 /* SourceFile */) { + while (node && node.kind !== 250 /* SourceFile */) { node = node.parent; } return node; @@ -4404,15 +4541,15 @@ var ts; return current; } switch (current.kind) { - case 248 /* SourceFile */: - case 220 /* CaseBlock */: - case 244 /* CatchClause */: - case 218 /* ModuleDeclaration */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 250 /* SourceFile */: + case 222 /* CaseBlock */: + case 246 /* CatchClause */: + case 220 /* ModuleDeclaration */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return current; - case 192 /* Block */: + case 194 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4425,9 +4562,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 211 /* VariableDeclaration */ && + declaration.kind === 213 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 244 /* CatchClause */; + declaration.parent.kind === 246 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4466,7 +4603,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4475,16 +4612,17 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 143 /* MethodDeclaration */: errorNode = node.name; break; } @@ -4512,11 +4650,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 217 /* EnumDeclaration */ && isConst(node); + return node.kind === 219 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 163 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 165 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4531,14 +4669,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 211 /* VariableDeclaration */) { + if (node.kind === 213 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 212 /* VariableDeclarationList */) { + if (node && node.kind === 214 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 193 /* VariableStatement */) { + if (node && node.kind === 195 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4553,7 +4691,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 195 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; + return node.kind === 197 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -4584,7 +4722,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (151 /* FirstTypeNode */ <= node.kind && node.kind <= 160 /* LastTypeNode */) { + if (150 /* FirstTypeNode */ <= node.kind && node.kind <= 162 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -4595,11 +4733,8 @@ var ts; case 131 /* SymbolKeyword */: return true; case 103 /* VoidKeyword */: - return node.parent.kind !== 177 /* VoidExpression */; - case 9 /* StringLiteral */: - // Specialized signatures can have string literals as their parameters' type names - return node.parent.kind === 138 /* Parameter */; - case 188 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 179 /* VoidExpression */; + case 190 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container @@ -4608,13 +4743,13 @@ var ts; if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 166 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); case 135 /* QualifiedName */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 97 /* ThisKeyword */: var parent_1 = node.parent; if (parent_1.kind === 154 /* TypeQuery */) { @@ -4626,22 +4761,22 @@ var ts; // // Calling isTypeNode would consider the qualified name A.B a type node. Only C or // A.B.C is a type node. - if (151 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 160 /* LastTypeNode */) { + if (150 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 162 /* LastTypeNode */) { return true; } switch (parent_1.kind) { - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); case 137 /* TypeParameter */: return node === parent_1.constraint; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 138 /* Parameter */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return node === parent_1.type; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 144 /* Constructor */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: @@ -4652,12 +4787,12 @@ var ts; case 148 /* ConstructSignature */: case 149 /* IndexSignature */: return node === parent_1.type; - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return node === parent_1.type; - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -4671,23 +4806,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return visitor(node); - case 220 /* CaseBlock */: - case 192 /* Block */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: + case 222 /* CaseBlock */: + case 194 /* Block */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: + case 209 /* LabeledStatement */: + case 211 /* TryStatement */: + case 246 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4697,18 +4832,18 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // 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. @@ -4735,14 +4870,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 163 /* BindingElement */: - case 247 /* EnumMember */: + case 165 /* BindingElement */: + case 249 /* EnumMember */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 246 /* ShorthandPropertyAssignment */: - case 211 /* VariableDeclaration */: + case 248 /* ShorthandPropertyAssignment */: + case 213 /* VariableDeclaration */: return true; } } @@ -4754,7 +4889,7 @@ var ts; } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 214 /* ClassDeclaration */ || node.kind === 186 /* ClassExpression */); + return node && (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4764,9 +4899,9 @@ var ts; function isFunctionLikeKind(kind) { switch (kind) { case 144 /* Constructor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: @@ -4787,8 +4922,8 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: return true; } return false; @@ -4796,26 +4931,30 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: return true; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 192 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 194 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 165 /* ObjectLiteralExpression */; + return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 167 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1 /* Identifier */; + } + ts.isIdentifierTypePredicate = isIdentifierTypePredicate; function getContainingFunction(node) { while (true) { node = node.parent; @@ -4869,14 +5008,14 @@ var ts; node = node.parent; } break; - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 218 /* ModuleDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 220 /* ModuleDeclaration */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 143 /* MethodDeclaration */: @@ -4887,34 +5026,45 @@ var ts; case 147 /* CallSignature */: case 148 /* ConstructSignature */: case 149 /* IndexSignature */: - case 217 /* EnumDeclaration */: - case 248 /* SourceFile */: + case 219 /* EnumDeclaration */: + case 250 /* SourceFile */: return node; } } } ts.getThisContainer = getThisContainer; - function getSuperContainer(node, includeFunctions) { + /** + * Given an super call\property node returns a closest node where either + * - super call\property is legal in the node and not legal in the parent node the node. + * i.e. super call is legal in constructor but not legal in the class body. + * - node is arrow function (so caller might need to call getSuperContainer in case if he needs to climb higher) + * - super call\property is definitely illegal in the node (but might be legal in some subnode) + * i.e. super property access is illegal in function declaration but can be legal in the statement list + */ + function getSuperContainer(node, stopOnFunctions) { while (true) { node = node.parent; - if (!node) + if (!node) { return node; + } switch (node.kind) { case 136 /* ComputedPropertyName */: - // If the grandparent node is an object literal (as opposed to a class), - // then the computed property is not a 'super' container. - // A computed property name in a class needs to be a super container - // so that we can error on it. - if (isClassLike(node.parent.parent)) { - return node; - } - // If this is a computed property, then the parent should not - // make it a super container. The parent might be a property - // in an object literal, like a method or accessor. But in order for - // such a parent to be a super container, the reference must be in - // the *body* of the container. node = node.parent; break; + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + if (!stopOnFunctions) { + continue; + } + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + return node; case 139 /* Decorator */: // Decorators are always applied outside of the body of a class or method. if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { @@ -4928,20 +5078,6 @@ var ts; node = node.parent; } break; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - if (!includeFunctions) { - continue; - } - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - return node; } } } @@ -4951,7 +5087,7 @@ var ts; switch (node.kind) { case 151 /* TypeReference */: return node.typeName; - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return node.expression; case 69 /* Identifier */: case 135 /* QualifiedName */: @@ -4962,7 +5098,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression, NewExpression, or Decorator. @@ -4971,27 +5107,27 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: // classes are valid targets return true; case 141 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 214 /* ClassDeclaration */; + return node.parent.kind === 216 /* ClassDeclaration */; case 138 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return node.parent.body && node.parent.parent.kind === 214 /* ClassDeclaration */; + return node.parent.body && node.parent.parent.kind === 216 /* ClassDeclaration */; case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 143 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. - return node.body && node.parent.kind === 214 /* ClassDeclaration */; + return node.body && node.parent.kind === 216 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: if (node.decorators) { return true; } @@ -5017,27 +5153,12 @@ var ts; return false; } ts.nodeIsDecorated = nodeIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 214 /* ClassDeclaration */: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: - return ts.forEach(node.parameters, nodeIsDecorated); - } - return false; - } - ts.childIsDecorated = childIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 166 /* PropertyAccessExpression */; + return node.kind === 168 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 167 /* ElementAccessExpression */; + return node.kind === 169 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -5047,34 +5168,34 @@ var ts; case 99 /* TrueKeyword */: case 84 /* FalseKeyword */: case 10 /* RegularExpressionLiteral */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 170 /* TaggedTemplateExpression */: - case 189 /* AsExpression */: - case 171 /* TypeAssertionExpression */: - case 172 /* ParenthesizedExpression */: - case 173 /* FunctionExpression */: - case 186 /* ClassExpression */: - case 174 /* ArrowFunction */: - case 177 /* VoidExpression */: - case 175 /* DeleteExpression */: - case 176 /* TypeOfExpression */: - case 179 /* PrefixUnaryExpression */: - case 180 /* PostfixUnaryExpression */: - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 183 /* TemplateExpression */: + case 166 /* ArrayLiteralExpression */: + case 167 /* ObjectLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 172 /* TaggedTemplateExpression */: + case 191 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 174 /* ParenthesizedExpression */: + case 175 /* FunctionExpression */: + case 188 /* ClassExpression */: + case 176 /* ArrowFunction */: + case 179 /* VoidExpression */: + case 177 /* DeleteExpression */: + case 178 /* TypeOfExpression */: + case 181 /* PrefixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: + case 183 /* BinaryExpression */: + case 184 /* ConditionalExpression */: + case 187 /* SpreadElementExpression */: + case 185 /* TemplateExpression */: case 11 /* NoSubstitutionTemplateLiteral */: - case 187 /* OmittedExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 184 /* YieldExpression */: - case 178 /* AwaitExpression */: + case 189 /* OmittedExpression */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 186 /* YieldExpression */: + case 180 /* AwaitExpression */: return true; case 135 /* QualifiedName */: while (node.parent.kind === 135 /* QualifiedName */) { @@ -5091,47 +5212,47 @@ var ts; case 97 /* ThisKeyword */: var parent_2 = node.parent; switch (parent_2.kind) { - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 247 /* EnumMember */: - case 245 /* PropertyAssignment */: - case 163 /* BindingElement */: + case 249 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 165 /* BindingElement */: return parent_2.initializer === node; - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 204 /* ReturnStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 208 /* ThrowStatement */: - case 206 /* SwitchStatement */: + case 197 /* ExpressionStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 206 /* ReturnStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 210 /* ThrowStatement */: + case 208 /* SwitchStatement */: return parent_2.expression === node; - case 199 /* ForStatement */: + case 201 /* ForStatement */: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 212 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 214 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 212 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214 /* VariableDeclarationList */) || forInStatement.expression === node; - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return node === parent_2.expression; - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return node === parent_2.expression; case 136 /* ComputedPropertyName */: return node === parent_2.expression; case 139 /* Decorator */: - case 240 /* JsxExpression */: - case 239 /* JsxSpreadAttribute */: + case 242 /* JsxExpression */: + case 241 /* JsxSpreadAttribute */: return true; - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -5155,7 +5276,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 232 /* ExternalModuleReference */; + return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5164,7 +5285,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 232 /* ExternalModuleReference */; + return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 234 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5182,53 +5303,59 @@ var ts; */ function isRequireCall(expression) { // of the form 'require("name")' - return expression.kind === 168 /* CallExpression */ && + return expression.kind === 170 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expression.arguments.length === 1 && expression.arguments[0].kind === 9 /* StringLiteral */; } ts.isRequireCall = isRequireCall; - /** - * Returns true if the node is an assignment to a property on the identifier 'exports'. - * This function does not test if the node is in a JavaScript file or not. - */ - function isExportsPropertyAssignment(expression) { - // of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary - return isInJavaScriptFile(expression) && - (expression.kind === 181 /* BinaryExpression */) && - (expression.operatorToken.kind === 56 /* EqualsToken */) && - (expression.left.kind === 166 /* PropertyAccessExpression */) && - (expression.left.expression.kind === 69 /* Identifier */) && - ((expression.left.expression).text === "exports"); + /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property + /// assignments we treat as special in the binder + function getSpecialPropertyAssignmentKind(expression) { + if (expression.kind !== 183 /* BinaryExpression */) { + return 0 /* None */; + } + var expr = expression; + if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 168 /* PropertyAccessExpression */) { + return 0 /* None */; + } + var lhs = expr.left; + if (lhs.expression.kind === 69 /* Identifier */) { + var lhsId = lhs.expression; + if (lhsId.text === "exports") { + // exports.name = expr + return 1 /* ExportsProperty */; + } + else if (lhsId.text === "module" && lhs.name.text === "exports") { + // module.exports = expr + return 2 /* ModuleExports */; + } + } + else if (lhs.expression.kind === 97 /* ThisKeyword */) { + return 4 /* ThisProperty */; + } + else if (lhs.expression.kind === 168 /* PropertyAccessExpression */) { + // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part + var innerPropertyAccess = lhs.expression; + if (innerPropertyAccess.expression.kind === 69 /* Identifier */ && innerPropertyAccess.name.text === "prototype") { + return 3 /* PrototypeProperty */; + } + } + return 0 /* None */; } - ts.isExportsPropertyAssignment = isExportsPropertyAssignment; - /** - * Returns true if the node is an assignment to the property access expression 'module.exports'. - * This function does not test if the node is in a JavaScript file or not. - */ - function isModuleExportsAssignment(expression) { - // of the form 'module.exports = expr' where 'expr' is arbitrary - return isInJavaScriptFile(expression) && - (expression.kind === 181 /* BinaryExpression */) && - (expression.operatorToken.kind === 56 /* EqualsToken */) && - (expression.left.kind === 166 /* PropertyAccessExpression */) && - (expression.left.expression.kind === 69 /* Identifier */) && - ((expression.left.expression).text === "module") && - (expression.left.name.text === "exports"); - } - ts.isModuleExportsAssignment = isModuleExportsAssignment; + ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 222 /* ImportDeclaration */) { + if (node.kind === 224 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 232 /* ExternalModuleReference */) { + if (reference.kind === 234 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 228 /* ExportDeclaration */) { + if (node.kind === 230 /* ExportDeclaration */) { return node.moduleSpecifier; } } @@ -5239,8 +5366,8 @@ var ts; case 138 /* Parameter */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 246 /* ShorthandPropertyAssignment */: - case 245 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return node.questionToken !== undefined; @@ -5250,9 +5377,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 261 /* JSDocFunctionType */ && + return node.kind === 263 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 263 /* JSDocConstructorType */; + node.parameters[0].type.kind === 265 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -5266,15 +5393,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 269 /* JSDocTypeTag */); + return getJSDocTag(node, 271 /* JSDocTypeTag */); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 268 /* JSDocReturnTag */); + return getJSDocTag(node, 270 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 270 /* JSDocTemplateTag */); + return getJSDocTag(node, 272 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -5285,7 +5412,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 267 /* JSDocParameterTag */) { + if (t.kind === 269 /* JSDocParameterTag */) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -5304,12 +5431,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32 /* JavaScriptFile */) { - if (node.type && node.type.kind === 262 /* JSDocVariadicType */) { + if (node.type && node.type.kind === 264 /* JSDocVariadicType */) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 262 /* JSDocVariadicType */; + return paramTag.typeExpression.type.kind === 264 /* JSDocVariadicType */; } } return node.dotDotDotToken !== undefined; @@ -5330,7 +5457,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 162 /* ArrayBindingPattern */ || node.kind === 161 /* ObjectBindingPattern */); + return !!node && (node.kind === 164 /* ArrayBindingPattern */ || node.kind === 163 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -5354,34 +5481,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 174 /* ArrowFunction */: - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 176 /* ArrowFunction */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: case 144 /* Constructor */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 230 /* ExportSpecifier */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 232 /* ExportSpecifier */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 145 /* GetAccessor */: - case 223 /* ImportClause */: - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 215 /* InterfaceDeclaration */: + case 225 /* ImportClause */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 217 /* InterfaceDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 218 /* ModuleDeclaration */: - case 224 /* NamespaceImport */: + case 220 /* ModuleDeclaration */: + case 226 /* NamespaceImport */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: case 146 /* SetAccessor */: - case 246 /* ShorthandPropertyAssignment */: - case 216 /* TypeAliasDeclaration */: + case 248 /* ShorthandPropertyAssignment */: + case 218 /* TypeAliasDeclaration */: case 137 /* TypeParameter */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return true; } return false; @@ -5389,25 +5516,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - case 210 /* DebuggerStatement */: - case 197 /* DoStatement */: - case 195 /* ExpressionStatement */: - case 194 /* EmptyStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 196 /* IfStatement */: - case 207 /* LabeledStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 193 /* VariableStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 227 /* ExportAssignment */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 212 /* DebuggerStatement */: + case 199 /* DoStatement */: + case 197 /* ExpressionStatement */: + case 196 /* EmptyStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 198 /* IfStatement */: + case 209 /* LabeledStatement */: + case 206 /* ReturnStatement */: + case 208 /* SwitchStatement */: + case 210 /* ThrowStatement */: + case 211 /* TryStatement */: + case 195 /* VariableStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 229 /* ExportAssignment */: return true; default: return false; @@ -5435,7 +5562,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 226 /* ImportSpecifier */ || parent.kind === 230 /* ExportSpecifier */) { + if (parent.kind === 228 /* ImportSpecifier */ || parent.kind === 232 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5456,9 +5583,9 @@ var ts; case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 247 /* EnumMember */: - case 245 /* PropertyAssignment */: - case 166 /* PropertyAccessExpression */: + case 249 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 168 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; case 135 /* QualifiedName */: @@ -5470,11 +5597,11 @@ var ts; return parent.kind === 154 /* TypeQuery */; } return false; - case 163 /* BindingElement */: - case 226 /* ImportSpecifier */: + case 165 /* BindingElement */: + case 228 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 230 /* ExportSpecifier */: + case 232 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -5490,12 +5617,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 221 /* ImportEqualsDeclaration */ || - node.kind === 223 /* ImportClause */ && !!node.name || - node.kind === 224 /* NamespaceImport */ || - node.kind === 226 /* ImportSpecifier */ || - node.kind === 230 /* ExportSpecifier */ || - node.kind === 227 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; + return node.kind === 223 /* ImportEqualsDeclaration */ || + node.kind === 225 /* ImportClause */ && !!node.name || + node.kind === 226 /* NamespaceImport */ || + node.kind === 228 /* ImportSpecifier */ || + node.kind === 232 /* ExportSpecifier */ || + node.kind === 229 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5643,7 +5770,7 @@ var ts; return node.kind === 69 /* Identifier */ && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isModifier(token) { + function isModifierKind(token) { switch (token) { case 115 /* AbstractKeyword */: case 118 /* AsyncKeyword */: @@ -5659,39 +5786,73 @@ var ts; } return false; } - ts.isModifier = isModifier; + ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); return root.kind === 138 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 163 /* BindingElement */) { + while (node.kind === 165 /* BindingElement */) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 218 /* ModuleDeclaration */ || n.kind === 248 /* SourceFile */; + return isFunctionLike(n) || n.kind === 220 /* ModuleDeclaration */ || n.kind === 250 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function cloneEntityName(node) { - if (node.kind === 69 /* Identifier */) { - var clone_1 = createSynthesizedNode(69 /* Identifier */); - clone_1.text = node.text; - return clone_1; + /** + * Creates a shallow, memberwise clone of a node. The "kind", "pos", "end", "flags", and "parent" + * properties are excluded by default, and can be provided via the "location", "flags", and + * "parent" parameters. + * @param node The node to clone. + * @param location An optional TextRange to use to supply the new position. + * @param flags The NodeFlags to use for the cloned node. + * @param parent The parent for the new node. + */ + function cloneNode(node, location, flags, parent) { + // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of + // the original node. We also need to exclude specific properties and only include own- + // properties (to skip members already defined on the shared prototype). + var clone = location !== undefined + ? ts.createNode(node.kind, location.pos, location.end) + : createSynthesizedNode(node.kind); + for (var key in node) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { + continue; + } + clone[key] = node[key]; } - else { - var clone_2 = createSynthesizedNode(135 /* QualifiedName */); - clone_2.left = cloneEntityName(node.left); - clone_2.left.parent = clone_2; - clone_2.right = cloneEntityName(node.right); - clone_2.right.parent = clone_2; - return clone_2; + if (flags !== undefined) { + clone.flags = flags; } + if (parent !== undefined) { + clone.parent = parent; + } + return clone; + } + ts.cloneNode = cloneNode; + /** + * Creates a deep clone of an EntityName, with new parent pointers. + * @param node The EntityName to clone. + * @param parent The parent for the cloned node. + */ + function cloneEntityName(node, parent) { + var clone = cloneNode(node, node, node.flags, parent); + if (isQualifiedName(clone)) { + var left = clone.left, right = clone.right; + clone.left = cloneEntityName(left, clone); + clone.right = cloneNode(right, right, right.flags, parent); + } + return clone; } ts.cloneEntityName = cloneEntityName; + function isQualifiedName(node) { + return node.kind === 135 /* QualifiedName */; + } + ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { return node.pos === -1; } @@ -5906,8 +6067,8 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, + increaseIndent: function () { indent++; }, + decreaseIndent: function () { indent--; }, getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, @@ -5921,8 +6082,10 @@ var ts; * Resolves a local path to a path which is absolute to the base of the emit */ function getExternalModuleNameFromPath(host, fileName) { - var dir = host.getCurrentDirectory(); - var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, fileName, dir, function (f) { return host.getCanonicalFileName(f); }, /*isAbsolutePathAnUrl*/ false); + var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); }; + var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return ts.removeFileExtension(relativePath); } ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath; @@ -5938,6 +6101,63 @@ var ts; return emitOutputFilePathWithoutExtension + extension; } ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getEmitScriptTarget(compilerOptions) { + return compilerOptions.target || 0 /* ES3 */; + } + ts.getEmitScriptTarget = getEmitScriptTarget; + function getEmitModuleKind(compilerOptions) { + return compilerOptions.module ? + compilerOptions.module : + getEmitScriptTarget(compilerOptions) === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + } + ts.getEmitModuleKind = getEmitModuleKind; + function forEachExpectedEmitFile(host, action, targetSourceFile) { + var options = host.getCompilerOptions(); + // Emit on each source file + if (options.outFile || options.out) { + onBundledEmit(host); + } + else { + var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile]; + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var sourceFile = sourceFiles_1[_i]; + if (!isDeclarationFile(sourceFile)) { + onSingleFileEmit(host, sourceFile); + } + } + } + function onSingleFileEmit(host, sourceFile) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, sourceFile.languageVariant === 1 /* JSX */ && options.jsx === 1 /* Preserve */ ? ".jsx" : ".js"); + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: !isSourceFileJavaScript(sourceFile) ? getDeclarationEmitFilePath(jsFilePath, options) : undefined + }; + action(emitFileNames, [sourceFile], /*isBundledEmit*/ false); + } + function onBundledEmit(host) { + // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified + var bundledSources = ts.filter(host.getSourceFiles(), function (sourceFile) { return !isDeclarationFile(sourceFile) && + (!isExternalModule(sourceFile) || + (getEmitModuleKind(options) && isExternalModule(sourceFile))); }); // module that can emit - note falsy value from getEmitModuleKind means the module kind that shouldn't be emitted + if (bundledSources.length) { + var jsFilePath = options.outFile || options.out; + var emitFileNames = { + jsFilePath: jsFilePath, + sourceMapFilePath: getSourceMapFilePath(jsFilePath, options), + declarationFilePath: getDeclarationEmitFilePath(jsFilePath, options) + }; + action(emitFileNames, bundledSources, /*isBundledEmit*/ true); + } + } + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap ? jsFilePath + ".map" : undefined; + } + function getDeclarationEmitFilePath(jsFilePath, options) { + return options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined; + } + } + ts.forEachExpectedEmitFile = forEachExpectedEmitFile; function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); @@ -5946,7 +6166,7 @@ var ts; ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }); } ts.writeFile = writeFile; @@ -5970,18 +6190,6 @@ var ts; return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) { - // 1. in-browser single file compilation scenario - // 2. non .js file - return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; function getAllAccessorDeclarations(declarations, accessor) { var firstAccessor; var secondAccessor; @@ -6225,24 +6433,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 169 /* NewExpression */: - case 168 /* CallExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 170 /* TaggedTemplateExpression */: - case 164 /* ArrayLiteralExpression */: - case 172 /* ParenthesizedExpression */: - case 165 /* ObjectLiteralExpression */: - case 186 /* ClassExpression */: - case 173 /* FunctionExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 171 /* NewExpression */: + case 170 /* CallExpression */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 172 /* TaggedTemplateExpression */: + case 166 /* ArrayLiteralExpression */: + case 174 /* ParenthesizedExpression */: + case 167 /* ObjectLiteralExpression */: + case 188 /* ClassExpression */: + case 175 /* FunctionExpression */: case 69 /* Identifier */: case 10 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 11 /* NoSubstitutionTemplateLiteral */: - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: case 84 /* FalseKeyword */: case 93 /* NullKeyword */: case 97 /* ThisKeyword */: @@ -6259,7 +6467,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 188 /* ExpressionWithTypeArguments */ && + return node.kind === 190 /* ExpressionWithTypeArguments */ && node.parent.token === 83 /* ExtendsKeyword */ && isClassLike(node.parent.parent); } @@ -6283,15 +6491,15 @@ var ts; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { return (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node); + (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 165 /* ObjectLiteralExpression */) { + if (kind === 167 /* ObjectLiteralExpression */) { return expression.properties.length === 0; } - if (kind === 164 /* ArrayLiteralExpression */) { + if (kind === 166 /* ArrayLiteralExpression */) { return expression.elements.length === 0; } return false; @@ -6302,13 +6510,9 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; function hasJavaScriptFileExtension(fileName) { - return ts.fileExtensionIs(fileName, ".js") || ts.fileExtensionIs(fileName, ".jsx"); + return ts.forEach(ts.supportedJavascriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); }); } ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension; - function allowsJsxExpressions(fileName) { - return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx"); - } - ts.allowsJsxExpressions = allowsJsxExpressions; /** * 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. @@ -6343,6 +6547,47 @@ var ts; } return output; } + /** + * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph + * as the fallback implementation does not check for circular references by default. + */ + ts.stringify = typeof JSON !== "undefined" && JSON.stringify + ? JSON.stringify + : stringifyFallback; + /** + * Serialize an object graph into a JSON string. + */ + function stringifyFallback(value) { + // JSON.stringify returns `undefined` here, instead of the string "undefined". + return value === undefined ? undefined : stringifyValue(value); + } + function stringifyValue(value) { + return typeof value === "string" ? "\"" + escapeString(value) + "\"" + : typeof value === "number" ? isFinite(value) ? String(value) : "null" + : typeof value === "boolean" ? value ? "true" : "false" + : typeof value === "object" && value ? ts.isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) + : "null"; + } + function cycleCheck(cb, value) { + ts.Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); + value.__cycle = true; + var result = cb(value); + delete value.__cycle; + return result; + } + function stringifyArray(value) { + return "[" + ts.reduceLeft(value, stringifyElement, "") + "]"; + } + function stringifyElement(memo, value) { + return (memo ? memo + "," : memo) + stringifyValue(value); + } + function stringifyObject(value) { + return "{" + ts.reduceProperties(value, stringifyProperty, "") + "}"; + } + function stringifyProperty(memo, value, key) { + return value === undefined || typeof value === "function" || key === "__cycle" ? memo + : (memo ? memo + "," : memo) + ("\"" + escapeString(key) + "\":" + stringifyValue(value)); + } var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** * Converts a string to a base-64 encoded ASCII string. @@ -6611,13 +6856,17 @@ var ts; function getTypeParameterOwner(d) { if (d && d.kind === 137 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 215 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217 /* InterfaceDeclaration */) { return current; } } } } ts.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node) { + return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 144 /* Constructor */ && ts.isClassLike(node.parent.parent); + } + ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); /// /// @@ -6627,7 +6876,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 248 /* SourceFile */) { + if (kind === 250 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -6677,7 +6926,7 @@ var ts; return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 246 /* ShorthandPropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -6687,9 +6936,9 @@ var ts; case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 247 /* PropertyAssignment */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -6713,9 +6962,9 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -6745,271 +6994,271 @@ var ts; return visitNodes(cbNodes, node.types); case 160 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 189 /* AsExpression */: + case 191 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 212 /* VariableDeclarationList */: + case 214 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return visitNode(cbNode, node.label); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 241 /* CaseClause */: + case 243 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 242 /* DefaultClause */: + case 244 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 139 /* Decorator */: return visitNode(cbNode, node.expression); - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 224 /* NamespaceImport */: + case 226 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 225 /* NamedImports */: - case 229 /* NamedExports */: + case 227 /* NamedImports */: + case 231 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 136 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 243 /* HeritageClause */: + case 245 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 232 /* ExternalModuleReference */: + case 234 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 231 /* MissingDeclaration */: + case 233 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 233 /* JsxElement */: + case 235 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 234 /* JsxSelfClosingElement */: - case 235 /* JsxOpeningElement */: + case 236 /* JsxSelfClosingElement */: + case 237 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 238 /* JsxAttribute */: + case 240 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 239 /* JsxSpreadAttribute */: + case 241 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return visitNode(cbNode, node.expression); - case 237 /* JsxClosingElement */: + case 239 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 249 /* JSDocTypeExpression */: + case 251 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 253 /* JSDocUnionType */: + case 255 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 254 /* JSDocTupleType */: + case 256 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 252 /* JSDocArrayType */: + case 254 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 256 /* JSDocNonNullableType */: + case 258 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 255 /* JSDocNullableType */: + case 257 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 257 /* JSDocRecordType */: + case 259 /* JSDocRecordType */: return visitNodes(cbNodes, node.members); - case 259 /* JSDocTypeReference */: + case 261 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 260 /* JSDocOptionalType */: + case 262 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 261 /* JSDocFunctionType */: + case 263 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 262 /* JSDocVariadicType */: + case 264 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 263 /* JSDocConstructorType */: + case 265 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 264 /* JSDocThisType */: + case 266 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 258 /* JSDocRecordMember */: + case 260 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 265 /* JSDocComment */: + case 267 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 267 /* JSDocParameterTag */: + case 269 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 268 /* JSDocReturnTag */: + case 270 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 269 /* JSDocTypeTag */: + case 271 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 270 /* JSDocTemplateTag */: + case 272 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); } } @@ -7150,6 +7399,10 @@ var ts; return result; } Parser.parseSourceFile = parseSourceFile; + function getLanguageVariant(fileName) { + // .tsx and .jsx files are treated as jsx language variant. + return ts.fileExtensionIs(fileName, ".tsx") || ts.fileExtensionIs(fileName, ".jsx") ? 1 /* JSX */ : 0 /* Standard */; + } function initializeState(fileName, _sourceText, languageVersion, isJavaScriptFile, _syntaxCursor) { NodeConstructor = ts.objectAllocator.getNodeConstructor(); SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor(); @@ -7166,7 +7419,7 @@ var ts; scanner.setText(sourceText); scanner.setOnError(scanError); scanner.setScriptTarget(languageVersion); - scanner.setLanguageVariant(ts.allowsJsxExpressions(fileName) ? 1 /* JSX */ : 0 /* Standard */); + scanner.setLanguageVariant(getLanguageVariant(fileName)); } function clearState() { // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. @@ -7213,8 +7466,8 @@ var ts; // Add additional cases as necessary depending on how we see JSDoc comments used // in the wild. switch (node.kind) { - case 193 /* VariableStatement */: - case 213 /* FunctionDeclaration */: + case 195 /* VariableStatement */: + case 215 /* FunctionDeclaration */: case 138 /* Parameter */: addJSDocComment(node); } @@ -7258,14 +7511,14 @@ var ts; function createSourceFile(fileName, languageVersion) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(248 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(250 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; sourceFile.languageVersion = languageVersion; sourceFile.fileName = ts.normalizePath(fileName); sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 4096 /* DeclarationFile */ : 0; - sourceFile.languageVariant = ts.allowsJsxExpressions(sourceFile.fileName) ? 1 /* JSX */ : 0 /* Standard */; + sourceFile.languageVariant = getLanguageVariant(sourceFile.fileName); return sourceFile; } function setContextFlag(val, flag) { @@ -7298,10 +7551,10 @@ var ts; var contextFlagsToClear = context & contextFlags; if (contextFlagsToClear) { // clear the requested context flags - setContextFlag(false, contextFlagsToClear); + setContextFlag(/*val*/ false, contextFlagsToClear); var result = func(); // restore the context flags we just cleared - setContextFlag(true, contextFlagsToClear); + setContextFlag(/*val*/ true, contextFlagsToClear); return result; } // no need to do anything special as we are not in any of the requested contexts @@ -7317,10 +7570,10 @@ var ts; var contextFlagsToSet = context & ~contextFlags; if (contextFlagsToSet) { // set the requested context flags - setContextFlag(true, contextFlagsToSet); + setContextFlag(/*val*/ true, contextFlagsToSet); var result = func(); // reset the context flags we just set - setContextFlag(false, contextFlagsToSet); + setContextFlag(/*val*/ false, contextFlagsToSet); return result; } // no need to do anything special as we are already in all of the requested contexts @@ -7335,9 +7588,6 @@ var ts; function doInYieldContext(func) { return doInsideOfContext(2 /* Yield */, func); } - function doOutsideOfYieldContext(func) { - return doOutsideOfContext(2 /* Yield */, func); - } function doInDecoratorContext(func) { return doInsideOfContext(4 /* Decorator */, func); } @@ -7350,9 +7600,6 @@ var ts; function doInYieldAndAwaitContext(func) { return doInsideOfContext(2 /* Yield */ | 8 /* Await */, func); } - function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(2 /* Yield */ | 8 /* Await */, func); - } function inContext(flags) { return (contextFlags & flags) !== 0; } @@ -7396,9 +7643,6 @@ var ts; function nextToken() { return token = scanner.scan(); } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } function reScanGreaterToken() { return token = scanner.reScanGreaterToken(); } @@ -7605,10 +7849,10 @@ var ts; return parseIdentifierName(); } function parsePropertyName() { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ true); + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ true); } function parseSimplePropertyName() { - return parsePropertyNameWorker(/*allowComputedPropertyNames:*/ false); + return parsePropertyNameWorker(/*allowComputedPropertyNames*/ false); } function isSimplePropertyName() { return token === 9 /* StringLiteral */ || token === 8 /* NumericLiteral */ || ts.tokenIsIdentifierOrKeyword(token); @@ -7629,6 +7873,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(nextTokenCanFollowModifier); } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } function nextTokenCanFollowModifier() { if (token === 74 /* ConstKeyword */) { // 'const' is only a modifier if followed by 'enum'. @@ -7648,14 +7899,10 @@ var ts; nextToken(); return canFollowModifier(); } - nextToken(); - if (scanner.hasPrecedingLineBreak()) { - return false; - } - return canFollowModifier(); + return nextTokenIsOnSameLineAndCanFollowModifier(); } function parseAnyContextualModifier() { - return ts.isModifier(token) && tryParse(nextTokenCanFollowModifier); + return ts.isModifierKind(token) && tryParse(nextTokenCanFollowModifier); } function canFollowModifier() { return token === 19 /* OpenBracketToken */ @@ -7861,7 +8108,7 @@ var ts; function isInSomeParsingContext() { for (var kind = 0; kind < 26 /* Count */; kind++) { if (parsingContext & (1 << kind)) { - if (isListElement(kind, /* inErrorRecovery */ true) || isListTerminator(kind)) { + if (isListElement(kind, /*inErrorRecovery*/ true) || isListTerminator(kind)) { return true; } } @@ -7875,7 +8122,7 @@ var ts; var result = []; result.pos = getNodePos(); while (!isListTerminator(kind)) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { var element = parseListElement(kind, parseElement); result.push(element); continue; @@ -8020,7 +8267,7 @@ var ts; case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 141 /* PropertyDeclaration */: - case 191 /* SemicolonClassElement */: + case 193 /* SemicolonClassElement */: return true; case 143 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal @@ -8037,8 +8284,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: return true; } } @@ -8047,42 +8294,42 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: - case 193 /* VariableStatement */: - case 192 /* Block */: - case 196 /* IfStatement */: - case 195 /* ExpressionStatement */: - case 208 /* ThrowStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 194 /* EmptyStatement */: - case 209 /* TryStatement */: - case 207 /* LabeledStatement */: - case 197 /* DoStatement */: - case 210 /* DebuggerStatement */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - case 227 /* ExportAssignment */: - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 195 /* VariableStatement */: + case 194 /* Block */: + case 198 /* IfStatement */: + case 197 /* ExpressionStatement */: + case 210 /* ThrowStatement */: + case 206 /* ReturnStatement */: + case 208 /* SwitchStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 196 /* EmptyStatement */: + case 211 /* TryStatement */: + case 209 /* LabeledStatement */: + case 199 /* DoStatement */: + case 212 /* DebuggerStatement */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: + case 229 /* ExportAssignment */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 218 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 247 /* EnumMember */; + return node.kind === 249 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { @@ -8098,7 +8345,7 @@ var ts; return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 211 /* VariableDeclaration */) { + if (node.kind !== 213 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -8174,7 +8421,7 @@ var ts; result.pos = getNodePos(); var commaStart = -1; // Meaning the previous token was not a comma while (true) { - if (isListElement(kind, /* inErrorRecovery */ false)) { + if (isListElement(kind, /*inErrorRecovery*/ false)) { result.push(parseListElement(kind, parseElement)); commaStart = scanner.getTokenPos(); if (parseOptional(24 /* CommaToken */)) { @@ -8269,14 +8516,14 @@ var ts; // Report that we need an identifier. However, report it right after the dot, // and not on the next token. This is because the next token might actually // be an identifier and the error would be quite confusing. - return createMissingNode(69 /* Identifier */, /*reportAtCurrentToken*/ true, ts.Diagnostics.Identifier_expected); + return createMissingNode(69 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(183 /* TemplateExpression */); - template.head = parseLiteralNode(); + var template = createNode(185 /* TemplateExpression */); + template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); @@ -8288,12 +8535,12 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(190 /* TemplateSpan */); + var span = createNode(192 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 16 /* CloseBraceToken */) { reScanTemplateToken(); - literal = parseLiteralNode(); + literal = parseTemplateLiteralFragment(); } else { literal = parseExpectedToken(14 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(16 /* CloseBraceToken */)); @@ -8301,8 +8548,17 @@ var ts; span.literal = literal; return finishNode(span); } + function parseStringLiteralTypeNode() { + return parseLiteralLikeNode(162 /* StringLiteralType */, /*internName*/ true); + } function parseLiteralNode(internName) { - var node = createNode(token); + return parseLiteralLikeNode(token, internName); + } + function parseTemplateLiteralFragment() { + return parseLiteralLikeNode(token, /*internName*/ false); + } + function parseLiteralLikeNode(kind, internName) { + var node = createNode(kind); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; if (scanner.hasExtendedUnicodeEscape()) { @@ -8331,11 +8587,7 @@ var ts; function parseTypeReferenceOrTypePredicate() { var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); if (typeName.kind === 69 /* Identifier */ && token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { - nextToken(); - var node_1 = createNode(150 /* TypePredicate */, typeName.pos); - node_1.parameterName = typeName; - node_1.type = parseType(); - return finishNode(node_1); + return parseTypePredicate(typeName); } var node = createNode(151 /* TypeReference */, typeName.pos); node.typeName = typeName; @@ -8344,6 +8596,18 @@ var ts; } return finishNode(node); } + function parseTypePredicate(lhs) { + nextToken(); + var node = createNode(150 /* TypePredicate */, lhs.pos); + node.parameterName = lhs; + node.type = parseType(); + return finishNode(node); + } + function parseThisTypeNode() { + var node = createNode(161 /* ThisType */); + nextToken(); + return finishNode(node); + } function parseTypeQuery() { var node = createNode(154 /* TypeQuery */); parseExpected(101 /* TypeOfKeyword */); @@ -8386,7 +8650,7 @@ var ts; return undefined; } function isStartOfParameter() { - return token === 22 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifier(token) || token === 55 /* AtToken */; + return token === 22 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifierKind(token) || token === 55 /* AtToken */; } function setModifiers(node, modifiers) { if (modifiers) { @@ -8402,7 +8666,7 @@ var ts; // FormalParameter [Yield,Await]: // BindingElement[?Yield,?Await] node.name = parseIdentifierOrPattern(); - if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifierKind(token)) { // in cases like // 'use strict' // function foo(static) @@ -8523,7 +8787,7 @@ var ts; if (token === 22 /* DotDotDotToken */ || token === 20 /* CloseBracketToken */) { return true; } - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { nextToken(); if (isIdentifier()) { return true; @@ -8580,6 +8844,12 @@ var ts; property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); + if (token === 56 /* EqualsToken */) { + // Although type literal properties cannot not have initializers, we attempt + // to parse an initializer so we can report in the checker that an interface + // property or type literal property cannot have an initializer. + property.initializer = parseNonParameterInitializer(); + } parseTypeMemberSemicolon(); return finishNode(property); } @@ -8591,7 +8861,7 @@ var ts; case 19 /* OpenBracketToken */: return true; default: - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = lookAhead(isStartOfIndexSignatureDeclaration); if (result) { return result; @@ -8601,7 +8871,7 @@ var ts; } } function isStartOfIndexSignatureDeclaration() { - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { nextToken(); } return isIndexSignature(); @@ -8639,7 +8909,7 @@ var ts; // when incrementally parsing as the parser will produce the Index declaration // if it has the same text regardless of whether it is inside a class or an // object type. - if (ts.isModifier(token)) { + if (ts.isModifierKind(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { return result; @@ -8713,10 +8983,18 @@ var ts; var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReferenceOrTypePredicate(); case 9 /* StringLiteral */: - return parseLiteralNode(/*internName*/ true); + return parseStringLiteralTypeNode(); case 103 /* VoidKeyword */: - case 97 /* ThisKeyword */: return parseTokenNode(); + case 97 /* ThisKeyword */: { + var thisKeyword = parseThisTypeNode(); + if (token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + return parseTypePredicate(thisKeyword); + } + else { + return thisKeyword; + } + } case 101 /* TypeOfKeyword */: return parseTypeQuery(); case 15 /* OpenBraceToken */: @@ -8801,11 +9079,11 @@ var ts; // ( ... return true; } - if (isIdentifier() || ts.isModifier(token)) { + if (isIdentifier() || ts.isModifierKind(token)) { nextToken(); if (token === 54 /* ColonToken */ || token === 24 /* CommaToken */ || token === 53 /* QuestionToken */ || token === 56 /* EqualsToken */ || - isIdentifier() || ts.isModifier(token)) { + isIdentifier() || ts.isModifierKind(token)) { // ( id : // ( id , // ( id ? @@ -8906,9 +9184,6 @@ var ts; token !== 55 /* AtToken */ && isStartOfExpression(); } - function allowInAndParseExpression() { - return allowInAnd(parseExpression); - } function parseExpression() { // Expression[in]: // AssignmentExpression[in] @@ -8916,7 +9191,7 @@ var ts; // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; @@ -8924,7 +9199,7 @@ var ts; expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return expr; } @@ -9029,7 +9304,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(184 /* YieldExpression */); + var node = createNode(186 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -9049,14 +9324,14 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(174 /* ArrowFunction */, identifier.pos); + var node = createNode(176 /* ArrowFunction */, identifier.pos); var parameter = createNode(138 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(34 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ false); return finishNode(node); } @@ -9160,7 +9435,7 @@ var ts; return 1 /* True */; } // This *could* be a parenthesized arrow function. - // Return Unknown to const the caller know. + // Return Unknown to let the caller know. return 2 /* Unknown */; } else { @@ -9202,7 +9477,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(174 /* ArrowFunction */); + var node = createNode(176 /* ArrowFunction */); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256 /* Async */); // Arrow functions are never generators. @@ -9246,7 +9521,7 @@ var ts; // user meant to supply a block. For example, if the user wrote: // // a => - // const v = 0; + // let v = 0; // } // // they may be missing an open brace. Check to see if that's the case so we can @@ -9268,7 +9543,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(182 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(184 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -9389,39 +9664,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(181 /* BinaryExpression */, left.pos); + var node = createNode(183 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(189 /* AsExpression */, left.pos); + var node = createNode(191 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(179 /* PrefixUnaryExpression */); + var node = createNode(181 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(175 /* DeleteExpression */); + var node = createNode(177 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(176 /* TypeOfExpression */); + var node = createNode(178 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(177 /* VoidExpression */); + var node = createNode(179 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9437,7 +9712,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(178 /* AwaitExpression */); + var node = createNode(180 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9463,7 +9738,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 171 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 173 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -9553,7 +9828,7 @@ var ts; */ function parseIncrementExpression() { if (token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) { - var node = createNode(179 /* PrefixUnaryExpression */); + var node = createNode(181 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -9566,7 +9841,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(180 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(182 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -9670,24 +9945,37 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(166 /* PropertyAccessExpression */, expression.pos); + var node = createNode(168 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 69 /* Identifier */) { + return lhs.text === rhs.text; + } + return lhs.right.text === rhs.right.text && + tagNamesAreEquivalent(lhs.left, rhs.left); + } function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 235 /* JsxOpeningElement */) { - var node = createNode(233 /* JsxElement */, opening.pos); + if (opening.kind === 237 /* JsxOpeningElement */) { + var node = createNode(235 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); + if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { + parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName)); + } result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 236 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -9702,7 +9990,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(181 /* BinaryExpression */, result.pos); + var badNode = createNode(183 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -9714,13 +10002,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(236 /* JsxText */, scanner.getStartPos()); + var node = createNode(238 /* JsxText */, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 236 /* JsxText */: + case 238 /* JsxText */: return parseJsxText(); case 15 /* OpenBraceToken */: return parseJsxExpression(/*inExpressionContext*/ false); @@ -9737,10 +10025,13 @@ var ts; while (true) { token = scanner.reScanJsxToken(); if (token === 26 /* LessThanSlashToken */) { + // Closing tag break; } else if (token === 1 /* EndOfFileToken */) { - parseErrorAtCurrentToken(ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); + // If we hit EOF, issue the error at the tag that lacks the closing element + // rather than at the end of the file (which is useless) + parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } result.push(parseJsxChild()); @@ -9759,7 +10050,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(235 /* JsxOpeningElement */, fullStart); + node = createNode(237 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -9768,10 +10059,10 @@ var ts; parseExpected(27 /* GreaterThanToken */); } else { - parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(234 /* JsxSelfClosingElement */, fullStart); + node = createNode(236 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -9790,16 +10081,16 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(240 /* JsxExpression */); + var node = createNode(242 /* JsxExpression */); parseExpected(15 /* OpenBraceToken */); if (token !== 16 /* CloseBraceToken */) { - node.expression = parseExpression(); + node.expression = parseAssignmentExpressionOrHigher(); } if (inExpressionContext) { parseExpected(16 /* CloseBraceToken */); } else { - parseExpected(16 /* CloseBraceToken */, /*message*/ undefined, /*advance*/ false); + parseExpected(16 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); @@ -9809,7 +10100,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(238 /* JsxAttribute */); + var node = createNode(240 /* JsxAttribute */); node.name = parseIdentifierName(); if (parseOptional(56 /* EqualsToken */)) { switch (token) { @@ -9824,7 +10115,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(239 /* JsxSpreadAttribute */); + var node = createNode(241 /* JsxSpreadAttribute */); parseExpected(15 /* OpenBraceToken */); parseExpected(22 /* DotDotDotToken */); node.expression = parseExpression(); @@ -9832,20 +10123,20 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(237 /* JsxClosingElement */); + var node = createNode(239 /* JsxClosingElement */); parseExpected(26 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { parseExpected(27 /* GreaterThanToken */); } else { - parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*advance*/ false); + parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } return finishNode(node); } function parseTypeAssertion() { - var node = createNode(171 /* TypeAssertionExpression */); + var node = createNode(173 /* TypeAssertionExpression */); parseExpected(25 /* LessThanToken */); node.type = parseType(); parseExpected(27 /* GreaterThanToken */); @@ -9856,7 +10147,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(166 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(168 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -9865,7 +10156,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(19 /* OpenBracketToken */)) { - var indexedAccess = createNode(167 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(169 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -9881,7 +10172,7 @@ var ts; continue; } if (token === 11 /* NoSubstitutionTemplateLiteral */ || token === 12 /* TemplateHead */) { - var tagExpression = createNode(170 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(172 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -9904,7 +10195,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(168 /* CallExpression */, expression.pos); + var callExpr = createNode(170 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -9912,7 +10203,7 @@ var ts; continue; } else if (token === 17 /* OpenParenToken */) { - var callExpr = createNode(168 /* CallExpression */, expression.pos); + var callExpr = createNode(170 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -10022,28 +10313,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(172 /* ParenthesizedExpression */); + var node = createNode(174 /* ParenthesizedExpression */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(185 /* SpreadElementExpression */); + var node = createNode(187 /* SpreadElementExpression */); parseExpected(22 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 /* DotDotDotToken */ ? parseSpreadElement() : - token === 24 /* CommaToken */ ? createNode(187 /* OmittedExpression */) : + token === 24 /* CommaToken */ ? createNode(189 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(164 /* ArrayLiteralExpression */); + var node = createNode(166 /* ArrayLiteralExpression */); parseExpected(19 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024 /* MultiLine */; @@ -10070,7 +10361,6 @@ var ts; } var asteriskToken = parseOptionalToken(37 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); - var nameToken = token; var propertyName = parsePropertyName(); // Disallowing of optional property assignments happens in the grammar checker. var questionToken = parseOptionalToken(53 /* QuestionToken */); @@ -10084,7 +10374,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 /* CommaToken */ || token === 16 /* CloseBraceToken */ || token === 56 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(246 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(248 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56 /* EqualsToken */); @@ -10095,7 +10385,8 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(245 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(247 /* PropertyAssignment */, fullStart); + propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(54 /* ColonToken */); @@ -10104,7 +10395,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(165 /* ObjectLiteralExpression */); + var node = createNode(167 /* ObjectLiteralExpression */); parseExpected(15 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024 /* MultiLine */; @@ -10121,9 +10412,9 @@ var ts; // function BindingIdentifier[opt](FormalParameters){ FunctionBody } var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } - var node = createNode(173 /* FunctionExpression */); + var node = createNode(175 /* FunctionExpression */); setModifiers(node, parseModifiers()); parseExpected(87 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(37 /* AsteriskToken */); @@ -10137,7 +10428,7 @@ var ts; fillSignature(54 /* ColonToken */, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlock(/*allowYield*/ isGenerator, /*allowAwait*/ isAsync, /*ignoreMissingOpenBrace*/ false); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } return finishNode(node); } @@ -10145,7 +10436,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(169 /* NewExpression */); + var node = createNode(171 /* NewExpression */); parseExpected(92 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -10156,7 +10447,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(192 /* Block */); + var node = createNode(194 /* Block */); if (parseExpected(15 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -10175,23 +10466,23 @@ var ts; // arrow function. The body of the function is not in [Decorator] context. var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { - setDecoratorContext(false); + setDecoratorContext(/*val*/ false); } var block = parseBlock(ignoreMissingOpenBrace, diagnosticMessage); if (saveDecoratorContext) { - setDecoratorContext(true); + setDecoratorContext(/*val*/ true); } setYieldContext(savedYieldContext); setAwaitContext(savedAwaitContext); return block; } function parseEmptyStatement() { - var node = createNode(194 /* EmptyStatement */); + var node = createNode(196 /* EmptyStatement */); parseExpected(23 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(196 /* IfStatement */); + var node = createNode(198 /* IfStatement */); parseExpected(88 /* IfKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10201,7 +10492,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(197 /* DoStatement */); + var node = createNode(199 /* DoStatement */); parseExpected(79 /* DoKeyword */); node.statement = parseStatement(); parseExpected(104 /* WhileKeyword */); @@ -10216,7 +10507,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(198 /* WhileStatement */); + var node = createNode(200 /* WhileStatement */); parseExpected(104 /* WhileKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10239,21 +10530,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90 /* InKeyword */)) { - var forInStatement = createNode(200 /* ForInStatement */, pos); + var forInStatement = createNode(202 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else if (parseOptional(134 /* OfKeyword */)) { - var forOfStatement = createNode(201 /* ForOfStatement */, pos); + var forOfStatement = createNode(203 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(199 /* ForStatement */, pos); + var forStatement = createNode(201 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(23 /* SemicolonToken */); if (token !== 23 /* SemicolonToken */ && token !== 18 /* CloseParenToken */) { @@ -10271,7 +10562,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 203 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); + parseExpected(kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -10279,7 +10570,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(204 /* ReturnStatement */); + var node = createNode(206 /* ReturnStatement */); parseExpected(94 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -10288,7 +10579,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(205 /* WithStatement */); + var node = createNode(207 /* WithStatement */); parseExpected(105 /* WithKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10297,7 +10588,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(241 /* CaseClause */); + var node = createNode(243 /* CaseClause */); parseExpected(71 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(54 /* ColonToken */); @@ -10305,7 +10596,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(242 /* DefaultClause */); + var node = createNode(244 /* DefaultClause */); parseExpected(77 /* DefaultKeyword */); parseExpected(54 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -10315,12 +10606,12 @@ var ts; return token === 71 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(206 /* SwitchStatement */); + var node = createNode(208 /* SwitchStatement */); parseExpected(96 /* SwitchKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); - var caseBlock = createNode(220 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(222 /* CaseBlock */, scanner.getStartPos()); parseExpected(15 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(16 /* CloseBraceToken */); @@ -10335,7 +10626,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(208 /* ThrowStatement */); + var node = createNode(210 /* ThrowStatement */); parseExpected(98 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -10343,7 +10634,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(209 /* TryStatement */); + var node = createNode(211 /* TryStatement */); parseExpected(100 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token === 72 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -10356,7 +10647,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(244 /* CatchClause */); + var result = createNode(246 /* CatchClause */); parseExpected(72 /* CatchKeyword */); if (parseExpected(17 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -10366,7 +10657,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(210 /* DebuggerStatement */); + var node = createNode(212 /* DebuggerStatement */); parseExpected(76 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -10378,13 +10669,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 /* Identifier */ && parseOptional(54 /* ColonToken */)) { - var labeledStatement = createNode(207 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(209 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(195 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(197 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -10558,9 +10849,9 @@ var ts; case 86 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 75 /* ContinueKeyword */: - return parseBreakOrContinueStatement(202 /* ContinueStatement */); + return parseBreakOrContinueStatement(204 /* ContinueStatement */); case 70 /* BreakKeyword */: - return parseBreakOrContinueStatement(203 /* BreakStatement */); + return parseBreakOrContinueStatement(205 /* BreakStatement */); case 94 /* ReturnKeyword */: return parseReturnStatement(); case 105 /* WithKeyword */: @@ -10633,7 +10924,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(231 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(233 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10655,16 +10946,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 24 /* CommaToken */) { - return createNode(187 /* OmittedExpression */); + return createNode(189 /* OmittedExpression */); } - var node = createNode(163 /* BindingElement */); + var node = createNode(165 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(163 /* BindingElement */); + var node = createNode(165 /* BindingElement */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -10679,14 +10970,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(161 /* ObjectBindingPattern */); + var node = createNode(163 /* ObjectBindingPattern */); parseExpected(15 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(16 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(162 /* ArrayBindingPattern */); + var node = createNode(164 /* ArrayBindingPattern */); parseExpected(19 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(20 /* CloseBracketToken */); @@ -10705,7 +10996,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(211 /* VariableDeclaration */); + var node = createNode(213 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -10714,7 +11005,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(212 /* VariableDeclarationList */); + var node = createNode(214 /* VariableDeclarationList */); switch (token) { case 102 /* VarKeyword */: break; @@ -10752,7 +11043,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(193 /* VariableStatement */, fullStart); + var node = createNode(195 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -10760,7 +11051,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(213 /* FunctionDeclaration */, fullStart); + var node = createNode(215 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87 /* FunctionKeyword */); @@ -10858,7 +11149,7 @@ var ts; return true; } // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. - while (ts.isModifier(token)) { + while (ts.isModifierKind(token)) { idToken = token; // If the idToken is a class modifier (protected, private, public, and static), it is // certain that we are starting to parse class member. This allows better error recovery @@ -10919,7 +11210,7 @@ var ts; } if (!decorators) { decorators = []; - decorators.pos = scanner.getStartPos(); + decorators.pos = decoratorStart; } var decorator = createNode(139 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); @@ -10930,14 +11221,30 @@ var ts; } return decorators; } - function parseModifiers() { + /* + * There are situations in which a modifier like 'const' will appear unexpectedly, such as on a class member. + * In those situations, if we are entirely sure that 'const' is not valid on its own (such as when ASI takes effect + * and turns it into a standalone declaration), then it is better to parse it and report an error later. + * + * In such situations, 'permitInvalidConstAsModifier' should be set to true. + */ + function parseModifiers(permitInvalidConstAsModifier) { var flags = 0; var modifiers; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token; - if (!parseAnyContextualModifier()) { - break; + if (token === 74 /* ConstKeyword */ && permitInvalidConstAsModifier) { + // We need to ensure that any subsequent modifiers appear on the same line + // so that when 'const' is a standalone declaration, we don't issue an error. + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + break; + } + } + else { + if (!parseAnyContextualModifier()) { + break; + } } if (!modifiers) { modifiers = []; @@ -10970,13 +11277,13 @@ var ts; } function parseClassElement() { if (token === 23 /* SemicolonToken */) { - var result = createNode(191 /* SemicolonClassElement */); + var result = createNode(193 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var fullStart = getNodePos(); var decorators = parseDecorators(); - var modifiers = parseModifiers(); + var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); if (accessor) { return accessor; @@ -11008,10 +11315,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 186 /* ClassExpression */); + /*modifiers*/ undefined, 188 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 214 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -11036,8 +11343,8 @@ var ts; // implements is a future reserved word so // 'class implements' might mean either // - class expression with omitted name, 'implements' starts heritage clause - // - class with name 'implements' - // 'isImplementsClause' helps to disambiguate between these two cases + // - class with name 'implements' + // 'isImplementsClause' helps to disambiguate between these two cases return isIdentifier() && !isImplementsClause() ? parseIdentifier() : undefined; @@ -11053,12 +11360,9 @@ var ts; } return undefined; } - function parseHeritageClausesWorker() { - return parseList(20 /* HeritageClauses */, parseHeritageClause); - } function parseHeritageClause() { if (token === 83 /* ExtendsKeyword */ || token === 106 /* ImplementsKeyword */) { - var node = createNode(243 /* HeritageClause */); + var node = createNode(245 /* HeritageClause */); node.token = token; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -11067,7 +11371,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(188 /* ExpressionWithTypeArguments */); + var node = createNode(190 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -11081,7 +11385,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215 /* InterfaceDeclaration */, fullStart); + var node = createNode(217 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107 /* InterfaceKeyword */); @@ -11092,7 +11396,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(216 /* TypeAliasDeclaration */, fullStart); + var node = createNode(218 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132 /* TypeKeyword */); @@ -11108,13 +11412,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(247 /* EnumMember */, scanner.getStartPos()); + var node = createNode(249 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217 /* EnumDeclaration */, fullStart); + var node = createNode(219 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81 /* EnumKeyword */); @@ -11129,7 +11433,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(219 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(221 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(15 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -11140,7 +11444,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(218 /* ModuleDeclaration */, fullStart); + var node = createNode(220 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 65536 /* Namespace */; @@ -11154,7 +11458,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218 /* ModuleDeclaration */, fullStart); + var node = createNode(220 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(/*internName*/ true); @@ -11184,11 +11488,6 @@ var ts; function nextTokenIsSlash() { return nextToken() === 39 /* SlashToken */; } - function nextTokenIsCommaOrFromKeyword() { - nextToken(); - return token === 24 /* CommaToken */ || - token === 133 /* FromKeyword */; - } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(89 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); @@ -11199,7 +11498,7 @@ var ts; // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(221 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(223 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -11210,7 +11509,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(222 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(224 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -11233,7 +11532,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(223 /* ImportClause */, fullStart); + var importClause = createNode(225 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -11243,7 +11542,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(24 /* CommaToken */)) { - importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(225 /* NamedImports */); + importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(227 /* NamedImports */); } return finishNode(importClause); } @@ -11253,7 +11552,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(232 /* ExternalModuleReference */); + var node = createNode(234 /* ExternalModuleReference */); parseExpected(127 /* RequireKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -11261,21 +11560,22 @@ var ts; return finishNode(node); } function parseModuleSpecifier() { - // We allow arbitrary expressions here, even though the grammar only allows string - // literals. We check to ensure that it is only a string literal later in the grammar - // walker. - var result = parseExpression(); - // Ensure the string being required is in our 'identifier' table. This will ensure - // that features like 'find refs' will look inside this file when search for its name. - if (result.kind === 9 /* StringLiteral */) { + if (token === 9 /* StringLiteral */) { + var result = parseLiteralNode(); internIdentifier(result.text); + return result; + } + else { + // We allow arbitrary expressions here, even though the grammar only allows string + // literals. We check to ensure that it is only a string literal later in the grammar + // check pass. + return parseExpression(); } - return result; } function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(224 /* NamespaceImport */); + var namespaceImport = createNode(226 /* NamespaceImport */); parseExpected(37 /* AsteriskToken */); parseExpected(116 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -11290,14 +11590,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 225 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); + node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 227 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(230 /* ExportSpecifier */); + return parseImportOrExportSpecifier(232 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(226 /* ImportSpecifier */); + return parseImportOrExportSpecifier(228 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -11322,14 +11622,14 @@ var ts; else { node.name = identifierName; } - if (kind === 226 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 228 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(228 /* ExportDeclaration */, fullStart); + var node = createNode(230 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37 /* AsteriskToken */)) { @@ -11337,7 +11637,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(229 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(231 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. @@ -11350,7 +11650,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(227 /* ExportAssignment */, fullStart); + var node = createNode(229 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56 /* EqualsToken */)) { @@ -11373,11 +11673,13 @@ var ts; // reference comment. while (true) { var kind = triviaScanner.scan(); - if (kind === 5 /* WhitespaceTrivia */ || kind === 4 /* NewLineTrivia */ || kind === 3 /* MultiLineCommentTrivia */) { - continue; - } if (kind !== 2 /* SingleLineCommentTrivia */) { - break; + if (ts.isTrivia(kind)) { + continue; + } + else { + break; + } } var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); @@ -11423,10 +11725,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 /* Export */ - || node.kind === 221 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 232 /* ExternalModuleReference */ - || node.kind === 222 /* ImportDeclaration */ - || node.kind === 227 /* ExportAssignment */ - || node.kind === 228 /* ExportDeclaration */ + || node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */ + || node.kind === 224 /* ImportDeclaration */ + || node.kind === 229 /* ExportAssignment */ + || node.kind === 230 /* ExportDeclaration */ ? node : undefined; }); @@ -11501,7 +11803,7 @@ var ts; scanner.setText(sourceText, start, length); // Prime the first token for us to start processing. token = nextToken(); - var result = createNode(249 /* JSDocTypeExpression */); + var result = createNode(251 /* JSDocTypeExpression */); parseExpected(15 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(16 /* CloseBraceToken */); @@ -11512,12 +11814,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47 /* BarToken */) { - var unionType = createNode(253 /* JSDocUnionType */, type.pos); + var unionType = createNode(255 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56 /* EqualsToken */) { - var optionalType = createNode(260 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(262 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -11528,20 +11830,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19 /* OpenBracketToken */) { - var arrayType = createNode(252 /* JSDocArrayType */, type.pos); + var arrayType = createNode(254 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token === 53 /* QuestionToken */) { - var nullableType = createNode(255 /* JSDocNullableType */, type.pos); + var nullableType = createNode(257 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49 /* ExclamationToken */) { - var nonNullableType = createNode(256 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(258 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -11586,27 +11888,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(264 /* JSDocThisType */); + var result = createNode(266 /* JSDocThisType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(263 /* JSDocConstructorType */); + var result = createNode(265 /* JSDocConstructorType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(262 /* JSDocVariadicType */); + var result = createNode(264 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(261 /* JSDocFunctionType */); + var result = createNode(263 /* JSDocFunctionType */); nextToken(); parseExpected(17 /* OpenParenToken */); result.parameters = parseDelimitedList(22 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -11623,14 +11925,8 @@ var ts; parameter.type = parseJSDocType(); return finishNode(parameter); } - function parseJSDocOptionalType(type) { - var result = createNode(260 /* JSDocOptionalType */, type.pos); - nextToken(); - result.type = type; - return finishNode(result); - } function parseJSDocTypeReference() { - var result = createNode(259 /* JSDocTypeReference */); + var result = createNode(261 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); while (parseOptional(21 /* DotToken */)) { if (token === 25 /* LessThanToken */) { @@ -11666,7 +11962,7 @@ var ts; return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(257 /* JSDocRecordType */); + var result = createNode(259 /* JSDocRecordType */); nextToken(); result.members = parseDelimitedList(24 /* JSDocRecordMembers */, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -11674,7 +11970,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(258 /* JSDocRecordMember */); + var result = createNode(260 /* JSDocRecordMember */); result.name = parseSimplePropertyName(); if (token === 54 /* ColonToken */) { nextToken(); @@ -11683,13 +11979,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(256 /* JSDocNonNullableType */); + var result = createNode(258 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(254 /* JSDocTupleType */); + var result = createNode(256 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(25 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -11703,7 +11999,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(253 /* JSDocUnionType */); + var result = createNode(255 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18 /* CloseParenToken */); @@ -11721,7 +12017,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(250 /* JSDocAllType */); + var result = createNode(252 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -11744,11 +12040,11 @@ var ts; token === 27 /* GreaterThanToken */ || token === 56 /* EqualsToken */ || token === 47 /* BarToken */) { - var result = createNode(251 /* JSDocUnknownType */, pos); + var result = createNode(253 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(255 /* JSDocNullableType */, pos); + var result = createNode(257 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -11836,7 +12132,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(265 /* JSDocComment */, start); + var result = createNode(267 /* JSDocComment */, start); result.tags = tags; return finishNode(result, end); } @@ -11873,7 +12169,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(266 /* JSDocTag */, atToken.pos); + var result = createNode(268 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -11924,7 +12220,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(267 /* JSDocParameterTag */, atToken.pos); + var result = createNode(269 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -11934,27 +12230,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 268 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(268 /* JSDocReturnTag */, atToken.pos); + var result = createNode(270 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 269 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(269 /* JSDocTypeTag */, atToken.pos); + var result = createNode(271 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -11978,7 +12274,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(270 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(272 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -12019,7 +12315,7 @@ var ts; if (sourceFile.statements.length === 0) { // If we don't have any statements in the current source file, then there's no real // way to incrementally parse. So just do a full parse instead. - return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true); + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true); } // Make sure we're not trying to incrementally update a source file more than once. Once // we do an update the original source file is considered unusbale from that point onwards. @@ -12075,7 +12371,7 @@ var ts; // inconsistent tree. Setting the parents on the new tree should be very fast. We // will immediately bail out of walking any subtrees when we can see that their parents // are already correct. - var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true); + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true); return result; } IncrementalParser.updateSourceFile = updateSourceFile; @@ -12508,16 +12804,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 218 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 219 /* ModuleBlock */) { + else if (node.kind === 221 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -12536,7 +12832,7 @@ var ts; }); return state; } - else if (node.kind === 218 /* ModuleDeclaration */) { + else if (node.kind === 220 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -12604,6 +12900,8 @@ var ts; file.symbolCount = symbolCount; file.classifiableNames = classifiableNames; } + file = undefined; + options = undefined; parent = undefined; container = undefined; blockScopeContainer = undefined; @@ -12632,20 +12930,25 @@ var ts; if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { symbol.members = {}; } - if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; + if (symbolFlags & 107455 /* Value */) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220 /* ModuleDeclaration */)) { + // other kinds of value declarations take precedence over modules + symbol.valueDeclaration = node; + } } } // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 218 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + if (node.kind === 220 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { return "\"" + node.name.text + "\""; } if (node.name.kind === 136 /* ComputedPropertyName */) { var nameExpression = node.name.expression; - // treat computed property names where expression is string/numeric literal as just string/numeric literal + // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression.kind)) { return nameExpression.text; } @@ -12665,15 +12968,27 @@ var ts; return "__new"; case 149 /* IndexSignature */: return "__index"; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return "__export"; - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 181 /* BinaryExpression */: - // Binary expression case is for JS module 'module.exports = expr' - return "export="; - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: + case 183 /* BinaryExpression */: + switch (ts.getSpecialPropertyAssignmentKind(node)) { + case 2 /* ModuleExports */: + // module.exports = ... + return "export="; + case 1 /* ExportsProperty */: + case 4 /* ThisProperty */: + // exports.x = ... or this.y = ... + return node.left.name.text; + case 3 /* PrototypeProperty */: + // className.prototype.methodName = ... + return node.left.expression.name.text; + } + ts.Debug.fail("Unknown binary declaration kind"); + break; + case 215 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: return node.flags & 512 /* Default */ ? "default" : undefined; } } @@ -12750,7 +13065,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 230 /* ExportSpecifier */ || (node.kind === 221 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 232 /* ExportSpecifier */ || (node.kind === 223 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -12833,10 +13148,10 @@ var ts; var flags = node.flags; // reset all reachability check related flags on node (for incremental scenarios) flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 215 /* InterfaceDeclaration */) { + if (kind === 217 /* InterfaceDeclaration */) { seenThisKeyword = false; } - var saveState = kind === 248 /* SourceFile */ || kind === 219 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + var saveState = kind === 250 /* SourceFile */ || kind === 221 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -12854,7 +13169,7 @@ var ts; flags |= 1048576 /* HasExplicitReturn */; } } - if (kind === 215 /* InterfaceDeclaration */) { + if (kind === 217 /* InterfaceDeclaration */) { flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; } node.flags = flags; @@ -12879,40 +13194,40 @@ var ts; return; } switch (node.kind) { - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: bindWhileStatement(node); break; - case 197 /* DoStatement */: + case 199 /* DoStatement */: bindDoStatement(node); break; - case 199 /* ForStatement */: + case 201 /* ForStatement */: bindForStatement(node); break; - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 196 /* IfStatement */: + case 198 /* IfStatement */: bindIfStatement(node); break; - case 204 /* ReturnStatement */: - case 208 /* ThrowStatement */: + case 206 /* ReturnStatement */: + case 210 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 209 /* TryStatement */: + case 211 /* TryStatement */: bindTryStatement(node); break; - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: bindSwitchStatement(node); break; - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: bindCaseBlock(node); break; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: bindLabeledStatement(node); break; default: @@ -12964,7 +13279,7 @@ var ts; popImplicitLabel(postStatementLabel, preStatementState); } function bindIfStatement(n) { - // denotes reachability state when entering 'thenStatement' part of the if statement: + // denotes reachability state when entering 'thenStatement' part of the if statement: // i.e. if condition is false then thenStatement is unreachable var ifTrueState = n.expression.kind === 84 /* FalseKeyword */ ? 4 /* Unreachable */ : currentReachabilityState; // denotes reachability state when entering 'elseStatement': @@ -12987,7 +13302,7 @@ var ts; function bindReturnOrThrow(n) { // bind expression (don't affect reachability) bind(n.expression); - if (n.kind === 204 /* ReturnStatement */) { + if (n.kind === 206 /* ReturnStatement */) { hasExplicitReturn = true; } currentReachabilityState = 4 /* Unreachable */; @@ -12996,7 +13311,7 @@ var ts; // call bind on label (don't affect reachability) bind(n.label); // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 203 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + var isValidJump = jumpToLabel(n.label, n.kind === 205 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); if (isValidJump) { currentReachabilityState = 4 /* Unreachable */; } @@ -13022,7 +13337,7 @@ var ts; // bind expression (don't affect reachability) bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 242 /* DefaultClause */; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244 /* DefaultClause */; }); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); @@ -13049,37 +13364,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return 1 /* IsContainer */; case 147 /* CallSignature */: case 148 /* ConstructSignature */: case 149 /* IndexSignature */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 152 /* FunctionType */: case 153 /* ConstructorType */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 218 /* ModuleDeclaration */: - case 248 /* SourceFile */: - case 216 /* TypeAliasDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 220 /* ModuleDeclaration */: + case 250 /* SourceFile */: + case 218 /* TypeAliasDeclaration */: return 5 /* IsContainerWithLocals */; - case 244 /* CatchClause */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 220 /* CaseBlock */: + case 246 /* CatchClause */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 222 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 192 /* Block */: + case 194 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Othewise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -13116,18 +13431,18 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); case 155 /* TypeLiteral */: - case 165 /* ObjectLiteralExpression */: - case 215 /* InterfaceDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 217 /* InterfaceDeclaration */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the @@ -13144,10 +13459,10 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 216 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 218 /* TypeAliasDeclaration */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -13168,11 +13483,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 248 /* SourceFile */ ? node : node.body; - if (body.kind === 248 /* SourceFile */ || body.kind === 219 /* ModuleBlock */) { + var body = node.kind === 250 /* SourceFile */ ? node : node.body; + if (body.kind === 250 /* SourceFile */ || body.kind === 221 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 228 /* ExportDeclaration */ || stat.kind === 227 /* ExportAssignment */) { + if (stat.kind === 230 /* ExportDeclaration */ || stat.kind === 229 /* ExportAssignment */) { return true; } } @@ -13256,7 +13571,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + var currentKind = prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen[identifier.text]; @@ -13278,10 +13593,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -13441,17 +13756,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 248 /* SourceFile */: - case 219 /* ModuleBlock */: + case 250 /* SourceFile */: + case 221 /* ModuleBlock */: updateStrictModeStatementList(node.statements); return; - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return; @@ -13481,45 +13796,61 @@ var ts; /* Strict mode checks */ case 69 /* Identifier */: return checkStrictModeIdentifier(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: if (ts.isInJavaScriptFile(node)) { - if (ts.isExportsPropertyAssignment(node)) { - bindExportsPropertyAssignment(node); - } - else if (ts.isModuleExportsAssignment(node)) { - bindModuleExportsAssignment(node); + var specialKind = ts.getSpecialPropertyAssignmentKind(node); + switch (specialKind) { + case 1 /* ExportsProperty */: + bindExportsPropertyAssignment(node); + break; + case 2 /* ModuleExports */: + bindModuleExportsAssignment(node); + break; + case 3 /* PrototypeProperty */: + bindPrototypePropertyAssignment(node); + break; + case 4 /* ThisProperty */: + bindThisPropertyAssignment(node); + break; + case 0 /* None */: + // Nothing to do + break; + default: + ts.Debug.fail("Unknown special property assignment kind"); } } return checkStrictModeBinaryExpression(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return checkStrictModeCatchClause(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return checkStrictModeWithStatement(node); - case 97 /* ThisKeyword */: + case 161 /* ThisType */: seenThisKeyword = true; return; + case 150 /* TypePredicate */: + return checkTypePredicate(node); case 137 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); case 138 /* Parameter */: return bindParameter(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: + case 247 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); case 147 /* CallSignature */: case 148 /* ConstructSignature */: @@ -13532,7 +13863,7 @@ var ts; // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: checkStrictModeFunctionName(node); return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); case 144 /* Constructor */: @@ -13546,46 +13877,56 @@ var ts; return bindFunctionOrConstructorType(node); case 155 /* TypeLiteral */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: checkStrictModeFunctionName(node); var bindingName = node.name ? node.name.text : "__function"; return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 168 /* CallExpression */: + case 170 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: return bindClassLikeDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Imports and exports - case 221 /* ImportEqualsDeclaration */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return bindImportClause(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return bindExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return bindExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return bindSourceFileIfExternalModule(); } } + function checkTypePredicate(node) { + var parameterName = node.parameterName, type = node.type; + if (parameterName && parameterName.kind === 69 /* Identifier */) { + checkStrictModeIdentifier(parameterName); + } + if (parameterName && parameterName.kind === 161 /* ThisType */) { + seenThisKeyword = true; + } + bind(type); + } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -13596,7 +13937,7 @@ var ts; bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 227 /* ExportAssignment */ ? node.expression : node.right; + var boundExpression = node.kind === 229 /* ExportAssignment */ ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { // Export assignment in some sort of block construct bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); @@ -13642,6 +13983,29 @@ var ts; setCommonJsModuleIndicator(node); bindExportAssignment(node); } + function bindThisPropertyAssignment(node) { + // Declare a 'member' in case it turns out the container was an ES5 class + if (container.kind === 175 /* FunctionExpression */ || container.kind === 215 /* FunctionDeclaration */) { + container.symbol.members = container.symbol.members || {}; + declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); + } + } + function bindPrototypePropertyAssignment(node) { + // We saw a node of the form 'x.prototype.y = z'. Declare a 'member' y on x if x was a function. + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var classId = node.left.expression.expression; + var funcSymbol = container.locals[classId.text]; + if (!funcSymbol || !(funcSymbol.flags & 16 /* Function */)) { + return; + } + // Set up the members collection if it doesn't exist already + if (!funcSymbol.members) { + funcSymbol.members = {}; + } + // Declare the method/property + declareSymbol(funcSymbol.members, funcSymbol, node.left, 4 /* Property */, 107455 /* PropertyExcludes */); + } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip // this check if we've already seen the module indicator @@ -13650,7 +14014,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -13725,9 +14089,7 @@ var ts; } // If this is a property-parameter, then also declare the property symbol into the // containing class. - if (node.flags & 56 /* AccessibilityModifier */ && - node.parent.kind === 144 /* Constructor */ && - ts.isClassLike(node.parent.parent)) { + if (ts.isParameterPropertyDeclaration(node)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -13797,18 +14159,18 @@ var ts; case 4 /* Unreachable */: var reportError = // report error on all statements except empty ones - (ts.isStatement(node) && node.kind !== 194 /* EmptyStatement */) || + (ts.isStatement(node) && node.kind !== 196 /* EmptyStatement */) || // report error on class declarations - node.kind === 214 /* ClassDeclaration */ || + node.kind === 216 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 218 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 220 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 217 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 219 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8 /* ReportedUnreachable */; // unreachable code is reported if // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error + // - statement is in not ambient context (statements in ambient context is already an error // so we should not report extras) AND // - node is not variable statement OR // - node is block scoped variable statement OR @@ -13817,7 +14179,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 193 /* VariableStatement */ || + (node.kind !== 195 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -13853,15 +14215,18 @@ var ts; var nextNodeId = 1; var nextMergeId = 1; function getNodeId(node) { - if (!node.id) - node.id = nextNodeId++; + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } return node.id; } ts.getNodeId = getNodeId; ts.checkTime = 0; function getSymbolId(symbol) { if (!symbol.id) { - symbol.id = nextSymbolId++; + symbol.id = nextSymbolId; + nextSymbolId++; } return symbol.id; } @@ -13887,8 +14252,10 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0 /* ES3 */; var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + var allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === 4 /* System */; var emitResolver = createResolver(); var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + undefinedSymbol.declarations = []; var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, @@ -13902,6 +14269,7 @@ var ts; // The language service will always care about the narrowed type of a symbol, because that is // the type the language says the symbol should have. getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: getSymbolsOfParameterPropertyDeclaration, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -13918,7 +14286,7 @@ var ts; symbolToString: symbolToString, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getContextualType: getApparentTypeOfContextualType, + getContextualType: getContextualType, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: getResolvedSignature, getConstantValue: getConstantValue, @@ -13943,8 +14311,8 @@ var ts; var undefinedType = createIntrinsicType(32 /* Undefined */ | 2097152 /* ContainsUndefinedOrNull */, "undefined"); var nullType = createIntrinsicType(64 /* Null */ | 2097152 /* ContainsUndefinedOrNull */, "null"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var circularType = createIntrinsicType(1 /* Any */, "__circular__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var emptyUnionType = emptyObjectType; var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); emptyGenericType.instantiations = {}; var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -13952,8 +14320,8 @@ var ts; // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. anyFunctionType.flags |= 8388608 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); + var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false); var globals = {}; var globalESSymbolConstructorSymbol; var getGlobalPromiseConstructorSymbol; @@ -13966,9 +14334,6 @@ var ts; var globalRegExpType; var globalTemplateStringsArrayType; var globalESSymbolType; - var jsxElementType; - /** Lazily loaded, use getJsxIntrinsicElementType() */ - var jsxIntrinsicElementsType; var globalIterableType; var globalIteratorType; var globalIterableIteratorType; @@ -13985,6 +14350,7 @@ var ts; var getGlobalPromiseConstructorLikeType; var getGlobalThenableType; var jsxElementClassType; + var deferredNodes; var tupleTypes = {}; var unionTypes = {}; var intersectionTypes = {}; @@ -14019,14 +14385,23 @@ var ts; "symbol": { type: esSymbolType, flags: 16777216 /* ESSymbol */ + }, + "undefined": { + type: undefinedType, + flags: 2097152 /* ContainsUndefinedOrNull */ } }; + var jsxElementType; + /** Things we lazy load from the JSX namespace */ + var jsxTypes = {}; var JsxNames = { JSX: "JSX", IntrinsicElements: "IntrinsicElements", ElementClass: "ElementClass", ElementAttributesPropertyNameContainer: "ElementAttributesProperty", - Element: "Element" + Element: "Element", + IntrinsicAttributes: "IntrinsicAttributes", + IntrinsicClassAttributes: "IntrinsicClassAttributes" }; var subtypeRelation = {}; var assignableRelation = {}; @@ -14040,6 +14415,10 @@ var ts; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var builtinGlobals = (_a = {}, + _a[undefinedSymbol.name] = undefinedSymbol, + _a + ); initializeTypeChecker(); return checker; function getEmitResolver(sourceFile, cancellationToken) { @@ -14095,8 +14474,10 @@ var ts; return result; } function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { @@ -14121,8 +14502,12 @@ var ts; target.constEnumOnlyModule = false; } target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) + if (source.valueDeclaration && + (!target.valueDeclaration || + (target.valueDeclaration.kind === 220 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 220 /* ModuleDeclaration */))) { + // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; + } ts.forEach(source.declarations, function (node) { target.declarations.push(node); }); @@ -14174,6 +14559,22 @@ var ts; } } } + function addToSymbolTable(target, source, message) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (ts.hasProperty(target, id)) { + // Error on redeclarations + ts.forEach(target[id].declarations, addDeclarationDiagnostic(id, message)); + } + else { + target[id] = source[id]; + } + } + } + function addDeclarationDiagnostic(id, message) { + return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); }; + } + } function getSymbolLinks(symbol) { if (symbol.flags & 67108864 /* Transient */) return symbol; @@ -14185,10 +14586,17 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 248 /* SourceFile */); + return ts.getAncestor(node, 250 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 248 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 250 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + } + /** Is this type one of the apparent types created from the primitive types. */ + function isPrimitiveApparentType(type) { + return type === globalStringType || + type === globalNumberType || + type === globalBooleanType || + type === globalESSymbolType; } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14207,6 +14615,22 @@ var ts; } // return undefined if we can't find a symbol. } + /** + * Get symbols that represent parameter-property-declaration as parameter and as property declaration + * @param parameter a parameterDeclaration node + * @param parameterName a name of the parameter to get the symbols for. + * @return a tuple of two symbols + */ + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + var constructoDeclaration = parameter.parent; + var classDeclaration = parameter.parent.parent; + var parameterSymbol = getSymbol(constructoDeclaration.locals, parameterName, 107455 /* Value */); + var propertySymbol = getSymbol(classDeclaration.symbol.members, parameterName, 107455 /* Value */); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { var declarationFile = ts.getSourceFileOfNode(declaration); var useFile = ts.getSourceFileOfNode(usage); @@ -14221,7 +14645,7 @@ var ts; if (declaration.pos <= usage.pos) { // declaration is before usage // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 211 /* VariableDeclaration */ || + return declaration.kind !== 213 /* VariableDeclaration */ || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } // declaration is after usage @@ -14229,14 +14653,14 @@ var ts; return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 193 /* VariableStatement */ || - declaration.parent.parent.kind === 199 /* ForStatement */) { + if (declaration.parent.parent.kind === 195 /* VariableStatement */ || + declaration.parent.parent.kind === 201 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 201 /* ForOfStatement */ || - declaration.parent.parent.kind === 200 /* ForInStatement */) { + else if (declaration.parent.parent.kind === 203 /* ForOfStatement */ || + declaration.parent.parent.kind === 202 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); @@ -14277,25 +14701,46 @@ var ts; // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - // Type parameters of a function are in scope in the entire function declaration, including the parameter - // list and return type. However, local types are only in scope in the function body. - if (!(meaning & 793056 /* Type */) || - !(result.flags & (793056 /* Type */ & ~262144 /* TypeParameter */)) || - !ts.isFunctionLike(location) || - lastLocation === location.body) { + var useResult = true; + if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { + // symbol lookup restrictions for function-like declarations + // - Type parameters of a function are in scope in the entire function declaration, including the parameter + // list and return type. However, local types are only in scope in the function body. + // - parameters are only in the scope of function body + if (meaning & result.flags & 793056 /* Type */) { + useResult = result.flags & 262144 /* TypeParameter */ + ? lastLocation === location.type || + lastLocation.kind === 138 /* Parameter */ || + lastLocation.kind === 137 /* TypeParameter */ + : false; + } + if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { + // parameters are visible only inside function body, parameter list and return type + // technically for parameter list case here we might mix parameters and variables declared in function, + // however it is detected separately when checking initializers of parameters + // to make sure that they reference no variables declared after them. + useResult = + lastLocation.kind === 138 /* Parameter */ || + (lastLocation === location.type && + result.valueDeclaration.kind === 138 /* Parameter */); + } + } + if (useResult) { break loop; } - result = undefined; + else { + result = undefined; + } } } switch (location.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 248 /* SourceFile */ || - (location.kind === 218 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { + if (location.kind === 250 /* SourceFile */ || + (location.kind === 220 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports["default"]) { @@ -14306,7 +14751,7 @@ var ts; result = undefined; } // Because of module/namespace merging, a module's exports are in scope, - // yet we never want to treat an export specifier as putting a member in scope. + // yet we never want to treat an export specifier as putting a member in scope. // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope. // Two things to note about this: // 1. We have to check this without calling getSymbol. The problem with calling getSymbol @@ -14318,7 +14763,7 @@ var ts; // which is not the desired behavior. if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 230 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExports[name], 232 /* ExportSpecifier */)) { break; } } @@ -14326,7 +14771,7 @@ var ts; break loop; } break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } @@ -14349,9 +14794,9 @@ var ts; } } break; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 64 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -14362,7 +14807,7 @@ var ts; } break loop; } - if (location.kind === 186 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 188 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -14380,7 +14825,7 @@ var ts; // case 136 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 215 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 217 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -14393,14 +14838,14 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -14482,7 +14927,7 @@ var ts; // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 211 /* VariableDeclaration */), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213 /* VariableDeclaration */), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -14503,10 +14948,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 222 /* ImportDeclaration */) { + while (node && node.kind !== 224 /* ImportDeclaration */) { node = node.parent; } return node; @@ -14516,7 +14961,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 232 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 234 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -14525,9 +14970,12 @@ var ts; var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); - if (!exportDefaultSymbol) { + if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } + else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + return resolveSymbol(moduleSymbol.exports["export="]) || resolveSymbol(moduleSymbol); + } return exportDefaultSymbol; } } @@ -14535,14 +14983,6 @@ var ts; var moduleSpecifier = node.parent.parent.moduleSpecifier; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } - function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3 /* Variable */) { - var typeAnnotation = moduleSymbol.valueDeclaration.type; - if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); - } - } - } // This function creates a synthetic symbol that combines the value side of one symbol with the // type/namespace side of another symbol. Consider this example: // @@ -14623,17 +15063,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 223 /* ImportClause */: + case 225 /* ImportClause */: return getTargetOfImportClause(node); - case 224 /* NamespaceImport */: + case 226 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 226 /* ImportSpecifier */: + case 228 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 230 /* ExportSpecifier */: + case 232 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -14678,11 +15118,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 227 /* ExportAssignment */) { + if (node.kind === 229 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 230 /* ExportSpecifier */) { + else if (node.kind === 232 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -14695,7 +15135,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 221 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 223 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -14714,7 +15154,7 @@ var ts; else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 221 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 223 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -14734,7 +15174,7 @@ var ts; return undefined; } } - else if (name.kind === 135 /* QualifiedName */ || name.kind === 166 /* PropertyAccessExpression */) { + else if (name.kind === 135 /* QualifiedName */ || name.kind === 168 /* PropertyAccessExpression */) { var left = name.kind === 135 /* QualifiedName */ ? name.left : name.expression; var right = name.kind === 135 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */, ignoreErrors); @@ -14760,16 +15200,12 @@ var ts; return; } var moduleReferenceLiteral = moduleReferenceExpression; - var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); // Module names are escaped in our symbol table. However, string literal values aren't. // Escape the name in the "require(...)" clause to ensure we find the right symbol. var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (moduleName === undefined) { return; } - if (moduleName.indexOf("!") >= 0) { - moduleName = moduleName.substr(0, moduleName.indexOf("!")); - } var isRelative = ts.isExternalModuleNameRelative(moduleName); if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); @@ -14817,38 +15253,66 @@ var ts; var links = getSymbolLinks(moduleSymbol); return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); } - function extendExportSymbols(target, source) { + /** + * Extends one symbol table with another while collecting information on name collisions for error message generation into the `lookupTable` argument + * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables + */ + function extendExportSymbols(target, source, lookupTable, exportNode) { for (var id in source) { if (id !== "default" && !ts.hasProperty(target, id)) { target[id] = source[id]; + if (lookupTable && exportNode) { + lookupTable[id] = { + specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) + }; + } + } + else if (lookupTable && exportNode && id !== "default" && ts.hasProperty(target, id) && resolveSymbol(target[id]) !== resolveSymbol(source[id])) { + if (!lookupTable[id].exportsWithDuplicate) { + lookupTable[id].exportsWithDuplicate = [exportNode]; + } + else { + lookupTable[id].exportsWithDuplicate.push(exportNode); + } } } } function getExportsForModule(moduleSymbol) { - var result; var visitedSymbols = []; - visit(moduleSymbol); - return result || moduleSymbol.exports; + return visit(moduleSymbol) || moduleSymbol.exports; // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. function visit(symbol) { - if (symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol)) { - visitedSymbols.push(symbol); - if (symbol !== moduleSymbol) { - if (!result) { - result = cloneSymbolTable(moduleSymbol.exports); - } - extendExportSymbols(result, symbol.exports); - } - // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; - if (exportStars) { - for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - visit(resolveExternalModuleName(node, node.moduleSpecifier)); - } - } + if (!(symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol))) { + return; } + visitedSymbols.push(symbol); + var symbols = cloneSymbolTable(symbol.exports); + // All export * declarations are collected in an __export symbol by the binder + var exportStars = symbol.exports["__export"]; + if (exportStars) { + var nestedSymbols = {}; + var lookupTable = {}; + for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { + var node = _a[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + var exportedSymbols = visit(resolvedModule); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable, node); + } + for (var id in lookupTable) { + var exportsWithDuplicate = lookupTable[id].exportsWithDuplicate; + // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || ts.hasProperty(symbols, id)) { + continue; + } + for (var _b = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _b < exportsWithDuplicate_1.length; _b++) { + var node = exportsWithDuplicate_1[_b]; + diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable[id].specifierText, id)); + } + } + extendExportSymbols(symbols, nestedSymbols); + } + return symbols; } } function getMergedSymbol(symbol) { @@ -14893,7 +15357,8 @@ var ts; } function createType(flags) { var result = new Type(checker, flags); - result.id = typeCount++; + result.id = typeCount; + typeCount++; return result; } function createIntrinsicType(kind, intrinsicName) { @@ -14956,17 +15421,17 @@ var ts; } } switch (location_1.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -15007,7 +15472,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230 /* ExportSpecifier */)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) { if (!useOnlyExternalAliasing || // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { @@ -15044,7 +15509,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 230 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -15117,8 +15582,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 218 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return (declaration.kind === 220 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || + (declaration.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15158,8 +15623,8 @@ var ts; // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 166 /* PropertyAccessExpression */ || - entityName.parent.kind === 221 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 168 /* PropertyAccessExpression */ || + entityName.parent.kind === 223 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -15193,9 +15658,9 @@ var ts; ts.releaseStringWriter(writer); return result; } - function signatureToString(signature, enclosingDeclaration, flags) { + function signatureToString(signature, enclosingDeclaration, flags, kind) { var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); var result = writer.string(); ts.releaseStringWriter(writer); return result; @@ -15217,7 +15682,7 @@ var ts; while (node.kind === 160 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -15231,10 +15696,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return "(Anonymous class)"; - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -15322,10 +15787,16 @@ var ts; function writeType(type, flags) { // Write undefined/null type as any if (type.flags & 16777343 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); + if (type.flags & 134217728 /* PredicateType */) { + buildTypePredicateDisplay(writer, type.predicate); + buildTypeDisplay(type.predicate.type, writer, enclosingDeclaration, flags, symbolStack); + } + else { + // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) + ? "any" + : type.intrinsicName); + } } else if (type.flags & 33554432 /* ThisType */) { if (inObjectTypeLiteral) { @@ -15381,11 +15852,13 @@ var ts; } if (pos < end) { writePunctuation(writer, 25 /* LessThanToken */); - writeType(typeArguments[pos++], 0 /* None */); + writeType(typeArguments[pos], 0 /* None */); + pos++; while (pos < end) { writePunctuation(writer, 24 /* CommaToken */); writeSpace(writer); - writeType(typeArguments[pos++], 0 /* None */); + writeType(typeArguments[pos], 0 /* None */); + pos++; } writePunctuation(writer, 27 /* GreaterThanToken */); } @@ -15481,7 +15954,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 248 /* SourceFile */ || declaration.parent.kind === 219 /* ModuleBlock */; + return declaration.parent.kind === 250 /* SourceFile */ || declaration.parent.kind === 221 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -15517,7 +15990,7 @@ var ts; if (flags & 64 /* InElementType */) { writePunctuation(writer, 17 /* OpenParenToken */); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (flags & 64 /* InElementType */) { writePunctuation(writer, 18 /* CloseParenToken */); } @@ -15529,7 +16002,7 @@ var ts; } writeKeyword(writer, 92 /* NewKeyword */); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); if (flags & 64 /* InElementType */) { writePunctuation(writer, 18 /* CloseParenToken */); } @@ -15543,15 +16016,13 @@ var ts; writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 92 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } @@ -15594,7 +16065,7 @@ var ts; if (p.flags & 536870912 /* Optional */) { writePunctuation(writer, 53 /* QuestionToken */); } - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); writePunctuation(writer, 23 /* SemicolonToken */); writer.writeLine(); } @@ -15682,6 +16153,17 @@ var ts; } writePunctuation(writer, 18 /* CloseParenToken */); } + function buildTypePredicateDisplay(writer, predicate) { + if (ts.isIdentifierTypePredicate(predicate)) { + writer.writeParameter(predicate.parameterName); + } + else { + writeKeyword(writer, 97 /* ThisKeyword */); + } + writeSpace(writer); + writeKeyword(writer, 124 /* IsKeyword */); + writeSpace(writer); + } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); @@ -15691,20 +16173,14 @@ var ts; writePunctuation(writer, 54 /* ColonToken */); } writeSpace(writer); - var returnType; - if (signature.typePredicate) { - writer.writeParameter(signature.typePredicate.parameterName); - writeSpace(writer); - writeKeyword(writer, 124 /* IsKeyword */); - writeSpace(writer); - returnType = signature.typePredicate.type; - } - else { - returnType = getReturnTypeOfSignature(signature); - } + var returnType = getReturnTypeOfSignature(signature); buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { + if (kind === 1 /* Construct */) { + writeKeyword(writer, 92 /* NewKeyword */); + writeSpace(writer); + } if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { // Instantiated signature, write type arguments instead // This is achieved by passing in the mapper separately @@ -15729,82 +16205,36 @@ var ts; }); } function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 218 /* ModuleDeclaration */) { - if (node.name.kind === 9 /* StringLiteral */) { - return node; - } - } - else if (node.kind === 248 /* SourceFile */) { - return ts.isExternalOrCommonJsModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - // Get source File and see if it is external module and has export assigned symbol - var externalModule = getContainingExternalModule(node); - var exportAssignmentSymbol; - var resolvedExportSymbol; - if (externalModule) { - // This is export assigned symbol node - var externalModuleSymbol = getSymbolOfNode(externalModule); - exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - // if symbolOfNode is alias declaration, resolve the symbol declaration and check - if (symbolOfNode.flags & 8388608 /* Alias */) { - return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); - } - } - // Check if the symbol is used in export assignment - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608 /* Alias */)) { - // if export assigned symbol is alias declaration, resolve the alias - resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - // Container of resolvedExportSymbol is visible - return ts.forEach(resolvedExportSymbol.declarations, function (current) { - while (current) { - if (current === node) { - return true; - } - current = current.parent; - } - }); - } + if (node) { + var links = getNodeLinks(node); + if (links.isVisible === undefined) { + links.isVisible = !!determineIfDeclarationIsVisible(); } + return links.isVisible; } + return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 163 /* BindingElement */: + case 165 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // Otherwise fall through - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 213 /* FunctionDeclaration */: - case 217 /* EnumDeclaration */: - case 221 /* ImportEqualsDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 215 /* FunctionDeclaration */: + case 219 /* EnumDeclaration */: + case 223 /* ImportEqualsDeclaration */: var parent_4 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 2 /* Export */) && - !(node.kind !== 221 /* ImportEqualsDeclaration */ && parent_4.kind !== 248 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 223 /* ImportEqualsDeclaration */ && parent_4.kind !== 250 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible @@ -15825,7 +16255,7 @@ var ts; case 147 /* CallSignature */: case 149 /* IndexSignature */: case 138 /* Parameter */: - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: case 152 /* FunctionType */: case 153 /* ConstructorType */: case 155 /* TypeLiteral */: @@ -15838,36 +16268,29 @@ var ts; return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: return false; // Type parameters are always visible case 137 /* TypeParameter */: // Source file is always visible - case 248 /* SourceFile */: + case 250 /* SourceFile */: return true; // Export assignments do not create name bindings outside the module - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 227 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 229 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 230 /* ExportSpecifier */) { + else if (node.parent.kind === 232 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -15917,7 +16340,7 @@ var ts; return false; } resolutionTargets.push(target); - resolutionResults.push(true); + resolutionResults.push(/*items*/ true); resolutionPropertyNames.push(propertyName); return true; } @@ -15959,7 +16382,7 @@ var ts; node = ts.getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 211 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 213 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -16018,7 +16441,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 161 /* ObjectBindingPattern */) { + if (pattern.kind === 163 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { @@ -16067,10 +16490,10 @@ var ts; // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { // A variable declared in a for..in statement is always of type any - if (declaration.parent.parent.kind === 200 /* ForInStatement */) { + if (declaration.parent.parent.kind === 202 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 201 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 203 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -16104,7 +16527,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 246 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 248 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -16160,7 +16583,7 @@ var ts; return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - var elementTypes = ts.map(elements, function (e) { return e.kind === 187 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 189 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -16176,7 +16599,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 161 /* ObjectBindingPattern */ + return pattern.kind === 163 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -16198,7 +16621,13 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - return declaration.kind !== 245 /* PropertyAssignment */ ? getWidenedType(type) : type; + if (declaration.kind === 247 /* PropertyAssignment */) { + return type; + } + if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 141 /* PropertyDeclaration */ || declaration.kind === 140 /* PropertySignature */)) { + return type; + } + return getWidenedType(type); } // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; @@ -16220,20 +16649,24 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 244 /* CatchClause */) { + if (declaration.parent.kind === 246 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 227 /* ExportAssignment */) { + if (declaration.kind === 229 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle module.exports = expr - if (declaration.kind === 181 /* BinaryExpression */) { + if (declaration.kind === 183 /* BinaryExpression */) { return links.type = checkExpression(declaration.right); } - // Handle exports.p = expr - if (declaration.kind === 166 /* PropertyAccessExpression */) { - return checkExpressionCached(declaration.parent.right); + if (declaration.kind === 168 /* PropertyAccessExpression */) { + // Declarations only exist for property access expressions for certain + // special assignment kinds + if (declaration.parent.kind === 183 /* BinaryExpression */) { + // Handle exports.p = expr or this.p = expr or className.prototype.method = expr + return links.type = checkExpressionCached(declaration.parent.right); + } } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { @@ -16406,9 +16839,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 214 /* ClassDeclaration */ || node.kind === 186 /* ClassExpression */ || - node.kind === 213 /* FunctionDeclaration */ || node.kind === 173 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || node.kind === 174 /* ArrowFunction */) { + if (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */ || + node.kind === 215 /* FunctionDeclaration */ || node.kind === 175 /* FunctionExpression */ || + node.kind === 143 /* MethodDeclaration */ || node.kind === 176 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -16418,7 +16851,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 215 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -16427,8 +16860,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 215 /* InterfaceDeclaration */ || node.kind === 214 /* ClassDeclaration */ || - node.kind === 186 /* ClassExpression */ || node.kind === 216 /* TypeAliasDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 216 /* ClassDeclaration */ || + node.kind === 188 /* ClassExpression */ || node.kind === 218 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -16492,9 +16925,6 @@ var ts; } return type.resolvedBaseConstructorType; } - function hasClassBaseType(type) { - return !!ts.forEach(getBaseTypes(type), function (t) { return !!(t.symbol.flags & 32 /* Class */); }); - } function getBaseTypes(type) { var isClass = type.symbol.flags & 32 /* Class */; var isInterface = type.symbol.flags & 64 /* Interface */; @@ -16571,7 +17001,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 217 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -16603,7 +17033,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 215 /* InterfaceDeclaration */) { + if (declaration.kind === 217 /* InterfaceDeclaration */) { if (declaration.flags & 262144 /* ContainsThis */) { return false; } @@ -16659,7 +17089,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 216 /* TypeAliasDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 218 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -16748,7 +17178,7 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: return true; case 156 /* ArrayType */: return isIndependentType(node.elementType); @@ -16824,14 +17254,6 @@ var ts; } } } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { - var signature = baseSignatures_1[_i]; - signatures.push(signature); - } - } - } function resolveDeclaredMembers(type) { if (!type.declaredProperties) { var symbol = type.symbol; @@ -16892,33 +17314,32 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasStringLiterals) { + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasStringLiterals = hasStringLiterals; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (!hasClassBaseType(classType)) { - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; - } var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); + if (baseSignatures.length === 0) { + return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false)]; + } var baseTypeNode = getBaseTypeNodeOfClass(classType); var typeArguments = ts.map(baseTypeNode.typeArguments, getTypeFromTypeNode); var typeArgCount = typeArguments ? typeArguments.length : 0; var result = []; - for (var _i = 0, baseSignatures_2 = baseSignatures; _i < baseSignatures_2.length; _i++) { - var baseSig = baseSignatures_2[_i]; + for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { + var baseSig = baseSignatures_1[_i]; var typeParamCount = baseSig.typeParameters ? baseSig.typeParameters.length : 0; if (typeParamCount === typeArgCount) { var sig = typeParamCount ? getSignatureInstantiation(baseSig, typeArguments) : cloneSignature(baseSig); @@ -16949,7 +17370,7 @@ var ts; function findMatchingSignature(signatureList, signature, partialMatch, ignoreReturnTypes) { for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) { var s = signatureList_1[_i]; - if (compareSignatures(s, signature, partialMatch, ignoreReturnTypes, compareTypes)) { + if (compareSignaturesIdentical(s, signature, partialMatch, ignoreReturnTypes, compareTypesIdentical)) { return s; } } @@ -17052,36 +17473,29 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - var members; - var callSignatures; - var constructSignatures; - var stringIndexType; - var numberIndexType; if (type.target) { - members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false); - callSignatures = instantiateList(getSignaturesOfType(type.target, 0 /* Call */), type.mapper, instantiateSignature); - constructSignatures = instantiateList(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper, instantiateSignature); - stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0 /* String */), type.mapper); - numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1 /* Number */), type.mapper); + var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false); + var callSignatures = instantiateList(getSignaturesOfType(type.target, 0 /* Call */), type.mapper, instantiateSignature); + var constructSignatures = instantiateList(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper, instantiateSignature); + var stringIndexType = instantiateType(getIndexTypeOfType(type.target, 0 /* String */), type.mapper); + var numberIndexType = instantiateType(getIndexTypeOfType(type.target, 1 /* Number */), type.mapper); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else if (symbol.flags & 2048 /* TypeLiteral */) { - members = symbol.members; - callSignatures = getSignaturesOfSymbol(members["__call"]); - constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } else { // Combinations of function, class, enum and module - members = emptySymbols; - callSignatures = emptyArray; - constructSignatures = emptyArray; + var members = emptySymbols; + var constructSignatures = emptyArray; if (symbol.flags & 1952 /* HasExports */) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); - } if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); @@ -17094,10 +17508,16 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType)); } } - stringIndexType = undefined; - numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + setObjectTypeMembers(type, members, emptyArray, constructSignatures, undefined, numberIndexType); + // We resolve the members before computing the signatures because a signature may use + // typeof with a qualified name expression that circularly references the type we are + // in the process of resolving (see issue #6072). The temporarily empty signature list + // will never be observed because a qualified name can't reference signatures. + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { + type.callSignatures = getSignaturesOfSymbol(symbol); + } } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveStructuredTypeMembers(type) { if (!type.members) { @@ -17122,15 +17542,15 @@ var ts; } return type; } - // Return properties of an object type or an empty array for other types + /** Return properties of an object type or an empty array for other types */ function getPropertiesOfObjectType(type) { if (type.flags & 80896 /* ObjectType */) { return resolveStructuredTypeMembers(type).properties; } return emptyArray; } - // If the given type is an object type and that type has a property by the given name, - // return the symbol for that property.Otherwise return undefined. + /** If the given type is an object type and that type has a property by the given name, + * return the symbol for that property. Otherwise return undefined. */ function getPropertyOfObjectType(type, name) { if (type.flags & 80896 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); @@ -17201,12 +17621,15 @@ var ts; function createUnionOrIntersectionProperty(containingType, name) { var types = containingType.types; var props; + // Flags we want to propagate to the result if they exist in all source symbols + var commonFlags = (containingType.flags & 32768 /* Intersection */) ? 536870912 /* Optional */ : 0 /* None */; for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { var current = types_2[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (prop && !(getDeclarationFlagsFromSymbol(prop) & (16 /* Private */ | 32 /* Protected */))) { + commonFlags &= prop.flags; if (!props) { props = [prop]; } @@ -17235,7 +17658,10 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* SyntheticProperty */, name); + var result = createSymbol(4 /* Property */ | + 67108864 /* Transient */ | + 268435456 /* SyntheticProperty */ | + commonFlags, name); result.containingType = containingType; result.declarations = declarations; result.type = containingType.flags & 16384 /* Union */ ? getUnionType(propTypes) : getIntersectionType(propTypes); @@ -17292,22 +17718,6 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfStructuredType(getApparentType(type), kind); } - function typeHasConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & (80896 /* ObjectType */ | 16384 /* Union */)) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.constructSignatures.length > 0; - } - return false; - } - function typeHasCallOrConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & 130048 /* StructuredType */) { - var resolved = resolveStructuredTypeMembers(type); - return resolved.callSignatures.length > 0 || resolved.constructSignatures.length > 0; - } - return false; - } function getIndexTypeOfStructuredType(type, kind) { if (type.flags & 130048 /* StructuredType */) { var resolved = resolveStructuredTypeMembers(type); @@ -17353,6 +17763,23 @@ var ts; } return false; } + function createTypePredicateFromTypePredicateNode(node) { + if (node.parameterName.kind === 69 /* Identifier */) { + var parameterName = node.parameterName; + return { + kind: 1 /* Identifier */, + parameterName: parameterName ? parameterName.text : undefined, + parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, + type: getTypeFromTypeNode(node.type) + }; + } + else { + return { + kind: 0 /* This */, + type: getTypeFromTypeNode(node.type) + }; + } + } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -17366,8 +17793,14 @@ var ts; var minArgumentCount = -1; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 9 /* StringLiteral */) { + var paramSymbol = param.symbol; + // Include parameter symbol instead of property symbol in the signature + if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !ts.isBindingPattern(param.name)) { + var resolvedSymbol = resolveName(param, paramSymbol.name, 107455 /* Value */, undefined, undefined); + paramSymbol = resolvedSymbol; + } + parameters.push(paramSymbol); + if (param.type && param.type.kind === 162 /* StringLiteralType */) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -17384,20 +17817,11 @@ var ts; minArgumentCount = declaration.parameters.length; } var returnType; - var typePredicate; if (classType) { returnType = classType; } else if (declaration.type) { returnType = getTypeFromTypeNode(declaration.type); - if (declaration.type.kind === 150 /* TypePredicate */) { - var typePredicateNode = declaration.type; - typePredicate = { - parameterName: typePredicateNode.parameterName ? typePredicateNode.parameterName.text : undefined, - parameterIndex: typePredicateNode.parameterName ? getTypePredicateParameterIndex(declaration.parameters, typePredicateNode.parameterName) : undefined, - type: getTypeFromTypeNode(typePredicateNode.type) - }; - } } else { // TypeScript 1.0 spec (April 2014): @@ -17410,7 +17834,7 @@ var ts; returnType = anyType; } } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); } return links.resolvedSignature; } @@ -17423,7 +17847,7 @@ var ts; switch (node.kind) { case 152 /* FunctionType */: case 153 /* ConstructorType */: - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 144 /* Constructor */: @@ -17432,8 +17856,8 @@ var ts; case 149 /* IndexSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -17499,7 +17923,7 @@ var ts; return anyType; } function getSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); } function getErasedSignature(signature) { if (!signature.typeParameters) @@ -17509,7 +17933,7 @@ var ts; signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); } else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), /*eraseTypeParameters*/ true); } } return signature.erasedSignatureCache; @@ -17556,17 +17980,38 @@ var ts; ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + function getConstraintDeclaration(type) { + return ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint; + } + function hasConstraintReferenceTo(type, target) { + var checked; + while (type && type.flags & 512 /* TypeParameter */ && !ts.contains(checked, type)) { + if (type === target) { + return true; + } + (checked || (checked = [])).push(type); + var constraintDeclaration = getConstraintDeclaration(type); + type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); + } + return false; + } + function getConstraintOfTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint); + var constraintDeclaration = getConstraintDeclaration(typeParameter); + var constraint = getTypeFromTypeNode(constraintDeclaration); + if (hasConstraintReferenceTo(constraint, typeParameter)) { + error(constraintDeclaration, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + constraint = unknownType; + } + typeParameter.constraint = constraint; } } - return type.constraint === noConstraintType ? undefined : type.constraint; + return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137 /* TypeParameter */).parent); @@ -17614,50 +18059,6 @@ var ts; } return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - // bubble up to the declaration - var currentNode = typeReferenceNode; - // forEach === exists - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 137 /* TypeParameter */; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 151 /* TypeReference */ && n.typeName.kind === 69 /* Identifier */) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // symbol.declaration.parent === typeParameter.parent - // -> typeParameter and symbol.declaration originate from the same type parameter list - // -> illegal for all declarations in symbol - // forEach === exists - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent === typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node, symbol) { var type = getDeclaredTypeOfSymbol(symbol); @@ -17702,13 +18103,6 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) function getTypeFromNonGenericTypeReference(node, symbol) { - if (symbol.flags & 262144 /* TypeParameter */ && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - return unknownType; - } if (node.typeArguments) { error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -17751,9 +18145,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: return declaration; } } @@ -17785,10 +18179,6 @@ var ts; if (arity === void 0) { arity = 0; } return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); } - function tryGetGlobalType(name, arity) { - if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalSymbol(name, 793056 /* Type */, /*diagnostic*/ undefined), arity); - } /** * Returns a type that is inside a namespace at the global scope, e.g. * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type @@ -17908,7 +18298,7 @@ var ts; // a named type that circularly references itself. function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { - return emptyObjectType; + return emptyUnionType; } var typeSet = []; addTypesToSet(typeSet, types, 16384 /* Union */); @@ -17980,8 +18370,7 @@ var ts; } return links.resolvedType; } - function getStringLiteralType(node) { - var text = node.text; + function getStringLiteralTypeForText(text) { if (ts.hasProperty(stringLiteralTypes, text)) { return stringLiteralTypes[text]; } @@ -17989,17 +18378,17 @@ var ts; type.text = text; return type; } - function getTypeFromStringLiteral(node) { + function getTypeFromStringLiteralTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); + links.resolvedType = getStringLiteralTypeForText(node.text); } return links.resolvedType; } function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 215 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 217 /* InterfaceDeclaration */)) { if (!(container.flags & 64 /* Static */) && (container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -18015,6 +18404,22 @@ var ts; } return links.resolvedType; } + function getPredicateType(node) { + return createPredicateType(getSymbolOfNode(node), createTypePredicateFromTypePredicateNode(node)); + } + function createPredicateType(symbol, predicate) { + var type = createType(8 /* Boolean */ | 134217728 /* PredicateType */); + type.symbol = symbol; + type.predicate = predicate; + return type; + } + function getTypeFromPredicateTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getPredicateType(node); + } + return links.resolvedType; + } function getTypeFromTypeNode(node) { switch (node.kind) { case 117 /* AnyKeyword */: @@ -18029,15 +18434,15 @@ var ts; return esSymbolType; case 103 /* VoidKeyword */: return voidType; - case 97 /* ThisKeyword */: + case 161 /* ThisType */: return getTypeFromThisTypeNode(node); - case 9 /* StringLiteral */: - return getTypeFromStringLiteral(node); + case 162 /* StringLiteralType */: + return getTypeFromStringLiteralTypeNode(node); case 151 /* TypeReference */: return getTypeFromTypeReference(node); case 150 /* TypePredicate */: - return booleanType; - case 188 /* ExpressionWithTypeArguments */: + return getTypeFromPredicateTypeNode(node); + case 190 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); case 154 /* TypeQuery */: return getTypeFromTypeQueryNode(node); @@ -18117,18 +18522,22 @@ var ts; return t; }; } - function createInferenceMapper(context) { - var mapper = function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); + function getInferenceMapper(context) { + if (!context.mapper) { + var mapper = function (t) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + context.inferences[i].isFixed = true; + return getInferredType(context, i); + } } - } - return t; - }; - mapper.context = context; - return mapper; + return t; + }; + mapper.context = context; + context.mapper = mapper; + } + return context.mapper; } function identityMapper(type) { return type; @@ -18136,33 +18545,42 @@ var ts; function combineTypeMappers(mapper1, mapper2) { return function (t) { return instantiateType(mapper1(t), mapper2); }; } - function instantiateTypeParameter(typeParameter, mapper) { + function cloneTypeParameter(typeParameter) { var result = createType(512 /* TypeParameter */); result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); + result.target = typeParameter; + return result; + } + function cloneTypePredicate(predicate, mapper) { + if (ts.isIdentifierTypePredicate(predicate)) { + return { + kind: 1 /* Identifier */, + parameterName: predicate.parameterName, + parameterIndex: predicate.parameterIndex, + type: instantiateType(predicate.type, mapper) + }; } else { - result.target = typeParameter; - result.mapper = mapper; + return { + kind: 0 /* This */, + type: instantiateType(predicate.type, mapper) + }; } - return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + // First create a fresh set of type parameters, then include a mapping from the old to the + // new type parameters in the mapper function. Finally store this mapper in the new type + // parameters such that we can use it when instantiating constraints. + freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) { + var tp = freshTypeParameters_1[_i]; + tp.mapper = mapper; + } } - if (signature.typePredicate) { - freshTypePredicate = { - parameterName: signature.typePredicate.parameterName, - parameterIndex: signature.typePredicate.parameterIndex, - type: instantiateType(signature.typePredicate.type, mapper) - }; - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), instantiateType(signature.resolvedReturnType, mapper), signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); result.target = signature; result.mapper = mapper; return result; @@ -18226,6 +18644,10 @@ var ts; if (type.flags & 32768 /* Intersection */) { return getIntersectionType(instantiateList(type.types, mapper, instantiateType)); } + if (type.flags & 134217728 /* PredicateType */) { + var predicate = type.predicate; + return createPredicateType(type.symbol, cloneTypePredicate(predicate, mapper)); + } } return type; } @@ -18234,25 +18656,25 @@ var ts; function isContextSensitive(node) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return node.operatorToken.kind === 52 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return isContextSensitive(node.initializer); case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -18278,7 +18700,7 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); } - function compareTypes(source, target) { + function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { @@ -18293,10 +18715,84 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined); + /** + * See signatureRelatedTo, compareSignaturesIdentical + */ + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + // TODO (drosen): De-duplicate code between related functions. + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N + source = getErasedSignature(source); + target = getErasedSignature(target); + var sourceMax = getNumNonRestParameters(source); + var targetMax = getNumNonRestParameters(target); + var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + if (!related) { + return false; + } + } + if (!ignoreReturnTypes) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return true; + } + var sourceReturnType = getReturnTypeOfSignature(source); + // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions + if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { + if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { + return false; + } + } + return isTypeAssignableTo(sourceReturnType, targetReturnType); + } + return true; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + var erasedSource = getErasedSignature(implementation); + var erasedTarget = getErasedSignature(overload); + // First see if the return types are compatible in either direction. + var sourceReturnType = getReturnTypeOfSignature(erasedSource); + var targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType + || checkTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation, /*errorNode*/ undefined) + || checkTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation, /*errorNode*/ undefined)) { + return isSignatureAssignableTo(erasedSource, erasedTarget, /*ignoreReturnTypes*/ true); + } + return false; + } + function getNumNonRestParameters(signature) { + var numParams = signature.parameters.length; + return signature.hasRestParameter ? + numParams - 1 : + numParams; + } + function getNumParametersToCheckForSignatureRelatability(source, sourceNonRestParamCount, target, targetNonRestParamCount) { + if (source.hasRestParameter === target.hasRestParameter) { + if (source.hasRestParameter) { + // If both have rest parameters, get the max and add 1 to + // compensate for the rest parameter. + return Math.max(sourceNonRestParamCount, targetNonRestParamCount) + 1; + } + else { + return Math.min(sourceNonRestParamCount, targetNonRestParamCount); + } + } + else { + // Return the count for whichever signature doesn't have rest parameters. + return source.hasRestParameter ? + targetNonRestParamCount : + sourceNonRestParamCount; + } } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). @@ -18370,6 +18866,11 @@ var ts; return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) return -1 /* True */; + if (source.flags & 128 /* Enum */ && target.flags & 128 /* Enum */) { + if (result = enumRelatedTo(source, target)) { + return result; + } + } if (source.flags & 256 /* StringLiteral */ && target === stringType) return -1 /* True */; if (relation === assignableRelation) { @@ -18378,6 +18879,36 @@ var ts; if (source === numberType && target.flags & 128 /* Enum */) return -1 /* True */; } + if (source.flags & 8 /* Boolean */ && target.flags & 8 /* Boolean */) { + if (source.flags & 134217728 /* PredicateType */ && target.flags & 134217728 /* PredicateType */) { + var sourcePredicate = source; + var targetPredicate = target; + if (sourcePredicate.predicate.kind !== targetPredicate.predicate.kind) { + if (reportErrors) { + reportError(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + if (sourcePredicate.predicate.kind === 1 /* Identifier */) { + var sourceIdentifierPredicate = sourcePredicate.predicate; + var targetIdentifierPredicate = targetPredicate.predicate; + if (sourceIdentifierPredicate.parameterIndex !== targetIdentifierPredicate.parameterIndex) { + if (reportErrors) { + reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceIdentifierPredicate.parameterName, targetIdentifierPredicate.parameterName); + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + } + var related = isRelatedTo(sourcePredicate.predicate.type, targetPredicate.predicate.type, reportErrors, headMessage); + if (related === 0 /* False */ && reportErrors) { + reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typeToString(source), typeToString(target)); + } + return related; + } + return -1 /* True */; + } if (source.flags & 1048576 /* FreshObjectLiteral */) { if (hasExcessProperties(source, target, reportErrors)) { if (reportErrors) { @@ -18471,9 +19002,6 @@ var ts; } return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - return typeParameterIdenticalTo(source, target); - } if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */ || source.flags & 32768 /* Intersection */ && target.flags & 32768 /* Intersection */) { if (result = eachTypeRelatedToSomeType(source, target)) { @@ -18529,7 +19057,7 @@ var ts; var sourceTypes = source.types; for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) { var sourceType = sourceTypes_1[_i]; - var related = typeRelatedToSomeType(sourceType, target, false); + var related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false); if (!related) { return 0 /* False */; } @@ -18589,8 +19117,9 @@ var ts; if (sources.length !== targets.length && relation === identityRelation) { return 0 /* False */; } + var length = sources.length <= targets.length ? sources.length : targets.length; var result = -1 /* True */; - for (var i = 0; i < targets.length; i++) { + for (var i = 0; i < length; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0 /* False */; @@ -18599,31 +19128,24 @@ var ts; } return result; } - function typeParameterIdenticalTo(source, target) { - // covers case when both type parameters does not have constraint (both equal to noConstraintType) - if (source.constraint === target.constraint) { - return -1 /* True */; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0 /* False */; - } - return isIdenticalTo(source.constraint, target.constraint); - } // Determine if two object types are related by structure. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(apparentSource, originalSource, target, reportErrors) { + function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0 /* False */; } - var id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id; + var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - // If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate - // errors, we can use the cached value. Otherwise, recompute the relation - if (!elaborateErrors || (related === 3 /* FailedAndReported */)) { + if (elaborateErrors && related === 2 /* Failed */) { + // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported + // failure and continue computing the relation such that errors get reported. + relation[id] = 3 /* FailedAndReported */; + } + else { return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } @@ -18645,13 +19167,13 @@ var ts; maybeStack = []; expandingFlags = 0; } - sourceStack[depth] = apparentSource; + sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; maybeStack[depth][id] = 1 /* Succeeded */; depth++; var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2; @@ -18660,15 +19182,15 @@ var ts; result = 1 /* Maybe */; } else { - result = propertiesRelatedTo(apparentSource, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 0 /* Call */, reportErrors); + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, 1 /* Construct */, reportErrors); + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); if (result) { - result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= stringIndexTypesRelatedTo(source, originalSource, target, reportErrors); if (result) { - result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= numberIndexTypesRelatedTo(source, originalSource, target, reportErrors); } } } @@ -18800,75 +19322,51 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length && + isAbstractConstructorType(source) && !isAbstractConstructorType(target)) { + // An abstract constructor type is not assignable to a non-abstract constructor type + // as it would otherwise be possible to new an abstract class. Note that the assignablity + // check we perform for an extends clause excludes construct signatures from the target, + // so this check never proceeds. + if (reportErrors) { + reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0 /* False */; + } var result = -1 /* True */; var saveErrorInfo = errorInfo; - if (kind === 1 /* Construct */) { - // Only want to compare the construct signatures for abstractness guarantees. - // Because the "abstractness" of a class is the same across all construct signatures - // (internally we are checking the corresponding declaration), it is enough to perform - // the check and report an error once over all pairs of source and target construct signatures. - // - // sourceSig and targetSig are (possibly) undefined. - // - // Note that in an extends-clause, targetSignatures is stripped, so the check never proceeds. - var sourceSig = sourceSignatures[0]; - var targetSig = targetSignatures[0]; - result &= abstractSignatureRelatedTo(source, sourceSig, target, targetSig); - if (result !== -1 /* True */) { - return result; - } - } outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; if (!t.hasStringLiterals || target.flags & 262144 /* FromSignature */) { - var localErrors = reportErrors; - var checkedAbstractAssignability = false; + // Only elaborate errors from the first failure + var shouldElaborateErrors = reportErrors; for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { var s = sourceSignatures_1[_a]; if (!s.hasStringLiterals || source.flags & 262144 /* FromSignature */) { - var related = signatureRelatedTo(s, t, localErrors); + var related = signatureRelatedTo(s, t, shouldElaborateErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } - // Only report errors from the first failure - localErrors = false; + shouldElaborateErrors = false; } } + // don't elaborate the primitive apparent types (like Number) + // because the actual primitives will have already been reported. + if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); + } return 0 /* False */; } } return result; - function abstractSignatureRelatedTo(source, sourceSig, target, targetSig) { - if (sourceSig && targetSig) { - var sourceDecl = source.symbol && getClassLikeDeclarationOfSymbol(source.symbol); - var targetDecl = target.symbol && getClassLikeDeclarationOfSymbol(target.symbol); - if (!sourceDecl) { - // If the source object isn't itself a class declaration, it can be freely assigned, regardless - // of whether the constructed object is abstract or not. - return -1 /* True */; - } - var sourceErasedSignature = getErasedSignature(sourceSig); - var targetErasedSignature = getErasedSignature(targetSig); - var sourceReturnType = sourceErasedSignature && getReturnTypeOfSignature(sourceErasedSignature); - var targetReturnType = targetErasedSignature && getReturnTypeOfSignature(targetErasedSignature); - var sourceReturnDecl = sourceReturnType && sourceReturnType.symbol && getClassLikeDeclarationOfSymbol(sourceReturnType.symbol); - var targetReturnDecl = targetReturnType && targetReturnType.symbol && getClassLikeDeclarationOfSymbol(targetReturnType.symbol); - var sourceIsAbstract = sourceReturnDecl && sourceReturnDecl.flags & 128 /* Abstract */; - var targetIsAbstract = targetReturnDecl && targetReturnDecl.flags & 128 /* Abstract */; - if (sourceIsAbstract && !(targetIsAbstract && targetDecl)) { - // if target isn't a class-declaration type, then it can be new'd, so we forbid the assignment. - if (reportErrors) { - reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); - } - return 0 /* False */; - } - } - return -1 /* True */; - } } + /** + * See signatureAssignableTo, signatureAssignableTo + */ function signatureRelatedTo(source, target, reportErrors) { + // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; } @@ -18905,7 +19403,7 @@ var ts; var saveErrorInfo = errorInfo; var related = isRelatedTo(s, t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(t, s, /*reportErrors*/ false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -18916,37 +19414,20 @@ var ts; } result &= related; } - if (source.typePredicate && target.typePredicate) { - var hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex; - var hasDifferentTypes; - if (hasDifferentParameterIndex || - (hasDifferentTypes = !isTypeIdenticalTo(source.typePredicate.type, target.typePredicate.type))) { + var targetReturnType = getReturnTypeOfSignature(target); + if (targetReturnType === voidType) { + return result; + } + var sourceReturnType = getReturnTypeOfSignature(source); + // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions + if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { + if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { if (reportErrors) { - var sourceParamText = source.typePredicate.parameterName; - var targetParamText = target.typePredicate.parameterName; - var sourceTypeText = typeToString(source.typePredicate.type); - var targetTypeText = typeToString(target.typePredicate.type); - if (hasDifferentParameterIndex) { - reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceParamText, targetParamText); - } - else if (hasDifferentTypes) { - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, sourceTypeText, targetTypeText); - } - reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, sourceParamText + " is " + sourceTypeText, targetParamText + " is " + targetTypeText); + reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); } return 0 /* False */; } } - else if (!source.typePredicate && target.typePredicate) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) - return result; - var sourceReturnType = getReturnTypeOfSignature(source); return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); } function signaturesIdenticalTo(source, target, kind) { @@ -18956,8 +19437,8 @@ var ts; return 0 /* False */; } var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - var related = compareSignatures(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); + for (var i = 0, len = sourceSignatures.length; i < len; i++) { + var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return 0 /* False */; } @@ -19016,7 +19497,7 @@ var ts; var related; if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); @@ -19042,6 +19523,38 @@ var ts; } return 0 /* False */; } + function enumRelatedTo(source, target) { + if (source.symbol.name !== target.symbol.name || + source.symbol.flags & 128 /* ConstEnum */ || + target.symbol.flags & 128 /* ConstEnum */) { + return 0 /* False */; + } + var targetEnumType = getTypeOfSymbol(target.symbol); + for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { + var property = _a[_i]; + if (property.flags & 8 /* EnumMember */) { + var targetProperty = getPropertyOfType(targetEnumType, property.name); + if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); + return 0 /* False */; + } + } + } + return -1 /* True */; + } + } + // Return true if the given type is the constructor type for an abstract class + function isAbstractConstructorType(type) { + if (type.flags & 65536 /* Anonymous */) { + var symbol = type.symbol; + if (symbol && symbol.flags & 32 /* Class */) { + var declaration = getClassLikeDeclarationOfSymbol(symbol); + if (declaration && declaration.flags & 128 /* Abstract */) { + return true; + } + } + } + return false; } // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, @@ -19065,7 +19578,7 @@ var ts; return false; } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; } function compareProperties(sourceProp, targetProp, compareTypes) { // Two members are considered identical when @@ -19108,33 +19621,30 @@ var ts; } return false; } - function compareSignatures(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + /** + * See signatureRelatedTo, compareSignaturesIdentical + */ + function compareSignaturesIdentical(source, target, partialMatch, ignoreReturnTypes, compareTypes) { + // TODO (drosen): De-duplicate code between related functions. if (source === target) { return -1 /* True */; } if (!(isMatchingSignature(source, target, partialMatch))) { return 0 /* False */; } - var result = -1 /* True */; - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return 0 /* False */; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); - if (!related) { - return 0 /* False */; - } - result &= related; - } - } - else if (source.typeParameters || target.typeParameters) { + // Check that the two signatures have the same number of type parameters. We might consider + // also checking that any type parameter constraints match, but that would require instantiating + // the constraints with a common set of type arguments to get relatable entities in places where + // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile, + // particularly as we're comparing erased versions of the signatures below. + if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) { return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; var targetLen = target.parameters.length; for (var i = 0; i < targetLen; i++) { var s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); @@ -19262,10 +19772,13 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 6291456 /* RequiresWidening */) { + if (type.flags & 140509184 /* RequiresWidening */) { if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } + if (type.flags & 134217728 /* PredicateType */) { + return booleanType; + } if (type.flags & 524288 /* ObjectLiteral */) { return getWidenedTypeOfObjectLiteral(type); } @@ -19340,13 +19853,13 @@ var ts; ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -19393,13 +19906,7 @@ var ts; } } function createInferenceContext(typeParameters, inferUnionTypes) { - var inferences = []; - for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { - var unused = typeParameters_1[_i]; - inferences.push({ - primary: undefined, secondary: undefined, isFixed: false - }); - } + var inferences = ts.map(typeParameters, createTypeInferencesObject); return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -19407,6 +19914,13 @@ var ts; inferredTypes: new Array(typeParameters.length) }; } + function createTypeInferencesObject() { + return { + primary: undefined, + secondary: undefined, + isFixed: false + }; + } function inferTypes(context, source, target) { var sourceStack; var targetStack; @@ -19422,6 +19936,29 @@ var ts; return false; } function inferFromTypes(source, target) { + if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */ || + source.flags & 32768 /* Intersection */ && target.flags & 32768 /* Intersection */) { + // Source and target are both unions or both intersections. First, find each + // target constituent type that has an identically matching source constituent + // type, and for each such target constituent type infer from the type to itself. + // When inferring from a type to itself we effectively find all type parameter + // occurrences within that type and infer themselves as their type arguments. + var matchingTypes; + for (var _i = 0, _a = target.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (typeIdenticalToSomeType(t, source.types)) { + (matchingTypes || (matchingTypes = [])).push(t); + inferFromTypes(t, t); + } + } + // Next, to improve the quality of inferences, reduce the source and target types by + // removing the identically matched constituents. For example, when inferring from + // 'string | string[]' to 'string | T' we reduce the types to 'string[]' and 'T'. + if (matchingTypes) { + source = removeTypesFromUnionOrIntersection(source, matchingTypes); + target = removeTypesFromUnionOrIntersection(target, matchingTypes); + } + } if (target.flags & 512 /* TypeParameter */) { // If target is a type parameter, make an inference, unless the source type contains // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions). @@ -19463,6 +20000,11 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } + else if (source.flags & 134217728 /* PredicateType */ && target.flags & 134217728 /* PredicateType */) { + if (source.predicate.kind === target.predicate.kind) { + inferFromTypes(source.predicate.type, target.predicate.type); + } + } else if (source.flags & 8192 /* Tuple */ && target.flags & 8192 /* Tuple */ && source.elementTypes.length === target.elementTypes.length) { // If source and target are tuples of the same size, infer from element types var sourceTypes = source.elementTypes; @@ -19476,8 +20018,8 @@ var ts; var typeParameterCount = 0; var typeParameter; // First infer to each type in union or intersection that isn't a type parameter - for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { - var t = targetTypes_2[_i]; + for (var _b = 0, targetTypes_2 = targetTypes; _b < targetTypes_2.length; _b++) { + var t = targetTypes_2[_b]; if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -19499,16 +20041,18 @@ var ts; else if (source.flags & 49152 /* UnionOrIntersection */) { // Source is a union or intersection type, infer from each consituent type var sourceTypes = source.types; - for (var _a = 0, sourceTypes_3 = sourceTypes; _a < sourceTypes_3.length; _a++) { - var sourceType = sourceTypes_3[_a]; + for (var _c = 0, sourceTypes_3 = sourceTypes; _c < sourceTypes_3.length; _c++) { + var sourceType = sourceTypes_3[_c]; inferFromTypes(sourceType, target); } } else { source = getApparentType(source); - if (source.flags & 80896 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || - (target.flags & 65536 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */))) { - // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members + if (source.flags & 80896 /* ObjectType */ && (target.flags & 4096 /* Reference */ && target.typeArguments || + target.flags & 8192 /* Tuple */ || + target.flags & 65536 /* Anonymous */ && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */))) { + // If source is an object type, and target is a type reference with type arguments, a tuple type, + // the type of a method, or a type literal, infer from members if (isInProcess(source, target)) { return; } @@ -19554,17 +20098,7 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromTypes); - if (source.typePredicate && target.typePredicate) { - if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) { - // Return types from type predicates are treated as booleans. In order to infer types - // from type predicates we would need to infer using the type within the type predicate - // (i.e. 'Foo' from 'x is Foo'). - inferFromTypes(source.typePredicate.type, target.typePredicate.type); - } - } - else { - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } function inferFromIndexTypes(source, target, sourceKind, targetKind) { var targetIndexType = getIndexTypeOfType(target, targetKind); @@ -19576,6 +20110,29 @@ var ts; } } } + function typeIdenticalToSomeType(type, types) { + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; + if (isTypeIdenticalTo(t, type)) { + return true; + } + } + return false; + } + /** + * Return a new union or intersection type computed by removing a given set of types + * from a given union or intersection type. + */ + function removeTypesFromUnionOrIntersection(type, typesToRemove) { + var reducedTypes = []; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (!typeIdenticalToSomeType(t, typesToRemove)) { + reducedTypes.push(t); + } + } + return type.flags & 16384 /* Union */ ? getUnionType(reducedTypes, /*noSubtypeReduction*/ true) : getIntersectionType(reducedTypes); + } function getInferenceCandidates(context, index) { var inferences = context.inferences[index]; return inferences.primary || inferences.secondary || emptyArray; @@ -19599,10 +20156,16 @@ var ts; inferredType = emptyObjectType; inferenceSucceeded = true; } + context.inferredTypes[index] = inferredType; // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + if (constraint) { + var instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); + if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + context.inferredTypes[index] = inferredType = instantiatedConstraint; + } + } } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). @@ -19610,7 +20173,6 @@ var ts; // So if this failure is on preceding type parameter, this type parameter is the new failure index. context.failedTypeParameterIndex = index; } - context.inferredTypes[index] = inferredType; } return inferredType; } @@ -19620,9 +20182,6 @@ var ts; } return context.inferredTypes; } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } // EXPRESSION TYPE CHECKING function getResolvedSymbol(node) { var links = getNodeLinks(node); @@ -19649,26 +20208,6 @@ var ts; } ts.Debug.fail("should not get here"); } - // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) - // or not of the given type kind (when isOfTypeKind is false) - function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384 /* Union */) { - var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - // Above we checked if we have anything to remove, now use the opposite test to do the removal - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types - // are represented ever changes. - return getUnionType(emptyArray); - } - return type; - } function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } @@ -19687,10 +20226,7 @@ var ts; return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 56 /* FirstAssignment */ && node.operatorToken.kind <= 68 /* LastAssignment */) { - var n = node.left; - while (n.kind === 172 /* ParenthesizedExpression */) { - n = n.expression; - } + var n = skipParenthesizedNodes(node.left); if (n.kind === 69 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } @@ -19705,55 +20241,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: - case 172 /* ParenthesizedExpression */: - case 179 /* PrefixUnaryExpression */: - case 175 /* DeleteExpression */: - case 178 /* AwaitExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 180 /* PostfixUnaryExpression */: - case 184 /* YieldExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 192 /* Block */: - case 193 /* VariableStatement */: - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 204 /* ReturnStatement */: - case 205 /* WithStatement */: - case 206 /* SwitchStatement */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - case 235 /* JsxOpeningElement */: - case 240 /* JsxExpression */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: + case 166 /* ArrayLiteralExpression */: + case 167 /* ObjectLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: + case 174 /* ParenthesizedExpression */: + case 181 /* PrefixUnaryExpression */: + case 177 /* DeleteExpression */: + case 180 /* AwaitExpression */: + case 178 /* TypeOfExpression */: + case 179 /* VoidExpression */: + case 182 /* PostfixUnaryExpression */: + case 186 /* YieldExpression */: + case 184 /* ConditionalExpression */: + case 187 /* SpreadElementExpression */: + case 194 /* Block */: + case 195 /* VariableStatement */: + case 197 /* ExpressionStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 206 /* ReturnStatement */: + case 207 /* WithStatement */: + case 208 /* SwitchStatement */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: + case 209 /* LabeledStatement */: + case 210 /* ThrowStatement */: + case 211 /* TryStatement */: + case 246 /* CatchClause */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + case 237 /* JsxOpeningElement */: + case 242 /* JsxExpression */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -19765,59 +20301,73 @@ var ts; // Only narrow when symbol is variable of type any or an object, union, or type parameter type if (node && symbol.flags & 3 /* Variable */) { if (isTypeAny(type) || type.flags & (80896 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { + var declaration = ts.getDeclarationOfKind(symbol, 213 /* VariableDeclaration */); + var top_1 = declaration && getDeclarationContainer(declaration); + var originalType = type; + var nodeStack = []; loop: while (node.parent) { var child = node; node = node.parent; - var narrowedType = type; switch (node.kind) { - case 196 /* IfStatement */: - // In a branch of an if statement, narrow based on controlling expression - if (child !== node.expression) { - narrowedType = narrowType(type, node.expression, /*assumeTrue*/ child === node.thenStatement); - } + case 198 /* IfStatement */: + case 184 /* ConditionalExpression */: + case 183 /* BinaryExpression */: + nodeStack.push({ node: node, child: child }); break; - case 182 /* ConditionalExpression */: - // In a branch of a conditional expression, narrow based on controlling condition - if (child !== node.condition) { - narrowedType = narrowType(type, node.condition, /*assumeTrue*/ child === node.whenTrue); - } - break; - case 181 /* BinaryExpression */: - // In the right operand of an && or ||, narrow based on left operand - if (child === node.right) { - if (node.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { - narrowedType = narrowType(type, node.left, /*assumeTrue*/ true); - } - else if (node.operatorToken.kind === 52 /* BarBarToken */) { - narrowedType = narrowType(type, node.left, /*assumeTrue*/ false); - } - } - break; - case 248 /* SourceFile */: - case 218 /* ModuleDeclaration */: - case 213 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - // Stop at the first containing function or module declaration + case 250 /* SourceFile */: + case 220 /* ModuleDeclaration */: + // Stop at the first containing file or module declaration break loop; } - // Use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; + if (node === top_1) { + break; } } + var nodes; + while (nodes = nodeStack.pop()) { + var node_1 = nodes.node, child = nodes.child; + switch (node_1.kind) { + case 198 /* IfStatement */: + // In a branch of an if statement, narrow based on controlling expression + if (child !== node_1.expression) { + type = narrowType(type, node_1.expression, /*assumeTrue*/ child === node_1.thenStatement); + } + break; + case 184 /* ConditionalExpression */: + // In a branch of a conditional expression, narrow based on controlling condition + if (child !== node_1.condition) { + type = narrowType(type, node_1.condition, /*assumeTrue*/ child === node_1.whenTrue); + } + break; + case 183 /* BinaryExpression */: + // In the right operand of an && or ||, narrow based on left operand + if (child === node_1.right) { + if (node_1.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { + type = narrowType(type, node_1.left, /*assumeTrue*/ true); + } + else if (node_1.operatorToken.kind === 52 /* BarBarToken */) { + type = narrowType(type, node_1.left, /*assumeTrue*/ false); + } + } + break; + default: + ts.Debug.fail("Unreachable!"); + } + // Use original type if construct contains assignments to variable + if (type !== originalType && isVariableAssignedWithin(symbol, node_1)) { + type = originalType; + } + } + // Preserve old top-level behavior - if the branch is really an empty set, revert to prior type + if (type === emptyUnionType) { + type = originalType; + } } } return type; function narrowTypeByEquality(type, expr, assumeTrue) { // Check that we have 'typeof ' on the left and string literal on the right - if (expr.left.kind !== 176 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { + if (expr.left.kind !== 178 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { return type; } var left = expr.left; @@ -19825,31 +20375,34 @@ var ts; if (left.expression.kind !== 69 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) { return type; } - var typeInfo = primitiveTypeInfo[right.text]; if (expr.operatorToken.kind === 33 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } - if (assumeTrue) { - // Assumed result is true. If check was not for a primitive type, remove all primitive types - if (!typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ 258 /* StringLike */ | 132 /* NumberLike */ | 8 /* Boolean */ | 16777216 /* ESSymbol */, - /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Check was for a primitive type, return that primitive type if it is a subtype - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is - // union of enum types and other types. - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ false, /*allowEmptyUnionResult*/ false); + var typeInfo = primitiveTypeInfo[right.text]; + // Don't narrow `undefined` + if (typeInfo && typeInfo.type === undefinedType) { + return type; + } + // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive + if (!!(type.flags & 1 /* Any */) && typeInfo && assumeTrue) { + return typeInfo.type; + } + var flags; + if (typeInfo) { + flags = typeInfo.flags; } else { - // Assumed result is false. If check was for a primitive type, remove that primitive type - if (typeInfo) { - return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ true, /*allowEmptyUnionResult*/ false); - } - // Otherwise we don't have enough information to do anything. - return type; + assumeTrue = !assumeTrue; + flags = 132 /* NumberLike */ | 258 /* StringLike */ | 16777216 /* ESSymbol */ | 8 /* Boolean */; + } + // At this point we can bail if it's not a union + if (!(type.flags & 16384 /* Union */)) { + // If the active non-union type would be removed from a union by this type guard, return an empty union + return filterUnion(type) ? type : emptyUnionType; + } + return getUnionType(ts.filter(type.types, filterUnion), /*noSubtypeReduction*/ true); + function filterUnion(type) { + return assumeTrue === !!(type.flags & flags); } } function narrowTypeByAnd(type, expr, assumeTrue) { @@ -19862,7 +20415,7 @@ var ts; // and the second operand was false. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ false), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ false) + narrowType(type, expr.right, /*assumeTrue*/ false) ]); } } @@ -19872,7 +20425,7 @@ var ts; // and the second operand was true. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, /*assumeTrue*/ true), - narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ true) + narrowType(type, expr.right, /*assumeTrue*/ true) ]); } else { @@ -19913,17 +20466,17 @@ var ts; } } if (targetType) { - if (!assumeTrue) { - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, targetType); })); - } - return type; - } - return getNarrowedType(type, targetType); + return getNarrowedType(type, targetType, assumeTrue); } return type; } - function getNarrowedType(originalType, narrowedTypeCandidate) { + function getNarrowedType(originalType, narrowedTypeCandidate, assumeTrue) { + if (!assumeTrue) { + if (originalType.flags & 16384 /* Union */) { + return getUnionType(ts.filter(originalType.types, function (t) { return !isTypeSubtypeOf(t, narrowedTypeCandidate); })); + } + return originalType; + } // If the current type is a union type, remove all constituents that aren't assignable to target. If that produces // 0 candidates, fall back to the assignability check if (originalType.flags & 16384 /* Union */) { @@ -19943,28 +20496,62 @@ var ts; return type; } var signature = getResolvedSignature(expr); - if (signature.typePredicate && - expr.arguments[signature.typePredicate.parameterIndex] && - getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { - if (!assumeTrue) { - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, signature.typePredicate.type); })); - } - return type; + var predicateType = getReturnTypeOfSignature(signature); + if (!predicateType || !(predicateType.flags & 134217728 /* PredicateType */)) { + return type; + } + var predicate = predicateType.predicate; + if (ts.isIdentifierTypePredicate(predicate)) { + var callExpression = expr; + if (callExpression.arguments[predicate.parameterIndex] && + getSymbolAtTypePredicatePosition(callExpression.arguments[predicate.parameterIndex]) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); } - return getNarrowedType(type, signature.typePredicate.type); + } + else { + var expression = skipParenthesizedNodes(expr.expression); + return narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue); } return type; } + function narrowTypeByTypePredicateMember(type, expr, assumeTrue) { + if (type.flags & 1 /* Any */) { + return type; + } + var memberType = getTypeOfExpression(expr); + if (!(memberType.flags & 134217728 /* PredicateType */)) { + return type; + } + return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); + } + function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { + if (expression.kind === 169 /* ElementAccessExpression */ || expression.kind === 168 /* PropertyAccessExpression */) { + var accessExpression = expression; + var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); + if (possibleIdentifier.kind === 69 /* Identifier */ && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { + return getNarrowedType(type, predicate.type, assumeTrue); + } + } + return type; + } + function getSymbolAtTypePredicatePosition(expr) { + expr = skipParenthesizedNodes(expr); + switch (expr.kind) { + case 69 /* Identifier */: + case 168 /* PropertyAccessExpression */: + case 135 /* QualifiedName */: + return getSymbolOfEntityNameOrPropertyAccessExpression(expr); + } + } // Narrow the given type based on the given expression having the assumed boolean value. The returned type // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 168 /* CallExpression */: + case 170 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 32 /* EqualsEqualsEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -19979,15 +20566,24 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: if (expr.operator === 49 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 169 /* ElementAccessExpression */: + case 168 /* PropertyAccessExpression */: + return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } + function skipParenthesizedNodes(expression) { + while (expression.kind === 174 /* ParenthesizedExpression */) { + expression = expression.expression; + } + return expression; + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. @@ -19998,7 +20594,7 @@ var ts; // can explicitly bound arguments objects if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 174 /* ArrowFunction */) { + if (container.kind === 176 /* ArrowFunction */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -20029,7 +20625,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 244 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 246 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -20045,12 +20641,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container container = symbol.valueDeclaration; - while (container.kind !== 212 /* VariableDeclarationList */) { + while (container.kind !== 214 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 193 /* VariableStatement */) { + if (container.kind === 195 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -20085,17 +20681,17 @@ var ts; var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 174 /* ArrowFunction */) { + if (container.kind === 176 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; @@ -20121,6 +20717,21 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } + // If this is a function in a JS file, it might be a class method. Check if it's the RHS + // of a x.prototype.y = function [name]() { .... } + if (ts.isInJavaScriptFile(node) && container.kind === 175 /* FunctionExpression */) { + if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { + // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') + var className = container.parent // x.protoype.y = f + .left // x.prototype.y + .expression // x.prototype + .expression; // x + var classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { + return getInferredClassType(classSymbol); + } + } + } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { @@ -20132,55 +20743,75 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 168 /* CallExpression */ && node.parent.expression === node; - var classDeclaration = ts.getContainingClass(node); - var classType = classDeclaration && getDeclaredTypeOfSymbol(getSymbolOfNode(classDeclaration)); - var baseClassType = classType && getBaseTypes(classType)[0]; - var container = ts.getSuperContainer(node, /*includeFunctions*/ true); + var isCallExpression = node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; if (!isCallExpression) { // adjust the container reference in case if super is used inside arrow functions with arbitrary deep nesting - while (container && container.kind === 174 /* ArrowFunction */) { - container = ts.getSuperContainer(container, /*includeFunctions*/ true); + while (container && container.kind === 176 /* ArrowFunction */) { + container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } } var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; - // always set NodeCheckFlags for 'super' expression node - if (canUseSuperExpression) { - if ((container.flags & 64 /* Static */) || isCallExpression) { - nodeCheckFlag = 512 /* SuperStatic */; - } - else { - nodeCheckFlag = 256 /* SuperInstance */; - } - getNodeLinks(node).flags |= nodeCheckFlag; - if (needToCaptureLexicalThis) { - // call expressions are allowed only in constructors so they should always capture correct 'this' - // super property access expressions can also appear in arrow functions - - // in this case they should also use correct lexical this - captureLexicalThis(node.parent, container); - } - } - if (!baseClassType) { - if (!classDeclaration || !ts.getClassExtendsHeritageClauseElement(classDeclaration)) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - } - return unknownType; - } if (!canUseSuperExpression) { - if (container && container.kind === 136 /* ComputedPropertyName */) { + // issue more specific error if super is used in computed property name + // class A { foo() { return "1" }} + // class B { + // [super.foo()]() {} + // } + var current = node; + while (current && current !== container && current.kind !== 136 /* ComputedPropertyName */) { + current = current.parent; + } + if (current && current.kind === 136 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return unknownType; } + if ((container.flags & 64 /* Static */) || isCallExpression) { + nodeCheckFlag = 512 /* SuperStatic */; + } + else { + nodeCheckFlag = 256 /* SuperInstance */; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (needToCaptureLexicalThis) { + // call expressions are allowed only in constructors so they should always capture correct 'this' + // super property access expressions can also appear in arrow functions - + // in this case they should also use correct lexical this + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (languageVersion < 2 /* ES6 */) { + error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return unknownType; + } + else { + // for object literal assume that type of 'super' is 'any' + return anyType; + } + } + // at this point the only legal case for parent is ClassLikeDeclaration + var classLikeDeclaration = container.parent; + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration)); + var baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + } + return unknownType; + } if (container.kind === 144 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); @@ -20203,8 +20834,8 @@ var ts; // 'super' property access is allowed // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor - // topmost container must be something that is directly nested in the class declaration - if (container && ts.isClassLike(container.parent)) { + // topmost container must be something that is directly nested in the class declaration\object literal expression + if (ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */) { if (container.flags & 64 /* Static */) { return container.kind === 143 /* MethodDeclaration */ || container.kind === 142 /* MethodSignature */ || @@ -20327,7 +20958,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 170 /* TaggedTemplateExpression */) { + if (template.parent.kind === 172 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -20350,6 +20981,11 @@ var ts; } return type; } + else if (operator === 51 /* AmpersandAmpersandToken */ || operator === 24 /* CommaToken */) { + if (node === binaryExpression.right) { + return getContextualType(binaryExpression); + } + } return undefined; } // Apply a mapping function to a contextual type and return the resulting type. If the contextual type @@ -20362,8 +20998,8 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var current = types_7[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var current = types_8[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -20449,22 +21085,20 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForJsxExpression(expr) { - // Contextual type only applies to JSX expressions that are in attribute assignments (not in 'Children' positions) - if (expr.parent.kind === 238 /* JsxAttribute */) { - var attrib = expr.parent; - var attrsType = getJsxElementAttributesType(attrib.parent); + function getContextualTypeForJsxAttribute(attribute) { + var kind = attribute.kind; + var jsxElement = attribute.parent; + var attrsType = getJsxElementAttributesType(jsxElement); + if (attribute.kind === 240 /* JsxAttribute */) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } - else { - return getTypeOfPropertyOfType(attrsType, attrib.name.text); - } + return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - if (expr.kind === 239 /* JsxSpreadAttribute */) { - return getJsxElementAttributesType(expr.parent); + else if (attribute.kind === 241 /* JsxSpreadAttribute */) { + return attrsType; } - return undefined; + ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -20499,39 +21133,41 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 138 /* Parameter */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 163 /* BindingElement */: + case 165 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 174 /* ArrowFunction */: - case 204 /* ReturnStatement */: + case 176 /* ArrowFunction */: + case 206 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 190 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 183 /* TemplateExpression */); + case 192 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 185 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return getContextualType(parent); - case 240 /* JsxExpression */: - case 239 /* JsxSpreadAttribute */: - return getContextualTypeForJsxExpression(parent); + case 242 /* JsxExpression */: + return getContextualType(parent); + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + return getContextualTypeForJsxAttribute(parent); } return undefined; } @@ -20547,7 +21183,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 173 /* FunctionExpression */ || node.kind === 174 /* ArrowFunction */; + return node.kind === 175 /* FunctionExpression */ || node.kind === 176 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -20573,15 +21209,15 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var current = types_8[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var current = types_9[_i]; var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { // This signature will contribute to contextual union signature signatureList = [signature]; } - else if (!compareSignatures(signatureList[0], signature, /*partialMatch*/ false, /*ignoreReturnTypes*/ true, compareTypes)) { + else if (!compareSignaturesIdentical(signatureList[0], signature, /*partialMatch*/ false, /*ignoreReturnTypes*/ true, compareTypesIdentical)) { // Signatures aren't identical, do not use return undefined; } @@ -20624,13 +21260,13 @@ var ts; // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 181 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 183 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 245 /* PropertyAssignment */) { + if (parent.kind === 247 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 164 /* ArrayLiteralExpression */) { + if (parent.kind === 166 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -20646,8 +21282,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function hasDefaultValue(node) { - return (node.kind === 163 /* BindingElement */ && !!node.initializer) || - (node.kind === 181 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); + return (node.kind === 165 /* BindingElement */ && !!node.initializer) || + (node.kind === 183 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -20656,7 +21292,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 185 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 187 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -20680,7 +21316,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 185 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 187 /* SpreadElementExpression */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -20695,7 +21331,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 162 /* ArrayBindingPattern */ || pattern.kind === 164 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 164 /* ArrayBindingPattern */ || pattern.kind === 166 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -20703,7 +21339,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 187 /* OmittedExpression */) { + if (patternElement.kind !== 189 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -20775,24 +21411,24 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 161 /* ObjectBindingPattern */ || contextualType.pattern.kind === 165 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 163 /* ObjectBindingPattern */ || contextualType.pattern.kind === 167 /* ObjectLiteralExpression */); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 245 /* PropertyAssignment */ || - memberDecl.kind === 246 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 247 /* PropertyAssignment */ || + memberDecl.kind === 248 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 245 /* PropertyAssignment */) { + if (memberDecl.kind === 247 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 143 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 246 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 248 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -20800,8 +21436,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 245 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 246 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 247 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 248 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912 /* Optional */; } @@ -20893,38 +21529,22 @@ var ts; checkJsxOpeningLikeElement(node); return jsxElementType || anyType; } - function tagNamesAreEquivalent(lhs, rhs) { - if (lhs.kind !== rhs.kind) { - return false; - } - if (lhs.kind === 69 /* Identifier */) { - return lhs.text === rhs.text; - } - return lhs.right.text === rhs.right.text && - tagNamesAreEquivalent(lhs.left, rhs.left); - } function checkJsxElement(node) { // Check attributes checkJsxOpeningLikeElement(node.openingElement); - // Check that the closing tag matches - if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { - error(node.closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNode(node.openingElement.tagName)); - } - else { - // Perform resolution on the closing tag so that rename/go to definition/etc work - getJsxElementTagSymbol(node.closingElement); - } + // Perform resolution on the closing tag so that rename/go to definition/etc work + getJsxElementTagSymbol(node.closingElement); // Check children for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: checkJsxExpression(child); break; - case 233 /* JsxElement */: + case 235 /* JsxElement */: checkJsxElement(child); break; - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } @@ -21006,12 +21626,11 @@ var ts; } return type; } - /// Returns the type JSX.IntrinsicElements. May return `unknownType` if that type is not present. - function getJsxIntrinsicElementsType() { - if (!jsxIntrinsicElementsType) { - jsxIntrinsicElementsType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.IntrinsicElements) || unknownType; + function getJsxType(name) { + if (jsxTypes[name] === undefined) { + return jsxTypes[name] = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType; } - return jsxIntrinsicElementsType; + return jsxTypes[name]; } /// Given a JSX opening element or self-closing element, return the symbol of the property that the tag name points to if /// this is an intrinsic tag. This might be a named @@ -21020,7 +21639,6 @@ var ts; /// type or factory function. /// Otherwise, returns unknownSymbol. function getJsxElementTagSymbol(node) { - var flags = 8 /* UnknownElement */; var links = getNodeLinks(node); if (!links.resolvedSymbol) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -21032,7 +21650,7 @@ var ts; } return links.resolvedSymbol; function lookupIntrinsicTag(node) { - var intrinsicElementsType = getJsxIntrinsicElementsType(); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); if (intrinsicElementsType !== unknownType) { // Property case var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.text); @@ -21060,7 +21678,7 @@ var ts; var valueSymbol = resolveJsxTagName(node); // Look up the value in the current scope if (valueSymbol && valueSymbol !== unknownSymbol) { - links.jsxFlags |= 4 /* ClassElement */; + links.jsxFlags |= 4 /* ValueElement */; if (valueSymbol.flags & 8388608 /* Alias */) { markAliasSymbolAsReferenced(valueSymbol); } @@ -21086,7 +21704,7 @@ var ts; function getJsxElementInstanceType(node) { // There is no such thing as an instance type for a non-class element. This // line shouldn't be hit. - ts.Debug.assert(!!(getNodeLinks(node).jsxFlags & 4 /* ClassElement */), "Should not call getJsxElementInstanceType on non-class Element"); + ts.Debug.assert(!!(getNodeLinks(node).jsxFlags & 4 /* ValueElement */), "Should not call getJsxElementInstanceType on non-class Element"); var classSymbol = getJsxElementTagSymbol(node); if (classSymbol === unknownSymbol) { // Couldn't find the class instance type. Error has already been issued @@ -21108,13 +21726,7 @@ var ts; return unknownType; } } - var returnType = getUnionType(signatures.map(getReturnTypeOfSignature)); - // Issue an error if this return type isn't assignable to JSX.ElementClass - var elemClassType = getJsxGlobalElementClassType(); - if (elemClassType) { - checkTypeRelatedTo(returnType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); - } - return returnType; + return getUnionType(signatures.map(getReturnTypeOfSignature)); } /// e.g. "props" for React.d.ts, /// or 'undefined' if ElementAttributesPropery doesn't exist (which means all @@ -21156,8 +21768,27 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedJsxType) { var sym = getJsxElementTagSymbol(node); - if (links.jsxFlags & 4 /* ClassElement */) { + if (links.jsxFlags & 4 /* ValueElement */) { + // Get the element instance type (the result of newing or invoking this tag) var elemInstanceType = getJsxElementInstanceType(node); + // Is this is a stateless function component? See if its single signature is + // assignable to the JSX Element Type + var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896 /* ObjectType */)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return paramType; + } + // Issue an error if this return type isn't assignable to JSX.ElementClass + var elemClassType = getJsxGlobalElementClassType(); + if (elemClassType) { + checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); + } if (isTypeAny(elemInstanceType)) { return links.resolvedJsxType = elemInstanceType; } @@ -21177,14 +21808,34 @@ var ts; return links.resolvedJsxType = emptyObjectType; } else if (isTypeAny(attributesType) || (attributesType === unknownType)) { + // Props is of type 'any' or unknown return links.resolvedJsxType = attributesType; } - else if (!(attributesType.flags & 80896 /* ObjectType */)) { - error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_must_be_an_object_type, typeToString(attributesType)); + else if (attributesType.flags & 16384 /* Union */) { + // Props cannot be a union type + error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType)); return links.resolvedJsxType = anyType; } else { - return links.resolvedJsxType = attributesType; + // Normal case -- add in IntrinsicClassElements and IntrinsicElements + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + if (typeParams) { + if (typeParams.length === 1) { + apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); + } + } + else { + apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); + } + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return links.resolvedJsxType = apparentAttributesType; } } } @@ -21219,7 +21870,7 @@ var ts; } /// Returns all the properties of the Jsx.IntrinsicElements interface function getJsxIntrinsicTagNames() { - var intrinsics = getJsxIntrinsicElementsType(); + var intrinsics = getJsxType(JsxNames.IntrinsicElements); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; } function checkJsxPreconditions(errorNode) { @@ -21236,14 +21887,13 @@ var ts; function checkJsxOpeningLikeElement(node) { checkGrammarJsxElement(node); checkJsxPreconditions(node); - // If we're compiling under --jsx react, the symbol 'React' should - // be marked as 'used' so we don't incorrectly elide its import. And if there - // is no 'React' symbol in scope, we should issue an error. - if (compilerOptions.jsx === 2 /* React */) { - var reactSym = resolveName(node.tagName, "React", 107455 /* Value */, ts.Diagnostics.Cannot_find_name_0, "React"); - if (reactSym) { - getSymbolLinks(reactSym).referenced = true; - } + // The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there + // is no reactNamespace symbol in scope when targeting React emit, we should issue an error. + var reactRefErr = compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; + var reactSym = resolveName(node.tagName, reactNamespace, 107455 /* Value */, reactRefErr, reactNamespace); + if (reactSym) { + getSymbolLinks(reactSym).referenced = true; } var targetAttributesType = getJsxElementAttributesType(node); var nameTable = {}; @@ -21252,11 +21902,11 @@ var ts; // thus should have their types ignored var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 238 /* JsxAttribute */) { + if (node.attributes[i].kind === 240 /* JsxAttribute */) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 239 /* JsxSpreadAttribute */); + ts.Debug.assert(node.attributes[i].kind === 241 /* JsxSpreadAttribute */); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -21303,7 +21953,7 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95 /* SuperKeyword */) { - var errorNode = node.kind === 166 /* PropertyAccessExpression */ ? + var errorNode = node.kind === 168 /* PropertyAccessExpression */ ? node.name : node.right; // TS 1.0 spec (April 2014): 4.8.2 @@ -21313,7 +21963,7 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { + if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { // `prop` refers to a *property* declared in the super class // rather than a *method*, so it does not satisfy the above criteria. error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); @@ -21400,7 +22050,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 166 /* PropertyAccessExpression */ + var left = node.kind === 168 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); @@ -21416,7 +22066,7 @@ var ts; // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 169 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -21497,7 +22147,7 @@ var ts; if (indexArgumentExpression.kind === 9 /* StringLiteral */ || indexArgumentExpression.kind === 8 /* NumericLiteral */) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 167 /* ElementAccessExpression */ || indexArgumentExpression.kind === 166 /* PropertyAccessExpression */) { + if (indexArgumentExpression.kind === 169 /* ElementAccessExpression */ || indexArgumentExpression.kind === 168 /* PropertyAccessExpression */) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -21552,7 +22202,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (node.kind !== 139 /* Decorator */) { @@ -21621,7 +22271,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 185 /* SpreadElementExpression */) { + if (arg && arg.kind === 187 /* SpreadElementExpression */) { return i; } } @@ -21633,13 +22283,13 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 183 /* TemplateExpression */) { + if (tagExpression.template.kind === 185 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -21665,7 +22315,7 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 169 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 171 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -21717,7 +22367,7 @@ var ts; } function inferTypeArguments(node, signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; - var inferenceMapper = createInferenceMapper(context); + var inferenceMapper = getInferenceMapper(context); // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var i = 0; i < typeParameters.length; i++) { // As an optimization, we don't have to clear (and later recompute) inferred types @@ -21744,7 +22394,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 187 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); // If the effective argument type is 'undefined', there is no synthetic type @@ -21775,14 +22425,11 @@ var ts; } getInferredTypes(context); } - function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors, headMessage) { + function checkTypeArguments(signature, typeArgumentNodes, typeArgumentTypes, reportErrors, headMessage) { var typeParameters = signature.typeParameters; var typeArgumentsAreAssignable = true; + var mapper; for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - // Do not push on this array! It has a preallocated length - typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -21792,7 +22439,11 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); typeArgumentHeadMessage = headMessage; } - typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, typeArgumentHeadMessage, errorInfo); + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + var typeArgument = typeArgumentTypes[i]; + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo); } } } @@ -21803,7 +22454,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 187 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); @@ -21811,7 +22462,7 @@ var ts; // for the argument. In that case, we should check the argument. if (argType === undefined) { argType = arg.kind === 9 /* StringLiteral */ && !reportErrors - ? getStringLiteralType(arg) + ? getStringLiteralTypeForText(arg.text) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); } // Use argument expression as error location when reporting errors @@ -21835,10 +22486,10 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 170 /* TaggedTemplateExpression */) { + if (node.kind === 172 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 183 /* TemplateExpression */) { + if (template.kind === 185 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -21871,8 +22522,8 @@ var ts; function getEffectiveArgumentCount(node, args, signature) { if (node.kind === 139 /* Decorator */) { switch (node.parent.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; case 141 /* PropertyDeclaration */: @@ -21915,7 +22566,7 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); @@ -21960,7 +22611,7 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } @@ -21984,7 +22635,7 @@ var ts; case 69 /* Identifier */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - return getStringLiteralType(element.name); + return getStringLiteralTypeForText(element.name.text); case 136 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) { @@ -22011,7 +22662,7 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a paramter decorator - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } @@ -22060,7 +22711,7 @@ var ts; if (node.kind === 139 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { return globalTemplateStringsArrayType; } // This is not a synthetic argument, so we return 'undefined' @@ -22073,7 +22724,7 @@ var ts; function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. if (node.kind === 139 /* Decorator */ || - (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */)) { + (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -22086,7 +22737,7 @@ var ts; // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 170 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -22095,7 +22746,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 170 /* TaggedTemplateExpression */; + var isTaggedTemplate = node.kind === 172 /* TaggedTemplateExpression */; var isDecorator = node.kind === 139 /* Decorator */; var typeArguments; if (!isTaggedTemplate && !isDecorator) { @@ -22202,7 +22853,8 @@ var ts; } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], /*reportErrors*/ true, headMessage); + var typeArguments_1 = node.typeArguments; + checkTypeArguments(candidateForTypeArgumentError, typeArguments_1, ts.map(typeArguments_1, getTypeFromTypeNode), /*reportErrors*/ true, headMessage); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -22260,7 +22912,7 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentTypes = ts.map(typeArguments, getTypeFromTypeNode); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { @@ -22441,8 +23093,8 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; case 138 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; @@ -22487,13 +23139,13 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 168 /* CallExpression */) { + if (node.kind === 170 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 169 /* NewExpression */) { + else if (node.kind === 171 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 172 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else if (node.kind === 139 /* Decorator */) { @@ -22505,6 +23157,13 @@ var ts; } return links.resolvedSignature; } + function getInferredClassType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.inferredClassType) { + links.inferredClassType = createAnonymousType(undefined, symbol.members, emptyArray, emptyArray, /*stringIndexType*/ undefined, /*numberIndexType*/ undefined); + } + return links.inferredClassType; + } /** * Syntactically and semantically checks a call or new expression. * @param node The call/new expression to be checked. @@ -22517,14 +23176,20 @@ var ts; if (node.expression.kind === 95 /* SuperKeyword */) { return voidType; } - if (node.kind === 169 /* NewExpression */) { + if (node.kind === 171 /* NewExpression */) { var declaration = signature.declaration; if (declaration && declaration.kind !== 144 /* Constructor */ && declaration.kind !== 148 /* ConstructSignature */ && declaration.kind !== 153 /* ConstructorType */) { - // When resolved signature is a call signature (and not a construct signature) the result type is any - if (compilerOptions.noImplicitAny) { + // When resolved signature is a call signature (and not a construct signature) the result type is any, unless + // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations + // in a JS file + var funcSymbol = checkExpression(node.expression).symbol; + if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */)) { + return getInferredClassType(funcSymbol); + } + else if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -22577,7 +23242,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { if (element.name.kind === 69 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -22642,7 +23307,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 192 /* Block */) { + if (func.body.kind !== 194 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -22755,38 +23420,53 @@ var ts; }); return aggregatedTypes; } - // TypeScript Specification 1.0 (6.3) - July 2014 - // An explicitly typed function whose return type isn't the Void or the Any type - // must have at least one return statement somewhere in its body. - // An exception to this rule is if the function implementation consists of a single 'throw' statement. + /* + *TypeScript Specification 1.0 (6.3) - July 2014 + * An explicitly typed function whose return type isn't the Void or the Any type + * must have at least one return statement somewhere in its body. + * An exception to this rule is if the function implementation consists of a single 'throw' statement. + * @param returnType - return type of the function, can be undefined if return type is not explicitly specified + */ function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { if (!produceDiagnostics) { return; } - // Functions that return 'void' or 'any' don't need any return expressions. + // Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions. if (returnType === voidType || isTypeAny(returnType)) { return; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - // also if HasImplicitReturnValue flags is not set this means that all codepaths in function body end with return of throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 192 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { + // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw + if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { return; } - if (func.flags & 1048576 /* HasExplicitReturn */) { - if (compilerOptions.noImplicitReturns) { - error(func.type, ts.Diagnostics.Not_all_code_paths_return_a_value); - } - } - else { - // This function does not conform to the specification. + var hasExplicitReturn = func.flags & 1048576 /* HasExplicitReturn */; + if (returnType && !hasExplicitReturn) { + // minimal check: function has syntactic return type annotation and no explicit return statements in the body + // this function does not conform to the specification. + // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } + else if (compilerOptions.noImplicitReturns) { + if (!returnType) { + // If return type annotation is omitted check if function has any explicit return statements. + // If it does not have any - its inferred return type is void - don't do any checks. + // Otherwise get inferred return type from function body and report error only if it is not void / anytype + var inferredReturnType = hasExplicitReturn + ? getReturnTypeOfSignature(getSignatureFromDeclaration(func)) + : voidType; + if (inferredReturnType === voidType || isTypeAny(inferredReturnType)) { + return; + } + } + error(func.type || func, ts.Diagnostics.Not_all_code_paths_return_a_value); + } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 173 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 175 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards @@ -22826,6 +23506,7 @@ var ts; } if (!contextChecked) { checkSignatureDeclaration(node); + checkNodeDeferred(node); } } } @@ -22835,19 +23516,16 @@ var ts; } return type; } - function checkFunctionExpressionOrObjectLiteralMethodBody(node) { + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); if (isAsync) { emitAwaiter = true; } - var returnType = node.type && getTypeFromTypeNode(node.type); - var promisedType; - if (returnType && isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - if (returnType && !node.asteriskToken) { - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + if (!node.asteriskToken) { + // return is not necessary in the body of generators + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (node.body) { if (!node.type) { @@ -22858,7 +23536,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 192 /* Block */) { + if (node.body.kind === 194 /* Block */) { checkSourceElement(node.body); } else { @@ -22868,16 +23546,15 @@ var ts; // check assignability of the awaited type of the expression body against the promised type of // its return type annotation. var exprType = checkExpression(node.body); - if (returnType) { + if (returnOrPromisedType) { if (isAsync) { var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member); - checkTypeAssignableTo(awaitedType, promisedType, node.body); + checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } else { - checkTypeAssignableTo(exprType, returnType, node.body); + checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } - checkFunctionAndClassExpressionBodies(node.body); } } } @@ -22911,17 +23588,17 @@ var ts; // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 166 /* PropertyAccessExpression */: { + case 168 /* PropertyAccessExpression */: { var symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.10 // A property access expression is always classified as a reference. // NOTE (not in spec): assignment to enum members should not be allowed return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: // old compiler doesn't check indexed access return true; - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -22930,11 +23607,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: { + case 168 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384 /* Const */) !== 0; } - case 167 /* ElementAccessExpression */: { + case 169 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9 /* StringLiteral */) { @@ -22944,7 +23621,7 @@ var ts; } return false; } - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -23025,8 +23702,8 @@ var ts; } if (type.flags & 49152 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var current = types_9[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var current = types_10[_i]; if (current.flags & kind) { return true; } @@ -23042,8 +23719,8 @@ var ts; } if (type.flags & 49152 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var current = types_10[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var current = types_11[_i]; if (!(current.flags & kind)) { return false; } @@ -23090,7 +23767,7 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { var name_13 = p.name; if (name_13.kind === 136 /* ComputedPropertyName */) { checkComputedPropertyName(name_13); @@ -23105,11 +23782,11 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { - if (p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { - // non-shorthand property assignments should always have initializers + // non-shorthand property assignments should always have initializers checkDestructuringAssignment(p.initializer, type); } } @@ -23131,8 +23808,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187 /* OmittedExpression */) { - if (e.kind !== 185 /* SpreadElementExpression */) { + if (e.kind !== 189 /* OmittedExpression */) { + if (e.kind !== 187 /* SpreadElementExpression */) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -23157,7 +23834,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 181 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { + if (restExpression.kind === 183 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -23171,7 +23848,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 246 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 248 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -23181,14 +23858,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 181 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 165 /* ObjectLiteralExpression */) { + if (target.kind === 167 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 164 /* ArrayLiteralExpression */) { + if (target.kind === 166 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -23205,7 +23882,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 /* EqualsToken */ && (left.kind === 165 /* ObjectLiteralExpression */ || left.kind === 164 /* ArrayLiteralExpression */)) { + if (operator === 56 /* EqualsToken */ && (left.kind === 167 /* ObjectLiteralExpression */ || left.kind === 166 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -23441,7 +24118,7 @@ var ts; function checkStringLiteralExpression(node) { var contextualType = getContextualType(node); if (contextualType && contextualTypeIsStringLiteralType(contextualType)) { - return getStringLiteralType(node); + return getStringLiteralTypeForText(node.text); } return stringType; } @@ -23527,8 +24204,8 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 167 /* ElementAccessExpression */ && node.parent.expression === node) || + var ok = (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.expression === node) || ((node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); @@ -23556,7 +24233,7 @@ var ts; return booleanType; case 8 /* NumericLiteral */: return checkNumericLiteral(node); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: return checkStringLiteralExpression(node); @@ -23564,58 +24241,58 @@ var ts; return stringType; case 10 /* RegularExpressionLiteral */: return globalRegExpType; - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return checkCallExpression(node); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return checkClassExpression(node); - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: + case 173 /* TypeAssertionExpression */: + case 191 /* AsExpression */: return checkAssertion(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return checkDeleteExpression(node); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return checkVoidExpression(node); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return checkAwaitExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 187 /* OmittedExpression */: + case 189 /* OmittedExpression */: return undefinedType; - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return checkYieldExpression(node); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return checkJsxExpression(node); - case 233 /* JsxElement */: + case 235 /* JsxElement */: return checkJsxElement(node); - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 235 /* JsxOpeningElement */: + case 237 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -23627,11 +24304,10 @@ var ts; grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); + getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } - // TODO: Check multiple declarations are identical } function checkParameter(node) { // Grammar checking @@ -23662,8 +24338,8 @@ var ts; return false; } return node.kind === 143 /* MethodDeclaration */ || - node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */; + node.kind === 215 /* FunctionDeclaration */ || + node.kind === 175 /* FunctionExpression */; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -23677,12 +24353,12 @@ var ts; } return -1; } - function isInLegalTypePredicatePosition(node) { + function isInLegalParameterTypePredicatePosition(node) { switch (node.parent.kind) { - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: case 147 /* CallSignature */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 152 /* FunctionType */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: @@ -23690,12 +24366,24 @@ var ts; } return false; } + function isInLegalThisTypePredicatePosition(node) { + if (isInLegalParameterTypePredicatePosition(node)) { + return true; + } + switch (node.parent.kind) { + case 141 /* PropertyDeclaration */: + case 140 /* PropertySignature */: + case 145 /* GetAccessor */: + return node === node.parent.type; + } + return false; + } function checkSignatureDeclaration(node) { // Grammar checking if (node.kind === 149 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 /* FunctionType */ || node.kind === 213 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || + else if (node.kind === 152 /* FunctionType */ || node.kind === 215 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || node.kind === 147 /* CallSignature */ || node.kind === 144 /* Constructor */ || node.kind === 148 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); @@ -23704,9 +24392,14 @@ var ts; ts.forEach(node.parameters, checkParameter); if (node.type) { if (node.type.kind === 150 /* TypePredicate */) { - var typePredicate = getSignatureFromDeclaration(node).typePredicate; + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { + return; + } + var typePredicate = returnType.predicate; var typePredicateNode = node.type; - if (isInLegalTypePredicatePosition(typePredicateNode)) { + checkSourceElement(typePredicateNode); + if (ts.isIdentifierTypePredicate(typePredicate)) { if (typePredicate.parameterIndex >= 0) { if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); @@ -23722,8 +24415,8 @@ var ts; if (hasReportedError) { break; } - if (param.name.kind === 161 /* ObjectBindingPattern */ || - param.name.kind === 162 /* ArrayBindingPattern */) { + if (param.name.kind === 163 /* ObjectBindingPattern */ || + param.name.kind === 164 /* ArrayBindingPattern */) { (function checkBindingPattern(pattern) { for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -23733,8 +24426,8 @@ var ts; hasReportedError = true; break; } - else if (element.name.kind === 162 /* ArrayBindingPattern */ || - element.name.kind === 161 /* ObjectBindingPattern */) { + else if (element.name.kind === 164 /* ArrayBindingPattern */ || + element.name.kind === 163 /* ObjectBindingPattern */) { checkBindingPattern(element.name); } } @@ -23746,9 +24439,6 @@ var ts; } } } - else { - error(typePredicateNode, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } } else { checkSourceElement(node.type); @@ -23789,7 +24479,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 215 /* InterfaceDeclaration */) { + if (node.kind === 217 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -23839,7 +24529,7 @@ var ts; // Grammar checking checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration - checkFunctionLikeDeclaration(node); + checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. if (node.flags & 128 /* Abstract */ && node.body) { @@ -23866,7 +24556,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 168 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; + return n.kind === 170 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -23887,7 +24577,7 @@ var ts; if (n.kind === 97 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 173 /* FunctionExpression */ && n.kind !== 213 /* FunctionDeclaration */) { + else if (n.kind !== 175 /* FunctionExpression */ && n.kind !== 215 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -23922,7 +24612,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 195 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { + if (statement.kind === 197 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -23948,6 +24638,8 @@ var ts; if (produceDiagnostics) { // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); if (node.kind === 145 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288 /* HasImplicitReturn */)) { if (node.flags & 1048576 /* HasExplicitReturn */) { @@ -23960,6 +24652,12 @@ var ts; } } } + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 136 /* ComputedPropertyName */) { + checkComputedPropertyName(node.name); + } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. @@ -23982,18 +24680,32 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - checkFunctionLikeDeclaration(node); + if (node.parent.kind !== 167 /* ObjectLiteralExpression */) { + checkSourceElement(node.body); + } + else { + checkNodeDeferred(node); + } + } + function checkAccessorDeferred(node) { + checkSourceElement(node.body); } function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArguments) { + function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { + var typeArguments; + var mapper; var result = true; for (var i = 0; i < typeParameters.length; i++) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { + if (!typeArguments) { + typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode); + mapper = createTypeMapper(typeParameters, typeArguments); + } var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; @@ -24059,7 +24771,7 @@ var ts; var signaturesToCheck; // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. // Use declaring type to obtain full list of signatures. - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 215 /* InterfaceDeclaration */) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217 /* InterfaceDeclaration */) { ts.Debug.assert(signatureDeclarationNode.kind === 147 /* CallSignature */ || signatureDeclarationNode.kind === 148 /* ConstructSignature */); var signatureKind = signatureDeclarationNode.kind === 147 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -24071,7 +24783,7 @@ var ts; } for (var _i = 0, signaturesToCheck_1 = signaturesToCheck; _i < signaturesToCheck_1.length; _i++) { var otherSignature = signaturesToCheck_1[_i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature, /*ignoreReturnTypes*/ false)) { return; } } @@ -24081,9 +24793,9 @@ var ts; var flags = ts.getCombinedNodeFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 215 /* InterfaceDeclaration */ && - n.parent.kind !== 214 /* ClassDeclaration */ && - n.parent.kind !== 186 /* ClassExpression */ && + if (n.parent.kind !== 217 /* InterfaceDeclaration */ && + n.parent.kind !== 216 /* ClassDeclaration */ && + n.parent.kind !== 188 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 4 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -24164,16 +24876,23 @@ var ts; seen = c === node; } }); - if (subsequentNode) { + // We may be here because of some extra junk between overloads that could not be parsed into a valid node. + // In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here. + if (subsequentNode && subsequentNode.pos === node.end) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */); - ts.Debug.assert((node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */)); - var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode_1, diagnostic); + var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && + (node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */); + // we can get here in two cases + // 1. mixed static and instance class members + // 2. something with the same name was defined before the set of overloads that prevents them from merging + // here we'll report error only for the first case since for second we should already report error in binder + if (reportError) { + var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + error(errorNode_1, diagnostic); + } return; } else if (ts.nodeIsPresent(subsequentNode.body)) { @@ -24206,7 +24925,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 215 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 217 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -24217,7 +24936,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 213 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { + if (node.kind === 215 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -24288,7 +25007,7 @@ var ts; // The implementation is completely unrelated to the specialized signature, yet we do not check this. for (var _a = 0, signatures_3 = signatures; _a < signatures_3.length; _a++) { var signature = signatures_3[_a]; - if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + if (!signature.hasStringLiterals && !isImplementationCompatibleWithOverload(bodySignature, signature)) { error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } @@ -24357,16 +25076,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return d.name.kind === 9 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -24587,6 +25306,8 @@ var ts; error(node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName); return unknownType; } + // If the Promise constructor, resolved locally, is an alias symbol we should mark it as referenced. + checkReturnTypeAnnotationAsExpression(node); // Validate the promise constructor type. var promiseConstructorType = getTypeOfSymbol(promiseConstructor); if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) { @@ -24594,10 +25315,10 @@ var ts; } // Verify there is no local declaration that could collide with the promise constructor. var promiseName = ts.getEntityNameFromTypeNode(node.type); - var root = getFirstIdentifier(promiseName); - var rootSymbol = getSymbol(node.locals, root.text, 107455 /* Value */); + var promiseNameOrNamespaceRoot = getFirstIdentifier(promiseName); + var rootSymbol = getSymbol(node.locals, promiseNameOrNamespaceRoot.text, 107455 /* Value */); if (rootSymbol) { - error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, root.text, getFullyQualifiedName(promiseConstructor)); + error(rootSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, promiseNameOrNamespaceRoot.text, getFullyQualifiedName(promiseConstructor)); return unknownType; } // Get and return the awaited type of the return type. @@ -24614,7 +25335,7 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); @@ -24662,23 +25383,10 @@ var ts; * an expression if it is a type reference to a type with a value declaration. */ function checkTypeAnnotationAsExpression(node) { - switch (node.kind) { - case 141 /* PropertyDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 138 /* Parameter */: - checkTypeNodeAsExpression(node.type); - break; - case 143 /* MethodDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 145 /* GetAccessor */: - checkTypeNodeAsExpression(node.type); - break; - case 146 /* SetAccessor */: - checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node)); - break; - } + checkTypeNodeAsExpression(node.type); + } + function checkReturnTypeAnnotationAsExpression(node) { + checkTypeNodeAsExpression(node.type); } /** Checks the type annotation of the parameters of a function/method or the constructor of a class as expressions */ function checkParameterTypeAnnotationsAsExpressions(node) { @@ -24704,17 +25412,18 @@ var ts; if (compilerOptions.emitDecoratorMetadata) { // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; case 143 /* MethodDeclaration */: - checkParameterTypeAnnotationsAsExpressions(node); - // fall-through - case 146 /* SetAccessor */: case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + checkParameterTypeAnnotationsAsExpressions(node); + checkReturnTypeAnnotationAsExpression(node); + break; case 141 /* PropertyDeclaration */: case 138 /* Parameter */: checkTypeAnnotationAsExpression(node); @@ -24729,13 +25438,13 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || checkGrammarForGenerator(node); + checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); } } - function checkFunctionLikeDeclaration(node) { + function checkFunctionOrMethodDeclaration(node) { checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); @@ -24756,7 +25465,13 @@ var ts; // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + // Since the javascript won't do semantic analysis like typescript, + // if the javascript file comes before the typescript file and both contain same name functions, + // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. + var firstDeclaration = ts.forEach(localSymbol.declarations, + // Get first non javascript function declaration + function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration : undefined; }); // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -24770,13 +25485,9 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { - var returnType = getTypeFromTypeNode(node.type); - var promisedType; - if (isAsync) { - promisedType = checkAsyncFunctionReturnType(node); - } - checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); + if (!node.asteriskToken) { + var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !node.type) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -24794,13 +25505,10 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 192 /* Block */) { + if (node.kind === 194 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 219 /* ModuleBlock */) { - checkFunctionAndClassExpressionBodies(node); - } } function checkCollisionWithArgumentsInGeneratedCode(node) { // no rest parameters \ declaration context \ overload - no codegen impact @@ -24884,12 +25592,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 218 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 248 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -24924,7 +25632,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 211 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 213 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -24934,17 +25642,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 212 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 193 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 195 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 192 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 219 /* ModuleBlock */ || - container.kind === 218 /* ModuleDeclaration */ || - container.kind === 248 /* SourceFile */); + (container.kind === 194 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 221 /* ModuleBlock */ || + container.kind === 220 /* ModuleDeclaration */ || + container.kind === 250 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -25002,7 +25710,7 @@ var ts; checkExpressionCached(node.initializer); } } - if (node.kind === 163 /* BindingElement */) { + if (node.kind === 165 /* BindingElement */) { // check computed properties inside property names of binding elements if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); @@ -25048,7 +25756,7 @@ var ts; if (node.kind !== 141 /* PropertyDeclaration */ && node.kind !== 140 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 211 /* VariableDeclaration */ || node.kind === 163 /* BindingElement */) { + if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -25071,7 +25779,7 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 165 /* ObjectLiteralExpression */) { + if (node.modifiers && node.parent.kind === 167 /* ObjectLiteralExpression */) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -25092,7 +25800,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 194 /* EmptyStatement */) { + if (node.thenStatement.kind === 196 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -25112,12 +25820,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -25137,14 +25845,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); // There may be a destructuring assignment on the left side - if (varExpr.kind === 164 /* ArrayLiteralExpression */ || varExpr.kind === 165 /* ObjectLiteralExpression */) { + if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -25173,7 +25881,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -25187,7 +25895,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 164 /* ArrayLiteralExpression */ || varExpr.kind === 165 /* ObjectLiteralExpression */) { + if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */)) { @@ -25383,7 +26091,13 @@ var ts; ts.Debug.assert(languageVersion < 2 /* ES6 */); // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the remaining type is the same as the initial type. - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258 /* StringLike */, /*isTypeOfKind*/ true, /*allowEmptyUnionResult*/ true); + var arrayType = arrayOrStringType; + if (arrayOrStringType.flags & 16384 /* Union */) { + arrayType = getUnionType(ts.filter(arrayOrStringType.types, function (t) { return !(t.flags & 258 /* StringLike */); })); + } + else if (arrayOrStringType.flags & 258 /* StringLike */) { + arrayType = emptyUnionType; + } var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { @@ -25457,7 +26171,7 @@ var ts; error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } - else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || signature.typePredicate) { + else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || returnType.flags & 134217728 /* PredicateType */) { if (ts.isAsyncFunctionLike(func)) { var promisedType = getPromisedType(returnType); var awaitedType = checkAwaitedType(exprType, node.expression, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -25494,7 +26208,7 @@ var ts; var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 242 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 244 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -25506,17 +26220,17 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 241 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 243 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014):5.9 // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. var caseType = checkExpression(caseClause.expression); + var expressionTypeIsAssignableToCaseType = // Permit 'number[] | "foo"' to be asserted to 'string'. - if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) { - return; - } - if (!isTypeAssignableTo(expressionType, caseType)) { - // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails + (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258 /* StringLike */)) || + isTypeAssignableTo(expressionType, caseType); + if (!expressionTypeIsAssignableToCaseType) { + // 'expressionType is not assignable to caseType', try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined); } } @@ -25531,7 +26245,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 207 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 209 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -25688,8 +26402,12 @@ var ts; } function checkClassExpression(node) { checkClassLikeDeclaration(node); + checkNodeDeferred(node); return getTypeOfSymbol(getSymbolOfNode(node)); } + function checkClassExpressionDeferred(node) { + ts.forEach(node.members, checkSourceElement); + } function checkClassDeclaration(node) { if (!node.name && !(node.flags & 512 /* Default */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); @@ -25814,7 +26532,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(derivedClassDecl.flags & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 186 /* ClassExpression */) { + if (derivedClassDecl.kind === 188 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -25932,7 +26650,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 215 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -26006,7 +26724,8 @@ var ts; error(member.name, ts.Diagnostics.Enum_member_must_have_initializer); } if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; + getNodeLinks(member).enumMemberValue = autoValue; + autoValue++; } } nodeLinks.flags |= 8192 /* EnumValuesComputed */; @@ -26041,7 +26760,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -26052,7 +26771,7 @@ var ts; case 50 /* TildeToken */: return ~value_1; } return undefined; - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -26077,11 +26796,11 @@ var ts; return undefined; case 8 /* NumericLiteral */: return +e.text; - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return evalConstant(e.expression); case 69 /* Identifier */: - case 167 /* ElementAccessExpression */: - case 166 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 168 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -26094,7 +26813,7 @@ var ts; } else { var expression; - if (e.kind === 167 /* ElementAccessExpression */) { + if (e.kind === 169 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -26112,7 +26831,7 @@ var ts; if (current.kind === 69 /* Identifier */) { break; } - else if (current.kind === 166 /* PropertyAccessExpression */) { + else if (current.kind === 168 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -26183,7 +26902,7 @@ var ts; var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 217 /* EnumDeclaration */) { + if (declaration.kind !== 219 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -26206,8 +26925,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 214 /* ClassDeclaration */ || - (declaration.kind === 213 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 216 /* ClassDeclaration */ || + (declaration.kind === 215 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -26263,7 +26982,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 214 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 216 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -26286,7 +27005,7 @@ var ts; if (node.kind === 135 /* QualifiedName */) { node = node.left; } - else if (node.kind === 166 /* PropertyAccessExpression */) { + else if (node.kind === 168 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -26302,9 +27021,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 219 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 248 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 228 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; + if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 230 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -26327,7 +27046,7 @@ var ts; (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 230 /* ExportSpecifier */ ? + var message = node.kind === 232 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -26354,7 +27073,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -26411,8 +27130,8 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 219 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 248 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; + if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -26426,7 +27145,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 248 /* SourceFile */ && node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 218 /* ModuleDeclaration */) { + if (node.parent.kind !== 250 /* SourceFile */ && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 220 /* ModuleDeclaration */) { return grammarErrorOnFirstToken(node, errorMessage); } } @@ -26441,8 +27160,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 248 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 218 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { + var container = node.parent.kind === 250 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 220 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -26468,15 +27187,6 @@ var ts; } } } - function getModuleStatements(node) { - if (node.kind === 248 /* SourceFile */) { - return node.statements; - } - if (node.kind === 218 /* ModuleDeclaration */ && node.body.kind === 219 /* ModuleBlock */) { - return node.body.statements; - } - return emptyArray; - } function hasExportedMembers(moduleSymbol) { for (var id in moduleSymbol.exports) { if (id !== "export=") { @@ -26494,13 +27204,43 @@ var ts; var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } + // Checks for export * conflicts + var exports = getExportsOfModule(moduleSymbol); + for (var id in exports) { + if (id === "__export") { + continue; + } + var _a = exports[id], declarations = _a.declarations, flags = _a.flags; + // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries. (TS Exceptions: namespaces, function overloads, enums, and interfaces) + if (!(flags & (1536 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) && (flags & 524288 /* TypeAlias */ ? declarations.length - 1 : declarations.length) > 1) { + var exportedDeclarations = ts.filter(declarations, isNotOverload); + if (exportedDeclarations.length > 1) { + for (var _i = 0, exportedDeclarations_1 = exportedDeclarations; _i < exportedDeclarations_1.length; _i++) { + var declaration = exportedDeclarations_1[_i]; + diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, id)); + } + } + } + } links.exportsChecked = true; } + function isNotOverload(declaration) { + return declaration.kind !== 215 /* FunctionDeclaration */ || !!declaration.body; + } } function checkTypePredicate(node) { - if (!isInLegalTypePredicatePosition(node)) { + var parameterName = node.parameterName; + if (parameterName.kind === 69 /* Identifier */ && !isInLegalParameterTypePredicatePosition(node)) { error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); } + else if (parameterName.kind === 161 /* ThisType */) { + if (!isInLegalThisTypePredicatePosition(node)) { + error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); + } + else { + getTypeFromThisTypeNode(parameterName); + } + } } function checkSourceElement(node) { if (!node) { @@ -26511,10 +27251,10 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessivly // hitting the cancellation token on every node we check. switch (kind) { - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -26558,71 +27298,71 @@ var ts; return checkUnionOrIntersectionType(node); case 160 /* ParenthesizedType */: return checkSourceElement(node.type); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return checkBlock(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return checkVariableStatement(node); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return checkExpressionStatement(node); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return checkIfStatement(node); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return checkDoStatement(node); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return checkWhileStatement(node); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return checkForStatement(node); - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return checkForInStatement(node); - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return checkForOfStatement(node); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return checkReturnStatement(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return checkWithStatement(node); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return checkSwitchStatement(node); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return checkLabeledStatement(node); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return checkThrowStatement(node); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return checkTryStatement(node); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 163 /* BindingElement */: + case 165 /* BindingElement */: return checkBindingElement(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return checkClassDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return checkImportDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return checkExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return checkExportAssignment(node); - case 194 /* EmptyStatement */: + case 196 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 231 /* MissingDeclaration */: + case 233 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -26635,102 +27375,29 @@ var ts; // Here, performing a full type check of the body of the function expression whilst in the process of // determining the type of foo would cause foo to be given type any because of the recursive reference. // Delaying the type check of the body ensures foo has been assigned a type. - function checkFunctionAndClassExpressionBodies(node) { - switch (node.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - checkFunctionExpressionOrObjectLiteralMethodBody(node); - break; - case 186 /* ClassExpression */: - ts.forEach(node.members, checkSourceElement); - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - ts.forEach(node.decorators, checkFunctionAndClassExpressionBodies); - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - if (ts.isObjectLiteralMethod(node)) { - checkFunctionExpressionOrObjectLiteralMethodBody(node); - } - break; - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - ts.forEach(node.parameters, checkFunctionAndClassExpressionBodies); - break; - case 205 /* WithStatement */: - checkFunctionAndClassExpressionBodies(node.expression); - break; - case 139 /* Decorator */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 163 /* BindingElement */: - case 164 /* ArrayLiteralExpression */: - case 165 /* ObjectLiteralExpression */: - case 245 /* PropertyAssignment */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 170 /* TaggedTemplateExpression */: - case 183 /* TemplateExpression */: - case 190 /* TemplateSpan */: - case 171 /* TypeAssertionExpression */: - case 189 /* AsExpression */: - case 172 /* ParenthesizedExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 178 /* AwaitExpression */: - case 175 /* DeleteExpression */: - case 179 /* PrefixUnaryExpression */: - case 180 /* PostfixUnaryExpression */: - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 185 /* SpreadElementExpression */: - case 184 /* YieldExpression */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 193 /* VariableStatement */: - case 195 /* ExpressionStatement */: - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: - case 204 /* ReturnStatement */: - case 206 /* SwitchStatement */: - case 220 /* CaseBlock */: - case 241 /* CaseClause */: - case 242 /* DefaultClause */: - case 207 /* LabeledStatement */: - case 208 /* ThrowStatement */: - case 209 /* TryStatement */: - case 244 /* CatchClause */: - case 211 /* VariableDeclaration */: - case 212 /* VariableDeclarationList */: - case 214 /* ClassDeclaration */: - case 243 /* HeritageClause */: - case 188 /* ExpressionWithTypeArguments */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 227 /* ExportAssignment */: - case 248 /* SourceFile */: - case 240 /* JsxExpression */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - case 235 /* JsxOpeningElement */: - ts.forEachChild(node, checkFunctionAndClassExpressionBodies); - break; + function checkNodeDeferred(node) { + if (deferredNodes) { + deferredNodes.push(node); + } + } + function checkDeferredNodes() { + for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { + var node = deferredNodes_1[_i]; + switch (node.kind) { + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + checkAccessorDeferred(node); + break; + case 188 /* ClassExpression */: + checkClassExpressionDeferred(node); + break; + } } } function checkSourceFile(node) { @@ -26756,9 +27423,12 @@ var ts; emitExtends = false; emitDecorate = false; emitParam = false; + emitAwaiter = false; potentialThisCollisions.length = 0; + deferredNodes = []; ts.forEach(node.statements, checkSourceElement); - checkFunctionAndClassExpressionBodies(node); + checkDeferredNodes(); + deferredNodes = undefined; if (ts.isExternalOrCommonJsModule(node)) { checkExternalModuleExports(node); } @@ -26818,7 +27488,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 205 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 207 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -26841,25 +27511,25 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } // fall through; this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -26868,7 +27538,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -26918,10 +27588,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 137 /* TypeParameter */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: return true; } } @@ -26935,19 +27605,19 @@ var ts; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 166 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 168 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 188 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 190 /* ExpressionWithTypeArguments */; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { while (nodeOnRightSide.parent.kind === 135 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 221 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 223 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 227 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 229 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -26959,11 +27629,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 227 /* ExportAssignment */) { + if (entityName.parent.kind === 229 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 166 /* PropertyAccessExpression */) { + if (entityName.kind !== 168 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -26975,7 +27645,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 188 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 190 /* ExpressionWithTypeArguments */) { meaning = 793056 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -26988,9 +27658,9 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 235 /* JsxOpeningElement */) || - (entityName.parent.kind === 234 /* JsxSelfClosingElement */) || - (entityName.parent.kind === 237 /* JsxClosingElement */)) { + else if ((entityName.parent.kind === 237 /* JsxOpeningElement */) || + (entityName.parent.kind === 236 /* JsxSelfClosingElement */) || + (entityName.parent.kind === 239 /* JsxClosingElement */)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -27004,7 +27674,7 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 166 /* PropertyAccessExpression */) { + else if (entityName.kind === 168 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); @@ -27026,7 +27696,7 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 238 /* JsxAttribute */) { + else if (entityName.parent.kind === 240 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } if (entityName.parent.kind === 150 /* TypePredicate */) { @@ -27046,12 +27716,12 @@ var ts; } if (node.kind === 69 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 227 /* ExportAssignment */ + return node.parent.kind === 229 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 163 /* BindingElement */ && - node.parent.parent.kind === 161 /* ObjectBindingPattern */ && + else if (node.parent.kind === 165 /* BindingElement */ && + node.parent.parent.kind === 163 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -27062,13 +27732,15 @@ var ts; } switch (node.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97 /* ThisKeyword */: case 95 /* SuperKeyword */: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; + case 161 /* ThisType */: + return getTypeFromTypeNode(node).symbol; case 121 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; @@ -27080,14 +27752,14 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 222 /* ImportDeclaration */ || node.parent.kind === 228 /* ExportDeclaration */) && + ((node.parent.kind === 224 /* ImportDeclaration */ || node.parent.kind === 230 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Fall through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 167 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -27104,7 +27776,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 246 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 248 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */); } return undefined; @@ -27207,6 +27879,30 @@ var ts; function isArgumentsLocalBinding(node) { return getReferencedValueSymbol(node) === argumentsSymbol; } + function moduleExportsSomeValue(moduleReferenceExpression) { + var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol) { + // module not found - be conservative + return true; + } + var hasExportAssignment = getExportAssignmentSymbol(moduleSymbol) !== undefined; + // if module has export assignment then 'resolveExternalModuleSymbol' will return resolved symbol for export assignment + // otherwise it will return moduleSymbol itself + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + var symbolLinks = getSymbolLinks(moduleSymbol); + if (symbolLinks.exportsSomeValue === undefined) { + // for export assignments - check if resolved symbol for RHS is itself a value + // otherwise - check if at least one export is value + symbolLinks.exportsSomeValue = hasExportAssignment + ? !!(moduleSymbol.flags & 107455 /* Value */) + : ts.forEachValue(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks.exportsSomeValue; + function isValue(s) { + s = resolveSymbol(s); + return s && !!(s.flags & 107455 /* Value */); + } + } // When resolved as an expression identifier, if the given node references an exported entity, return the declaration // node of the exported entity's container. Otherwise, return undefined. function getReferencedExportContainer(node) { @@ -27224,11 +27920,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 248 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 250 /* SourceFile */) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 218 /* ModuleDeclaration */ || n.kind === 217 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 220 /* ModuleDeclaration */ || n.kind === 219 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -27243,11 +27939,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 192 /* Block */: - case 220 /* CaseBlock */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 194 /* Block */: + case 222 /* CaseBlock */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return true; } return false; @@ -27277,22 +27973,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return node.expression && node.expression.kind === 69 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 248 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 250 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -27354,7 +28050,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 247 /* EnumMember */) { + if (node.kind === 249 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -27446,17 +28142,6 @@ var ts; var symbol = getReferencedValueSymbol(reference); return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; } - function instantiateSingleCallFunctionType(functionType, typeArguments) { - if (functionType === unknownType) { - return unknownType; - } - var signature = getSingleCallSignature(functionType); - if (!signature) { - return unknownType; - } - var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); - return getOrCreateTypeFromSignature(instantiatedSignature); - } function createResolver() { return { getReferencedExportContainer: getReferencedExportContainer, @@ -27480,6 +28165,7 @@ var ts; getReferencedValueDeclaration: getReferencedValueDeclaration, getTypeReferenceSerializationKind: getTypeReferenceSerializationKind, isOptionalParameter: isOptionalParameter, + moduleExportsSomeValue: moduleExportsSomeValue, isArgumentsLocalBinding: isArgumentsLocalBinding, getExternalModuleFileFromDeclaration: getExternalModuleFileFromDeclaration }; @@ -27490,7 +28176,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 248 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 250 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -27503,10 +28189,11 @@ var ts; mergeSymbolTable(globals, file.locals); } }); + // Setup global builtins + addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; // Initialize special types globalArrayType = getGlobalType("Array", /*arity*/ 1); globalObjectType = getGlobalType("Object"); @@ -27575,7 +28262,12 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + if (node.kind === 143 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } + else { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); + } } else if (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); @@ -27595,30 +28287,30 @@ var ts; case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 149 /* IndexSignature */: - case 218 /* ModuleDeclaration */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: - case 227 /* ExportAssignment */: + case 220 /* ModuleDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: + case 229 /* ExportAssignment */: case 138 /* Parameter */: break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118 /* AsyncKeyword */) && - node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 193 /* VariableStatement */: - case 216 /* TypeAliasDeclaration */: - if (node.modifiers && node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 195 /* VariableStatement */: + case 218 /* TypeAliasDeclaration */: + if (node.modifiers && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74 /* ConstKeyword */) && - node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 248 /* SourceFile */) { + node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -27633,6 +28325,11 @@ var ts; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; switch (modifier.kind) { + case 74 /* ConstKeyword */: + if (node.kind !== 219 /* EnumDeclaration */ && node.parent.kind === 216 /* ClassDeclaration */) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74 /* ConstKeyword */)); + } + break; case 112 /* PublicKeyword */: case 111 /* ProtectedKeyword */: case 110 /* PrivateKeyword */: @@ -27657,7 +28354,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128 /* Abstract */) { @@ -27677,7 +28374,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 138 /* Parameter */) { @@ -27702,7 +28399,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } else if (node.kind === 138 /* Parameter */) { @@ -27717,13 +28414,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } else if (node.kind === 138 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 219 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4 /* Ambient */; @@ -27733,11 +28430,11 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 214 /* ClassDeclaration */) { + if (node.kind !== 216 /* ClassDeclaration */) { if (node.kind !== 143 /* MethodDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 214 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { + if (!(node.parent.kind === 216 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64 /* Static */) { @@ -27782,7 +28479,7 @@ var ts; } return; } - else if ((node.kind === 222 /* ImportDeclaration */ || node.kind === 221 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { + else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 138 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { @@ -27798,9 +28495,9 @@ var ts; } switch (node.kind) { case 143 /* MethodDeclaration */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: if (!node.asteriskToken) { return false; } @@ -27866,7 +28563,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 174 /* ArrowFunction */) { + if (node.kind === 176 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -27934,7 +28631,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 187 /* OmittedExpression */) { + if (arg.kind === 189 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -28012,14 +28709,14 @@ var ts; return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 181 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { + if (computedPropertyName.expression.kind === 183 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */ || + ts.Debug.assert(node.kind === 215 /* FunctionDeclaration */ || + node.kind === 175 /* FunctionExpression */ || node.kind === 143 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); @@ -28043,20 +28740,25 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; + var _loop_1 = function(prop) { var name_16 = prop.name; - if (prop.kind === 187 /* OmittedExpression */ || + if (prop.kind === 189 /* OmittedExpression */ || name_16.kind === 136 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name_16); - continue; + return "continue"; } - if (prop.kind === 246 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 248 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error - return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); + return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } + // Modifiers are never allowed on properties except for 'async' on a method declaration + ts.forEach(prop.modifiers, function (mod) { + if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 143 /* MethodDeclaration */) { + grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); + } + }); // ECMA-262 11.1.5 Object Initialiser // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true // a.This production is contained in strict code and IsDataDescriptor(previous) is true and @@ -28066,7 +28768,7 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 245 /* PropertyAssignment */ || prop.kind === 246 /* ShorthandPropertyAssignment */) { + if (prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_16.kind === 8 /* NumericLiteral */) { @@ -28092,27 +28794,33 @@ var ts; else { var existingKind = seen[name_16.text]; if (currentKind === Property && existingKind === Property) { - continue; + return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { seen[name_16.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } + }; + for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { + var prop = _a[_i]; + var state_1 = _loop_1(prop); + if (typeof state_1 === "object") return state_1.value + if (state_1 === "continue") continue; } } function checkGrammarJsxElement(node) { var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 239 /* JsxSpreadAttribute */) { + if (attr.kind === 241 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; @@ -28124,7 +28832,7 @@ var ts; return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 240 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 242 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -28133,24 +28841,35 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 212 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 214 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var declarations = variableList.declarations; + // declarations.length can be zero if there is an error in variable declaration in for-of or for-in + // See http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements for details + // For example: + // var let = 10; + // for (let of [1,2,3]) {} // this is invalid ES6 syntax + // for (let in [1,2,3]) {} // this is invalid ES6 syntax + // We will then want to skip on grammar checking on variableList declaration + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } - var firstDeclaration = variableList.declarations[0]; + var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 200 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -28211,7 +28930,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 165 /* ObjectLiteralExpression */) { + if (node.parent.kind === 167 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -28235,7 +28954,7 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 215 /* InterfaceDeclaration */) { + else if (node.parent.kind === 217 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } else if (node.parent.kind === 155 /* TypeLiteral */) { @@ -28249,11 +28968,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 202 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 204 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -28261,8 +28980,8 @@ var ts; return false; } break; - case 206 /* SwitchStatement */: - if (node.kind === 203 /* BreakStatement */ && !node.label) { + case 208 /* SwitchStatement */: + if (node.kind === 205 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -28277,13 +28996,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 203 /* BreakStatement */ + var message = node.kind === 205 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 203 /* BreakStatement */ + var message = node.kind === 205 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -28295,7 +29014,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 162 /* ArrayBindingPattern */ || node.name.kind === 161 /* ObjectBindingPattern */) { + if (node.name.kind === 164 /* ArrayBindingPattern */ || node.name.kind === 163 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -28305,7 +29024,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 200 /* ForInStatement */ && node.parent.parent.kind !== 201 /* ForOfStatement */) { + if (node.parent.parent.kind !== 202 /* ForInStatement */ && node.parent.parent.kind !== 203 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -28322,7 +29041,7 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 /* ES6 */ && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = (ts.isLet(node) || ts.isConst(node)); // 1. LexicalDeclaration : LetOrConst BindingList ; // It is a Syntax Error if the BoundNames of BindingList contains "let". // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding @@ -28333,7 +29052,7 @@ var ts; } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 69 /* Identifier */) { - if (name.text === "let") { + if (name.originalKeywordKind === 108 /* LetKeyword */) { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } @@ -28341,7 +29060,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -28358,15 +29077,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 196 /* IfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 198 /* IfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return false; - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -28381,23 +29100,6 @@ var ts; } } } - function isIntegerLiteral(expression) { - if (expression.kind === 179 /* PrefixUnaryExpression */) { - var unaryExpression = expression; - if (unaryExpression.operator === 35 /* PlusToken */ || unaryExpression.operator === 36 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 8 /* NumericLiteral */) { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); - } - return false; - } function hasParseDiagnostics(sourceFile) { return sourceFile.parseDiagnostics.length > 0; } @@ -28422,10 +29124,6 @@ var ts; return true; } } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 69 /* Identifier */ && - (node.text === "eval" || node.text === "arguments"); - } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -28443,15 +29141,21 @@ var ts; return true; } } - else if (node.parent.kind === 215 /* InterfaceDeclaration */) { + else if (node.parent.kind === 217 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); + } } else if (node.parent.kind === 155 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } } if (ts.isInAmbientContext(node) && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); @@ -28470,12 +29174,12 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 215 /* InterfaceDeclaration */ || - node.kind === 216 /* TypeAliasDeclaration */ || - node.kind === 222 /* ImportDeclaration */ || - node.kind === 221 /* ImportEqualsDeclaration */ || - node.kind === 228 /* ExportDeclaration */ || - node.kind === 227 /* ExportAssignment */ || + if (node.kind === 217 /* InterfaceDeclaration */ || + node.kind === 218 /* TypeAliasDeclaration */ || + node.kind === 224 /* ImportDeclaration */ || + node.kind === 223 /* ImportEqualsDeclaration */ || + node.kind === 230 /* ExportDeclaration */ || + node.kind === 229 /* ExportAssignment */ || (node.flags & 4 /* Ambient */) || (node.flags & (2 /* Export */ | 512 /* Default */))) { return false; @@ -28485,7 +29189,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 193 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 195 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -28511,7 +29215,7 @@ var ts; // to prevent noisyness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 192 /* Block */ || node.parent.kind === 219 /* ModuleBlock */ || node.parent.kind === 248 /* SourceFile */) { + if (node.parent.kind === 194 /* Block */ || node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -28536,21 +29240,293 @@ var ts; return true; } } + var _a; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); /// /* @internal */ var ts; +(function (ts) { + var nullSourceMapWriter; + function getNullSourceMapWriter() { + if (nullSourceMapWriter === undefined) { + nullSourceMapWriter = { + getSourceMapData: function () { return undefined; }, + setSourceFile: function (sourceFile) { }, + emitStart: function (range) { }, + emitEnd: function (range) { }, + emitPos: function (pos) { }, + getText: function () { return undefined; }, + getSourceMappingURL: function () { return undefined; }, + initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, + reset: function () { } + }; + } + return nullSourceMapWriter; + } + ts.getNullSourceMapWriter = getNullSourceMapWriter; + function createSourceMapWriter(host, writer) { + var compilerOptions = host.getCompilerOptions(); + var currentSourceFile; + var sourceMapDir; // The directory in which sourcemap will be + // Current source map file and its index in the sources list + var sourceMapSourceIndex; + // Last recorded and encoded spans + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan; + var lastEncodedNameIndex; + // Source map data + var sourceMapData; + return { + getSourceMapData: function () { return sourceMapData; }, + setSourceFile: setSourceFile, + emitPos: emitPos, + emitStart: emitStart, + emitEnd: emitEnd, + getText: getText, + getSourceMappingURL: getSourceMappingURL, + initialize: initialize, + reset: reset + }; + function initialize(filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + if (sourceMapData) { + reset(); + } + currentSourceFile = undefined; + // Current source map file and its index in the sources list + sourceMapSourceIndex = -1; + // Last recorded and encoded spans + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + lastEncodedNameIndex = 0; + // Initialize source map data + sourceMapData = { + sourceMapFilePath: sourceMapFilePath, + jsSourceMappingURL: !compilerOptions.inlineSourceMap ? ts.getBaseFileName(ts.normalizeSlashes(sourceMapFilePath)) : undefined, + sourceMapFile: ts.getBaseFileName(ts.normalizeSlashes(filePath)), + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined, + sourceMapDecodedMappings: [] + }; + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // relative paths of the sources list in the sourcemap + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (!isBundledEmit) { + ts.Debug.assert(sourceFiles.length === 1); + // For modules or multiple emit files the mapRoot will have directory structure like the sources + // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map + sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFiles[0], host, sourceMapDir)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + // The relative paths are relative to the common directory + sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap + host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(filePath)); + } + } + function reset() { + currentSourceFile = undefined; + sourceMapDir = undefined; + sourceMapSourceIndex = undefined; + lastRecordedSourceMapSpan = undefined; + lastEncodedSourceMapSpan = undefined; + lastEncodedNameIndex = undefined; + sourceMapData = undefined; + } + // Encoding for sourcemap span + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Line/Comma delimiters + if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { + // Emit comma to separate the entry + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + // Emit line delimiters + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + // 1. Relative Column 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + // 2. Relative sourceIndex + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + // 3. Relative sourceLine 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + // 4. Relative sourceColumn 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + // 5. Relative namePosition 0 based + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + } + function emitPos(pos) { + if (pos === -1) { + return; + } + var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + // Convert the location to be one-based. + sourceLinePos.line++; + sourceLinePos.character++; + var emittedLine = writer.getLine(); + var emittedColumn = writer.getColumn(); + // If this location wasn't recorded or the location in source is going backwards, record the span + if (!lastRecordedSourceMapSpan || + lastRecordedSourceMapSpan.emittedLine !== emittedLine || + lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || + (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && + (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || + (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + // Encode the last recordedSpan before assigning new + encodeLastRecordedSourceMapSpan(); + // New span + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + sourceIndex: sourceMapSourceIndex + }; + } + else { + // Take the new pos instead since there is no change in emittedLine and column since last location + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; + } + } + function emitStart(range) { + var rangeHasDecorators = !!range.decorators; + emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + } + function emitEnd(range) { + emitPos(range.end); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + // Add the file to tsFilePaths + // If sourceroot option: Use the relative path corresponding to the common directory path + // otherwise source locations relative to map file location + var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; + var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSourceFile.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); + sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + if (sourceMapSourceIndex === -1) { + sourceMapSourceIndex = sourceMapData.sourceMapSources.length; + sourceMapData.sourceMapSources.push(source); + // The one that can be used from program to get the actual source file + sourceMapData.inputSourceFileNames.push(sourceFile.fileName); + if (compilerOptions.inlineSources) { + sourceMapData.sourceMapSourcesContent.push(sourceFile.text); + } + } + } + function getText() { + encodeLastRecordedSourceMapSpan(); + return ts.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings, + sourcesContent: sourceMapData.sourceMapSourcesContent + }); + } + function getSourceMappingURL() { + if (compilerOptions.inlineSourceMap) { + // Encode the sourceMap into the sourceMap url + var base64SourceMapText = ts.convertToBase64(getText()); + return sourceMapData.jsSourceMappingURL = "data:application/json;base64," + base64SourceMapText; + } + else { + return sourceMapData.jsSourceMappingURL; + } + } + } + ts.createSourceMapWriter = createSourceMapWriter; + var base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + function base64FormatEncode(inValue) { + if (inValue < 64) { + return base64Chars.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + function base64VLQFormatEncode(inValue) { + // Add a new least significant bit that has the sign of the value. + // if negative number the least significant bit that gets added to the number has value 1 + // else least significant bit value that gets added is 0 + // eg. -1 changes to binary : 01 [1] => 3 + // +1 changes to binary : 01 [0] => 2 + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + // Encode 5 bits at a time starting from least significant bits + var encodedStr = ""; + do { + var currentDigit = inValue & 31; // 11111 + inValue = inValue >> 5; + if (inValue > 0) { + // There are still more digits to decode, set the msb (6th bit) + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } +})(ts || (ts = {})); +/// +/* @internal */ +var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; + var declarationDiagnostics = ts.createDiagnosticCollection(); + ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile); + return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName); + function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) { + var declarationFilePath = _a.declarationFilePath; + emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit); + } } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { + function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -28568,103 +29544,79 @@ var ts; var errorNameNode; var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var noDeclare = !root; + var noDeclare; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; // Contains the reference paths that needs to go in the declaration file. // Collecting this separately because reference paths need to be first thing in the declaration file // and we could be collecting these paths from multiple files into single one with --out option var referencePathsOutput = ""; - if (root) { - // Emitting just a single file, so emit references in this file only + // Emit references corresponding to each file + var emittedReferencedFiles = []; + var addedGlobalFileReference = false; + var allSourcesModuleElementDeclarationEmitInfo = []; + ts.forEach(sourceFiles, function (sourceFile) { + // Dont emit for javascript file + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + // Check what references need to be added if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - // All the references that are not going to be part of same file - if (referencedFile && ((referencedFile.flags & 4096 /* DeclarationFile */) || - ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + // Emit reference in dts, if the file reference was not already emitted + if (referencedFile && !ts.contains(emittedReferencedFiles, referencedFile)) { + // Add a reference to generated dts file, + // global file reference is added only + // - if it is not bundled emit (because otherwise it would be self reference) + // - and it is not already added + if (writeReferencePath(referencedFile, !isBundledEmit && !addedGlobalFileReference)) { addedGlobalFileReference = true; } + emittedReferencedFiles.push(referencedFile); } }); } - emitSourceFile(root); + if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { + noDeclare = false; + emitSourceFile(sourceFile); + } + else if (ts.isExternalModule(sourceFile)) { + noDeclare = true; + write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); + writeLine(); + increaseIndent(); + emitSourceFile(sourceFile); + decreaseIndent(); + write("}"); + writeLine(); + } // create asynchronous output for the importDeclarations if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); + if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { + ts.Debug.assert(aliasEmitInfo.node.kind === 224 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 0); + ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + increaseIndent(); + } writeImportDeclaration(aliasEmitInfo.node); aliasEmitInfo.asynchronousOutput = writer.getText(); + for (var i = 0; i < aliasEmitInfo.indent; i++) { + decreaseIndent(); + } } }); setWriter(oldWriter); + allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); + moduleElementDeclarationEmitInfo = []; } - } - else { - // Emit references corresponding to this file - var emittedReferencedFiles = []; - var prevModuleElementDeclarationEmitInfo = []; - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - // If the reference file is a declaration file, emit that reference - if (referencedFile && (ts.isDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - } - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - noDeclare = false; - emitSourceFile(sourceFile); - } - else if (ts.isExternalModule(sourceFile)) { - noDeclare = true; - write("declare module \"" + ts.getResolvedExternalModuleName(host, sourceFile) + "\" {"); - writeLine(); - increaseIndent(); - emitSourceFile(sourceFile); - decreaseIndent(); - write("}"); - writeLine(); - // create asynchronous output for the importDeclarations - if (moduleElementDeclarationEmitInfo.length) { - var oldWriter = writer; - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 222 /* ImportDeclaration */); - createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 1); - increaseIndent(); - writeImportDeclaration(aliasEmitInfo.node); - aliasEmitInfo.asynchronousOutput = writer.getText(); - decreaseIndent(); - } - }); - setWriter(oldWriter); - } - prevModuleElementDeclarationEmitInfo = prevModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); - moduleElementDeclarationEmitInfo = []; - } - }); - moduleElementDeclarationEmitInfo = moduleElementDeclarationEmitInfo.concat(prevModuleElementDeclarationEmitInfo); - } + }); return { reportedDeclarationError: reportedDeclarationError, - moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, + moduleElementDeclarationEmitInfo: allSourcesModuleElementDeclarationEmitInfo, synchronousDeclarationOutput: writer.getText(), referencePathsOutput: referencePathsOutput }; @@ -28707,10 +29659,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 211 /* VariableDeclaration */) { + if (declaration.kind === 213 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 225 /* NamedImports */ || declaration.kind === 226 /* ImportSpecifier */ || declaration.kind === 223 /* ImportClause */) { + else if (declaration.kind === 227 /* NamedImports */ || declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 225 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -28728,7 +29680,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 222 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 224 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -28738,12 +29690,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 218 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 218 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -28766,10 +29718,10 @@ var ts; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNodeFromSourceText(currentText, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } else { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + emitterDiagnostics.add(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); } } } @@ -28779,7 +29731,8 @@ var ts; } function reportInaccessibleThisError() { if (errorNameNode) { - diagnostics.push(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); + reportedDeclarationError = true; + emitterDiagnostics.add(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode))); } } function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { @@ -28850,10 +29803,10 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 97 /* ThisKeyword */: - case 9 /* StringLiteral */: + case 161 /* ThisType */: + case 162 /* StringLiteralType */: return writeTextOfNode(currentText, type); - case 188 /* ExpressionWithTypeArguments */: + case 190 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); case 151 /* TypeReference */: return emitTypeReference(type); @@ -28896,13 +29849,13 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 221 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 223 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 166 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 168 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -28980,7 +29933,8 @@ var ts; } var count = 0; while (true) { - var name_18 = baseName + "_" + (++count); + count++; + var name_18 = baseName + "_" + count; if (!ts.hasProperty(currentIdentifiers, name_18)) { return name_18; } @@ -29026,10 +29980,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 221 /* ImportEqualsDeclaration */ || - (node.parent.kind === 248 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 223 /* ImportEqualsDeclaration */ || + (node.parent.kind === 250 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 248 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -29039,7 +29993,7 @@ var ts; }); } else { - if (node.kind === 222 /* ImportDeclaration */) { + if (node.kind === 224 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -29057,23 +30011,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return writeVariableStatement(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return writeClassDeclaration(node); - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -29081,7 +30035,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 248 /* SourceFile */) { + if (node.parent.kind === 250 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -29089,7 +30043,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 215 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 217 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -29124,7 +30078,7 @@ var ts; } else { write("require("); - writeTextOfNode(currentText, ts.getExternalModuleImportEqualsDeclarationExpression(node)); + emitExternalModuleSpecifier(node); write(");"); } writer.writeLine(); @@ -29138,7 +30092,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 224 /* NamespaceImport */) { + if (namedBindings.kind === 226 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -29166,7 +30120,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -29178,13 +30132,22 @@ var ts; } write(" from "); } - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); write(";"); writer.writeLine(); } - function emitExternalModuleSpecifier(moduleSpecifier) { - if (moduleSpecifier.kind === 9 /* StringLiteral */ && (!root) && (compilerOptions.out || compilerOptions.outFile)) { - var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent); + function emitExternalModuleSpecifier(parent) { + var moduleSpecifier; + if (parent.kind === 223 /* ImportEqualsDeclaration */) { + var node = parent; + moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); + } + else { + var node = parent; + moduleSpecifier = node.moduleSpecifier; + } + if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { + var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { write("\""); write(moduleName); @@ -29221,7 +30184,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitExternalModuleSpecifier(node.moduleSpecifier); + emitExternalModuleSpecifier(node); } write(";"); writer.writeLine(); @@ -29236,7 +30199,7 @@ var ts; write("module "); } writeTextOfNode(currentText, node.name); - while (node.body.kind !== 219 /* ModuleBlock */) { + while (node.body.kind !== 221 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -29331,10 +30294,10 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 148 /* ConstructSignature */: @@ -29348,14 +30311,14 @@ var ts; if (node.parent.flags & 64 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -29389,7 +30352,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + if (node.parent.parent.kind === 216 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -29473,7 +30436,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 211 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 213 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -29495,7 +30458,7 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 211 /* VariableDeclaration */) { + if (node.kind === 213 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29511,7 +30474,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29543,7 +30506,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 187 /* OmittedExpression */) { + if (element.kind !== 189 /* OmittedExpression */) { elements.push(element); } } @@ -29685,13 +30648,13 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } else if (node.kind === 143 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } @@ -29712,6 +30675,8 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; // Construct signature or constructor type write new Signature if (node.kind === 148 /* ConstructSignature */ || node.kind === 153 /* ConstructorType */) { write("new "); @@ -29723,8 +30688,6 @@ var ts; else { write("("); } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; // Parameters emitCommaList(node.parameters, emitParameterDeclaration); if (node.kind === 149 /* IndexSignature */) { @@ -29780,7 +30743,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.kind === 216 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -29794,7 +30757,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -29872,7 +30835,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 214 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29885,7 +30848,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -29897,12 +30860,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 161 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 163 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 162 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 164 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -29913,15 +30876,7 @@ var ts; } } function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.kind === 187 /* OmittedExpression */) { + if (bindingElement.kind === 189 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -29930,7 +30885,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 163 /* BindingElement */) { + else if (bindingElement.kind === 165 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -29969,20 +30924,20 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: - case 218 /* ModuleDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 215 /* InterfaceDeclaration */: - case 214 /* ClassDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: + case 215 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 217 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return emitExportDeclaration(node); case 144 /* Constructor */: case 143 /* MethodDeclaration */: @@ -29998,35 +30953,57 @@ var ts; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return emitPropertyDeclaration(node); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return emitExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return emitSourceFile(node); } } - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 4096 /* DeclarationFile */ - ? referencedFile.fileName // Declaration file, use declaration file name - : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) - ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file - : ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; // Global out file - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ false); - referencePathsOutput += "/// " + newLine; + /** + * Adds the reference to referenced file, returns true if global file reference was emitted + * @param referencedFile + * @param addBundledFileReference Determines if global file reference corresponding to bundled file should be emitted or not + */ + function writeReferencePath(referencedFile, addBundledFileReference) { + var declFileName; + var addedBundledEmitReference = false; + if (ts.isDeclarationFile(referencedFile)) { + // Declaration file, use declaration file name + declFileName = referencedFile.fileName; + } + else { + // Get the declaration file path + ts.forEachExpectedEmitFile(host, getDeclFileName, referencedFile); + } + if (declFileName) { + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(declarationFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); + referencePathsOutput += "/// " + newLine; + } + return addedBundledEmitReference; + function getDeclFileName(emitFileNames, sourceFiles, isBundledEmit) { + // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path + if (isBundledEmit && !addBundledFileReference) { + return; + } + ts.Debug.assert(!!emitFileNames.declarationFilePath || ts.isSourceFileJavaScript(referencedFile), "Declaration file is not present only for javascript files"); + declFileName = emitFileNames.declarationFilePath || emitFileNames.jsFilePath; + addedBundledEmitReference = isBundledEmit; + } } } /* @internal */ - function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - // TODO(shkamat): Should we not write any declaration file if any of them can produce error, - // or should we just not write this file like we are doing now - if (!emitDeclarationResult.reportedDeclarationError) { + function writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) { + var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFiles, isBundledEmit); + var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; + if (!emitSkipped) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); + ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM); } + return emitSkipped; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; @@ -30045,14 +31022,11 @@ var ts; ts.writeDeclarationFile = writeDeclarationFile; })(ts || (ts = {})); /// +/// /// /* @internal */ var ts; (function (ts) { - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function getResolvedExternalModuleName(host, file) { return file.moduleName || ts.getExternalModuleNameFromPath(host, file.fileName); } @@ -30345,43 +31319,17 @@ var ts; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; - var modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === 2 /* ES6 */ ? 5 /* ES6 */ : 0 /* None */; + var languageVersion = ts.getEmitScriptTarget(compilerOptions); + var modulekind = ts.getEmitModuleKind(compilerOptions); var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - var diagnostics = []; + var emitterDiagnostics = ts.createDiagnosticCollection(); + var emitSkipped = false; var newLine = host.getNewLine(); - var jsxDesugaring = host.getCompilerOptions().jsx !== 1 /* Preserve */; - var shouldEmitJsx = function (s) { return (s.languageVariant === 1 /* JSX */ && !jsxDesugaring); }; - var outFile = compilerOptions.outFile || compilerOptions.out; var emitJavaScript = createFileEmitter(); - if (targetSourceFile === undefined) { - if (outFile) { - emitFile(outFile); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - } - } - else { - // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) - if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && outFile) { - emitFile(outFile); - } - } - // Sort and make the unique list of diagnostics - diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); + ts.forEachExpectedEmitFile(host, emitFile, targetSourceFile); return { - emitSkipped: false, - diagnostics: diagnostics, + emitSkipped: emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), sourceMaps: sourceMapDataList }; function isUniqueLocalName(name, container) { @@ -30429,6 +31377,8 @@ var ts; function createFileEmitter() { var writer = ts.createTextWriter(newLine); var write = writer.write, writeTextOfNode = writer.writeTextOfNode, writeLine = writer.writeLine, increaseIndent = writer.increaseIndent, decreaseIndent = writer.decreaseIndent; + var sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? ts.createSourceMapWriter(host, writer) : ts.getNullSourceMapWriter(); + var setSourceFile = sourceMap.setSourceFile, emitStart = sourceMap.emitStart, emitEnd = sourceMap.emitEnd, emitPos = sourceMap.emitPos; var currentSourceFile; var currentText; var currentLineMap; @@ -30451,40 +31401,18 @@ var ts; var decorateEmitted; var paramEmitted; var awaiterEmitted; - var tempFlags; + var tempFlags = 0; var tempVariables; var tempParameters; var externalImports; var exportSpecifiers; var exportEquals; - var hasExportStars; - /** Write emitted output to disk */ - var writeEmittedFiles = writeJavaScriptFile; + var hasExportStarsToExportValues; var detachedCommentsInfo; - var writeComment = ts.writeCommentRange; - /** Emit a node */ - var emit = emitNodeWithCommentsAndWithoutSourcemap; - /** Called just before starting emit of a node */ - var emitStart = function (node) { }; - /** Called once the emit of the node is done */ - var emitEnd = function (node) { }; - /** Emit the text for the given token that comes after startPos - * This by default writes the text provided with the given tokenKind - * but if optional emitFn callback is provided the text is emitted using the callback instead of default text - * @param tokenKind the kind of the token to search and emit - * @param startPos the position in the source to start searching for the token - * @param emitFn if given will be invoked to emit the text instead of actual token emit */ - var emitToken = emitTokenText; - /** Called to before starting the lexical scopes as in function/class in the emitted code because of node - * @param scopeDeclaration node that starts the lexical scope - * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - /** Called after coming out of the scope */ - var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; - /** The root file passed to the emit function (if present) */ - var root; + /** Is the file being emitted into its own file */ + var isOwnFileEmit; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; var moduleEmitDelegates = (_a = {}, @@ -30504,15 +31432,32 @@ var ts; _b ); return doEmit; - function doEmit(jsFilePath, rootFile) { + function doEmit(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit) { + sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + generatedNameSet = {}; + nodeToGeneratedName = []; + isOwnFileEmit = !isBundledEmit; + // Emit helpers from all the files + if (isBundledEmit && modulekind) { + ts.forEach(sourceFiles, emitEmitHelpers); + } + // Do not call emit directly. It does not set the currentSourceFile. + ts.forEach(sourceFiles, emitSourceFile); + writeLine(); + var sourceMappingURL = sourceMap.getSourceMappingURL(); + if (sourceMappingURL) { + write("//# sourceMappingURL=" + sourceMappingURL); + } + writeEmittedFiles(writer.getText(), jsFilePath, sourceMapFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); // reset the state + sourceMap.reset(); writer.reset(); currentSourceFile = undefined; currentText = undefined; currentLineMap = undefined; exportFunctionForFile = undefined; - generatedNameSet = {}; - nodeToGeneratedName = []; + generatedNameSet = undefined; + nodeToGeneratedName = undefined; computedPropertyNamesToGeneratedNames = undefined; convertedLoopState = undefined; extendsEmitted = false; @@ -30525,32 +31470,12 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = undefined; + hasExportStarsToExportValues = undefined; detachedCommentsInfo = undefined; sourceMapData = undefined; isEs6Module = false; renamedDependencies = undefined; isCurrentFileExternalModule = false; - root = rootFile; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(jsFilePath, root); - } - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - if (modulekind) { - ts.forEach(host.getSourceFiles(), emitEmitHelpers); - } - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if ((!isExternalModuleOrDeclarationFile(sourceFile)) || (modulekind && ts.isExternalModule(sourceFile))) { - emitSourceFile(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), jsFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM); } function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -30561,7 +31486,8 @@ var ts; renamedDependencies = sourceFile.renamedDependencies; currentFileIdentifiers = sourceFile.identifiers; isCurrentFileExternalModule = ts.isExternalModule(sourceFile); - emit(sourceFile); + setSourceFile(sourceFile); + emitNodeWithCommentsAndWithoutSourcemap(sourceFile); } function isUniqueName(name) { return !resolver.hasGlobalName(name) && @@ -30630,17 +31556,17 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return makeUniqueName(node.text); - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 222 /* ImportDeclaration */: - case 228 /* ExportDeclaration */: + case 224 /* ImportDeclaration */: + case 230 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 213 /* FunctionDeclaration */: - case 214 /* ClassDeclaration */: - case 227 /* ExportAssignment */: + case 215 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: + case 229 /* ExportAssignment */: return generateNameForExportDefault(); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return generateNameForClassExpression(); } } @@ -30648,338 +31574,15 @@ var ts; var id = ts.getNodeId(node); return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); } - function initializeEmitterWithSourceMaps(jsFilePath, root) { - var sourceMapDir; // The directory in which sourcemap will be - // Current source map file and its index in the sources list - var sourceMapSourceIndex = -1; - // Names and its index map - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; + /** Write emitted output to disk */ + function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark) { + if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { + ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), /*writeByteOrderMark*/ false); } - // Last recorded and encoded spans - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - // Encoding for sourcemap span - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - // Line/Comma delimiters - if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { - // Emit comma to separate the entry - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - // Emit line delimiters - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - // 1. Relative Column 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - // 2. Relative sourceIndex - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - // 3. Relative sourceLine 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - // 4. Relative sourceColumn 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - // 5. Relative namePosition 0 based - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - // Add a new least significant bit that has the sign of the value. - // if negative number the least significant bit that gets added to the number has value 1 - // else least significant bit value that gets added is 0 - // eg. -1 changes to binary : 01 [1] => 3 - // +1 changes to binary : 01 [0] => 2 - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - // Encode 5 bits at a time starting from least significant bits - var encodedStr = ""; - do { - var currentDigit = inValue & 31; // 11111 - inValue = inValue >> 5; - if (inValue > 0) { - // There are still more digits to decode, set the msb (6th bit) - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } + if (sourceMapDataList) { + sourceMapDataList.push(sourceMap.getSourceMapData()); } - function recordSourceMapSpan(pos) { - var sourceLinePos = ts.computeLineAndCharacterOfPosition(currentLineMap, pos); - // Convert the location to be one-based. - sourceLinePos.line++; - sourceLinePos.character++; - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - // If this location wasn't recorded or the location in source is going backwards, record the span - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine !== emittedLine || - lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - // Encode the last recordedSpan before assigning new - encodeLastRecordedSourceMapSpan(); - // New span - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - // Take the new pos instead since there is no change in emittedLine and column since last location - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(ts.skipTrivia(currentText, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentText, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - // Add the file to tsFilePaths - // If sourceroot option: Use the relative path corresponding to the common directory path - // otherwise source locations relative to map file location - var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - // The one that can be used from program to get the actual source file - sourceMapData.inputSourceFileNames.push(node.fileName); - if (compilerOptions.inlineSources) { - if (!sourceMapData.sourceMapSourcesContent) { - sourceMapData.sourceMapSourcesContent = []; - } - sourceMapData.sourceMapSourcesContent.push(node.text); - } - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - // Child scopes are always shown with a dot (even if they have no name), - // unless it is a computed property. Then it is shown with brackets, - // but the brackets are included in the name. - var name_21 = node.name; - if (!name_21 || name_21.kind !== 136 /* ComputedPropertyName */) { - scopeName = "." + scopeName; - } - scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - // The scope was already given a name use it - recordScopeNameStart(scopeName); - } - else if (node.kind === 213 /* FunctionDeclaration */ || - node.kind === 173 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 142 /* MethodSignature */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */ || - node.kind === 218 /* ModuleDeclaration */ || - node.kind === 214 /* ClassDeclaration */ || - node.kind === 217 /* EnumDeclaration */) { - // Declaration and has associated name use it - if (node.name) { - var name_22 = node.name; - // For computed property names, the text will include the brackets - scopeName = name_22.kind === 136 /* ComputedPropertyName */ - ? ts.getTextOfNode(name_22) - : node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - // Block just use the name from upper level scope - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(currentText, currentLineMap, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentText, currentLineMap, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { - if (typeof JSON !== "undefined") { - var map_1 = { - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }; - if (sourcesContent !== undefined) { - map_1.sourcesContent = sourcesContent; - } - return JSON.stringify(map_1); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, jsFilePath, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); - sourceMapDataList.push(sourceMapData); - var sourceMapUrl; - if (compilerOptions.inlineSourceMap) { - // Encode the sourceMap into the sourceMap url - var base64SourceMapText = ts.convertToBase64(sourceMapText); - sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; - } - else { - // Write source map file - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, /*writeByteOrderMark*/ false); - sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; - } - // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + sourceMapUrl, jsFilePath, writeByteOrderMark); - } - // Initialize source map data - var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapSourcesContent: undefined, - sourceMapDecodedMappings: [] - }; - // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the - // relative paths of the sources list in the sourcemap - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - // For modules or multiple emit files the mapRoot will have directory structure like the sources - // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - // The relative paths are relative to the common directory - sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), // get the relative sourceMapDir path based on jsFilePath - ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap - host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithSourceMap(node) { - if (node) { - if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); - } - if (node.kind !== 248 /* SourceFile */) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); - } - } - } - function emitNodeWithCommentsAndWithSourcemap(node) { - emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithCommentsAndWithSourcemap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, jsFilePath, writeByteOrderMark) { - ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); + ts.writeFile(host, emitterDiagnostics, jsFilePath, emitOutput, writeByteOrderMark); } // Create a temporary variable with a unique unused name. function createTempVariable(flags) { @@ -31011,7 +31614,15 @@ var ts; write(";"); } } - function emitTokenText(tokenKind, startPos, emitFn) { + /** Emit the text for the given token that comes after startPos + * This by default writes the text provided with the given tokenKind + * but if optional emitFn callback is provided the text is emitted using the callback instead of default text + * @param tokenKind the kind of the token to search and emit + * @param startPos the position in the source to start searching for the token + * @param emitFn if given will be invoked to emit the text instead of actual token emit */ + function emitToken(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(currentText, startPos); + emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); @@ -31019,7 +31630,9 @@ var ts; else { write(tokenString); } - return startPos + tokenString.length; + var tokenEndPos = tokenStartPos + tokenString.length; + emitPos(tokenEndPos); + return tokenEndPos; } function emitOptional(prefix, node) { if (node) { @@ -31036,11 +31649,6 @@ var ts; write(")"); } } - function emitTrailingCommaIfPresent(nodeList) { - if (nodeList.hasTrailingComma) { - write(","); - } - } function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); @@ -31113,7 +31721,7 @@ var ts; } function emitCommaList(nodes) { if (nodes) { - emitList(nodes, 0, nodes.length, /*multiline*/ false, /*trailingComma*/ false); + emitList(nodes, 0, nodes.length, /*multiLine*/ false, /*trailingComma*/ false); } } function emitLines(nodes) { @@ -31228,10 +31836,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 183 /* TemplateExpression */) { + if (node.template.kind === 185 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 181 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 183 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 24 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -31266,7 +31874,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 172 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 174 /* ParenthesizedExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { // If this is the first span and the head was not emitted, then this templateSpan's @@ -31308,11 +31916,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: return parent.expression === template; - case 170 /* TaggedTemplateExpression */: - case 172 /* ParenthesizedExpression */: + case 172 /* TaggedTemplateExpression */: + case 174 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -31333,7 +31941,7 @@ var ts; // TODO (drosen): Note that we need to account for the upcoming 'yield' and // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 37 /* AsteriskToken */: case 39 /* SlashToken */: @@ -31345,8 +31953,8 @@ var ts; default: return -1 /* LessThan */; } - case 184 /* YieldExpression */: - case 182 /* ConditionalExpression */: + case 186 /* YieldExpression */: + case 184 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -31374,13 +31982,13 @@ var ts; /// these emit into an object literal property name, we don't need to be worried /// about keywords, just non-identifier characters function emitAttributeName(name) { - if (/[A-Za-z_]+[\w*]/.test(name.text)) { - write("\""); + if (/^[A-Za-z_]\w*$/.test(name.text)) { emit(name); - write("\""); } else { + write("\""); emit(name); + write("\""); } } /// Emit an name/value pair for an attribute (e.g. "x: 3") @@ -31396,7 +32004,7 @@ var ts; } function emitJsxElement(openingNode, children) { var syntheticReactRef = ts.createSynthesizedNode(69 /* Identifier */); - syntheticReactRef.text = "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; // Call React.createElement(tag, ... emitLeadingComments(openingNode); @@ -31413,12 +32021,12 @@ var ts; // Either emit one big object literal (no spread attribs), or // a call to React.__spread var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 239 /* JsxSpreadAttribute */; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 241 /* JsxSpreadAttribute */; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 239 /* JsxSpreadAttribute */) { + if (attrs[i_1].kind === 241 /* JsxSpreadAttribute */) { // If this is the first argument, we need to emit a {} as the first argument if (i_1 === 0) { write("{}, "); @@ -31433,7 +32041,7 @@ var ts; emit(attrs[i_1].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 238 /* JsxAttribute */); + ts.Debug.assert(attrs[i_1].kind === 240 /* JsxAttribute */); if (haveOpenedObjectLiteral) { write(", "); } @@ -31467,11 +32075,11 @@ var ts; if (children) { for (var i = 0; i < children.length; i++) { // Don't emit empty expressions - if (children[i].kind === 240 /* JsxExpression */ && !(children[i].expression)) { + if (children[i].kind === 242 /* JsxExpression */ && !(children[i].expression)) { continue; } // Don't emit empty strings - if (children[i].kind === 236 /* JsxText */) { + if (children[i].kind === 238 /* JsxText */) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -31489,11 +32097,11 @@ var ts; write(")"); // closes "React.createElement(" emitTrailingComments(openingNode); } - if (node.kind === 233 /* JsxElement */) { + if (node.kind === 235 /* JsxElement */) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); emitJsxElement(node); } } @@ -31515,11 +32123,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 239 /* JsxSpreadAttribute */) { + if (attribs[i].kind === 241 /* JsxSpreadAttribute */) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 238 /* JsxAttribute */); + ts.Debug.assert(attribs[i].kind === 240 /* JsxAttribute */); emitJsxAttribute(attribs[i]); } } @@ -31527,11 +32135,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 234 /* JsxSelfClosingElement */)) { + if (node.attributes.length > 0 || (node.kind === 236 /* JsxSelfClosingElement */)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 234 /* JsxSelfClosingElement */) { + if (node.kind === 236 /* JsxSelfClosingElement */) { write("/>"); } else { @@ -31550,11 +32158,11 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 233 /* JsxElement */) { + if (node.kind === 235 /* JsxElement */) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 234 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); emitJsxOpeningOrSelfClosingElement(node); } } @@ -31562,7 +32170,7 @@ var ts; // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 163 /* BindingElement */); + ts.Debug.assert(node.kind !== 165 /* BindingElement */); if (node.kind === 9 /* StringLiteral */) { emitLiteral(node); } @@ -31610,59 +32218,60 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 164 /* ArrayLiteralExpression */: - case 189 /* AsExpression */: - case 181 /* BinaryExpression */: - case 168 /* CallExpression */: - case 241 /* CaseClause */: + case 166 /* ArrayLiteralExpression */: + case 191 /* AsExpression */: + case 183 /* BinaryExpression */: + case 170 /* CallExpression */: + case 243 /* CaseClause */: case 136 /* ComputedPropertyName */: - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: case 139 /* Decorator */: - case 175 /* DeleteExpression */: - case 197 /* DoStatement */: - case 167 /* ElementAccessExpression */: - case 227 /* ExportAssignment */: - case 195 /* ExpressionStatement */: - case 188 /* ExpressionWithTypeArguments */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 196 /* IfStatement */: - case 234 /* JsxSelfClosingElement */: - case 235 /* JsxOpeningElement */: - case 239 /* JsxSpreadAttribute */: - case 240 /* JsxExpression */: - case 169 /* NewExpression */: - case 172 /* ParenthesizedExpression */: - case 180 /* PostfixUnaryExpression */: - case 179 /* PrefixUnaryExpression */: - case 204 /* ReturnStatement */: - case 246 /* ShorthandPropertyAssignment */: - case 185 /* SpreadElementExpression */: - case 206 /* SwitchStatement */: - case 170 /* TaggedTemplateExpression */: - case 190 /* TemplateSpan */: - case 208 /* ThrowStatement */: - case 171 /* TypeAssertionExpression */: - case 176 /* TypeOfExpression */: - case 177 /* VoidExpression */: - case 198 /* WhileStatement */: - case 205 /* WithStatement */: - case 184 /* YieldExpression */: + case 177 /* DeleteExpression */: + case 199 /* DoStatement */: + case 169 /* ElementAccessExpression */: + case 229 /* ExportAssignment */: + case 197 /* ExpressionStatement */: + case 190 /* ExpressionWithTypeArguments */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 198 /* IfStatement */: + case 239 /* JsxClosingElement */: + case 236 /* JsxSelfClosingElement */: + case 237 /* JsxOpeningElement */: + case 241 /* JsxSpreadAttribute */: + case 242 /* JsxExpression */: + case 171 /* NewExpression */: + case 174 /* ParenthesizedExpression */: + case 182 /* PostfixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: + case 206 /* ReturnStatement */: + case 248 /* ShorthandPropertyAssignment */: + case 187 /* SpreadElementExpression */: + case 208 /* SwitchStatement */: + case 172 /* TaggedTemplateExpression */: + case 192 /* TemplateSpan */: + case 210 /* ThrowStatement */: + case 173 /* TypeAssertionExpression */: + case 178 /* TypeOfExpression */: + case 179 /* VoidExpression */: + case 200 /* WhileStatement */: + case 207 /* WithStatement */: + case 186 /* YieldExpression */: return true; - case 163 /* BindingElement */: - case 247 /* EnumMember */: + case 165 /* BindingElement */: + case 249 /* EnumMember */: case 138 /* Parameter */: - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: case 141 /* PropertyDeclaration */: - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return parent.initializer === node; - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return parent.expression === node; - case 174 /* ArrowFunction */: - case 173 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 175 /* FunctionExpression */: return parent.body === node; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return parent.moduleReference === node; case 135 /* QualifiedName */: return parent.left === node; @@ -31676,7 +32285,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 248 /* SourceFile */) { + if (container.kind === 250 /* SourceFile */) { // Identifier references module export if (modulekind !== 5 /* ES6 */ && modulekind !== 4 /* System */) { write("exports."); @@ -31692,17 +32301,17 @@ var ts; if (modulekind !== 5 /* ES6 */) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 223 /* ImportClause */) { + if (declaration.kind === 225 /* ImportClause */) { // Identifier references default import write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 /* ES3 */ ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 226 /* ImportSpecifier */) { + else if (declaration.kind === 228 /* ImportSpecifier */) { // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_23 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_23); + var name_21 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -31733,10 +32342,10 @@ var ts; if (languageVersion < 2 /* ES6 */) { var parent_6 = node.parent; switch (parent_6.kind) { - case 163 /* BindingElement */: - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 211 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 213 /* VariableDeclaration */: return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); } } @@ -31746,8 +32355,8 @@ var ts; if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { // in converted loop body arguments cannot be used directly. - var name_24 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_24); + var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_22); return; } } @@ -31771,6 +32380,9 @@ var ts; if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); } + else if (convertedLoopState) { + write(convertedLoopState.thisName || (convertedLoopState.thisName = makeUniqueName("this"))); + } else { write("this"); } @@ -31844,10 +32456,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 181 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 183 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 182 /* ConditionalExpression */ && node.parent.condition === node) { + else if (node.parent.kind === 184 /* ConditionalExpression */ && node.parent.condition === node) { return true; } return false; @@ -31855,11 +32467,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69 /* Identifier */: - case 164 /* ArrayLiteralExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: - case 168 /* CallExpression */: - case 172 /* ParenthesizedExpression */: + case 166 /* ArrayLiteralExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 174 /* ParenthesizedExpression */: // This list is not exhaustive and only includes those cases that are relevant // to the check in emitArrayLiteral. More cases can be added as needed. return false; @@ -31879,17 +32491,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 185 /* SpreadElementExpression */) { + if (e.kind === 187 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 164 /* ArrayLiteralExpression */) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166 /* ArrayLiteralExpression */) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 185 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 187 /* SpreadElementExpression */) { i++; } write("["); @@ -31912,7 +32524,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 185 /* SpreadElementExpression */; + return node.kind === 187 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -31921,7 +32533,7 @@ var ts; } else if (languageVersion >= 2 /* ES6 */ || !ts.forEach(elements, isSpreadElementExpression)) { write("["); - emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces:*/ false); + emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces*/ false); write("]"); } else { @@ -31941,7 +32553,7 @@ var ts; // then try to preserve the original shape of the object literal. // Otherwise just try to preserve the formatting. if (numElements === properties.length) { - emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= 1 /* ES5 */, /* spacesBetweenBraces */ true); + emitLinePreservingList(node, properties, /*allowTrailingComma*/ languageVersion >= 1 /* ES5 */, /*spacesBetweenBraces*/ true); } else { var multiLine = (node.flags & 1024 /* MultiLine */) !== 0; @@ -32034,10 +32646,10 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 245 /* PropertyAssignment */) { + if (property.kind === 247 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 246 /* ShorthandPropertyAssignment */) { + else if (property.kind === 248 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } else if (property.kind === 143 /* MethodDeclaration */) { @@ -32090,21 +32702,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(181 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(183 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(166 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(168 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(167 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(169 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -32112,7 +32724,7 @@ var ts; function parenthesizeForAccess(expr) { // When diagnosing whether the expression needs parentheses, the decision should be based // on the innermost expression in a chain of nested type assertions. - while (expr.kind === 171 /* TypeAssertionExpression */ || expr.kind === 189 /* AsExpression */) { + while (expr.kind === 173 /* TypeAssertionExpression */ || expr.kind === 191 /* AsExpression */) { expr = expr.expression; } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary @@ -32124,11 +32736,11 @@ var ts; // 1.x -> not the same as (1).x // if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 169 /* NewExpression */ && + expr.kind !== 171 /* NewExpression */ && expr.kind !== 8 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(172 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(174 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -32163,7 +32775,7 @@ var ts; // Return true if identifier resolves to an exported member of a namespace function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 248 /* SourceFile */; + return container && container.kind !== 250 /* SourceFile */; } function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here @@ -32193,7 +32805,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 166 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 168 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -32204,7 +32816,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 166 /* PropertyAccessExpression */ || node.kind === 167 /* ElementAccessExpression */ + return node.kind === 168 /* PropertyAccessExpression */ || node.kind === 169 /* ElementAccessExpression */ ? resolver.getConstantValue(node) : undefined; } @@ -32296,6 +32908,9 @@ var ts; case 135 /* QualifiedName */: emitQualifiedNameAsExpression(node, useFallback); break; + default: + emitNodeWithoutSourceMap(node); + break; } } function emitIndexedAccess(node) { @@ -32308,10 +32923,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 185 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 187 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 172 /* ParenthesizedExpression */ || node.kind === 171 /* TypeAssertionExpression */ || node.kind === 189 /* AsExpression */) { + while (node.kind === 174 /* ParenthesizedExpression */ || node.kind === 173 /* TypeAssertionExpression */ || node.kind === 191 /* AsExpression */) { node = node.expression; } return node; @@ -32332,13 +32947,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 166 /* PropertyAccessExpression */) { + if (expr.kind === 168 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 167 /* ElementAccessExpression */) { + else if (expr.kind === 169 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -32383,7 +32998,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 166 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; + superCall = node.expression.kind === 168 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -32425,7 +33040,7 @@ var ts; write(".bind.apply("); emit(target); write(", [void 0].concat("); - emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiline*/ false, /*trailingComma*/ false, /*useConcat*/ false); + emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*trailingComma*/ false, /*useConcat*/ false); write(")))"); write("()"); } @@ -32452,12 +33067,12 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 174 /* ArrowFunction */) { - if (node.expression.kind === 171 /* TypeAssertionExpression */ || node.expression.kind === 189 /* AsExpression */) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176 /* ArrowFunction */) { + if (node.expression.kind === 173 /* TypeAssertionExpression */ || node.expression.kind === 191 /* AsExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind === 171 /* TypeAssertionExpression */ || operand.kind === 189 /* AsExpression */) { + while (operand.kind === 173 /* TypeAssertionExpression */ || operand.kind === 191 /* AsExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -32468,15 +33083,15 @@ var ts; // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() // new (A()) should be emitted as new (A()) and not new A() // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () - if (operand.kind !== 179 /* PrefixUnaryExpression */ && - operand.kind !== 177 /* VoidExpression */ && - operand.kind !== 176 /* TypeOfExpression */ && - operand.kind !== 175 /* DeleteExpression */ && - operand.kind !== 180 /* PostfixUnaryExpression */ && - operand.kind !== 169 /* NewExpression */ && - !(operand.kind === 168 /* CallExpression */ && node.parent.kind === 169 /* NewExpression */) && - !(operand.kind === 173 /* FunctionExpression */ && node.parent.kind === 168 /* CallExpression */) && - !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 166 /* PropertyAccessExpression */)) { + if (operand.kind !== 181 /* PrefixUnaryExpression */ && + operand.kind !== 179 /* VoidExpression */ && + operand.kind !== 178 /* TypeOfExpression */ && + operand.kind !== 177 /* DeleteExpression */ && + operand.kind !== 182 /* PostfixUnaryExpression */ && + operand.kind !== 171 /* NewExpression */ && + !(operand.kind === 170 /* CallExpression */ && node.parent.kind === 171 /* NewExpression */) && + !(operand.kind === 175 /* FunctionExpression */ && node.parent.kind === 170 /* CallExpression */) && + !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 168 /* PropertyAccessExpression */)) { emit(operand); return; } @@ -32505,14 +33120,15 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 /* Identifier */ || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 211 /* VariableDeclaration */ || node.parent.kind === 163 /* BindingElement */); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 /* VariableDeclaration */ || node.parent.kind === 165 /* BindingElement */); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, /*isExported*/ true); } function emitPrefixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + var exportChanged = (node.operator === 41 /* PlusPlusToken */ || node.operator === 42 /* MinusMinusToken */) && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); if (exportChanged) { // emit // ++x @@ -32535,7 +33151,7 @@ var ts; // the resulting expression a prefix increment operation. And in the second, it will make the resulting // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. - if (node.operand.kind === 179 /* PrefixUnaryExpression */) { + if (node.operand.kind === 181 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 35 /* PlusToken */ && (operand.operator === 35 /* PlusToken */ || operand.operator === 41 /* PlusPlusToken */)) { write(" "); @@ -32591,10 +33207,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 248 /* SourceFile */) { + if (current.kind === 250 /* SourceFile */) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2 /* Export */) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 219 /* ModuleBlock */) { + else if (ts.isFunctionLike(current) || current.kind === 221 /* ModuleBlock */) { return false; } else { @@ -32614,8 +33230,8 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(167 /* ElementAccessExpression */, /*startsOnNewLine*/ false); - var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldEmitCommaBeforeAssignment*/ false); + synthesizedLHS = ts.createSynthesizedNode(169 /* ElementAccessExpression */, /*startsOnNewLine*/ false); + var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 /* NumericLiteral */ && leftHandSideExpression.argumentExpression.kind !== 9 /* StringLiteral */) { @@ -32631,8 +33247,8 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(166 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); - var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false); + synthesizedLHS = ts.createSynthesizedNode(168 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); + var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; synthesizedLHS.name = leftHandSideExpression.name; @@ -32659,8 +33275,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 56 /* EqualsToken */ && - (node.left.kind === 165 /* ObjectLiteralExpression */ || node.left.kind === 164 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 195 /* ExpressionStatement */); + (node.left.kind === 167 /* ObjectLiteralExpression */ || node.left.kind === 166 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 197 /* ExpressionStatement */); } else { var exportChanged = node.operatorToken.kind >= 56 /* FirstAssignment */ && @@ -32725,7 +33341,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 192 /* Block */) { + if (node && node.kind === 194 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -32739,22 +33355,20 @@ var ts; } emitToken(15 /* OpenBraceToken */, node.pos); increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 219 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 218 /* ModuleDeclaration */); + if (node.kind === 221 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 220 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 219 /* ModuleBlock */) { + if (node.kind === 221 /* ModuleBlock */) { emitTempDeclarations(/*newLine*/ true); } decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.statements.end); - scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 192 /* Block */) { + if (node.kind === 194 /* Block */) { write(" "); emit(node); } @@ -32766,7 +33380,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 174 /* ArrowFunction */); + emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 176 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -32779,7 +33393,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 196 /* IfStatement */) { + if (node.elseStatement.kind === 198 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -32794,12 +33408,12 @@ var ts; function emitDoStatementWorker(node, loop) { write("do"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } - if (node.statement.kind === 192 /* Block */) { + if (node.statement.kind === 194 /* Block */) { write(" "); } else { @@ -32817,10 +33431,10 @@ var ts; emit(node.expression); write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } /** @@ -32834,7 +33448,7 @@ var ts; return false; } if (convertedLoopState && (ts.getCombinedNodeFlags(decl) & 24576 /* BlockScoped */) === 0) { - // we are inside a converted loop - this can only happen in downlevel scenarios + // we are inside a converted loop - this can only happen in downlevel scenarios // record names for all variable declarations for (var _a = 0, _b = decl.declarations; _a < _b.length; _a++) { var varDecl = _b[_a]; @@ -32898,7 +33512,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 207 /* LabeledStatement */) { + if (node.parent.kind === 209 /* LabeledStatement */) { // if parent of the loop was labeled statement - attach the label to loop skipping converted loop body emitLabelAndColon(node.parent); } @@ -32909,10 +33523,10 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + if (node.initializer.kind === 214 /* VariableDeclarationList */) { loopInitializer = node.initializer; } break; @@ -32926,7 +33540,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 192 /* Block */; + var bodyIsBlock = node.statement.kind === 194 /* Block */; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -32945,6 +33559,11 @@ var ts; // use the same name in all nested loops convertedLoopState.argumentsName = convertedOuterLoopState.argumentsName; } + if (convertedOuterLoopState.thisName) { + // outer loop has already used 'this' so we've already have some name to alias it + // use the same name in all nested loops + convertedLoopState.thisName = convertedOuterLoopState.thisName; + } if (convertedOuterLoopState.hoistedLocalVariables) { // we've already collected some non-block scoped variable declarations in enclosing loop // use the same storage in nested loop @@ -32971,6 +33590,21 @@ var ts; writeLine(); } } + if (convertedLoopState.thisName) { + // if alias for this is set + if (convertedOuterLoopState) { + // pass it to outer converted loop + convertedOuterLoopState.thisName = convertedLoopState.thisName; + } + else { + // this is top level converted loop so we need to create an alias for 'this' here + // NOTE: + // if converted loops were all nested in arrow function then we'll always emit '_this' so convertedLoopState.thisName will not be set. + // If it is set this means that all nested loops are not nested in arrow function and it is safe to capture 'this'. + write("var " + convertedLoopState.thisName + " = this;"); + writeLine(); + } + } if (convertedLoopState.hoistedLocalVariables) { // if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later if (convertedOuterLoopState) { @@ -33027,7 +33661,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 192 /* Block */) { + else if (node.statement.kind === 194 /* Block */) { emitLines(node.statement.statements); } else { @@ -33097,8 +33731,8 @@ var ts; } write("switch(" + loopResultVariable + ") {"); increaseIndent(); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /* isBreak */ true, loopResultVariable, outerLoop); - emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /* isBreak */ false, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /*isBreak*/ true, loopResultVariable, outerLoop); + emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /*isBreak*/ false, loopResultVariable, outerLoop); decreaseIndent(); writeLine(); write("}"); @@ -33113,7 +33747,7 @@ var ts; write("case \"" + labelMarker + "\": "); // if there are no outer converted loop or outer label in question is located inside outer converted loop // then emit labeled break\continue - // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do + // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do if (!outerLoop || (outerLoop.labels && outerLoop.labels[labelText])) { if (isBreak) { write("break "); @@ -33137,7 +33771,7 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); if (startIsEmitted) { @@ -33156,14 +33790,14 @@ var ts; emitOptional(" ", node.incrementor); write(")"); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 201 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 203 /* ForOfStatement */) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -33174,7 +33808,7 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); @@ -33184,7 +33818,7 @@ var ts; else { emit(node.initializer); } - if (node.kind === 200 /* ForInStatement */) { + if (node.kind === 202 /* ForInStatement */) { write(" in "); } else { @@ -33193,15 +33827,12 @@ var ts; emit(node.expression); emitToken(18 /* CloseParenToken */, node.expression.end); if (loop) { - emitConvertedLoopCall(loop, /* emitAsBlock */ true); + emitConvertedLoopCall(loop, /*emitAsBlock*/ true); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } } - function emitDownLevelForOfStatement(node) { - emitLoop(node, emitDownLevelForOfStatementWorker); - } function emitDownLevelForOfStatementWorker(node, loop) { // The following ES6 code: // @@ -33277,7 +33908,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 212 /* VariableDeclarationList */) { + if (node.initializer.kind === 214 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -33307,7 +33938,7 @@ var ts; // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 56 /* EqualsToken */, rhsIterationValue, /*startsOnNewLine*/ false); - if (node.initializer.kind === 164 /* ArrayLiteralExpression */ || node.initializer.kind === 165 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 166 /* ArrayLiteralExpression */ || node.initializer.kind === 167 /* ObjectLiteralExpression */) { // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); @@ -33320,10 +33951,10 @@ var ts; write(";"); if (loop) { writeLine(); - emitConvertedLoopCall(loop, /* emitAsBlock */ false); + emitConvertedLoopCall(loop, /*emitAsBlock*/ false); } else { - emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ false); + emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ false); } writeLine(); decreaseIndent(); @@ -33335,12 +33966,12 @@ var ts; // it is possible if either // - break\continue is statement labeled and label is located inside the converted loop // - break\continue is non-labeled and located in non-converted loop\switch statement - var jump = node.kind === 203 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 205 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 203 /* BreakStatement */) { + if (node.kind === 205 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; write("return \"break\";"); } @@ -33351,20 +33982,20 @@ var ts; } else { var labelMarker; - if (node.kind === 203 /* BreakStatement */) { + if (node.kind === 205 /* BreakStatement */) { labelMarker = "break-" + node.label.text; - setLabeledJump(convertedLoopState, /* isBreak */ true, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } else { labelMarker = "continue-" + node.label.text; - setLabeledJump(convertedLoopState, /* isBreak */ false, node.label.text, labelMarker); + setLabeledJump(convertedLoopState, /*isBreak*/ false, node.label.text, labelMarker); } write("return \"" + labelMarker + "\";"); } return; } } - emitToken(node.kind === 203 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -33430,7 +34061,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 241 /* CaseClause */) { + if (node.kind === 243 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -33499,7 +34130,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 218 /* ModuleDeclaration */); + } while (node && node.kind !== 220 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -33524,22 +34155,22 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(177 /* VoidExpression */); + var result = ts.createSynthesizedNode(179 /* VoidExpression */); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 248 /* SourceFile */) { - ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 227 /* ExportAssignment */); + if (node.parent.kind === 250 /* SourceFile */) { + ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 229 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { if (!isEs6Module) { - if (languageVersion === 1 /* ES5 */) { + if (languageVersion !== 0 /* ES3 */) { // default value of configurable, enumerable, writable are `false`. write("Object.defineProperty(exports, \"__esModule\", { value: true });"); writeLine(); } - else if (languageVersion === 0 /* ES3 */) { + else { write("exports.__esModule = true;"); writeLine(); } @@ -33636,7 +34267,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 211 /* VariableDeclaration */ || name.parent.kind === 163 /* BindingElement */); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 /* VariableDeclaration */ || name.parent.kind === 165 /* BindingElement */); if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } @@ -33670,7 +34301,7 @@ var ts; // Also temporary variables should be explicitly allocated for source level declarations when module target is system // because actual variable declarations are hoisted var canDefineTempVariablesInPlace = false; - if (root.kind === 211 /* VariableDeclaration */) { + if (root.kind === 213 /* VariableDeclaration */) { var isExported = ts.getCombinedNodeFlags(root) & 2 /* Export */; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; @@ -33678,7 +34309,7 @@ var ts; else if (root.kind === 138 /* Parameter */) { canDefineTempVariablesInPlace = true; } - if (root.kind === 181 /* BinaryExpression */) { + if (root.kind === 183 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -33707,14 +34338,14 @@ var ts; // we need to generate a temporary variable value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(181 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(183 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(182 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(184 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -33731,7 +34362,7 @@ var ts; var index; var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, /* reuseIdentifierExpression */ false); + index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -33744,7 +34375,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(168 /* CallExpression */); + var call = ts.createSynthesizedNode(170 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(69 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -33761,9 +34392,9 @@ var ts; } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 245 /* PropertyAssignment */ || p.kind === 246 /* ShorthandPropertyAssignment */) { + if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { var propName = p.name; - var target_1 = p.kind === 246 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; + var target_1 = p.kind === 248 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); } } @@ -33777,8 +34408,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 187 /* OmittedExpression */) { - if (e.kind !== 185 /* SpreadElementExpression */) { + if (e.kind !== 189 /* OmittedExpression */) { + if (e.kind !== 187 /* SpreadElementExpression */) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -33788,20 +34419,20 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 246 /* ShorthandPropertyAssignment */) { + if (target.kind === 248 /* ShorthandPropertyAssignment */) { if (target.objectAssignmentInitializer) { value = createDefaultValueCheck(value, target.objectAssignmentInitializer); } target = target.name; } - else if (target.kind === 181 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + else if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 165 /* ObjectLiteralExpression */) { + if (target.kind === 167 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 164 /* ArrayLiteralExpression */) { + else if (target.kind === 166 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -33819,14 +34450,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 172 /* ParenthesizedExpression */) { + if (root.parent.kind !== 174 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 172 /* ParenthesizedExpression */) { + if (root.parent.kind !== 174 /* ParenthesizedExpression */) { write(")"); } } @@ -33853,12 +34484,12 @@ var ts; } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 161 /* ObjectBindingPattern */) { + if (pattern.kind === 163 /* ObjectBindingPattern */) { // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 187 /* OmittedExpression */) { + else if (element.kind !== 189 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -33898,8 +34529,8 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 8192 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isLetDefinedInLoop && - node.parent.parent.kind !== 200 /* ForInStatement */ && - node.parent.parent.kind !== 201 /* ForOfStatement */) { + node.parent.parent.kind !== 202 /* ForInStatement */ && + node.parent.parent.kind !== 203 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -33917,7 +34548,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 187 /* OmittedExpression */) { + if (node.kind === 189 /* OmittedExpression */) { return; } var name = node.name; @@ -33929,7 +34560,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 211 /* VariableDeclaration */ && node.parent.kind !== 163 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 213 /* VariableDeclaration */ && node.parent.kind !== 165 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -33937,7 +34568,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2 /* Export */) && modulekind === 5 /* ES6 */ && - node.parent.kind === 248 /* SourceFile */; + node.parent.kind === 250 /* SourceFile */; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -33988,12 +34619,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_25 = createTempVariable(0 /* Auto */); + var name_23 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_25); - emit(name_25); + tempParameters.push(name_23); + emit(name_23); } else { emit(node.name); @@ -34103,7 +34734,7 @@ var ts; emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 174 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 176 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -34114,13 +34745,13 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 173 /* FunctionExpression */) { + if (node.kind === 175 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) - return !!node.name || languageVersion < 2 /* ES6 */; + return !!node.name || modulekind !== 5 /* ES6 */; } } function emitFunctionDeclaration(node) { @@ -34129,20 +34760,29 @@ var ts; } // TODO (yuisu) : we should not have special cases to condition emitting comments // but have one place to fix check for these conditions. - if (node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */ && - node.parent && node.parent.kind !== 245 /* PropertyAssignment */ && - node.parent.kind !== 168 /* CallExpression */) { - // 1. Methods will emit the comments as part of emitting method declaration + var kind = node.kind, parent = node.parent; + if (kind !== 143 /* MethodDeclaration */ && + kind !== 142 /* MethodSignature */ && + parent && + parent.kind !== 247 /* PropertyAssignment */ && + parent.kind !== 170 /* CallExpression */ && + parent.kind !== 166 /* ArrayLiteralExpression */) { + // 1. Methods will emit comments at their assignment declaration sites. + // // 2. If the function is a property of object literal, emitting leading-comments - // is done by emitNodeWithoutSourceMap which then call this function. - // In particular, we would like to avoid emit comments twice in following case: - // For example: + // is done by emitNodeWithoutSourceMap which then call this function. + // In particular, we would like to avoid emit comments twice in following case: + // // var obj = { // id: // /*comment*/ () => void // } + // // 3. If the function is an argument in call expression, emitting of comments will be - // taken care of in emit list of arguments inside of emitCallexpression + // taken care of in emit list of arguments inside of 'emitCallExpression'. + // + // 4. If the function is in an array literal, 'emitLinePreservingList' will take care + // of leading comments. emitLeadingComments(node); } emitStart(node); @@ -34165,11 +34805,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 /* ES6 */ && node.kind === 213 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { + if (modulekind !== 5 /* ES6 */ && kind === 215 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */) { + if (kind !== 143 /* MethodDeclaration */ && kind !== 142 /* MethodSignature */) { emitTrailingComments(node); } } @@ -34202,7 +34842,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 174 /* ArrowFunction */; + var isArrowFunction = node.kind === 176 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -34285,17 +34925,16 @@ var ts; } write(" __awaiter(this"); if (hasLexicalArguments) { - write(", arguments"); + write(", arguments, "); } else { - write(", void 0"); + write(", void 0, "); } if (promiseConstructor) { - write(", "); - emitNodeWithoutSourceMap(promiseConstructor); + emitEntityNameAsExpression(promiseConstructor, /*useFallback*/ false); } else { - write(", Promise"); + write("Promise"); } // Emit the call to __awaiter. if (hasLexicalArguments) { @@ -34322,7 +34961,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 192 /* Block */) { + if (node.body.kind === 194 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -34348,7 +34987,7 @@ var ts; emitSignatureParameters(node); } var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync && languageVersion === 2 /* ES6 */) { + if (isAsync) { emitAsyncFunctionBodyForES6(node); } else { @@ -34381,14 +35020,13 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 171 /* TypeAssertionExpression */) { + while (current.kind === 173 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 165 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 167 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); increaseIndent(); var outPos = writer.getTextPos(); emitDetachedCommentsAndUpdateCommentsInfo(node.body); @@ -34411,8 +35049,10 @@ var ts; increaseIndent(); writeLine(); emitLeadingComments(node.body); + emitStart(body); write("return "); emit(body); + emitEnd(body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(/*newLine*/ true); @@ -34422,11 +35062,9 @@ var ts; emitStart(node.body); write("}"); emitEnd(node.body); - scopeEmitEnd(); } function emitBlockFunctionBody(node, body) { write(" {"); - scopeEmitStart(node); var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedCommentsAndUpdateCommentsInfo(body.statements); @@ -34455,14 +35093,13 @@ var ts; decreaseIndent(); } emitToken(16 /* CloseBraceToken */, body.statements.end); - scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 195 /* ExpressionStatement */) { + if (statement && statement.kind === 197 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 168 /* CallExpression */) { + if (expr && expr.kind === 170 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 95 /* SuperKeyword */) { return statement; @@ -34548,7 +35185,7 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 191 /* SemicolonClassElement */) { + if (member.kind === 193 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -34645,7 +35282,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 191 /* SemicolonClassElement */) { + else if (member.kind === 193 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -34719,7 +35356,6 @@ var ts; } var startIndex = 0; write(" {"); - scopeEmitStart(node, "constructor"); increaseIndent(); if (ctor) { // Emit all the directive prologues (like "use strict"). These have to come before @@ -34754,7 +35390,7 @@ var ts; emitEnd(baseTypeElement); } } - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -34769,7 +35405,6 @@ var ts; } decreaseIndent(); emitToken(16 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { emitTrailingComments(ctor); @@ -34794,7 +35429,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { if (thisNodeIsDecorated) { // To preserve the correct runtime semantics when decorators are applied to the class, // the emit needs to follow one of the following rules: @@ -34870,8 +35505,8 @@ var ts; // // This keeps the expression as an expression, while ensuring that the static parts // of it have been initialized by the time it is used. - var staticProperties = getInitializedProperties(node, /*static:*/ true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 186 /* ClassExpression */; + var staticProperties = getInitializedProperties(node, /*isStatic*/ true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -34884,7 +35519,7 @@ var ts; // emit name if // - node has a name // - this is default export with static initializers - if ((node.name || (node.flags & 512 /* Default */ && staticProperties.length > 0)) && !thisNodeIsDecorated) { + if ((node.name || (node.flags & 512 /* Default */ && (staticProperties.length > 0 || modulekind !== 5 /* ES6 */))) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -34895,14 +35530,12 @@ var ts; } write(" {"); increaseIndent(); - scopeEmitStart(node); writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. // For a decorated class, we need to assign its name (if it has one). This is because we emit // the class as a class expression to avoid the double-binding of the identifier: @@ -34924,7 +35557,7 @@ var ts; var property = staticProperties_1[_a]; write(","); writeLine(); - emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true); + emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true); } write(","); writeLine(); @@ -34937,27 +35570,37 @@ var ts; emitPropertyDeclarations(node, staticProperties); emitDecoratorsOfClass(node); } - // If this is an exported class, but not on the top level (i.e. on an internal - // module), export it - if (!isES6ExportedDeclaration(node) && (node.flags & 2 /* Export */)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); + if (!(node.flags & 2 /* Export */)) { + return; } - else if (isES6ExportedDeclaration(node) && (node.flags & 512 /* Default */) && thisNodeIsDecorated) { - // if this is a top level default export of decorated class, write the export after the declaration. - writeLine(); - write("export default "); - emitDeclarationName(node); - write(";"); + if (modulekind !== 5 /* ES6 */) { + emitExportMemberAssignment(node); + } + else { + // If this is an exported class, but not on the top level (i.e. on an internal + // module), export it + if (node.flags & 512 /* Default */) { + // if this is a top level default export of decorated class, write the export after the declaration. + if (thisNodeIsDecorated) { + writeLine(); + write("export default "); + emitDeclarationName(node); + write(";"); + } + } + else if (node.parent.kind !== 250 /* SourceFile */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emitDeclarationName(node); + emitEnd(node); + write(";"); + } } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { // source file level classes in system modules are hoisted so 'var's for them are already defined if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); @@ -34982,7 +35625,6 @@ var ts; tempParameters = undefined; computedPropertyNamesToGeneratedNames = undefined; increaseIndent(); - scopeEmitStart(node); if (baseTypeNode) { writeLine(); emitStart(baseTypeNode); @@ -34994,7 +35636,7 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true)); + emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -35013,18 +35655,17 @@ var ts; decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); emitStart(node); - write(")("); + write("("); if (baseTypeNode) { emit(baseTypeNode.expression); } - write(")"); - if (node.kind === 214 /* ClassDeclaration */) { + write("))"); + if (node.kind === 216 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { emitExportMemberAssignment(node); } } @@ -35042,9 +35683,9 @@ var ts; function emitDecoratorsOfConstructor(node) { var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + var firstParameterDecorator = constructor && ts.forEach(constructor.parameters, function (parameter) { return parameter.decorators; }); // skip decoration of the constructor if neither it nor its parameters are decorated - if (!decorators && !hasDecoratedParameters) { + if (!decorators && !firstParameterDecorator) { return; } // Emit the call to __decorate. Given the class: @@ -35058,25 +35699,24 @@ var ts; // C = __decorate([dec], C); // writeLine(); - emitStart(node); + emitStart(node.decorators || firstParameterDecorator); emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(constructor, /*leadingComma*/ argumentsWritten > 0); + } emitSerializedTypeMetadata(node, /*leadingComma*/ argumentsWritten >= 0); decreaseIndent(); writeLine(); write("], "); emitDeclarationName(node); - write(");"); - emitEnd(node); + write(")"); + emitEnd(node.decorators || firstParameterDecorator); + write(";"); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { @@ -35090,10 +35730,6 @@ var ts; if (!ts.nodeCanBeDecorated(member)) { continue; } - // skip a member if it or any of its parameters are not decorated - if (!ts.nodeOrChildIsDecorated(member)) { - continue; - } // skip an accessor declaration if it is not the first accessor var decorators = void 0; var functionLikeMember = void 0; @@ -35117,6 +35753,11 @@ var ts; functionLikeMember = member; } } + var firstParameterDecorator = functionLikeMember && ts.forEach(functionLikeMember.parameters, function (parameter) { return parameter.decorators; }); + // skip a member if it or any of its parameters are not decorated + if (!decorators && !firstParameterDecorator) { + continue; + } // Emit the call to __decorate. Given the following: // // class C { @@ -35148,26 +35789,22 @@ var ts; // ], C.prototype, "prop"); // writeLine(); - emitStart(member); + emitStart(decorators || firstParameterDecorator); write("__decorate(["); increaseIndent(); writeLine(); var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + var argumentsWritten = emitList(decorators, 0, decoratorCount, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ false, /*noTrailingNewLine*/ true, function (decorator) { return emit(decorator.expression); }); + if (firstParameterDecorator) { + argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); + } emitSerializedTypeMetadata(member, argumentsWritten > 0); decreaseIndent(); writeLine(); write("], "); - emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); - emitEnd(member.name); if (languageVersion > 0 /* ES3 */) { if (member.kind !== 141 /* PropertyDeclaration */) { // We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly. @@ -35180,8 +35817,9 @@ var ts; write(", void 0"); } } - write(");"); - emitEnd(member); + write(")"); + emitEnd(decorators || firstParameterDecorator); + write(";"); writeLine(); } } @@ -35194,15 +35832,13 @@ var ts; if (ts.nodeIsDecorated(parameter)) { var decorators = parameter.decorators; argumentsWritten += emitList(decorators, 0, decorators.length, /*multiLine*/ true, /*trailingComma*/ false, /*leadingComma*/ leadingComma, /*noTrailingNewLine*/ true, function (decorator) { - emitStart(decorator); write("__param(" + parameterIndex + ", "); emit(decorator.expression); write(")"); - emitEnd(decorator); }); leadingComma = true; } - ++parameterIndex; + parameterIndex++; } } return argumentsWritten; @@ -35235,7 +35871,7 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: case 143 /* MethodDeclaration */: case 146 /* SetAccessor */: return true; @@ -35255,7 +35891,7 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: write("Function"); return; case 141 /* PropertyDeclaration */: @@ -35299,7 +35935,7 @@ var ts; write("Boolean"); return; case 130 /* StringKeyword */: - case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: write("String"); return; case 128 /* NumberKeyword */: @@ -35316,6 +35952,7 @@ var ts; case 158 /* UnionType */: case 159 /* IntersectionType */: case 117 /* AnyKeyword */: + case 161 /* ThisType */: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -35331,8 +35968,7 @@ var ts; location = location.parent; } // Clone the type name and parent it to a location outside of the current declaration. - var typeName = ts.cloneEntityName(node.typeName); - typeName.parent = location; + var typeName = ts.cloneEntityName(node.typeName, location); var result = resolver.getTypeReferenceSerializationKind(typeName); switch (result) { case ts.TypeReferenceSerializationKind.Unknown: @@ -35389,7 +36025,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -35484,9 +36120,10 @@ var ts; } if (!shouldHoistDeclarationInSystemJsModule(node)) { // do not emit var if variable was already hoisted - if (!(node.flags & 2 /* Export */) || isES6ExportedDeclaration(node)) { + var isES6ExportedEnum = isES6ExportedDeclaration(node); + if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219 /* EnumDeclaration */))) { emitStart(node); - if (isES6ExportedDeclaration(node)) { + if (isES6ExportedEnum) { write("export "); } write("var "); @@ -35503,12 +36140,10 @@ var ts; emitEnd(node.name); write(") {"); increaseIndent(); - scopeEmitStart(node); emitLines(node.members); decreaseIndent(); writeLine(); emitToken(16 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); write(")("); emitModuleMemberName(node); write(" || ("); @@ -35568,7 +36203,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 218 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -35579,6 +36214,9 @@ var ts; function isModuleMergedWithES6Class(node) { return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 32768 /* LexicalModuleMergesWithClass */); } + function isFirstDeclarationOfKind(node, declarations, kind) { + return !ts.forEach(declarations, function (declaration) { return declaration.kind === kind && declaration.pos < node.pos; }); + } function emitModuleDeclaration(node) { // Emit only if this module is non-ambient. var shouldEmit = shouldEmitModuleDeclaration(node); @@ -35588,15 +36226,18 @@ var ts; var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + var isES6ExportedNamespace = isES6ExportedDeclaration(node); + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* ModuleDeclaration */)) { + emitStart(node); + if (isES6ExportedNamespace) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); } emitStart(node); write("(function ("); @@ -35604,7 +36245,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 219 /* ModuleBlock */) { + if (node.body.kind === 221 /* ModuleBlock */) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -35620,7 +36261,6 @@ var ts; else { write("{"); increaseIndent(); - scopeEmitStart(node); emitCaptureThisForNodeIfNecessary(node); writeLine(); emit(node.body); @@ -35628,7 +36268,6 @@ var ts; writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; emitToken(16 /* CloseBraceToken */, moduleBlock.statements.end); - scopeEmitEnd(); } write(")("); // write moduleDecl = containingModule.m only if it is not exported es6 module member @@ -35682,16 +36321,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 221 /* ImportEqualsDeclaration */) { + if (node.kind === 223 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 222 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 224 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -35719,7 +36358,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -35745,7 +36384,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 221 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; + var isExportedImport = node.kind === 223 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2 /* AMD */) { emitLeadingComments(node); @@ -35764,7 +36403,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 222 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 224 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -35882,15 +36521,17 @@ var ts; } else { // export * from "foo" - writeLine(); - write("__export("); - if (modulekind !== 2 /* AMD */) { - emitRequire(ts.getExternalModuleName(node)); + if (hasExportStarsToExportValues && resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + writeLine(); + write("__export("); + if (modulekind !== 2 /* AMD */) { + emitRequire(ts.getExternalModuleName(node)); + } + else { + write(generatedName); + } + write(");"); } - else { - write(generatedName); - } - write(");"); } emitEnd(node); } @@ -35941,8 +36582,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 213 /* FunctionDeclaration */ && - expression.kind !== 214 /* ClassDeclaration */) { + if (expression.kind !== 215 /* FunctionDeclaration */ && + expression.kind !== 216 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -35975,11 +36616,11 @@ var ts; externalImports = []; exportSpecifiers = {}; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, /*checkChildren*/ true)) { // import "mod" @@ -35989,18 +36630,20 @@ var ts; externalImports.push(node); } break; - case 221 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 232 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 223 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 234 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" - externalImports.push(node); - hasExportStars = true; + if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } } else if (resolver.isValueAliasDeclaration(node)) { // export { x, y } from "mod" where at least one export is a value symbol @@ -36011,12 +36654,12 @@ var ts; // export { x, y } for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_26 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_26] || (exportSpecifiers[name_26] = [])).push(specifier); + var name_24 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); } } break; - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -36026,7 +36669,7 @@ var ts; } } function emitExportStarHelper() { - if (hasExportStars) { + if (hasExportStarsToExportValues) { writeLine(); write("function __export(m) {"); increaseIndent(); @@ -36042,14 +36685,20 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 222 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 224 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 228 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 230 /* ExportDeclaration */ && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } - function getExternalModuleNameText(importNode) { + function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { + if (emitRelativePathAsModuleName) { + var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_25) { + return "\"" + name_25 + "\""; + } + } var moduleName = ts.getExternalModuleName(importNode); if (moduleName.kind === 9 /* StringLiteral */) { return tryRenameExternalModule(moduleName) || getLiteralText(moduleName); @@ -36065,8 +36714,8 @@ var ts; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; // do not create variable declaration for exports and imports that lack import clause - var skipNode = importNode.kind === 228 /* ExportDeclaration */ || - (importNode.kind === 222 /* ImportDeclaration */ && !importNode.importClause); + var skipNode = importNode.kind === 230 /* ExportDeclaration */ || + (importNode.kind === 224 /* ImportDeclaration */ && !importNode.importClause); if (skipNode) { continue; } @@ -36088,7 +36737,7 @@ var ts; // should always win over entries with similar names that were added via star exports // to support this we store names of local/indirect exported entries in a set. // this set is used to filter names brought by star expors. - if (!hasExportStars) { + if (!hasExportStarsToExportValues) { // local names set is needed only in presence of star exports return undefined; } @@ -36099,7 +36748,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 228 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 230 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -36115,7 +36764,7 @@ var ts; increaseIndent(); var started = false; if (exportedDeclarations) { - for (var i = 0; i < exportedDeclarations.length; ++i) { + for (var i = 0; i < exportedDeclarations.length; i++) { // write name of exported declaration, i.e 'export var x...' writeExportedName(exportedDeclarations[i]); } @@ -36131,7 +36780,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 228 /* ExportDeclaration */) { + if (externalImport.kind !== 230 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -36217,14 +36866,14 @@ var ts; writeLine(); write("var "); var seen = {}; - for (var i = 0; i < hoistedVars.length; ++i) { + for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_27 = local.kind === 69 /* Identifier */ + var name_26 = local.kind === 69 /* Identifier */ ? local : local.name; - if (name_27) { + if (name_26) { // do not emit duplicate entries (in case of declaration merging) in the list of hoisted variables - var text = ts.unescapeIdentifier(name_27.text); + var text = ts.unescapeIdentifier(name_26.text); if (ts.hasProperty(seen, text)) { continue; } @@ -36235,7 +36884,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 214 /* ClassDeclaration */ || local.kind === 218 /* ModuleDeclaration */ || local.kind === 217 /* EnumDeclaration */) { + if (local.kind === 216 /* ClassDeclaration */ || local.kind === 220 /* ModuleDeclaration */ || local.kind === 219 /* EnumDeclaration */) { emitDeclarationName(local); } else { @@ -36269,21 +36918,21 @@ var ts; if (node.flags & 4 /* Ambient */) { return; } - if (node.kind === 213 /* FunctionDeclaration */) { + if (node.kind === 215 /* FunctionDeclaration */) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 214 /* ClassDeclaration */) { + if (node.kind === 216 /* ClassDeclaration */) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 217 /* EnumDeclaration */) { + if (node.kind === 219 /* EnumDeclaration */) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36292,7 +36941,7 @@ var ts; } return; } - if (node.kind === 218 /* ModuleDeclaration */) { + if (node.kind === 220 /* ModuleDeclaration */) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36301,17 +36950,17 @@ var ts; } return; } - if (node.kind === 211 /* VariableDeclaration */ || node.kind === 163 /* BindingElement */) { + if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { if (shouldHoistVariable(node, /*checkIfSourceFileLevelDecl*/ false)) { - var name_28 = node.name; - if (name_28.kind === 69 /* Identifier */) { + var name_27 = node.name; + if (name_27.kind === 69 /* Identifier */) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_28); + hoistedVars.push(name_27); } else { - ts.forEachChild(name_28, visit); + ts.forEachChild(name_27, visit); } } return; @@ -36342,7 +36991,7 @@ var ts; // if block scoped variables are nested in some another block then // no other functions can use them except ones that are defined at least in the same block return (ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 248 /* SourceFile */; + ts.getEnclosingBlockScopeContainer(node).kind === 250 /* SourceFile */; } function isCurrentFileSystemExternalModule() { return modulekind === 4 /* System */ && isCurrentFileExternalModule; @@ -36402,7 +37051,7 @@ var ts; } function emitSetters(exportStarFunction, dependencyGroups) { write("setters:["); - for (var i = 0; i < dependencyGroups.length; ++i) { + for (var i = 0; i < dependencyGroups.length; i++) { if (i !== 0) { write(","); } @@ -36417,21 +37066,21 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // fall-through - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== ""); writeLine(); // save import into the local write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -36444,7 +37093,7 @@ var ts; write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; ++i_2) { + for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { if (i_2 !== 0) { write(","); writeLine(); @@ -36461,6 +37110,8 @@ var ts; write("});"); } else { + // collectExternalModuleInfo prefilters star exports to keep only ones that export values + // this means that check 'resolver.moduleExportsSomeValue' is redundant and can be omitted here writeLine(); // export * from 'foo' // emit as: @@ -36481,17 +37132,17 @@ var ts; write("execute: function() {"); increaseIndent(); writeLine(); - for (var i = startIndex; i < node.statements.length; ++i) { + for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { // - function declarations are not emitted because they were already hoisted // - import declarations are not emitted since they are already handled in setters // - export declarations with module specifiers are not emitted since they were already written in setters // - export declarations without module specifiers are emitted preserving the order - case 213 /* FunctionDeclaration */: - case 222 /* ImportDeclaration */: + case 215 /* FunctionDeclaration */: + case 224 /* ImportDeclaration */: continue; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -36500,7 +37151,7 @@ var ts; } } continue; - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { // - import equals declarations that import external modules are not emitted continue; @@ -36540,8 +37191,8 @@ var ts; write("["); var groupIndices = {}; var dependencyGroups = []; - for (var i = 0; i < externalImports.length; ++i) { - var text = getExternalModuleNameText(externalImports[i]); + for (var i = 0; i < externalImports.length; i++) { + var text = getExternalModuleNameText(externalImports[i], emitRelativePathAsModuleName); if (ts.hasProperty(groupIndices, text)) { // deduplicate/group entries in dependency list by the dependency name var groupIndex = groupIndices[text]; @@ -36555,18 +37206,12 @@ var ts; if (i !== 0) { write(", "); } - if (emitRelativePathAsModuleName) { - var name_29 = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]); - if (name_29) { - text = "\"" + name_29 + "\""; - } - } write(text); } write("], function(" + exportFunctionForFile + ") {"); writeLine(); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitSystemModuleBody(node, dependencyGroups, startIndex); @@ -36596,13 +37241,7 @@ var ts; for (var _c = 0, externalImports_4 = externalImports; _c < externalImports_4.length; _c++) { var importNode = externalImports_4[_c]; // Find the name of the external module - var externalModuleName = getExternalModuleNameText(importNode); - if (emitRelativePathAsModuleName) { - var name_30 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_30) { - externalModuleName = "\"" + name_30 + "\""; - } - } + var externalModuleName = getExternalModuleNameText(importNode, emitRelativePathAsModuleName); // Find the name of the module alias, if there is one var importAliasName = getLocalNameForExternalImport(importNode); if (includeNonAmdDependencies && importAliasName) { @@ -36662,7 +37301,7 @@ var ts; writeModuleName(node, emitRelativePathAsModuleName); emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36673,7 +37312,7 @@ var ts; write("});"); } function emitCommonJSModule(node) { - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false, /*ensureUseStrict*/ true); emitEmitHelpers(node); collectExternalModuleInfo(node); emitExportStarHelper(); @@ -36693,7 +37332,7 @@ var ts; writeLines(" }\n})("); emitAMDFactoryHeader(dependencyNames); increaseIndent(); - var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true); + var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true, /*ensureUseStrict*/ true); emitExportStarHelper(); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36707,7 +37346,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); @@ -36770,7 +37409,9 @@ var ts; // Replace entities like   result = result.replace(/&(\w+);/g, function (s, m) { if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + var ch = String.fromCharCode(entities[m]); + // " needs to be escaped + return ch === "\"" ? "\\\"" : ch; } else { return s; @@ -36822,24 +37463,41 @@ var ts; } } } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { + function isUseStrictPrologue(node) { + return !!node.expression.text.match(/use strict/); + } + function ensureUseStrictPrologue(startWithNewLine, writeUseStrict) { + if (writeUseStrict) { + if (startWithNewLine) { + writeLine(); + } + write("\"use strict\";"); + } + } + function emitDirectivePrologues(statements, startWithNewLine, ensureUseStrict) { + var foundUseStrict = false; + for (var i = 0; i < statements.length; i++) { if (ts.isPrologueDirective(statements[i])) { + if (isUseStrictPrologue(statements[i])) { + foundUseStrict = true; + } if (startWithNewLine || i > 0) { writeLine(); } emit(statements[i]); } else { + ensureUseStrictPrologue(startWithNewLine || i > 0, !foundUseStrict && ensureUseStrict); // return index of the first non prologue directive return i; } } + ensureUseStrictPrologue(startWithNewLine, !foundUseStrict && ensureUseStrict); return statements.length; } function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); - for (var i = 0; i < lines.length; ++i) { + for (var i = 0; i < lines.length; i++) { var line = lines[i]; if (line.length) { writeLine(); @@ -36879,7 +37537,7 @@ var ts; emitShebang(); emitDetachedCommentsAndUpdateCommentsInfo(node); if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - if (root || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { + if (isOwnFileEmit || (!ts.isExternalModule(node) && compilerOptions.isolatedModules)) { var emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[1 /* CommonJS */]; emitModule(node); } @@ -36893,7 +37551,7 @@ var ts; externalImports = undefined; exportSpecifiers = undefined; exportEquals = undefined; - hasExportStars = false; + hasExportStarsToExportValues = false; emitEmitHelpers(node); emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); @@ -36901,6 +37559,9 @@ var ts; } emitLeadingComments(node.endOfFileToken); } + function emit(node) { + emitNodeConsideringCommentsOption(node, emitNodeWithSourceMap); + } function emitNodeWithCommentsAndWithoutSourcemap(node) { emitNodeConsideringCommentsOption(node, emitNodeWithoutSourceMap); } @@ -36923,6 +37584,13 @@ var ts; } } } + function emitNodeWithSourceMap(node) { + if (node) { + emitStart(node); + emitNodeWithoutSourceMap(node); + emitEnd(node); + } + } function emitNodeWithoutSourceMap(node) { if (node) { emitJavaScriptWorker(node); @@ -36932,24 +37600,24 @@ var ts; switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow // the specialized methods for each to handle the comments on the nodes. - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 227 /* ExportAssignment */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 229 /* ExportAssignment */: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -36961,9 +37629,9 @@ var ts; // then we don't want to emit comments when we emit the body. It will have already // been taken care of when we emitted the 'return' statement for the function // expression body. - if (node.kind !== 192 /* Block */ && + if (node.kind !== 194 /* Block */ && node.parent && - node.parent.kind === 174 /* ArrowFunction */ && + node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -37002,142 +37670,142 @@ var ts; case 13 /* TemplateMiddle */: case 14 /* TemplateTail */: return emitLiteral(node); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: return emitTemplateExpression(node); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return emitTemplateSpan(node); - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: + case 235 /* JsxElement */: + case 236 /* JsxSelfClosingElement */: return emitJsxElement(node); - case 236 /* JsxText */: + case 238 /* JsxText */: return emitJsxText(node); - case 240 /* JsxExpression */: + case 242 /* JsxExpression */: return emitJsxExpression(node); case 135 /* QualifiedName */: return emitQualifiedName(node); - case 161 /* ObjectBindingPattern */: + case 163 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 162 /* ArrayBindingPattern */: + case 164 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 163 /* BindingElement */: + case 165 /* BindingElement */: return emitBindingElement(node); - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 245 /* PropertyAssignment */: + case 247 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 246 /* ShorthandPropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); case 136 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 168 /* CallExpression */: + case 170 /* CallExpression */: return emitCallExpression(node); - case 169 /* NewExpression */: + case 171 /* NewExpression */: return emitNewExpression(node); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 171 /* TypeAssertionExpression */: + case 173 /* TypeAssertionExpression */: return emit(node.expression); - case 189 /* AsExpression */: + case 191 /* AsExpression */: return emit(node.expression); - case 172 /* ParenthesizedExpression */: + case 174 /* ParenthesizedExpression */: return emitParenExpression(node); - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 175 /* DeleteExpression */: + case 177 /* DeleteExpression */: return emitDeleteExpression(node); - case 176 /* TypeOfExpression */: + case 178 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 177 /* VoidExpression */: + case 179 /* VoidExpression */: return emitVoidExpression(node); - case 178 /* AwaitExpression */: + case 180 /* AwaitExpression */: return emitAwaitExpression(node); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 180 /* PostfixUnaryExpression */: + case 182 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return emitBinaryExpression(node); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return emitConditionalExpression(node); - case 185 /* SpreadElementExpression */: + case 187 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 184 /* YieldExpression */: + case 186 /* YieldExpression */: return emitYieldExpression(node); - case 187 /* OmittedExpression */: + case 189 /* OmittedExpression */: return; - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return emitBlock(node); - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: return emitVariableStatement(node); - case 194 /* EmptyStatement */: + case 196 /* EmptyStatement */: return write(";"); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return emitExpressionStatement(node); - case 196 /* IfStatement */: + case 198 /* IfStatement */: return emitIfStatement(node); - case 197 /* DoStatement */: + case 199 /* DoStatement */: return emitDoStatement(node); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: return emitWhileStatement(node); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return emitForStatement(node); - case 201 /* ForOfStatement */: - case 200 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 202 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 202 /* ContinueStatement */: - case 203 /* BreakStatement */: + case 204 /* ContinueStatement */: + case 205 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: return emitReturnStatement(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: return emitWithStatement(node); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return emitSwitchStatement(node); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: return emitLabeledStatement(node); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: return emitThrowStatement(node); - case 209 /* TryStatement */: + case 211 /* TryStatement */: return emitTryStatement(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return emitCatchClause(node); - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: return emitClassExpression(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return emitClassDeclaration(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return emitEnumMember(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: return emitImportDeclaration(node); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: return emitExportDeclaration(node); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: return emitExportAssignment(node); - case 248 /* SourceFile */: + case 250 /* SourceFile */: return emitSourceFileNode(node); } } @@ -37176,7 +37844,7 @@ var ts; function getLeadingCommentsToEmit(node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 248 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 250 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -37191,7 +37859,7 @@ var ts; function getTrailingCommentsToEmit(node) { // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 248 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 250 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -37200,10 +37868,10 @@ var ts; * Emit comments associated with node that will not be emitted into JS file */ function emitCommentsOnNotEmittedNode(node) { - emitLeadingCommentsWorker(node, /*isEmittedNode:*/ false); + emitLeadingCommentsWorker(node, /*isEmittedNode*/ false); } function emitLeadingComments(node) { - return emitLeadingCommentsWorker(node, /*isEmittedNode:*/ true); + return emitLeadingCommentsWorker(node, /*isEmittedNode*/ true); } function emitLeadingCommentsWorker(node, isEmittedNode) { if (compilerOptions.removeComments) { @@ -37228,7 +37896,7 @@ var ts; } ts.emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment); + ts.emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitTrailingComments(node) { if (compilerOptions.removeComments) { @@ -37280,18 +37948,31 @@ var ts; } } } + function writeComment(text, lineMap, writer, comment, newLine) { + emitPos(comment.pos); + ts.writeCommentRange(text, lineMap, writer, comment, newLine); + emitPos(comment.end); + } function emitShebang() { var shebang = ts.getShebang(currentText); if (shebang) { write(shebang); + writeLine(); } } var _a, _b; } - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (compilerOptions.declaration) { - ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); + function emitFile(_a, sourceFiles, isBundledEmit) { + var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; + // Make sure not to write js File and source map file if any of them cannot be written + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + emitJavaScript(jsFilePath, sourceMapFilePath, sourceFiles, isBundledEmit); + } + else { + emitSkipped = true; + } + if (declarationFilePath) { + emitSkipped = ts.writeDeclarationFile(declarationFilePath, sourceFiles, isBundledEmit, host, resolver, emitterDiagnostics) || emitSkipped; } } } @@ -37309,10 +37990,10 @@ var ts; /** The version of the TypeScript compiler release */ var emptyArray = []; ts.version = "1.8.0"; - function findConfigFile(searchPath) { + function findConfigFile(searchPath, fileExists) { var fileName = "tsconfig.json"; while (true) { - if (ts.sys.fileExists(fileName)) { + if (fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -37336,21 +38017,22 @@ var ts; ? compilerOptions.moduleResolution : compilerOptions.module === 1 /* CommonJS */ ? 2 /* NodeJs */ : 1 /* Classic */; switch (moduleResolution) { - case 2 /* NodeJs */: return nodeModuleNameResolver(moduleName, containingFile, host); + case 2 /* NodeJs */: return nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host); case 1 /* Classic */: return classicNameResolver(moduleName, containingFile, compilerOptions, host); } } ts.resolveModuleName = resolveModuleName; - function nodeModuleNameResolver(moduleName, containingFile, host) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host) { var containingDirectory = ts.getDirectoryPath(containingFile); + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); if (ts.getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { var failedLookupLocations = []; var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName)); - var resolvedFileName = loadNodeModuleFromFile(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + var resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(ts.supportedJsExtensions, candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); return resolvedFileName ? { resolvedModule: { resolvedFileName: resolvedFileName }, failedLookupLocations: failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; @@ -37360,11 +38042,21 @@ var ts; } } ts.nodeModuleNameResolver = nodeModuleNameResolver; - function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, host) { + /* @internal */ + function directoryProbablyExists(directoryName, host) { + // if host does not support 'directoryExists' assume that directory will exist + return !host.directoryExists || host.directoryExists(directoryName); + } + ts.directoryProbablyExists = directoryProbablyExists; + /** + * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary + * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. + */ + function loadNodeModuleFromFile(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { return ts.forEach(extensions, tryLoad); function tryLoad(ext) { var fileName = ts.fileExtensionIs(candidate, ext) ? candidate : candidate + ext; - if (host.fileExists(fileName)) { + if (!onlyRecordFailures && host.fileExists(fileName)) { return fileName; } else { @@ -37373,9 +38065,10 @@ var ts; } } } - function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, host) { + function loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocation, onlyRecordFailures, host) { var packageJsonPath = ts.combinePaths(candidate, "package.json"); - if (host.fileExists(packageJsonPath)) { + var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host); + if (directoryExists && host.fileExists(packageJsonPath)) { var jsonContent; try { var jsonText = host.readFile(packageJsonPath); @@ -37385,8 +38078,9 @@ var ts; // gracefully handle if readFile fails or returns not JSON jsonContent = { typings: undefined }; } - if (jsonContent.typings) { - var result = loadNodeModuleFromFile(extensions, ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + if (typeof jsonContent.typings === "string") { + var path = ts.normalizePath(ts.combinePaths(candidate, jsonContent.typings)); + var result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(ts.getDirectoryPath(path), host), host); if (result) { return result; } @@ -37396,7 +38090,7 @@ var ts; // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host); } function loadModuleFromNodeModules(moduleName, directory, host) { var failedLookupLocations = []; @@ -37405,12 +38099,14 @@ var ts; var baseName = ts.getBaseFileName(directory); if (baseName !== "node_modules") { var nodeModulesFolder = ts.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host); var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName)); - var result = loadNodeModuleFromFile(ts.supportedExtensions, candidate, failedLookupLocations, host); + // Load only typescript files irrespective of allowJs option if loading from node modules + var result = loadNodeModuleFromFile(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } - result = loadNodeModuleFromDirectory(ts.supportedExtensions, candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(ts.supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations: failedLookupLocations }; } @@ -37436,10 +38132,10 @@ var ts; var searchName; var failedLookupLocations = []; var referencedSourceFile; - var extensions = compilerOptions.allowNonTsExtensions ? ts.supportedJsExtensions : ts.supportedExtensions; + var supportedExtensions = ts.getSupportedExtensions(compilerOptions); while (true) { searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - referencedSourceFile = ts.forEach(extensions, function (extension) { + referencedSourceFile = ts.forEach(supportedExtensions, function (extension) { if (extension === ".tsx" && !compilerOptions.jsx) { // resolve .tsx files only if jsx support is enabled // 'logical not' handles both undefined and None cases @@ -37540,14 +38236,15 @@ var ts; getCanonicalFileName: getCanonicalFileName, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return ts.sys.fileExists(fileName); }, - readFile: function (fileName) { return ts.sys.readFile(fileName); } + readFile: function (fileName) { return ts.sys.readFile(fileName); }, + directoryExists: function (directoryName) { return ts.sys.directoryExists(directoryName); } }; } ts.createCompilerHost = createCompilerHost; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + diagnostics = diagnostics.concat(program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -37585,8 +38282,11 @@ var ts; var noDiagnosticsTypeChecker; var classifiableNames; var skipDefaultLib = options.noLib; + var supportedExtensions = ts.getSupportedExtensions(options); var start = new Date().getTime(); host = host || createCompilerHost(options); + // Map storing if there is emit blocking diagnostics for given input + var hasEmitBlockingDiagnostics = ts.createFileMap(getCanonicalFileName); var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) @@ -37603,24 +38303,23 @@ var ts; (oldOptions.noResolve !== options.noResolve) || (oldOptions.target !== options.target) || (oldOptions.noLib !== options.noLib) || - (oldOptions.jsx !== options.jsx)) { + (oldOptions.jsx !== options.jsx) || + (oldOptions.allowJs !== options.allowJs)) { oldProgram = undefined; } } if (!tryReuseStructureFromOldProgram()) { - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false); }); // Do not process the default library if: // - The '--noLib' flag is used. // - A 'no-default-lib' reference comment is encountered in // processing the root files. if (!skipDefaultLib) { - processRootFile(host.getDefaultLibFileName(options), true); + processRootFile(host.getDefaultLibFileName(options), /*isDefaultLib*/ true); } } - verifyCompilerOptions(); // unconditionally set oldProgram to undefined to prevent it from being captured in closure oldProgram = undefined; - ts.programTime += new Date().getTime() - start; program = { getRootFileNames: function () { return rootNames; }, getSourceFile: getSourceFile, @@ -37634,7 +38333,7 @@ var ts; getTypeChecker: getTypeChecker, getClassifiableNames: getClassifiableNames, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: getCommonSourceDirectory, emit: emit, getCurrentDirectory: function () { return currentDirectory; }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, @@ -37643,7 +38342,27 @@ var ts; getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; } }; + verifyCompilerOptions(); + ts.programTime += new Date().getTime() - start; return program; + function getCommonSourceDirectory() { + if (typeof commonSourceDirectory === "undefined") { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + // If a rootDir is specified and is valid use it as the commonSourceDirectory + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path + commonSourceDirectory += ts.directorySeparator; + } + } + return commonSourceDirectory; + } function getClassifiableNames() { if (!classifiableNames) { // Initialize a checker so that all our files are bound. @@ -37699,7 +38418,7 @@ var ts; var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct - for (var i = 0; i < moduleNames.length; ++i) { + for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; var oldResolution = ts.getResolvedModule(oldSourceFile, moduleNames[i]); var resolutionChanged = oldResolution @@ -37724,7 +38443,7 @@ var ts; newSourceFiles.push(newSourceFile); } // update fileName -> file mapping - for (var i = 0, len = newSourceFiles.length; i < len; ++i) { + for (var i = 0, len = newSourceFiles.length; i < len; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } files = newSourceFiles; @@ -37745,7 +38464,8 @@ var ts; getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }), + isEmitBlocked: isEmitBlocked }; } function getDiagnosticsProducingTypeChecker() { @@ -37758,12 +38478,18 @@ var ts; var _this = this; return runWithCancellationToken(function () { return emitWorker(_this, sourceFile, writeFileCallback, cancellationToken); }); } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.contains(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName)); + } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken) { // If the noEmitOnError flag is set, then check if we have any errors so far. If so, // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we // get any preEmit diagnostics, not just the ones - if (options.noEmitOnError && getPreEmitDiagnostics(program, /*sourceFile:*/ undefined, cancellationToken).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + if (options.noEmitOnError) { + var preEmitDiagnostics = getPreEmitDiagnostics(program, /*sourceFile:*/ undefined, cancellationToken); + if (preEmitDiagnostics.length > 0) { + return { diagnostics: preEmitDiagnostics, sourceMaps: undefined, emitSkipped: true }; + } } // Create the emit resolver outside of the "emitTime" tracking code below. That way // any cost associated with it (like type checking) are appropriate associated with @@ -37833,12 +38559,164 @@ var ts; var typeChecker = getDiagnosticsProducingTypeChecker(); ts.Debug.assert(!!sourceFile.bindDiagnostics); var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile, cancellationToken); + // For JavaScript files, we don't want to report the normal typescript semantic errors. + // Instead, we just report errors for using TypeScript-only constructs from within a + // JavaScript file. + var checkDiagnostics = ts.isSourceFileJavaScript(sourceFile) ? + getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) : + typeChecker.getDiagnostics(sourceFile, cancellationToken); var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(fileProcessingDiagnosticsInFile).concat(programDiagnosticsInFile); }); } + function getJavaScriptSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return runWithCancellationToken(function () { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 223 /* ImportEqualsDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 229 /* ExportAssignment */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 216 /* ClassDeclaration */: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 245 /* HeritageClause */: + var heritageClause = node; + if (heritageClause.token === 106 /* ImplementsKeyword */) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 217 /* InterfaceDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 220 /* ModuleDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 218 /* TypeAliasDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 143 /* MethodDeclaration */: + case 142 /* MethodSignature */: + case 144 /* Constructor */: + case 145 /* GetAccessor */: + case 146 /* SetAccessor */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 195 /* VariableStatement */: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 213 /* VariableDeclaration */: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 170 /* CallExpression */: + case 171 /* NewExpression */: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start_2 = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_2, expression.typeArguments.end - start_2, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 138 /* Parameter */: + var parameter = node; + if (parameter.modifiers) { + var start_3 = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_3, parameter.modifiers.end - start_3, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 141 /* PropertyDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 219 /* EnumDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 173 /* TypeAssertionExpression */: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 139 /* Decorator */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start_4 = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start_4, typeParameters.end - start_4, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { + var modifier = modifiers_1[_i]; + switch (modifier.kind) { + case 112 /* PublicKeyword */: + case 110 /* PrivateKeyword */: + case 111 /* ProtectedKeyword */: + case 122 /* DeclareKeyword */: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + // These are all legal modifiers. + case 113 /* StaticKeyword */: + case 82 /* ExportKeyword */: + case 74 /* ConstKeyword */: + case 77 /* DefaultKeyword */: + case 115 /* AbstractKeyword */: + } + } + } + return false; + } + }); + } function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { return runWithCancellationToken(function () { if (!ts.isDeclarationFile(sourceFile)) { @@ -37880,16 +38758,16 @@ var ts; var imports; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /* allowRelativeModuleNames */ true, /* collectOnlyRequireCalls */ false); + collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); } file.imports = imports || emptyArray; return; function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { if (!collectOnlyRequireCalls) { switch (node.kind) { - case 222 /* ImportDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 228 /* ExportDeclaration */: + case 224 /* ImportDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 230 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; @@ -37901,7 +38779,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An AmbientExternalModuleDeclaration declares an external module. @@ -37912,7 +38790,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 12.1.6 // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules // only through top - level external module names. Relative external module names are not permitted. - collect(node, /* allowRelativeModuleNames */ false, collectOnlyRequireCalls); + collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); }); } break; @@ -37923,7 +38801,7 @@ var ts; (imports || (imports = [])).push(node.arguments[0]); } else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /* collectOnlyRequireCalls */ true); }); + ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true); }); } } } @@ -37932,9 +38810,9 @@ var ts; var diagnosticArgument; var diagnostic; if (hasExtension(fileName)) { - if (!options.allowNonTsExtensions && !ts.forEach(ts.supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { + if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1; - diagnosticArgument = [fileName, "'" + ts.supportedExtensions.join("', '") + "'"]; + diagnosticArgument = [fileName, "'" + supportedExtensions.join("', '") + "'"]; } else if (!findSourceFile(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd)) { diagnostic = ts.Diagnostics.File_0_not_found; @@ -37952,7 +38830,7 @@ var ts; diagnostic = ts.Diagnostics.File_0_not_found; diagnosticArgument = [fileName]; } - else if (!ts.forEach(ts.supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { + else if (!ts.forEach(supportedExtensions, function (extension) { return findSourceFile(fileName + extension, ts.toPath(fileName + extension, currentDirectory, getCanonicalFileName), isDefaultLib, refFile, refPos, refEnd); })) { diagnostic = ts.Diagnostics.File_0_not_found; fileName += ".ts"; diagnosticArgument = [fileName]; @@ -37977,12 +38855,12 @@ var ts; } } // Get source file from normalized fileName - function findSourceFile(fileName, normalizedAbsolutePath, isDefaultLib, refFile, refPos, refEnd) { - if (filesByName.contains(normalizedAbsolutePath)) { - var file_1 = filesByName.get(normalizedAbsolutePath); + function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) { + if (filesByName.contains(path)) { + var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path // NOTE: this only makes sense for case-insensitive file systems - if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== normalizedAbsolutePath) { + if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) { reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd); } return file_1; @@ -37996,17 +38874,17 @@ var ts; fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); - filesByName.set(normalizedAbsolutePath, file); + filesByName.set(path, file); if (file) { - file.path = normalizedAbsolutePath; + file.path = path; if (host.useCaseSensitiveFileNames()) { // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case - var existingFile = filesByNameIgnoreCase.get(normalizedAbsolutePath); + var existingFile = filesByNameIgnoreCase.get(path); if (existingFile) { reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd); } else { - filesByNameIgnoreCase.set(normalizedAbsolutePath, file); + filesByNameIgnoreCase.set(path, file); } } skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib; @@ -38028,7 +38906,7 @@ var ts; function processReferencedFiles(file, basePath) { ts.forEach(file.referencedFiles, function (ref) { var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName); - processSourceFile(referencedFileName, /* isDefaultLib */ false, file, ref.pos, ref.end); + processSourceFile(referencedFileName, /*isDefaultLib*/ false, file, ref.pos, ref.end); }); } function getCanonicalFileName(fileName) { @@ -38040,15 +38918,17 @@ var ts; file.resolvedModules = {}; var moduleNames = ts.map(file.imports, function (name) { return name.text; }); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; ++i) { + for (var i = 0; i < file.imports.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); if (resolution && !options.noResolve) { - var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /* isDefaultLib */ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); + var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { + // Since currently irrespective of allowJs, we only look for supportedTypeScript extension external module files, + // this check is ok. Otherwise this would be never true for javascript file if (!ts.isExternalModule(importedFile)) { - var start_2 = ts.getTokenPosOfNode(file.imports[i], file); - fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_2, file.imports[i].end - start_2, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); + var start_5 = ts.getTokenPosOfNode(file.imports[i], file); + fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } else if (importedFile.referencedFiles.length) { var firstRef = importedFile.referencedFiles[0]; @@ -38066,7 +38946,7 @@ var ts; } function computeCommonSourceDirectory(sourceFiles) { var commonPathComponents; - ts.forEach(files, function (sourceFile) { + var failed = ts.forEach(files, function (sourceFile) { // Each file contributes into common source file path if (ts.isDeclarationFile(sourceFile)) { return; @@ -38079,10 +38959,10 @@ var ts; return; } for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; + // Failed to find any common path component + return true; } // New common path found that is 0 -> i-1 commonPathComponents.length = i; @@ -38094,6 +38974,10 @@ var ts; commonPathComponents.length = sourcePathComponents.length; } }); + // A common path can not be found when paths span multiple drives on windows, for example + if (failed) { + return ""; + } if (!commonPathComponents) { return currentDirectory; } @@ -38103,8 +38987,8 @@ var ts; var allFilesBelongToPath = true; if (sourceFiles) { var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { - var sourceFile = sourceFiles_1[_i]; + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var sourceFile = sourceFiles_2[_i]; if (!ts.isDeclarationFile(sourceFile)) { var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { @@ -38138,14 +39022,14 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")); } - if (options.sourceRoot) { - programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap")); - } } if (options.inlineSources) { if (!options.sourceMap && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); } + if (options.sourceRoot) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources")); + } } if (options.out && options.outFile) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile")); @@ -38155,10 +39039,9 @@ var ts; if (options.mapRoot) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap")); } - if (options.sourceRoot) { + if (options.sourceRoot && !options.inlineSourceMap) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap")); } - return; } var languageVersion = options.target || 0 /* ES3 */; var outFile = options.outFile || options.out; @@ -38176,7 +39059,7 @@ var ts; else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); + programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file)); } // Cannot specify module gen target of es6 when below es6 if (options.module === 5 /* ES6 */ && languageVersion < 2 /* ES6 */) { @@ -38191,19 +39074,11 @@ var ts; if (options.outDir || options.sourceRoot || options.mapRoot) { - if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { - // If a rootDir is specified and is valid use it as the commonSourceDirectory - commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory); - } - else { - // Compute the commonSourceDirectory from the input files - commonSourceDirectory = computeCommonSourceDirectory(files); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { - // Make sure directory path ends with directory separator so this string can directly - // used to replace with "" to get the relative path of the source file and the relative path doesn't - // start with / making it rooted path - commonSourceDirectory += ts.directorySeparator; + // Precalculate and cache the common source directory + var dir = getCommonSourceDirectory(); + // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure + if (options.outDir && dir === "" && ts.forEach(files, function (file) { return ts.getRootLength(file.fileName) > 1; })) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); } } if (options.noEmit) { @@ -38220,10 +39095,47 @@ var ts; programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration")); } } + else if (options.allowJs && options.declaration) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")); + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + if (options.reactNamespace && !ts.isIdentifier(options.reactNamespace, languageVersion)) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace)); + } + // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files + if (!options.noEmit) { + var emitHost = getEmitHost(); + var emitFilesSeen = ts.createFileMap(!host.useCaseSensitiveFileNames() ? function (key) { return key.toLocaleLowerCase(); } : undefined); + ts.forEachExpectedEmitFile(emitHost, function (emitFileNames, sourceFiles, isBundledEmit) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + // Verify that all the emit files are unique and don't overwrite input files + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); + // Report error if the output overwrites input file + if (filesByName.contains(emitFilePath)) { + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + } + // Report error if multiple files write into same file + if (emitFilesSeen.contains(emitFilePath)) { + // Already seen the same emit file - report error + createEmitBlockingDiagnostics(emitFileName, emitFilePath, ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + } + else { + emitFilesSeen.set(emitFilePath, true); + } + } + } + } + function createEmitBlockingDiagnostics(emitFileName, emitFilePath, message) { + hasEmitBlockingDiagnostics.set(ts.toPath(emitFileName, currentDirectory, getCanonicalFileName), true); + programDiagnostics.add(ts.createCompilerDiagnostic(message, emitFileName)); } } ts.createProgram = createProgram; @@ -38284,6 +39196,11 @@ var ts; description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, error: ts.Diagnostics.Argument_for_jsx_must_be_preserve_or_react }, + { + name: "reactNamespace", + type: "string", + description: ts.Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, { name: "listFiles", type: "boolean" @@ -38509,6 +39426,16 @@ var ts; name: "forceConsistentCasingInFileNames", type: "boolean", description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + }, + { + name: "allowJs", + type: "boolean", + description: ts.Diagnostics.Allow_javascript_files_to_be_compiled } ]; var optionNameMapCache; @@ -38543,7 +39470,8 @@ var ts; function parseStrings(args) { var i = 0; while (i < args.length) { - var s = args[i++]; + var s = args[i]; + i++; if (s.charCodeAt(0) === 64 /* at */) { parseResponseFile(s.slice(1)); } @@ -38561,20 +39489,23 @@ var ts; } switch (opt.type) { case "number": - options[opt.name] = parseInt(args[i++]); + options[opt.name] = parseInt(args[i]); + i++; break; case "boolean": options[opt.name] = true; break; case "string": - options[opt.name] = args[i++] || ""; + options[opt.name] = args[i] || ""; + i++; break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: - var map_2 = opt.type; - var key = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(map_2, key)) { - options[opt.name] = map_2[key]; + var map_1 = opt.type; + var key = (args[i] || "").toLowerCase(); + i++; + if (ts.hasProperty(map_1, key)) { + options[opt.name] = map_1[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -38687,8 +39618,10 @@ var ts; * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json, host, basePath) { - var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), options = _a.options, errors = _a.errors; + function parseJsonConfigFileContent(json, host, basePath, existingOptions) { + if (existingOptions === void 0) { existingOptions = {}; } + var _a = convertCompilerOptionsFromJson(json["compilerOptions"], basePath), optionsFromJsonConfigFile = _a.options, errors = _a.errors; + var options = ts.extend(existingOptions, optionsFromJsonConfigFile); return { options: options, fileNames: getFileNames(), @@ -38705,23 +39638,31 @@ var ts; } } else { + var filesSeen = {}; var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; - var sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude)); - for (var i = 0; i < sysFiles.length; i++) { - var name_31 = sysFiles[i]; - if (ts.fileExtensionIs(name_31, ".d.ts")) { - var baseName = name_31.substr(0, name_31.length - ".d.ts".length); - if (!ts.contains(sysFiles, baseName + ".tsx") && !ts.contains(sysFiles, baseName + ".ts")) { - fileNames.push(name_31); + var supportedExtensions = ts.getSupportedExtensions(options); + ts.Debug.assert(ts.indexOf(supportedExtensions, ".ts") < ts.indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick"); + // Get files of supported extensions in their order of resolution + for (var _i = 0, supportedExtensions_1 = supportedExtensions; _i < supportedExtensions_1.length; _i++) { + var extension = supportedExtensions_1[_i]; + var filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); + for (var _a = 0, filesInDirWithExtension_1 = filesInDirWithExtension; _a < filesInDirWithExtension_1.length; _a++) { + var fileName = filesInDirWithExtension_1[_a]; + // .ts extension would read the .d.ts extension files too but since .d.ts is lower priority extension, + // lets pick them when its turn comes up + if (extension === ".ts" && ts.fileExtensionIs(fileName, ".d.ts")) { + continue; } - } - else if (ts.fileExtensionIs(name_31, ".ts")) { - if (!ts.contains(sysFiles, name_31 + "x")) { - fileNames.push(name_31); + // If this is one of the output extension (which would be .d.ts and .js if we are allowing compilation of js files) + // do not include this file if we included .ts or .tsx file with same base name as it could be output of the earlier compilation + if (extension === ".d.ts" || (options.allowJs && ts.contains(ts.supportedJavascriptExtensions, extension))) { + var baseName = fileName.substr(0, fileName.length - extension.length); + if (ts.hasProperty(filesSeen, baseName + ".ts") || ts.hasProperty(filesSeen, baseName + ".tsx")) { + continue; + } } - } - else { - fileNames.push(name_31); + filesSeen[fileName] = true; + fileNames.push(fileName); } } } @@ -38845,7 +39786,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 174 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 176 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -38857,7 +39798,7 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 192 /* Block */: + case 194 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_7 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); @@ -38865,18 +39806,18 @@ var ts; // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collaps the block, but consider its hint span // to be the entire span of the parent. - if (parent_7.kind === 197 /* DoStatement */ || - parent_7.kind === 200 /* ForInStatement */ || - parent_7.kind === 201 /* ForOfStatement */ || - parent_7.kind === 199 /* ForStatement */ || - parent_7.kind === 196 /* IfStatement */ || - parent_7.kind === 198 /* WhileStatement */ || - parent_7.kind === 205 /* WithStatement */ || - parent_7.kind === 244 /* CatchClause */) { + if (parent_7.kind === 199 /* DoStatement */ || + parent_7.kind === 202 /* ForInStatement */ || + parent_7.kind === 203 /* ForOfStatement */ || + parent_7.kind === 201 /* ForStatement */ || + parent_7.kind === 198 /* IfStatement */ || + parent_7.kind === 200 /* WhileStatement */ || + parent_7.kind === 207 /* WithStatement */ || + parent_7.kind === 246 /* CatchClause */) { addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 209 /* TryStatement */) { + if (parent_7.kind === 211 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent_7; if (tryStatement.tryBlock === n) { @@ -38903,23 +39844,23 @@ var ts; break; } // Fallthrough. - case 219 /* ModuleBlock */: { + case 221 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 165 /* ObjectLiteralExpression */: - case 220 /* CaseBlock */: { + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 222 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 19 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -38949,12 +39890,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_32 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_32); + for (var name_28 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_28); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_32); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); if (!matches) { continue; } @@ -38967,14 +39908,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_32); + matches = patternMatcher.getMatches(containers, name_28); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_32, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -39013,7 +39954,7 @@ var ts; containers.unshift(text); } else if (declaration.name.kind === 136 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { // Don't know how to add this. @@ -39033,12 +39974,12 @@ var ts; } return true; } - if (expression.kind === 166 /* PropertyAccessExpression */) { + if (expression.kind === 168 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); } return false; } @@ -39047,7 +39988,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. if (declaration.name.kind === 136 /* ComputedPropertyName */) { - if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion:*/ false)) { + if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } } @@ -39108,7 +40049,7 @@ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { + function getNavigationBarItems(sourceFile, compilerOptions) { // If the source file has any child items, then it included in the tree // and takes lexical ownership of all other top-level items. var hasGlobalNode = false; @@ -39120,17 +40061,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // If we have a module declared as A.B.C, it is more "intuitive" // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 218 /* ModuleDeclaration */); + } while (current.kind === 220 /* ModuleDeclaration */); // fall through - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -39141,21 +40082,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -39167,7 +40108,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -39176,21 +40117,21 @@ var ts; } } break; - case 163 /* BindingElement */: - case 211 /* VariableDeclaration */: + case 165 /* BindingElement */: + case 213 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: - case 218 /* ModuleDeclaration */: - case 213 /* FunctionDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 230 /* ExportSpecifier */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: + case 220 /* ModuleDeclaration */: + case 215 /* FunctionDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 232 /* ExportSpecifier */: childNodes.push(node); break; } @@ -39238,17 +40179,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 217 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -39259,12 +40200,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 213 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 215 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 192 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 194 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 213 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -39341,7 +40282,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 149 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 247 /* EnumMember */: + case 249 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 147 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -39350,18 +40291,18 @@ var ts; case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: var variableDeclarationNode; - var name_33; - if (node.kind === 163 /* BindingElement */) { - name_33 = node.name; + var name_29; + if (node.kind === 165 /* BindingElement */) { + name_29 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 211 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 213 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -39369,24 +40310,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_33 = node.name; + name_29 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_33), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); } case 144 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 230 /* ExportSpecifier */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: + case 232 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -39416,17 +40357,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: return createSourceFileItem(node); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: return createClassItem(node); - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: return createEnumItem(node); - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return createModuleItem(node); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -39438,7 +40379,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 218 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -39450,7 +40391,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 192 /* Block */) { + if (node.body && node.body.kind === 194 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -39504,13 +40445,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 218 /* ModuleDeclaration */) { + while (node.body.kind === 220 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 248 /* SourceFile */ + return node.kind === 250 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -39542,12 +40483,11 @@ var ts; } function createPatternMatcher(pattern) { // We'll often see the same candidate string many times when searching (For example, when - // we see the name of a module that is used everywhere, or the name of an overload). As - // such, we cache the information we compute about the candidate for the life of this + // we see the name of a module that is used everywhere, or the name of an overload). As + // such, we cache the information we compute about the candidate for the life of this // pattern matcher so we don't have to compute it multiple times. var stringToWordSpans = {}; pattern = pattern.trim(); - var fullPatternSegment = createSegment(pattern); var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { @@ -39587,7 +40527,7 @@ var ts; // So far so good. Now break up the container for the candidate and check if all // the dotted parts match up correctly. var totalMatch = candidateMatch; - for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { + for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) { var segment = dotSeparatedSegments[i]; var containerName = candidateContainers[j]; var containerMatch = matchSegment(containerName, segment); @@ -39626,7 +40566,7 @@ var ts; if (index > 0) { // c) If the part is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of some // word part. That way we don't match something like 'Class' when the user types 'a'. @@ -39666,8 +40606,8 @@ var ts; if (isLowercase) { // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? // We could check every character boundary start of the candidate for the pattern. However, that's - // an m * n operation in the wost case. Instead, find the first instance of the pattern - // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to + // an m * n operation in the wost case. Instead, find the first instance of the pattern + // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to // filter the list based on a substring that starts on a capital letter and also with a lowercase one. // (Pattern: fogbar, Candidate: quuxfogbarFogBar). if (chunk.text.length < candidate.length) { @@ -39719,7 +40659,7 @@ var ts; // // c) If the word is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of // some word part. That way we don't match something like 'Class' when the user @@ -39733,7 +40673,7 @@ var ts; // e) If the word was not entirely lowercase, then attempt a camel cased match as // well. // - // f) The word is all lower case. Is it a case insensitive substring of the candidate starting + // f) The word is all lower case. Is it a case insensitive substring of the candidate starting // on a part boundary of the candidate? // // Only if all words have some sort of match is the pattern considered matched. @@ -39783,7 +40723,7 @@ var ts; // Note: we may have more pattern parts than candidate parts. This is because multiple // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U - // and I will both match in UI. + // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; var firstMatch = undefined; @@ -39812,13 +40752,13 @@ var ts; // Consider the case of matching SiUI against SimpleUIElement. The candidate parts // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to - // still keep matching pattern parts against that candidate part. + // still keep matching pattern parts against that candidate part. for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { // We've already gotten one pattern part match in this candidate. We will // only continue trying to consumer pattern parts if the last part and this - // part are both upper case. + // part are both upper case. if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; @@ -39848,42 +40788,6 @@ var ts; } } ts.createPatternMatcher = createPatternMatcher; - // Helper function to compare two matches to determine which is better. Matches are first - // ordered by kind (so all prefix matches always beat all substring matches). Then, if the - // match is a camel case match, the relative weights of the match are used to determine - // which is better (with a greater weight being better). Then if the match is of the same - // type, then a case sensitive match is considered better than an insensitive one. - function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); - } - function comparePunctuation(result1, result2) { - // Consider a match to be better if it was successful without stripping punctuation - // versus a match that had to strip punctuation to succeed. - if (result1.punctuationStripped !== result2.punctuationStripped) { - return result1.punctuationStripped ? 1 : -1; - } - return 0; - } - function compareCase(result1, result2) { - if (result1.isCaseSensitive !== result2.isCaseSensitive) { - return result1.isCaseSensitive ? -1 : 1; - } - return 0; - } - function compareType(result1, result2) { - return result1.kind - result2.kind; - } - function compareCamelCase(result1, result2) { - if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { - // Swap the values here. If result1 has a higher weight, then we want it to come - // first. - return result2.camelCaseWeight - result1.camelCaseWeight; - } - return 0; - } function createSegment(text) { return { totalTextChunk: createTextChunk(text), @@ -39902,7 +40806,7 @@ var ts; if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toUpperCase(); @@ -39915,19 +40819,11 @@ var ts; if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toLowerCase(); } - function containsUpperCaseLetter(string) { - for (var i = 0, n = string.length; i < n; i++) { - if (isUpperCaseLetter(string.charCodeAt(i))) { - return true; - } - } - return false; - } function startsWith(string, search) { for (var i = 0, n = search.length; i < n; i++) { if (string.charCodeAt(i) !== search.charCodeAt(i)) { @@ -39964,7 +40860,7 @@ var ts; if (ch < 127 /* maxAsciiCharacter */) { return ch; } - // TODO: find a way to compute this for any unicode characters in a + // TODO: find a way to compute this for any unicode characters in a // non-allocating manner. return String.fromCharCode(ch).toLowerCase().charCodeAt(0); } @@ -39982,9 +40878,10 @@ var ts; for (var i = 0; i < pattern.length; i++) { var ch = pattern.charCodeAt(i); if (isWordChar(ch)) { - if (wordLength++ === 0) { + if (wordLength === 0) { wordStart = i; } + wordLength++; } else { if (wordLength > 0) { @@ -40115,7 +41012,7 @@ var ts; var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); // See if the casing indicates we're starting a new word. Note: if we're breaking on // words, then just seeing an upper case character isn't enough. Instead, it has to - // be uppercase and the previous character can't be uppercase. + // be uppercase and the previous character can't be uppercase. // // For example, breaking "AddMetadata" on words would make: Add Metadata // @@ -40305,7 +41202,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 168 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 170 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -40313,7 +41210,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 69 /* Identifier */ ? expression - : expression.kind === 166 /* PropertyAccessExpression */ + : expression.kind === 168 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -40346,7 +41243,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 168 /* CallExpression */ || node.parent.kind === 169 /* NewExpression */) { + if (node.parent.kind === 170 /* CallExpression */ || node.parent.kind === 171 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -40399,25 +41296,25 @@ var ts; }; } } - else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 172 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); } } - else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 172 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 190 /* TemplateSpan */ && node.parent.parent.parent.kind === 170 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 192 /* TemplateSpan */ && node.parent.parent.parent.kind === 172 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 183 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 14 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -40535,7 +41432,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 183 /* TemplateExpression */) { + if (template.kind === 185 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -40544,7 +41441,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 248 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 250 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -40744,25 +41641,25 @@ var ts; return false; } switch (n.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 165 /* ObjectLiteralExpression */: - case 161 /* ObjectBindingPattern */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 167 /* ObjectLiteralExpression */: + case 163 /* ObjectBindingPattern */: case 155 /* TypeLiteral */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 220 /* CaseBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: + case 222 /* CaseBlock */: return nodeEndsWith(n, 16 /* CloseBraceToken */, sourceFile); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 169 /* NewExpression */: + case 171 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 168 /* CallExpression */: - case 172 /* ParenthesizedExpression */: + case 170 /* CallExpression */: + case 174 /* ParenthesizedExpression */: case 160 /* ParenthesizedType */: return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); case 152 /* FunctionType */: @@ -40771,13 +41668,13 @@ var ts; case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 148 /* ConstructSignature */: case 147 /* CallSignature */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -40787,19 +41684,19 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 18 /* CloseParenToken */, sourceFile); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 196 /* IfStatement */: + case 198 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23 /* SemicolonToken */); - case 164 /* ArrayLiteralExpression */: - case 162 /* ArrayBindingPattern */: - case 167 /* ElementAccessExpression */: + case 166 /* ArrayLiteralExpression */: + case 164 /* ArrayBindingPattern */: + case 169 /* ElementAccessExpression */: case 136 /* ComputedPropertyName */: case 157 /* TupleType */: return nodeEndsWith(n, 20 /* CloseBracketToken */, sourceFile); @@ -40808,16 +41705,16 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 197 /* DoStatement */: + case 199 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 104 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { @@ -40826,25 +41723,25 @@ var ts; return isCompletedNode(n.statement, sourceFile); case 154 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 176 /* TypeOfExpression */: - case 175 /* DeleteExpression */: - case 177 /* VoidExpression */: - case 184 /* YieldExpression */: - case 185 /* SpreadElementExpression */: + case 178 /* TypeOfExpression */: + case 177 /* DeleteExpression */: + case 179 /* VoidExpression */: + case 186 /* YieldExpression */: + case 187 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 170 /* TaggedTemplateExpression */: + case 172 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 183 /* TemplateExpression */: + case 185 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 190 /* TemplateSpan */: + case 192 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 179 /* PrefixUnaryExpression */: + case 181 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 181 /* BinaryExpression */: + case 183 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 182 /* ConditionalExpression */: + case 184 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -40900,7 +41797,7 @@ var ts; // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { // find syntax list that covers the span of the node - if (c.kind === 271 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 273 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -41006,7 +41903,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 236 /* JsxText */) { + if (isToken(n) || n.kind === 238 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41014,7 +41911,7 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 236 /* JsxText */) { + if (isToken(n) || n.kind === 238 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41028,10 +41925,10 @@ var ts; // if no - position is in the node itself so we should recurse in it. // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 236 /* JsxText */)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 238 /* JsxText */)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 236 /* JsxText */ && start === child.end); // whitespace only JsxText + (child.kind === 238 /* JsxText */ && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -41043,8 +41940,8 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 248 /* SourceFile */); - // Here we know that none of child token nodes embrace the position, + ts.Debug.assert(startNode !== undefined || n.kind === 250 /* SourceFile */); + // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' @@ -41065,7 +41962,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && token.kind === 9 /* StringLiteral */ && position > token.getStart(); + return token && (token.kind === 9 /* StringLiteral */ || token.kind === 162 /* StringLiteralType */) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -41169,10 +42066,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 /* TypeReference */ || node.kind === 168 /* CallExpression */) { + if (node.kind === 151 /* TypeReference */ || node.kind === 170 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 214 /* ClassDeclaration */ || node.kind === 215 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 216 /* ClassDeclaration */ || node.kind === 217 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -41195,6 +42092,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 /* StringLiteral */ + || kind === 162 /* StringLiteralType */ || kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(kind)) { return true; @@ -41431,7 +42329,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 226 /* ImportSpecifier */ || location.parent.kind === 230 /* ExportSpecifier */) && + (location.parent.kind === 228 /* ImportSpecifier */ || location.parent.kind === 232 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -41488,6 +42386,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, + getCurrentLeadingTrivia: function () { return leadingTrivia; }, lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { ts.Debug.assert(scanner !== undefined); @@ -41553,10 +42452,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 238 /* JsxAttribute */: - case 235 /* JsxOpeningElement */: - case 237 /* JsxClosingElement */: - case 234 /* JsxSelfClosingElement */: + case 240 /* JsxAttribute */: + case 237 /* JsxOpeningElement */: + case 239 /* JsxClosingElement */: + case 236 /* JsxSelfClosingElement */: return node.kind === 69 /* Identifier */; } } @@ -41763,7 +42662,7 @@ var ts; return false; }; return FormattingContext; - })(); + }()); formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41802,7 +42701,7 @@ var ts; "flag=" + this.Flag + "]"; }; return Rule; - })(); + }()); formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41849,7 +42748,7 @@ var ts; return new RuleDescriptor(left, right); }; return RuleDescriptor; - })(); + }()); formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41891,7 +42790,7 @@ var ts; return result; }; return RuleOperation; - })(); + }()); formatting.RuleOperation = RuleOperation; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -41926,7 +42825,7 @@ var ts; }; RuleOperationContext.Any = new RuleOperationContext(); return RuleOperationContext; - })(); + }()); formatting.RuleOperationContext = RuleOperationContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42030,6 +42929,7 @@ var ts; // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(9 /* StringLiteral */, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); // Lambda expressions + this.SpaceBeforeArrow = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 34 /* EqualsGreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(34 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Optional parameters and let args this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(22 /* DotDotDotToken */, 69 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); @@ -42055,72 +42955,68 @@ var ts; this.SpaceBetweenAsyncAndOpenParen = new formatting.Rule(formatting.RuleDescriptor.create1(118 /* AsyncKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsArrowFunctionContext, Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceBetweenAsyncAndFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(118 /* AsyncKeyword */, 87 /* FunctionKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // template string - this.SpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(69 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // These rules are higher in priority than user-configurable rules. - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - 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, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, - this.SpaceBetweenTagAndTemplateString, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, - // TypeScript-specific rules - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket, - this.NoSpaceAfterTypeAssertion, - this.SpaceBeforeAt, - this.NoSpaceAfterAt, - this.SpaceAfterDecorator, - ]; + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, + 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, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, + this.NoSpaceBetweenTagAndTemplateString, + // TypeScript-specific rules + this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceBeforeArrow, this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket, + this.NoSpaceAfterTypeAssertion, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, + ]; // These rules are lower in priority than user-configurable rules. - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, this.SpaceAfterTryFinally + ]; /// /// Rules controlled by user options /// // Insert space after comma delimiter - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNextTokenNotCloseBracket), 2 /* Space */)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Insert space before and after binary operators this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); @@ -42152,15 +43048,20 @@ var ts; this.NoSpaceBetweenBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(19 /* OpenBracketToken */, 20 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space after opening and before closing template string braces + this.NoSpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterTemplateHeadAndMiddle = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([12 /* TemplateHead */, 13 /* TemplateMiddle */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeTemplateMiddleAndTail = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([13 /* TemplateMiddle */, 14 /* TemplateTail */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Insert space after function keyword for anonymous functions this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87 /* FunctionKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(87 /* FunctionKeyword */, 17 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_34 in o) { - if (o[name_34] === rule) { - return name_34; + for (var name_30 in o) { + if (o[name_30] === rule) { + return name_30; } } throw new Error("Unknown rule"); @@ -42169,39 +43070,39 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 199 /* ForStatement */; + return context.contextNode.kind === 201 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 181 /* BinaryExpression */: - case 182 /* ConditionalExpression */: - case 189 /* AsExpression */: + case 183 /* BinaryExpression */: + case 184 /* ConditionalExpression */: + case 191 /* AsExpression */: case 150 /* TypePredicate */: case 158 /* UnionType */: case 159 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 163 /* BindingElement */: + case 165 /* BindingElement */: // equals in type X = ... - case 216 /* TypeAliasDeclaration */: + case 218 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: // equal in p = 0; case 138 /* Parameter */: - case 247 /* EnumMember */: + case 249 /* EnumMember */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return context.currentTokenSpan.kind === 56 /* EqualsToken */ || context.nextTokenSpan.kind === 56 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 200 /* ForInStatement */: + case 202 /* ForInStatement */: return context.currentTokenSpan.kind === 90 /* InKeyword */ || context.nextTokenSpan.kind === 90 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 201 /* ForOfStatement */: + case 203 /* ForOfStatement */: return context.currentTokenSpan.kind === 134 /* OfKeyword */ || context.nextTokenSpan.kind === 134 /* OfKeyword */; } return false; @@ -42210,7 +43111,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 182 /* ConditionalExpression */; + return context.contextNode.kind === 184 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -42254,17 +43155,17 @@ var ts; return true; } switch (node.kind) { - case 192 /* Block */: - case 220 /* CaseBlock */: - case 165 /* ObjectLiteralExpression */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 222 /* CaseBlock */: + case 167 /* ObjectLiteralExpression */: + case 221 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: @@ -42272,75 +43173,75 @@ var ts; case 146 /* SetAccessor */: ///case SyntaxKind.MethodSignature: case 147 /* CallSignature */: - case 173 /* FunctionExpression */: + case 175 /* FunctionExpression */: case 144 /* Constructor */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 213 /* FunctionDeclaration */ || context.contextNode.kind === 173 /* FunctionExpression */; + return context.contextNode.kind === 215 /* FunctionDeclaration */ || context.contextNode.kind === 175 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: case 155 /* TypeLiteral */: - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 214 /* ClassDeclaration */: - case 218 /* ModuleDeclaration */: - case 217 /* EnumDeclaration */: - case 192 /* Block */: - case 244 /* CatchClause */: - case 219 /* ModuleBlock */: - case 206 /* SwitchStatement */: + case 216 /* ClassDeclaration */: + case 220 /* ModuleDeclaration */: + case 219 /* EnumDeclaration */: + case 194 /* Block */: + case 246 /* CatchClause */: + case 221 /* ModuleBlock */: + case 208 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 196 /* IfStatement */: - case 206 /* SwitchStatement */: - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: - case 209 /* TryStatement */: - case 197 /* DoStatement */: - case 205 /* WithStatement */: + case 198 /* IfStatement */: + case 208 /* SwitchStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 211 /* TryStatement */: + case 199 /* DoStatement */: + case 207 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 244 /* CatchClause */: + case 246 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 165 /* ObjectLiteralExpression */; + return context.contextNode.kind === 167 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 168 /* CallExpression */; + return context.contextNode.kind === 170 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 169 /* NewExpression */; + return context.contextNode.kind === 171 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -42348,8 +43249,11 @@ var ts; Rules.IsPreviousTokenNotComma = function (context) { return context.currentTokenSpan.kind !== 24 /* CommaToken */; }; + Rules.IsNextTokenNotCloseBracket = function (context) { + return context.nextTokenSpan.kind !== 20 /* CloseBracketToken */; + }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 174 /* ArrowFunction */; + return context.contextNode.kind === 176 /* ArrowFunction */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -42370,14 +43274,14 @@ var ts; return node.kind === 139 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 212 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 214 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 218 /* ModuleDeclaration */; + return context.contextNode.kind === 220 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { return context.contextNode.kind === 155 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; @@ -42388,20 +43292,20 @@ var ts; } switch (parent.kind) { case 151 /* TypeReference */: - case 171 /* TypeAssertionExpression */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 173 /* TypeAssertionExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 147 /* CallSignature */: case 148 /* ConstructSignature */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 188 /* ExpressionWithTypeArguments */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 190 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -42412,16 +43316,16 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 171 /* TypeAssertionExpression */; + return context.contextNode.kind === 173 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 177 /* VoidExpression */; + return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 179 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 184 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 186 /* YieldExpression */ && context.contextNode.expression !== undefined; }; return Rules; - })(); + }()); formatting.Rules = Rules; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42489,7 +43393,7 @@ var ts; return null; }; return RulesMap; - })(); + }()); formatting.RulesMap = RulesMap; var MaskBitSize = 5; var Mask = 0x1f; @@ -42541,7 +43445,7 @@ var ts; this.rulesInsertionIndexBitmap = temp; }; return RulesBucketConstructionState; - })(); + }()); formatting.RulesBucketConstructionState = RulesBucketConstructionState; var RulesBucket = (function () { function RulesBucket() { @@ -42576,7 +43480,7 @@ var ts; state.IncreaseInsertionIndex(position); }; return RulesBucket; - })(); + }()); formatting.RulesBucket = RulesBucket; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42604,7 +43508,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenRangeAccess; - })(); + }()); Shared.TokenRangeAccess = TokenRangeAccess; var TokenValuesAccess = (function () { function TokenValuesAccess(tks) { @@ -42617,7 +43521,7 @@ var ts; return this.tokens.indexOf(token) >= 0; }; return TokenValuesAccess; - })(); + }()); Shared.TokenValuesAccess = TokenValuesAccess; var TokenSingleValueAccess = (function () { function TokenSingleValueAccess(token) { @@ -42630,7 +43534,7 @@ var ts; return tokenValue === this.token; }; return TokenSingleValueAccess; - })(); + }()); Shared.TokenSingleValueAccess = TokenSingleValueAccess; var TokenAllAccess = (function () { function TokenAllAccess() { @@ -42649,7 +43553,7 @@ var ts; return "[allTokens]"; }; return TokenAllAccess; - })(); + }()); Shared.TokenAllAccess = TokenAllAccess; var TokenRange = (function () { function TokenRange(tokenAccess) { @@ -42691,7 +43595,7 @@ var ts; TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); TokenRange.TypeNames = TokenRange.FromTokens([69 /* Identifier */, 128 /* NumberKeyword */, 130 /* StringKeyword */, 120 /* BooleanKeyword */, 131 /* SymbolKeyword */, 103 /* VoidKeyword */, 117 /* AnyKeyword */]); return TokenRange; - })(); + }()); Shared.TokenRange = TokenRange; })(Shared = formatting.Shared || (formatting.Shared = {})); })(formatting = ts.formatting || (ts.formatting = {})); @@ -42777,6 +43681,14 @@ var ts; rules.push(this.globalRules.NoSpaceBeforeCloseBracket); rules.push(this.globalRules.NoSpaceBetweenBrackets); } + if (options.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces) { + rules.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail); + } + else { + rules.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail); + } if (options.InsertSpaceAfterSemicolonInForStatements) { rules.push(this.globalRules.SpaceAfterSemicolonInFor); } @@ -42802,7 +43714,7 @@ var ts; return rules; }; return RulesProvider; - })(); + }()); formatting.RulesProvider = RulesProvider; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -42903,17 +43815,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 192 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 248 /* SourceFile */: - case 192 /* Block */: - case 219 /* ModuleBlock */: + return body && body.kind === 194 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 250 /* SourceFile */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -43011,17 +43923,17 @@ var ts; */ function getOwnOrInheritedDelta(n, options, sourceFile) { var previousLine = -1 /* Unknown */; - var childKind = 0 /* Unknown */; + var child; while (n) { var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; if (previousLine !== -1 /* Unknown */ && line !== previousLine) { break; } - if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { + if (formatting.SmartIndenter.shouldIndentChildNode(n, child)) { return options.IndentSize; } previousLine = line; - childKind = n.kind; + child = n; n = n.parent; } return 0; @@ -43051,6 +43963,13 @@ var ts; var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } + if (!formattingScanner.isOnToken()) { + var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (leadingTrivia) { + processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + trimTrailingWhitespacesForRemainingRange(); + } + } formattingScanner.close(); return edits; // local functions @@ -43062,7 +43981,8 @@ var ts; * to inherited indentation from its predecessors. */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { - if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || + ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { if (inheritedIndentation !== -1 /* Unknown */) { return inheritedIndentation; } @@ -43079,32 +43999,7 @@ var ts; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { var indentation = inheritedIndentation; - if (indentation === -1 /* Unknown */) { - if (isSomeBlock(node.kind)) { - // blocks should be indented in - // - other blocks - // - source file - // - switch\default clauses - if (isSomeBlock(parent.kind) || - parent.kind === 248 /* SourceFile */ || - parent.kind === 241 /* CaseClause */ || - parent.kind === 242 /* DefaultClause */) { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - else { - indentation = parentDynamicIndentation.getIndentation(); - } - } - else { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); - } - else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - } - } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; + var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { // if node is located on the same line with the parent // - inherit indentation from the parent @@ -43112,7 +44007,15 @@ var ts; indentation = startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta(node) + delta); + } + else if (indentation === -1 /* Unknown */) { + if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + } } return { indentation: indentation, @@ -43124,10 +44027,10 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 214 /* ClassDeclaration */: return 73 /* ClassKeyword */; - case 215 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; - case 213 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; - case 217 /* EnumDeclaration */: return 217 /* EnumDeclaration */; + case 216 /* ClassDeclaration */: return 73 /* ClassKeyword */; + case 217 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; + case 215 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; + case 219 /* EnumDeclaration */: return 219 /* EnumDeclaration */; case 145 /* GetAccessor */: return 123 /* GetKeyword */; case 146 /* SetAccessor */: return 129 /* SetKeyword */; case 143 /* MethodDeclaration */: @@ -43142,7 +44045,7 @@ var ts; } function getDynamicIndentation(node, nodeStartLine, indentation, delta) { return { - getIndentationForComment: function (kind, tokenIndentation) { + getIndentationForComment: function (kind, tokenIndentation, container) { switch (kind) { // preceding comment to the token that closes the indentation scope inherits the indentation from the scope // .. { @@ -43151,11 +44054,11 @@ var ts; case 16 /* CloseBraceToken */: case 20 /* CloseBracketToken */: case 18 /* CloseParenToken */: - return indentation + delta; + return indentation + getEffectiveDelta(delta, container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; }, - getIndentationForToken: function (line, kind) { + getIndentationForToken: function (line, kind, container) { if (nodeStartLine !== line && node.decorators) { if (kind === getFirstNonDecoratorTokenOfNode(node)) { // if this token is the first token following the list of decorators, we do not need to indent @@ -43176,20 +44079,20 @@ var ts; return indentation; default: // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + delta : indentation; + return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; } }, getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getDelta: function (child) { return getEffectiveDelta(delta, child); }, recomputeIndentation: function (lineAdded) { - if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { if (lineAdded) { indentation += options.IndentSize; } else { indentation -= options.IndentSize; } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { + if (formatting.SmartIndenter.shouldIndentChildNode(node)) { delta = options.IndentSize; } else { @@ -43198,6 +44101,10 @@ var ts; } } }; + function getEffectiveDelta(delta, child) { + // Delta value should be zero when the node explicitly prevents indentation of the child node + return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; + } } function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { @@ -43269,7 +44176,7 @@ var ts; // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules var tokenInfo = formattingScanner.readTokenInfo(child); ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } var effectiveParentStartLine = child.kind === 139 /* Decorator */ ? childStartLine : undecoratedParentStartLine; @@ -43323,7 +44230,7 @@ var ts; } } } - function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation, container) { ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); var indentToken = false; @@ -43358,10 +44265,10 @@ var ts; } if (indentToken) { var tokenIndentation = (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) ? - dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind) : + dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container) : -1 /* Unknown */; if (currentTokenInfo.leadingTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation); + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); var indentNextTokenOrTrivia = true; for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { var triviaItem = _a[_i]; @@ -43450,9 +44357,7 @@ var ts; } } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = - (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && - rule.Flag !== 1 /* CanDeleteNewLines */; + trimTrailingWhitespaces = !(rule.Operation.Action & 8 /* Delete */) && rule.Flag !== 1 /* CanDeleteNewLines */; } else { trimTrailingWhitespaces = true; @@ -43535,16 +44440,36 @@ var ts; if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } - var pos = lineEndPosition; - while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== lineEndPosition) { - ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); - recordDelete(pos + 1, lineEndPosition - pos); + var whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + ts.Debug.assert(whitespaceStart === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); } } } + /** + * @param start The position of the first character in range + * @param end The position of the last character in range + */ + function getTrailingWhitespaceStartPosition(start, end) { + var pos = end; + while (pos >= start && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + /** + * Trimming will be done for lines after the previous range + */ + function trimTrailingWhitespacesForRemainingRange() { + var startPosition = previousRange ? previousRange.end : originalRange.pos; + var startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; + trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); + } function newTextChange(start, len, newText) { return { span: ts.createTextSpan(start, len), newText: newText }; } @@ -43598,8 +44523,8 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 192 /* Block */: - case 219 /* ModuleBlock */: + case 194 /* Block */: + case 221 /* ModuleBlock */: return true; } return false; @@ -43607,11 +44532,11 @@ var ts; function getOpenTokenForList(node, list) { switch (node.kind) { case 144 /* Constructor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: if (node.typeParameters === list) { return 25 /* LessThanToken */; } @@ -43619,8 +44544,8 @@ var ts; return 17 /* OpenParenToken */; } break; - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -43744,7 +44669,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 181 /* BinaryExpression */) { + if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 183 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -43758,7 +44683,7 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current, previous)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -43825,7 +44750,7 @@ var ts; } } // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(parent, current) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } current = parent; @@ -43863,7 +44788,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 248 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 250 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -43896,7 +44821,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 196 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 198 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -43914,13 +44839,13 @@ var ts; return node.parent.typeArguments; } break; - case 165 /* ObjectLiteralExpression */: + case 167 /* ObjectLiteralExpression */: return node.parent.properties; - case 164 /* ArrayLiteralExpression */: + case 166 /* ArrayLiteralExpression */: return node.parent.elements; - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 147 /* CallSignature */: @@ -43935,8 +44860,8 @@ var ts; } break; } - case 169 /* NewExpression */: - case 168 /* CallExpression */: { + case 171 /* NewExpression */: + case 170 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -43966,8 +44891,8 @@ var ts; if (node.kind === 18 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 168 /* CallExpression */ || - node.parent.kind === 169 /* NewExpression */) && + if (node.parent && (node.parent.kind === 170 /* CallExpression */ || + node.parent.kind === 171 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -43985,10 +44910,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 166 /* PropertyAccessExpression */: - case 167 /* ElementAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 168 /* PropertyAccessExpression */: + case 169 /* ElementAccessExpression */: node = node.expression; break; default: @@ -44052,34 +44977,35 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 195 /* ExpressionStatement */: - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 164 /* ArrayLiteralExpression */: - case 192 /* Block */: - case 219 /* ModuleBlock */: - case 165 /* ObjectLiteralExpression */: + case 197 /* ExpressionStatement */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 166 /* ArrayLiteralExpression */: + case 194 /* Block */: + case 221 /* ModuleBlock */: + case 167 /* ObjectLiteralExpression */: case 155 /* TypeLiteral */: case 157 /* TupleType */: - case 220 /* CaseBlock */: - case 242 /* DefaultClause */: - case 241 /* CaseClause */: - case 172 /* ParenthesizedExpression */: - case 166 /* PropertyAccessExpression */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: - case 193 /* VariableStatement */: - case 211 /* VariableDeclaration */: - case 227 /* ExportAssignment */: - case 204 /* ReturnStatement */: - case 182 /* ConditionalExpression */: - case 162 /* ArrayBindingPattern */: - case 161 /* ObjectBindingPattern */: - case 233 /* JsxElement */: - case 234 /* JsxSelfClosingElement */: + case 222 /* CaseBlock */: + case 244 /* DefaultClause */: + case 243 /* CaseClause */: + case 174 /* ParenthesizedExpression */: + case 168 /* PropertyAccessExpression */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: + case 195 /* VariableStatement */: + case 213 /* VariableDeclaration */: + case 229 /* ExportAssignment */: + case 206 /* ReturnStatement */: + case 184 /* ConditionalExpression */: + case 164 /* ArrayBindingPattern */: + case 163 /* ObjectBindingPattern */: + case 237 /* JsxOpeningElement */: + case 236 /* JsxSelfClosingElement */: + case 242 /* JsxExpression */: case 142 /* MethodSignature */: case 147 /* CallSignature */: case 148 /* ConstructSignature */: @@ -44087,34 +45013,43 @@ var ts; case 152 /* FunctionType */: case 153 /* ConstructorType */: case 160 /* ParenthesizedType */: - case 170 /* TaggedTemplateExpression */: - case 178 /* AwaitExpression */: + case 172 /* TaggedTemplateExpression */: + case 180 /* AwaitExpression */: + case 227 /* NamedImports */: return true; } return false; } - function shouldIndentChildNode(parent, child) { - if (nodeContentIsAlwaysIndented(parent)) { - return true; - } - switch (parent) { - case 197 /* DoStatement */: - case 198 /* WhileStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 199 /* ForStatement */: - case 196 /* IfStatement */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + /* @internal */ + function nodeWillIndentChild(parent, child, indentByDefault) { + var childKind = child ? child.kind : 0 /* Unknown */; + switch (parent.kind) { + case 199 /* DoStatement */: + case 200 /* WhileStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 201 /* ForStatement */: + case 198 /* IfStatement */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 143 /* MethodDeclaration */: - case 174 /* ArrowFunction */: + case 176 /* ArrowFunction */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - return child !== 192 /* Block */; - default: - return false; + return childKind !== 194 /* Block */; + case 235 /* JsxElement */: + return childKind !== 239 /* JsxClosingElement */; } + // No explicit rule for given nodes so the result will follow the default value argument + return indentByDefault; + } + SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; + /* + Function returns true when the parent node should indent the given child by an explicit rule + */ + function shouldIndentChildNode(parent, child) { + return nodeContentIsAlwaysIndented(parent.kind) || nodeWillIndentChild(parent, child, false); } SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); @@ -44157,7 +45092,7 @@ var ts; return undefined; }; return StringScriptSnapshot; - })(); + }()); function fromString(text) { return new StringScriptSnapshot(text); } @@ -44256,7 +45191,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(271 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); + var list = createNode(273 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -44333,7 +45268,7 @@ var ts; return child.kind < 135 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; return NodeObject; - })(); + }()); var SymbolObject = (function () { function SymbolObject(flags, name) { this.flags = flags; @@ -44355,7 +45290,7 @@ var ts; return this.documentationComment; }; return SymbolObject; - })(); + }()); function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { var documentationComment = []; var docComments = getJsDocCommentsSeparatedByNewLines(); @@ -44373,7 +45308,7 @@ var ts; // Make sure we are collecting doc comment from declaration once, // In case of union property there might be same declaration multiple times // which only varies in type parameter - // Eg. let a: Array | Array; a.length + // Eg. const a: Array | Array; a.length // The property length will have two declarations of property length coming // from Array - Array and Array if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { @@ -44388,15 +45323,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 218 /* ModuleDeclaration */ && declaration.body.kind === 218 /* ModuleDeclaration */) { + if (declaration.kind === 220 /* ModuleDeclaration */ && declaration.body.kind === 220 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 218 /* ModuleDeclaration */ && declaration.parent.kind === 218 /* ModuleDeclaration */) { + while (declaration.kind === 220 /* ModuleDeclaration */ && declaration.parent.kind === 220 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 211 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -44444,7 +45379,8 @@ var ts; } function pushDocCommentLineText(docComments, text, blankLineCount) { // Add the empty lines in between texts - while (blankLineCount--) { + while (blankLineCount) { + blankLineCount--; docComments.push(ts.textPart("")); } docComments.push(ts.textPart(text)); @@ -44670,7 +45606,7 @@ var ts; : undefined; }; return TypeObject; - })(); + }()); var SignatureObject = (function () { function SignatureObject(checker) { this.checker = checker; @@ -44696,7 +45632,7 @@ var ts; return this.documentationComment; }; return SignatureObject; - })(); + }()); var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { @@ -44742,7 +45678,7 @@ var ts; } if (declaration.name.kind === 136 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 166 /* PropertyAccessExpression */) { + if (expr.kind === 168 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -44762,7 +45698,7 @@ var ts; } function visit(node) { switch (node.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: var functionDeclaration = node; @@ -44784,31 +45720,31 @@ var ts; ts.forEachChild(node, visit); } break; - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: - case 217 /* EnumDeclaration */: - case 218 /* ModuleDeclaration */: - case 221 /* ImportEqualsDeclaration */: - case 230 /* ExportSpecifier */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 223 /* ImportClause */: - case 224 /* NamespaceImport */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: + case 219 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: + case 223 /* ImportEqualsDeclaration */: + case 232 /* ExportSpecifier */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 225 /* ImportClause */: + case 226 /* NamespaceImport */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 155 /* TypeLiteral */: addDeclaration(node); // fall through case 144 /* Constructor */: - case 193 /* VariableStatement */: - case 212 /* VariableDeclarationList */: - case 161 /* ObjectBindingPattern */: - case 162 /* ArrayBindingPattern */: - case 219 /* ModuleBlock */: + case 195 /* VariableStatement */: + case 214 /* VariableDeclarationList */: + case 163 /* ObjectBindingPattern */: + case 164 /* ArrayBindingPattern */: + case 221 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } @@ -44819,25 +45755,25 @@ var ts; break; } // fall through - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 247 /* EnumMember */: + case 249 /* EnumMember */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: addDeclaration(node); break; - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -44849,7 +45785,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 224 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -44862,12 +45798,12 @@ var ts; } }; return SourceFileObject; - })(NodeObject); + }(NodeObject)); var TextChange = (function () { function TextChange() { } return TextChange; - })(); + }()); ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { @@ -44957,7 +45893,7 @@ var ts; // enum E ScriptElementKind.enumElement = "enum"; // Inside module and script only - // let v = .. + // const v = .. ScriptElementKind.variableElement = "var"; // Inside function ScriptElementKind.localVariableElement = "local var"; @@ -45026,7 +45962,7 @@ var ts; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; return ClassificationTypeNames; - })(); + }()); ts.ClassificationTypeNames = ClassificationTypeNames; (function (ClassificationType) { ClassificationType[ClassificationType["comment"] = 1] = "comment"; @@ -45065,16 +46001,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 173 /* FunctionExpression */) { + if (declaration.kind === 175 /* FunctionExpression */) { return true; } - if (declaration.kind !== 211 /* VariableDeclaration */ && declaration.kind !== 213 /* FunctionDeclaration */) { + if (declaration.kind !== 213 /* VariableDeclaration */ && declaration.kind !== 215 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { // Reached source file or module block - if (parent_8.kind === 248 /* SourceFile */ || parent_8.kind === 219 /* ModuleBlock */) { + if (parent_8.kind === 250 /* SourceFile */ || parent_8.kind === 221 /* ModuleBlock */) { return false; } } @@ -45157,7 +46093,7 @@ var ts; return file && file.scriptSnapshot; }; return HostCache; - })(); + }()); var SyntaxTreeCache = (function () { function SyntaxTreeCache(host) { this.host = host; @@ -45172,7 +46108,7 @@ var ts; var sourceFile; if (this.currentFileName !== fileName) { // This is a new file, just parse it - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, /*setNodeParents:*/ true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, /*setNodeParents*/ true); } else if (this.currentFileVersion !== version) { // This is the same file, just a newer version. Incrementally parse the file. @@ -45189,7 +46125,7 @@ var ts; return this.currentSourceFile; }; return SyntaxTreeCache; - })(); + }()); function setSourceFileFields(sourceFile, scriptSnapshot, version) { sourceFile.version = version; sourceFile.scriptSnapshot = scriptSnapshot; @@ -45234,7 +46170,7 @@ var ts; sourceMapText = text; } else { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); + ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: '" + name + "'"); outputText = text; } }, @@ -45244,7 +46180,8 @@ var ts; getCurrentDirectory: function () { return ""; }, getNewLine: function () { return newLine; }, fileExists: function (fileName) { return fileName === inputFileName; }, - readFile: function (fileName) { return ""; } + readFile: function (fileName) { return ""; }, + directoryExists: function (directoryExists) { return true; } }; var program = ts.createProgram([inputFileName], options, compilerHost); var diagnostics; @@ -45326,7 +46263,7 @@ var ts; } } // Otherwise, just create a new source file. - return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents:*/ true); + return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; function createGetCanonicalFileName(useCaseSensitivefileNames) { @@ -45342,7 +46279,7 @@ var ts; var buckets = {}; var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { - return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx; + return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -45353,7 +46290,7 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === "_"; }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; entries.forEachValue(function (key, entry) { @@ -45369,13 +46306,13 @@ var ts; sourceFiles: sourceFiles }; }); - return JSON.stringify(bucketInfoArray, null, 2); + return JSON.stringify(bucketInfoArray, undefined, 2); } function acquireDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring:*/ true); + return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ true); } function updateDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring:*/ false); + return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, /*acquiring*/ false); } function acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, acquiring) { var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ true); @@ -45384,7 +46321,7 @@ var ts; if (!entry) { ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); // Have never seen this file with these settings. Create a new source file for it. - var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents:*/ false); + var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false); entry = { sourceFile: sourceFile, languageServiceRefCount: 0, @@ -45411,7 +46348,7 @@ var ts; return entry.sourceFile; } function releaseDocument(fileName, compilationSettings) { - var bucket = getBucketForCompilationSettings(compilationSettings, false); + var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false); ts.Debug.assert(bucket !== undefined); var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = bucket.get(path); @@ -45507,7 +46444,7 @@ var ts; } } else if (token === 56 /* EqualsToken */) { - if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } } @@ -45599,7 +46536,7 @@ var ts; if (token === 69 /* Identifier */ || ts.isKeyword(token)) { token = scanner.scan(); if (token === 56 /* EqualsToken */) { - if (tryConsumeRequireCall(/* skipCurrentToken */ true)) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } } @@ -45686,7 +46623,7 @@ var ts; if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/* skipCurrentToken */ false) || tryConsumeDefine()))) { + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { continue; } else { @@ -45705,7 +46642,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 207 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 209 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -45714,12 +46651,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 /* Identifier */ && - (node.parent.kind === 203 /* BreakStatement */ || node.parent.kind === 202 /* ContinueStatement */) && + (node.parent.kind === 205 /* BreakStatement */ || node.parent.kind === 204 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 /* Identifier */ && - node.parent.kind === 207 /* LabeledStatement */ && + node.parent.kind === 209 /* LabeledStatement */ && node.parent.label === node; } /** @@ -45727,7 +46664,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 207 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 209 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -45741,22 +46678,22 @@ var ts; return node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 166 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 168 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 169 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 218 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 220 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 /* Identifier */ && @@ -45765,22 +46702,22 @@ var ts; /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { return (node.kind === 69 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - (node.parent.kind === 245 /* PropertyAssignment */ || node.parent.kind === 246 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 247 /* PropertyAssignment */ || node.parent.kind === 248 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 247 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 249 /* EnumMember */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: return node.parent.name === node; - case 167 /* ElementAccessExpression */: + case 169 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -45854,17 +46791,17 @@ var ts; return undefined; } switch (node.kind) { - case 248 /* SourceFile */: + case 250 /* SourceFile */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 217 /* EnumDeclaration */: - case 218 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 219 /* EnumDeclaration */: + case 220 /* ModuleDeclaration */: return node; } } @@ -45872,18 +46809,18 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 218 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 214 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 215 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 216 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 217 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 211 /* VariableDeclaration */: + case 220 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 216 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 217 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 218 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 219 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 213 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 213 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 215 /* FunctionDeclaration */: return ScriptElementKind.functionElement; case 145 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; case 146 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; case 143 /* MethodDeclaration */: @@ -45897,13 +46834,13 @@ var ts; case 147 /* CallSignature */: return ScriptElementKind.callSignatureElement; case 144 /* Constructor */: return ScriptElementKind.constructorImplementationElement; case 137 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 247 /* EnumMember */: return ScriptElementKind.variableElement; + case 249 /* EnumMember */: return ScriptElementKind.variableElement; case 138 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 221 /* ImportEqualsDeclaration */: - case 226 /* ImportSpecifier */: - case 223 /* ImportClause */: - case 230 /* ExportSpecifier */: - case 224 /* NamespaceImport */: + case 223 /* ImportEqualsDeclaration */: + case 228 /* ImportSpecifier */: + case 225 /* ImportClause */: + case 232 /* ExportSpecifier */: + case 226 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -45922,7 +46859,7 @@ var ts; } }; return CancellationTokenObject; - })(); + }()); function createLanguageService(host, documentRegistry) { if (documentRegistry === void 0) { documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } var syntaxTreeCache = new SyntaxTreeCache(host); @@ -45985,7 +46922,8 @@ var ts; (oldSettings.target !== newSettings.target || oldSettings.module !== newSettings.module || oldSettings.noResolve !== newSettings.noResolve || - oldSettings.jsx !== newSettings.jsx); + oldSettings.jsx !== newSettings.jsx || + oldSettings.allowJs !== newSettings.allowJs); // Now create a new compiler var compilerHost = { getSourceFile: getOrCreateSourceFile, @@ -46005,6 +46943,10 @@ var ts; // stub missing host functionality var entry = hostCache.getOrCreateEntry(fileName); return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + }, + directoryExists: function (directoryName) { + ts.Debug.assert(!host.resolveModuleNames); + return ts.directoryProbablyExists(directoryName, host); } }; if (host.resolveModuleNames) { @@ -46074,8 +47016,11 @@ var ts; return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } function sourceFileUpToDate(sourceFile) { + if (!sourceFile) { + return false; + } var path = sourceFile.path || ts.toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName); - return sourceFile && sourceFile.version === hostCache.getVersion(path); + return sourceFile.version === hostCache.getVersion(path); } function programUpToDate() { // If we haven't create a program yet, then it is not up-to-date @@ -46124,12 +47069,6 @@ var ts; function getSemanticDiagnostics(fileName) { synchronizeHostData(); var targetSourceFile = getValidSourceFile(fileName); - // For JavaScript files, we don't want to report the normal typescript semantic errors. - // Instead, we just report errors for using TypeScript-only constructs from within a - // JavaScript file. - if (ts.isSourceFileJavaScript(targetSourceFile)) { - return getJavaScriptSemanticDiagnostics(targetSourceFile); - } // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. // Therefore only get diagnostics for given file. var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); @@ -46140,151 +47079,6 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } - function getJavaScriptSemanticDiagnostics(sourceFile) { - var diagnostics = []; - walk(sourceFile); - return diagnostics; - function walk(node) { - if (!node) { - return false; - } - switch (node.kind) { - case 221 /* ImportEqualsDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); - return true; - case 227 /* ExportAssignment */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); - return true; - case 214 /* ClassDeclaration */: - var classDeclaration = node; - if (checkModifiers(classDeclaration.modifiers) || - checkTypeParameters(classDeclaration.typeParameters)) { - return true; - } - break; - case 243 /* HeritageClause */: - var heritageClause = node; - if (heritageClause.token === 106 /* ImplementsKeyword */) { - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 215 /* InterfaceDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 218 /* ModuleDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 216 /* TypeAliasDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); - return true; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: - case 213 /* FunctionDeclaration */: - var functionDeclaration = node; - if (checkModifiers(functionDeclaration.modifiers) || - checkTypeParameters(functionDeclaration.typeParameters) || - checkTypeAnnotation(functionDeclaration.type)) { - return true; - } - break; - case 193 /* VariableStatement */: - var variableStatement = node; - if (checkModifiers(variableStatement.modifiers)) { - return true; - } - break; - case 211 /* VariableDeclaration */: - var variableDeclaration = node; - if (checkTypeAnnotation(variableDeclaration.type)) { - return true; - } - break; - case 168 /* CallExpression */: - case 169 /* NewExpression */: - var expression = node; - if (expression.typeArguments && expression.typeArguments.length > 0) { - var start = expression.typeArguments.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 138 /* Parameter */: - var parameter = node; - if (parameter.modifiers) { - var start = parameter.modifiers.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); - return true; - } - if (parameter.questionToken) { - diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, '?')); - return true; - } - if (parameter.type) { - diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 141 /* PropertyDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 217 /* EnumDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 171 /* TypeAssertionExpression */: - var typeAssertionExpression = node; - diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); - return true; - case 139 /* Decorator */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); - return true; - } - return ts.forEachChild(node, walk); - } - function checkTypeParameters(typeParameters) { - if (typeParameters) { - var start = typeParameters.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkTypeAnnotation(type) { - if (type) { - diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkModifiers(modifiers) { - if (modifiers) { - for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { - var modifier = modifiers_1[_i]; - switch (modifier.kind) { - case 112 /* PublicKeyword */: - case 110 /* PrivateKeyword */: - case 111 /* ProtectedKeyword */: - case 122 /* DeclareKeyword */: - diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); - return true; - // These are all legal modifiers. - case 113 /* StaticKeyword */: - case 82 /* ExportKeyword */: - case 74 /* ConstKeyword */: - case 77 /* DefaultKeyword */: - case 115 /* AbstractKeyword */: - } - } - } - return false; - } - } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); @@ -46301,7 +47095,7 @@ var ts; // First check of the displayName is not external module; if it is an external module, it is not valid entry if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there) + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) return undefined; } } @@ -46324,20 +47118,14 @@ var ts; // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. if (performCharacterChecks) { - if (!ts.isIdentifierStart(name.charCodeAt(0), target)) { + if (!ts.isIdentifier(name, target)) { return undefined; } - for (var i = 1, n = name.length; i < n; i++) { - if (!ts.isIdentifierPart(name.charCodeAt(i), target)) { - return undefined; - } - } } return name; } function getCompletionData(fileName, position) { var typeChecker = program.getTypeChecker(); - var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var isJavaScriptFile = ts.isSourceFileJavaScript(sourceFile); var isJsDocTagName = false; @@ -46349,7 +47137,7 @@ var ts; var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. + // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names if (ts.hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { isJsDocTagName = true; @@ -46364,9 +47152,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { - case 269 /* JSDocTypeTag */: - case 267 /* JSDocParameterTag */: - case 268 /* JSDocReturnTag */: + case 271 /* JSDocTypeTag */: + case 269 /* JSDocParameterTag */: + case 270 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -46378,7 +47166,7 @@ var ts; return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName: isJsDocTagName }; } if (!insideJsDocTagExpression) { - // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal + // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); return undefined; @@ -46393,9 +47181,9 @@ var ts; // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| // Skip this partial identifier and adjust the contextToken to the token that precedes it. if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_3 = new Date().getTime(); + var start_6 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_3)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_6)); } // Find the node where completion is requested on. // Also determine whether we are trying to complete with members of that node @@ -46413,7 +47201,7 @@ var ts; } var parent_9 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_9.kind === 166 /* PropertyAccessExpression */) { + if (parent_9.kind === 168 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } @@ -46432,7 +47220,7 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 237 /* JsxClosingElement */) { + else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 239 /* JsxClosingElement */) { isStartingCloseTag = true; } } @@ -46475,7 +47263,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 166 /* PropertyAccessExpression */) { + if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -46531,7 +47319,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 234 /* JsxSelfClosingElement */) || (jsxContainer.kind === 235 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 236 /* JsxSelfClosingElement */) || (jsxContainer.kind === 237 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { @@ -46603,15 +47391,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 236 /* JsxText */) { + if (contextToken.kind === 238 /* JsxText */) { return true; } if (contextToken.kind === 27 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 235 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 237 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 237 /* JsxClosingElement */ || contextToken.parent.kind === 234 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 233 /* JsxElement */; + if (contextToken.parent.kind === 239 /* JsxClosingElement */ || contextToken.parent.kind === 236 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 235 /* JsxElement */; } } return false; @@ -46621,36 +47409,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 168 /* CallExpression */ // func( a, | + return containingNodeKind === 170 /* CallExpression */ // func( a, | || containingNodeKind === 144 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 169 /* NewExpression */ // new C(a, | - || containingNodeKind === 164 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 181 /* BinaryExpression */ // let x = (a, | + || containingNodeKind === 171 /* NewExpression */ // new C(a, | + || containingNodeKind === 166 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 183 /* BinaryExpression */ // const x = (a, | || containingNodeKind === 152 /* FunctionType */; // var x: (s: string, list| case 17 /* OpenParenToken */: - return containingNodeKind === 168 /* CallExpression */ // func( | + return containingNodeKind === 170 /* CallExpression */ // func( | || containingNodeKind === 144 /* Constructor */ // constructor( | - || containingNodeKind === 169 /* NewExpression */ // new C(a| - || containingNodeKind === 172 /* ParenthesizedExpression */ // let x = (a| + || containingNodeKind === 171 /* NewExpression */ // new C(a| + || containingNodeKind === 174 /* ParenthesizedExpression */ // const x = (a| || containingNodeKind === 160 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 19 /* OpenBracketToken */: - return containingNodeKind === 164 /* ArrayLiteralExpression */ // [ | + return containingNodeKind === 166 /* ArrayLiteralExpression */ // [ | || containingNodeKind === 149 /* IndexSignature */ // [ | : string ] || containingNodeKind === 136 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 125 /* ModuleKeyword */: // module | case 126 /* NamespaceKeyword */: return true; case 21 /* DotToken */: - return containingNodeKind === 218 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 220 /* ModuleDeclaration */; // module A.| case 15 /* OpenBraceToken */: - return containingNodeKind === 214 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 216 /* ClassDeclaration */; // class A{ | case 56 /* EqualsToken */: - return containingNodeKind === 211 /* VariableDeclaration */ // let x = a| - || containingNodeKind === 181 /* BinaryExpression */; // x = a| + return containingNodeKind === 213 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 183 /* BinaryExpression */; // x = a| case 12 /* TemplateHead */: - return containingNodeKind === 183 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 185 /* TemplateExpression */; // `aa ${| case 13 /* TemplateMiddle */: - return containingNodeKind === 190 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 192 /* TemplateSpan */; // `aa ${10} dd ${| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: @@ -46668,15 +47456,16 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 /* StringLiteral */ + || contextToken.kind === 162 /* StringLiteralType */ || contextToken.kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(contextToken.kind)) { - var start_4 = contextToken.getStart(); + var start_7 = contextToken.getStart(); var end = contextToken.getEnd(); // To be "in" one of these literals, the position has to be: // 1. entirely within the token text. // 2. at the end position of an unterminated token. // 3. at the end of a regular expression (due to trailing flags like '/foo/g'). - if (start_4 < position && position < end) { + if (start_7 < position && position < end) { return true; } if (position === end) { @@ -46697,14 +47486,14 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 165 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 167 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 161 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 163 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -46750,9 +47539,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 225 /* NamedImports */ ? - 222 /* ImportDeclaration */ : - 228 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 227 /* NamedImports */ ? + 224 /* ImportDeclaration */ : + 230 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -46775,10 +47564,10 @@ var ts; function tryGetObjectLikeCompletionContainer(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 15 /* OpenBraceToken */: // let x = { | + case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 165 /* ObjectLiteralExpression */ || parent_10.kind === 161 /* ObjectBindingPattern */)) { + if (parent_10 && (parent_10.kind === 167 /* ObjectLiteralExpression */ || parent_10.kind === 163 /* ObjectBindingPattern */)) { return parent_10; } break; @@ -46796,8 +47585,8 @@ var ts; case 15 /* OpenBraceToken */: // import { | case 24 /* CommaToken */: switch (contextToken.parent.kind) { - case 225 /* NamedImports */: - case 229 /* NamedExports */: + case 227 /* NamedImports */: + case 231 /* NamedExports */: return contextToken.parent; } } @@ -46811,12 +47600,12 @@ var ts; case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: - case 238 /* JsxAttribute */: - case 239 /* JsxSpreadAttribute */: - if (parent_11 && (parent_11.kind === 234 /* JsxSelfClosingElement */ || parent_11.kind === 235 /* JsxOpeningElement */)) { + case 240 /* JsxAttribute */: + case 241 /* JsxSpreadAttribute */: + if (parent_11 && (parent_11.kind === 236 /* JsxSelfClosingElement */ || parent_11.kind === 237 /* JsxOpeningElement */)) { return parent_11; } - else if (parent_11.kind === 238 /* JsxAttribute */) { + else if (parent_11.kind === 240 /* JsxAttribute */) { return parent_11.parent; } break; @@ -46824,18 +47613,18 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_11 && ((parent_11.kind === 238 /* JsxAttribute */) || (parent_11.kind === 239 /* JsxSpreadAttribute */))) { + if (parent_11 && ((parent_11.kind === 240 /* JsxAttribute */) || (parent_11.kind === 241 /* JsxSpreadAttribute */))) { return parent_11.parent; } break; case 16 /* CloseBraceToken */: if (parent_11 && - parent_11.kind === 240 /* JsxExpression */ && + parent_11.kind === 242 /* JsxExpression */ && parent_11.parent && - (parent_11.parent.kind === 238 /* JsxAttribute */)) { + (parent_11.parent.kind === 240 /* JsxAttribute */)) { return parent_11.parent.parent; } - if (parent_11 && parent_11.kind === 239 /* JsxSpreadAttribute */) { + if (parent_11 && parent_11.kind === 241 /* JsxSpreadAttribute */) { return parent_11.parent; } break; @@ -46845,9 +47634,9 @@ var ts; } function isFunction(kind) { switch (kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 213 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: @@ -46866,54 +47655,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 211 /* VariableDeclaration */ || - containingNodeKind === 212 /* VariableDeclarationList */ || - containingNodeKind === 193 /* VariableStatement */ || - containingNodeKind === 217 /* EnumDeclaration */ || + return containingNodeKind === 213 /* VariableDeclaration */ || + containingNodeKind === 214 /* VariableDeclarationList */ || + containingNodeKind === 195 /* VariableStatement */ || + containingNodeKind === 219 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 214 /* ClassDeclaration */ || - containingNodeKind === 186 /* ClassExpression */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 162 /* ArrayBindingPattern */ || - containingNodeKind === 216 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 216 /* ClassDeclaration */ || + containingNodeKind === 188 /* ClassExpression */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 164 /* ArrayBindingPattern */ || + containingNodeKind === 218 /* TypeAliasDeclaration */; // type Map, K, | case 21 /* DotToken */: - return containingNodeKind === 162 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 164 /* ArrayBindingPattern */; // var [.| case 54 /* ColonToken */: - return containingNodeKind === 163 /* BindingElement */; // var {x :html| + return containingNodeKind === 165 /* BindingElement */; // var {x :html| case 19 /* OpenBracketToken */: - return containingNodeKind === 162 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 164 /* ArrayBindingPattern */; // var [x| case 17 /* OpenParenToken */: - return containingNodeKind === 244 /* CatchClause */ || + return containingNodeKind === 246 /* CatchClause */ || isFunction(containingNodeKind); case 15 /* OpenBraceToken */: - return containingNodeKind === 217 /* EnumDeclaration */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 155 /* TypeLiteral */; // let x : { | + return containingNodeKind === 219 /* EnumDeclaration */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 155 /* TypeLiteral */; // const x : { | case 23 /* SemicolonToken */: return containingNodeKind === 140 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 215 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 155 /* TypeLiteral */); // let x : { a; | + (contextToken.parent.parent.kind === 217 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 155 /* TypeLiteral */); // const x : { a; | case 25 /* LessThanToken */: - return containingNodeKind === 214 /* ClassDeclaration */ || - containingNodeKind === 186 /* ClassExpression */ || - containingNodeKind === 215 /* InterfaceDeclaration */ || - containingNodeKind === 216 /* TypeAliasDeclaration */ || + return containingNodeKind === 216 /* ClassDeclaration */ || + containingNodeKind === 188 /* ClassExpression */ || + containingNodeKind === 217 /* InterfaceDeclaration */ || + containingNodeKind === 218 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 113 /* StaticKeyword */: return containingNodeKind === 141 /* PropertyDeclaration */; case 22 /* DotDotDotToken */: return containingNodeKind === 138 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 162 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 164 /* ArrayBindingPattern */); // var [...z| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: return containingNodeKind === 138 /* Parameter */; case 116 /* AsKeyword */: - return containingNodeKind === 226 /* ImportSpecifier */ || - containingNodeKind === 230 /* ExportSpecifier */ || - containingNodeKind === 224 /* NamespaceImport */; + return containingNodeKind === 228 /* ImportSpecifier */ || + containingNodeKind === 232 /* ExportSpecifier */ || + containingNodeKind === 226 /* NamespaceImport */; case 73 /* ClassKeyword */: case 81 /* EnumKeyword */: case 107 /* InterfaceKeyword */: @@ -46973,8 +47762,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_35 = element.propertyName || element.name; - exisingImportsOrExports[name_35.text] = true; + var name_31 = element.propertyName || element.name; + exisingImportsOrExports[name_31.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -46995,9 +47784,10 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 245 /* PropertyAssignment */ && - m.kind !== 246 /* ShorthandPropertyAssignment */ && - m.kind !== 163 /* BindingElement */) { + if (m.kind !== 247 /* PropertyAssignment */ && + m.kind !== 248 /* ShorthandPropertyAssignment */ && + m.kind !== 165 /* BindingElement */ && + m.kind !== 143 /* MethodDeclaration */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -47005,7 +47795,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 163 /* BindingElement */ && m.propertyName) { + if (m.kind === 165 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 69 /* Identifier */) { existingName = m.propertyName.text; @@ -47035,7 +47825,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 238 /* JsxAttribute */) { + if (attr.kind === 240 /* JsxAttribute */) { seenNames[attr.name.text] = true; } } @@ -47074,10 +47864,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_36 in nameTable) { - if (!uniqueNames[name_36]) { - uniqueNames[name_36] = name_36; - var displayName = getCompletionEntryDisplayName(name_36, target, /*performCharacterChecks:*/ true); + for (var name_32 in nameTable) { + if (!uniqueNames[name_32]) { + uniqueNames[name_32] = name_32; + var displayName = getCompletionEntryDisplayName(name_32, target, /*performCharacterChecks*/ true); if (displayName) { var entry = { name: displayName, @@ -47105,7 +47895,7 @@ var ts; // Try to get a valid display name for this symbol, if we could not find one, then ignore it. // We would like to only show things that can be added after a dot, so for instance numeric properties can // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true, location); + var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks*/ true, location); if (!displayName) { return undefined; } @@ -47154,7 +47944,7 @@ var ts; // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false, location_2) === entryName ? s : undefined; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks*/ false, location_2) === entryName ? s : undefined; }); if (symbol) { var _a = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind; return { @@ -47183,7 +47973,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 186 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; @@ -47248,7 +48038,7 @@ var ts; }); if (!unionPropertyKind) { // If this was union of all methods, - //make sure it has call signatures before we can label it as method + // make sure it has call signatures before we can label it as method var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; @@ -47285,7 +48075,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 166 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 168 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -47294,7 +48084,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 168 /* CallExpression */ || location.kind === 169 /* NewExpression */) { + if (location.kind === 170 /* CallExpression */ || location.kind === 171 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -47307,7 +48097,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 169 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 171 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -47341,16 +48131,16 @@ var ts; case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(ts.SyntaxKind.ColonToken)); + displayParts.push(ts.punctuationPart(54 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(ts.SyntaxKind.NewKeyword)); + displayParts.push(ts.keywordPart(92 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - if (!(type.flags & ts.TypeFlags.Anonymous)) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, ts.SymbolFormatFlags.WriteTypeParametersOrArguments)); + if (!(type.flags & 65536 /* Anonymous */)) { + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); } - addSignatureDisplayParts(signature, allSignatures, ts.TypeFormatFlags.WriteArrowStyleSignature); + addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); break; default: // Just signature @@ -47386,7 +48176,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 186 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -47430,7 +48220,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 218 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 220 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 69 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 126 /* NamespaceKeyword */ : 125 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -47453,35 +48243,37 @@ var ts; } else { // Method/function type parameter - var container = ts.getContainingFunction(location); - if (container) { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).parent; - var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 148 /* ConstructSignature */) { - displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */); + ts.Debug.assert(declaration !== undefined); + declaration = declaration.parent; + if (declaration) { + if (ts.isFunctionLikeKind(declaration.kind)) { + var signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === 148 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(92 /* NewKeyword */)); + displayParts.push(ts.spacePart()); + } + else if (declaration.kind !== 147 /* CallSignature */ && declaration.name) { + addFullSymbolName(declaration.symbol); + } + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); + } + else { + // Type alias type parameter + // For example + // type list = T[]; // Both T will go through same code path + displayParts.push(ts.keywordPart(132 /* TypeKeyword */)); displayParts.push(ts.spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } - else if (signatureDeclaration.kind !== 147 /* CallSignature */ && signatureDeclaration.name) { - addFullSymbolName(signatureDeclaration.symbol); - } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); - } - else { - // Type aliash type parameter - // For example - // type list = T[]; // Both T will go through same code path - var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).parent; - displayParts.push(ts.keywordPart(132 /* TypeKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(declaration.symbol); - writeTypeParametersOfSymbol(declaration.symbol, sourceFile); } } } if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 247 /* EnumMember */) { + if (declaration.kind === 249 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -47497,7 +48289,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 221 /* ImportEqualsDeclaration */) { + if (declaration.kind === 223 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -47630,9 +48422,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 69 /* Identifier */: - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: case 97 /* ThisKeyword */: + case 161 /* ThisType */: case 95 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -47712,7 +48505,7 @@ var ts; var definition; ts.forEach(signatureDeclarations, function (d) { if ((selectConstructors && d.kind === 144 /* Constructor */) || - (!selectConstructors && (d.kind === 213 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { + (!selectConstructors && (d.kind === 215 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -47781,7 +48574,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 246 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 248 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -47857,10 +48650,11 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 /* Identifier */ || node.kind === 97 /* ThisKeyword */ || + node.kind === 161 /* ThisType */ || node.kind === 95 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - var referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false); return convertReferencedSymbols(referencedSymbols); } return undefined; @@ -47910,58 +48704,58 @@ var ts; switch (node.kind) { case 88 /* IfKeyword */: case 80 /* ElseKeyword */: - if (hasKind(node.parent, 196 /* IfStatement */)) { + if (hasKind(node.parent, 198 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 94 /* ReturnKeyword */: - if (hasKind(node.parent, 204 /* ReturnStatement */)) { + if (hasKind(node.parent, 206 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 98 /* ThrowKeyword */: - if (hasKind(node.parent, 208 /* ThrowStatement */)) { + if (hasKind(node.parent, 210 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 72 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 209 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 211 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100 /* TryKeyword */: case 85 /* FinallyKeyword */: - if (hasKind(parent(node), 209 /* TryStatement */)) { + if (hasKind(parent(node), 211 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96 /* SwitchKeyword */: - if (hasKind(node.parent, 206 /* SwitchStatement */)) { + if (hasKind(node.parent, 208 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71 /* CaseKeyword */: case 77 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 206 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 208 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70 /* BreakKeyword */: case 75 /* ContinueKeyword */: - if (hasKind(node.parent, 203 /* BreakStatement */) || hasKind(node.parent, 202 /* ContinueStatement */)) { + if (hasKind(node.parent, 205 /* BreakStatement */) || hasKind(node.parent, 204 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86 /* ForKeyword */: - if (hasKind(node.parent, 199 /* ForStatement */) || - hasKind(node.parent, 200 /* ForInStatement */) || - hasKind(node.parent, 201 /* ForOfStatement */)) { + if (hasKind(node.parent, 201 /* ForStatement */) || + hasKind(node.parent, 202 /* ForInStatement */) || + hasKind(node.parent, 203 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104 /* WhileKeyword */: case 79 /* DoKeyword */: - if (hasKind(node.parent, 198 /* WhileStatement */) || hasKind(node.parent, 197 /* DoStatement */)) { + if (hasKind(node.parent, 200 /* WhileStatement */) || hasKind(node.parent, 199 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -47977,8 +48771,8 @@ var ts; } break; default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 193 /* VariableStatement */)) { + if (ts.isModifierKind(node.kind) && node.parent && + (ts.isDeclaration(node.parent) || node.parent.kind === 195 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -47994,10 +48788,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 208 /* ThrowStatement */) { + if (node.kind === 210 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 209 /* TryStatement */) { + else if (node.kind === 211 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -48025,12 +48819,12 @@ var ts; var child = throwStatement; while (child.parent) { var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 248 /* SourceFile */) { + if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250 /* SourceFile */) { return parent_12; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_12.kind === 209 /* TryStatement */) { + if (parent_12.kind === 211 /* TryStatement */) { var tryStatement = parent_12; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -48045,7 +48839,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 203 /* BreakStatement */ || node.kind === 202 /* ContinueStatement */) { + if (node.kind === 205 /* BreakStatement */ || node.kind === 204 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -48060,16 +48854,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 206 /* SwitchStatement */: - if (statement.kind === 202 /* ContinueStatement */) { + case 208 /* SwitchStatement */: + if (statement.kind === 204 /* ContinueStatement */) { continue; } // Fall through. - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 198 /* WhileStatement */: - case 197 /* DoStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 199 /* DoStatement */: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -48088,24 +48882,24 @@ var ts; var container = declaration.parent; // Make sure we only highlight the keyword when it makes sense to do so. if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 214 /* ClassDeclaration */ || - container.kind === 186 /* ClassExpression */ || + if (!(container.kind === 216 /* ClassDeclaration */ || + container.kind === 188 /* ClassExpression */ || (declaration.kind === 138 /* Parameter */ && hasKind(container, 144 /* Constructor */)))) { return undefined; } } else if (modifier === 113 /* StaticKeyword */) { - if (!(container.kind === 214 /* ClassDeclaration */ || container.kind === 186 /* ClassExpression */)) { + if (!(container.kind === 216 /* ClassDeclaration */ || container.kind === 188 /* ClassExpression */)) { return undefined; } } else if (modifier === 82 /* ExportKeyword */ || modifier === 122 /* DeclareKeyword */) { - if (!(container.kind === 219 /* ModuleBlock */ || container.kind === 248 /* SourceFile */)) { + if (!(container.kind === 221 /* ModuleBlock */ || container.kind === 250 /* SourceFile */)) { return undefined; } } else if (modifier === 115 /* AbstractKeyword */) { - if (!(container.kind === 214 /* ClassDeclaration */ || declaration.kind === 214 /* ClassDeclaration */)) { + if (!(container.kind === 216 /* ClassDeclaration */ || declaration.kind === 216 /* ClassDeclaration */)) { return undefined; } } @@ -48117,8 +48911,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 219 /* ModuleBlock */: - case 248 /* SourceFile */: + case 221 /* ModuleBlock */: + case 250 /* SourceFile */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */) { nodes = declaration.members.concat(declaration); @@ -48130,8 +48924,8 @@ var ts; case 144 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 214 /* ClassDeclaration */: - case 186 /* ClassExpression */: + case 216 /* ClassDeclaration */: + case 188 /* ClassExpression */: nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -48214,7 +49008,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 197 /* DoStatement */) { + if (loopNode.kind === 199 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104 /* WhileKeyword */)) { @@ -48235,13 +49029,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 199 /* ForStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: - case 197 /* DoStatement */: - case 198 /* WhileStatement */: + case 201 /* ForStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: + case 199 /* DoStatement */: + case 200 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -48295,7 +49089,7 @@ var ts; function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 192 /* Block */))) { + if (!(func && hasKind(func.body, 194 /* Block */))) { return undefined; } var keywords = []; @@ -48311,7 +49105,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 196 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 198 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -48324,7 +49118,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 196 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 198 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -48400,11 +49194,11 @@ var ts; return convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); return convertReferences(referencedSymbols); } function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false); + var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); // Only include referenced symbols that have a valid definition. return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); } @@ -48417,8 +49211,8 @@ var ts; } if (node.kind !== 69 /* Identifier */ && // TODO (drosen): This should be enabled in a later release - currently breaks rename. - //node.kind !== SyntaxKind.ThisKeyword && - //node.kind !== SyntaxKind.SuperKeyword && + // node.kind !== SyntaxKind.ThisKeyword && + // node.kind !== SyntaxKind.SuperKeyword && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; @@ -48441,7 +49235,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97 /* ThisKeyword */) { + if (node.kind === 97 /* ThisKeyword */ || node.kind === 161 /* ThisType */) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95 /* SuperKeyword */) { @@ -48475,8 +49269,8 @@ var ts; } else { var internedName = getInternedName(symbol, node, declarations); - for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { - var sourceFile = sourceFiles_2[_i]; + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; cancellationToken.throwIfCancellationRequested(); var nameTable = getNameTable(sourceFile); if (ts.lookUp(nameTable, internedName)) { @@ -48504,7 +49298,7 @@ var ts; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 226 /* ImportSpecifier */ || declaration.kind === 230 /* ExportSpecifier */; + return declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 232 /* ExportSpecifier */; }); } function getInternedName(symbol, location, declarations) { @@ -48531,14 +49325,14 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 173 /* FunctionExpression */ || valueDeclaration.kind === 186 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 175 /* FunctionExpression */ || valueDeclaration.kind === 188 /* ClassExpression */)) { return valueDeclaration; } // If this is private property or method, the scope is the containing class if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 214 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 216 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -48551,7 +49345,7 @@ var ts; if (symbol.parent || (symbol.flags & 268435456 /* SyntheticProperty */)) { return undefined; } - var scope = undefined; + var scope; var declarations = symbol.getDeclarations(); if (declarations) { for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { @@ -48564,7 +49358,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 248 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -48730,7 +49524,7 @@ var ts; } } function getReferencesForSuperKeyword(superKeyword) { - var searchSpaceNode = ts.getSuperContainer(superKeyword, /*includeFunctions*/ false); + var searchSpaceNode = ts.getSuperContainer(superKeyword, /*stopOnFunctions*/ false); if (!searchSpaceNode) { return undefined; } @@ -48759,7 +49553,7 @@ var ts; if (!node || node.kind !== 95 /* SuperKeyword */) { return; } - var container = ts.getSuperContainer(node, /*includeFunctions*/ false); + var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. @@ -48789,13 +49583,13 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 248 /* SourceFile */: + case 250 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -48804,7 +49598,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 248 /* SourceFile */) { + if (searchSpaceNode.kind === 250 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -48830,13 +49624,13 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 97 /* ThisKeyword */) { + if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 161 /* ThisType */)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } @@ -48847,16 +49641,16 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 186 /* ClassExpression */: - case 214 /* ClassDeclaration */: + case 188 /* ClassExpression */: + case 216 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 248 /* SourceFile */: - if (container.kind === 248 /* SourceFile */ && !ts.isExternalModule(container)) { + case 250 /* SourceFile */: + if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -48883,8 +49677,8 @@ var ts; * property name and variable declaration of the identifier. * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service * should show both 'name' in 'obj' and 'name' in variable declaration - * let name = "Foo"; - * let obj = { name }; + * const name = "Foo"; + * const obj = { name }; * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration * will be included correctly. @@ -48894,6 +49688,14 @@ var ts; result.push(shorthandValueSymbol); } } + // If the symbol.valueDeclaration is a property parameter declaration, + // we should include both parameter declaration symbol and property declaration symbol + // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals. + // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 /* Parameter */ && + ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { + result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + } // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { @@ -48910,11 +49712,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 214 /* ClassDeclaration */) { + if (declaration.kind === 216 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 215 /* InterfaceDeclaration */) { + else if (declaration.kind === 217 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -48975,19 +49777,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_37 = node.text; + var name_33 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_37); + var unionProperty = contextualType.getProperty(name_33); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_37); + var symbol = t.getProperty(name_33); if (symbol) { result_4.push(symbol); } @@ -48996,7 +49798,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_37); + var symbol_1 = contextualType.getProperty(name_33); if (symbol_1) { return [symbol_1]; } @@ -49054,10 +49856,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 180 /* PostfixUnaryExpression */ || parent.kind === 179 /* PrefixUnaryExpression */) { + if (parent.kind === 182 /* PostfixUnaryExpression */ || parent.kind === 181 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 181 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 183 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 56 /* FirstAssignment */ <= operator && operator <= 68 /* LastAssignment */; } @@ -49069,9 +49871,6 @@ var ts; synchronizeHostData(); return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } - function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); - } function getEmitOutput(fileName) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -49092,32 +49891,32 @@ var ts; function getMeaningFromDeclaration(node) { switch (node.kind) { case 138 /* Parameter */: - case 211 /* VariableDeclaration */: - case 163 /* BindingElement */: + case 213 /* VariableDeclaration */: + case 165 /* BindingElement */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: - case 245 /* PropertyAssignment */: - case 246 /* ShorthandPropertyAssignment */: - case 247 /* EnumMember */: + case 247 /* PropertyAssignment */: + case 248 /* ShorthandPropertyAssignment */: + case 249 /* EnumMember */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 144 /* Constructor */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: - case 213 /* FunctionDeclaration */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: - case 244 /* CatchClause */: + case 215 /* FunctionDeclaration */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: + case 246 /* CatchClause */: return 1 /* Value */; case 137 /* TypeParameter */: - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: case 155 /* TypeLiteral */: return 2 /* Type */; - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (node.name.kind === 9 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -49127,15 +49926,15 @@ var ts; else { return 4 /* Namespace */; } - case 225 /* NamedImports */: - case 226 /* ImportSpecifier */: - case 221 /* ImportEqualsDeclaration */: - case 222 /* ImportDeclaration */: - case 227 /* ExportAssignment */: - case 228 /* ExportDeclaration */: + case 227 /* NamedImports */: + case 228 /* ImportSpecifier */: + case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportDeclaration */: + case 229 /* ExportAssignment */: + case 230 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 248 /* SourceFile */: + case 250 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -49145,8 +49944,9 @@ var ts; node = node.parent; } return node.parent.kind === 151 /* TypeReference */ || - (node.parent.kind === 188 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node); + (node.parent.kind === 190 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + (node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node)) || + node.kind === 161 /* ThisType */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -49154,16 +49954,16 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 166 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 166 /* PropertyAccessExpression */) { + if (root.parent.kind === 168 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 168 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 188 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 243 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 190 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 245 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 214 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || - (decl.kind === 215 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); + return (decl.kind === 216 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || + (decl.kind === 217 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); } return false; } @@ -49191,13 +49991,13 @@ var ts; // import a = |b.c|.d; // Namespace if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 221 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 223 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 227 /* ExportAssignment */) { + if (node.parent.kind === 229 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -49237,14 +50037,16 @@ var ts; return; } switch (node.kind) { - case 166 /* PropertyAccessExpression */: + case 168 /* PropertyAccessExpression */: case 135 /* QualifiedName */: case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: case 84 /* FalseKeyword */: case 99 /* TrueKeyword */: case 93 /* NullKeyword */: case 95 /* SuperKeyword */: case 97 /* ThisKeyword */: + case 161 /* ThisType */: case 69 /* Identifier */: break; // Cant create the text span @@ -49261,7 +50063,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 218 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 220 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -49285,7 +50087,7 @@ var ts; } function getNavigationBarItems(fileName) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.NavigationBar.getNavigationBarItems(sourceFile); + return ts.NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings()); } function getSemanticClassifications(fileName, span) { return convertClassifications(getEncodedSemanticClassifications(fileName, span)); @@ -49302,10 +50104,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 218 /* ModuleDeclaration */: - case 214 /* ClassDeclaration */: - case 215 /* InterfaceDeclaration */: - case 213 /* FunctionDeclaration */: + case 220 /* ModuleDeclaration */: + case 216 /* ClassDeclaration */: + case 217 /* InterfaceDeclaration */: + case 215 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -49359,7 +50161,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 218 /* ModuleDeclaration */ && + return declaration.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -49433,8 +50235,8 @@ var ts; var spanStart = span.start; var spanLength = span.length; // Make a scanner we can get trivia from. - var triviaScanner = ts.createScanner(2 /* Latest */, /*skipTrivia:*/ false, sourceFile.languageVariant, sourceFile.text); - var mergeConflictScanner = ts.createScanner(2 /* Latest */, /*skipTrivia:*/ false, sourceFile.languageVariant, sourceFile.text); + var triviaScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + var mergeConflictScanner = ts.createScanner(2 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); var result = []; processElement(sourceFile); return { spans: result, endOfLineState: 0 /* None */ }; @@ -49517,16 +50319,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 267 /* JSDocParameterTag */: + case 269 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 270 /* JSDocTemplateTag */: + case 272 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 269 /* JSDocTypeTag */: + case 271 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 268 /* JSDocReturnTag */: + case 270 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -49617,16 +50419,16 @@ var ts; if (token) { if (tokenKind === 56 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 211 /* VariableDeclaration */ || + if (token.parent.kind === 213 /* VariableDeclaration */ || token.parent.kind === 141 /* PropertyDeclaration */ || token.parent.kind === 138 /* Parameter */) { return 5 /* operator */; } } - if (token.parent.kind === 181 /* BinaryExpression */ || - token.parent.kind === 179 /* PrefixUnaryExpression */ || - token.parent.kind === 180 /* PostfixUnaryExpression */ || - token.parent.kind === 182 /* ConditionalExpression */) { + if (token.parent.kind === 183 /* BinaryExpression */ || + token.parent.kind === 181 /* PrefixUnaryExpression */ || + token.parent.kind === 182 /* PostfixUnaryExpression */ || + token.parent.kind === 184 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -49635,7 +50437,7 @@ var ts; else if (tokenKind === 8 /* NumericLiteral */) { return 4 /* numericLiteral */; } - else if (tokenKind === 9 /* StringLiteral */) { + else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 162 /* StringLiteralType */) { return 6 /* stringLiteral */; } else if (tokenKind === 10 /* RegularExpressionLiteral */) { @@ -49649,7 +50451,7 @@ var ts; else if (tokenKind === 69 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } @@ -49659,17 +50461,17 @@ var ts; return 15 /* typeParameterName */; } return; - case 215 /* InterfaceDeclaration */: + case 217 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } @@ -49679,17 +50481,17 @@ var ts; return 17 /* parameterName */; } return; - case 235 /* JsxOpeningElement */: + case 237 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } return; - case 237 /* JsxClosingElement */: + case 239 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } return; - case 234 /* JsxSelfClosingElement */: + case 236 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } @@ -49818,7 +50620,6 @@ var ts; * be performed. */ function getDocCommentTemplateAtPosition(fileName, position) { - var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Check if in a context where we don't want to perform any insertion if (ts.isInString(sourceFile, position) || ts.isInComment(sourceFile, position) || ts.hasDocComment(sourceFile, position)) { @@ -49837,19 +50638,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 144 /* Constructor */: - case 214 /* ClassDeclaration */: - case 193 /* VariableStatement */: + case 216 /* ClassDeclaration */: + case 195 /* VariableStatement */: break findOwner; - case 248 /* SourceFile */: + case 250 /* SourceFile */: return undefined; - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 218 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 220 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -49891,7 +50692,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 193 /* VariableStatement */) { + if (commentOwner.kind === 195 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -49909,14 +50710,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 172 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 174 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return rightHandSide.parameters; - case 186 /* ClassExpression */: + case 188 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.kind === 144 /* Constructor */) { @@ -50065,12 +50866,17 @@ var ts; if (declarations && declarations.length > 0) { // Disallow rename for elements that are defined in the standard TypeScript library. var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); + var canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); if (defaultLibFileName) { for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { var current = declarations_10[_i]; var sourceFile_2 = current.getSourceFile(); + // TODO (drosen): When is there no source file? + if (!sourceFile_2) { + continue; + } var canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)); - if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + if (canonicalName === canonicalDefaultLibName) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); } } @@ -50080,10 +50886,10 @@ var ts; if (kind) { return { canRename: true, - localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, + displayName: displayName, + localizedErrorMessage: undefined, + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) }; @@ -50168,7 +50974,7 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 232 /* ExternalModuleReference */ || + node.parent.kind === 234 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -50181,7 +50987,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 167 /* ElementAccessExpression */ && + node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -50310,7 +51116,7 @@ var ts; // (and a newline). That way when we lex we'll think we're still in a multiline comment. switch (lexState) { case 3 /* InDoubleQuoteStringLiteral */: - text = '"\\\n' + text; + text = "\"\\\n" + text; offset = 3; break; case 2 /* InSingleQuoteStringLiteral */: @@ -50440,7 +51246,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9 /* StringLiteral */) { + if (token === 9 /* StringLiteral */ || token === 162 /* StringLiteralType */) { // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { @@ -50579,6 +51385,7 @@ var ts; case 8 /* NumericLiteral */: return 4 /* numericLiteral */; case 9 /* StringLiteral */: + case 162 /* StringLiteralType */: return 6 /* stringLiteral */; case 10 /* RegularExpressionLiteral */: return 7 /* regularExpressionLiteral */; @@ -50645,7 +51452,7 @@ var ts; } var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { // Get previous token if the token is returned starts on new line // eg: let x =10; |--- cursor is here // let y = 10; @@ -50664,14 +51471,20 @@ var ts; // Get the span in the node based on its syntax return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { - return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + var start = startNode.decorators ? + ts.skipTrivia(sourceFile.text, startNode.decorators.end) : + startNode.getStart(sourceFile); + return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { - if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart()).line) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); } return spanInNode(otherwiseOnNode); } + function spanInNodeArray(nodeArray) { + return ts.createTextSpanFromBounds(ts.skipTrivia(sourceFile.text, nodeArray.pos), nodeArray.end); + } function spanInPreviousNode(node) { return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); } @@ -50681,125 +51494,131 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 199 /* ForStatement */) { + if (node.parent.kind === 139 /* Decorator */) { + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + } + if (node.parent.kind === 201 /* ForStatement */) { // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 181 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { + if (node.parent.kind === 183 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind === 174 /* ArrowFunction */ && node.parent.body === node) { + if (node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } } switch (node.kind) { - case 193 /* VariableStatement */: + case 195 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 211 /* VariableDeclaration */: + case 213 /* VariableDeclaration */: case 141 /* PropertyDeclaration */: case 140 /* PropertySignature */: return spanInVariableDeclaration(node); case 138 /* Parameter */: return spanInParameterDeclaration(node); - case 213 /* FunctionDeclaration */: + case 215 /* FunctionDeclaration */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 144 /* Constructor */: - case 173 /* FunctionExpression */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 176 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: return spanInBlock(node); - case 244 /* CatchClause */: + case 246 /* CatchClause */: return spanInBlock(node.block); - case 195 /* ExpressionStatement */: + case 197 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 204 /* ReturnStatement */: + case 206 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 198 /* WhileStatement */: + case 200 /* WhileStatement */: // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 197 /* DoStatement */: + case 199 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 210 /* DebuggerStatement */: + case 212 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 196 /* IfStatement */: + case 198 /* IfStatement */: // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 207 /* LabeledStatement */: + case 209 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 203 /* BreakStatement */: - case 202 /* ContinueStatement */: + case 205 /* BreakStatement */: + case 204 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 199 /* ForStatement */: + case 201 /* ForStatement */: return spanInForStatement(node); - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 206 /* SwitchStatement */: + case 208 /* SwitchStatement */: // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 241 /* CaseClause */: - case 242 /* DefaultClause */: + case 243 /* CaseClause */: + case 244 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 209 /* TryStatement */: + case 211 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 208 /* ThrowStatement */: + case 210 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 227 /* ExportAssignment */: + case 229 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 221 /* ImportEqualsDeclaration */: + case 223 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 222 /* ImportDeclaration */: + case 224 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 228 /* ExportDeclaration */: + case 230 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 214 /* ClassDeclaration */: - case 217 /* EnumDeclaration */: - case 247 /* EnumMember */: - case 168 /* CallExpression */: - case 169 /* NewExpression */: + case 216 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 249 /* EnumMember */: + case 170 /* CallExpression */: + case 171 /* NewExpression */: // span on complete node return textSpan(node); - case 205 /* WithStatement */: + case 207 /* WithStatement */: // span in statement return spanInNode(node.statement); + case 139 /* Decorator */: + return spanInNodeArray(node.parent.decorators); // No breakpoint in interface, type alias - case 215 /* InterfaceDeclaration */: - case 216 /* TypeAliasDeclaration */: + case 217 /* InterfaceDeclaration */: + case 218 /* TypeAliasDeclaration */: return undefined; // Tokens: case 23 /* SemicolonToken */: @@ -50829,11 +51648,11 @@ var ts; return spanInNextNode(node); default: // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 245 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 247 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 171 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 173 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } // return type of function go to previous token @@ -50846,12 +51665,12 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 200 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 201 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 202 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 203 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 193 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 199 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -50905,7 +51724,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2 /* Export */) || - (functionDeclaration.parent.kind === 214 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); + (functionDeclaration.parent.kind === 216 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -50928,18 +51747,18 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 218 /* ModuleDeclaration */: + case 220 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 198 /* WhileStatement */: - case 196 /* IfStatement */: - case 200 /* ForInStatement */: - case 201 /* ForOfStatement */: + case 200 /* WhileStatement */: + case 198 /* IfStatement */: + case 202 /* ForInStatement */: + case 203 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 199 /* ForStatement */: + case 201 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement @@ -50947,7 +51766,7 @@ var ts; } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 212 /* VariableDeclarationList */) { + if (forStatement.initializer.kind === 214 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -50967,13 +51786,13 @@ var ts; // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 217 /* EnumDeclaration */: + case 219 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 214 /* ClassDeclaration */: + case 216 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -50981,24 +51800,24 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 219 /* ModuleBlock */: + case 221 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 217 /* EnumDeclaration */: - case 214 /* ClassDeclaration */: + case 219 /* EnumDeclaration */: + case 216 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 192 /* Block */: + case 194 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 244 /* CatchClause */: + case 246 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 220 /* CaseBlock */: + case 222 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -51012,7 +51831,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Go to while keyword and do action instead return spanInPreviousNode(node); } @@ -51022,17 +51841,17 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 173 /* FunctionExpression */: - case 213 /* FunctionDeclaration */: - case 174 /* ArrowFunction */: + case 175 /* FunctionExpression */: + case 215 /* FunctionDeclaration */: + case 176 /* ArrowFunction */: case 143 /* MethodDeclaration */: case 142 /* MethodSignature */: case 145 /* GetAccessor */: case 146 /* SetAccessor */: case 144 /* Constructor */: - case 198 /* WhileStatement */: - case 197 /* DoStatement */: - case 199 /* ForStatement */: + case 200 /* WhileStatement */: + case 199 /* DoStatement */: + case 201 /* ForStatement */: return spanInPreviousNode(node); // Default to parent node default: @@ -51041,19 +51860,19 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 245 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 247 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 171 /* TypeAssertionExpression */) { + if (node.parent.kind === 173 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 197 /* DoStatement */) { + if (node.parent.kind === 199 /* DoStatement */) { // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } @@ -51082,6 +51901,9 @@ var ts; /// /* @internal */ var debugObjectHost = this; +// We need to use 'null' to interface with the managed side. +/* tslint:disable:no-null */ +/* tslint:disable:no-in-operator */ /* @internal */ var ts; (function (ts) { @@ -51093,7 +51915,6 @@ var ts; var ScriptSnapshotShimAdapter = (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { this.scriptSnapshotShim = scriptSnapshotShim; - this.lineStartPositions = null; } ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { return this.scriptSnapshotShim.getText(start, end); @@ -51119,7 +51940,7 @@ var ts; } }; return ScriptSnapshotShimAdapter; - })(); + }()); var LanguageServiceShimHostAdapter = (function () { function LanguageServiceShimHostAdapter(shimHost) { var _this = this; @@ -51137,6 +51958,9 @@ var ts; }); }; } + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } LanguageServiceShimHostAdapter.prototype.log = function (s) { if (this.loggingEnabled) { @@ -51174,11 +51998,6 @@ var ts; return this.files = JSON.parse(encoded); }; LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - if (this.files && this.files.indexOf(fileName) < 0) { - return undefined; - } var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); }; @@ -51206,17 +52025,10 @@ var ts; return this.shimHost.getCurrentDirectory(); }; LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - try { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - catch (e) { - return ""; - } + return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); }; return LanguageServiceShimHostAdapter; - })(); + }()); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; /** A cancellation that throttles calls to the host */ var ThrottledCancellationToken = (function () { @@ -51238,23 +52050,17 @@ var ts; return false; }; return ThrottledCancellationToken; - })(); + }()); var CoreServicesShimHostAdapter = (function () { function CoreServicesShimHostAdapter(shimHost) { + var _this = this; this.shimHost = shimHost; + if ("directoryExists" in this.shimHost) { + this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension, exclude) { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - // Also consider removing the optional designation for - // the exclude param at this time. - var encoded; - try { - encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); - } - catch (e) { - encoded = this.shimHost.readDirectory(rootDir, extension); - } + var encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); return JSON.parse(encoded); }; CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) { @@ -51264,18 +52070,19 @@ var ts; return this.shimHost.readFile(fileName); }; return CoreServicesShimHostAdapter; - })(); + }()); ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; function simpleForwardCall(logger, actionDescription, action, logPerformance) { + var start; if (logPerformance) { logger.log(actionDescription); - var start = Date.now(); + start = Date.now(); } var result = action(); if (logPerformance) { var end = Date.now(); logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { + if (typeof result === "string") { var str = result; if (str.length > 128) { str = str.substring(0, 128) + "..."; @@ -51308,7 +52115,7 @@ var ts; this.factory.unregisterShim(this); }; return ShimBase; - })(); + }()); function realizeDiagnostics(diagnostics, newLine) { return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); } @@ -51357,9 +52164,7 @@ var ts; * Update the list of scripts known to the compiler */ LanguageServiceShimObject.prototype.refresh = function (throwOnError) { - this.forwardJSONCall("refresh(" + throwOnError + ")", function () { - return null; - }); + this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; }); }; LanguageServiceShimObject.prototype.cleanupSemanticCache = function () { var _this = this; @@ -51374,33 +52179,25 @@ var ts; }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); + return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); }); }; LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { var _this = this; - return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); - }); + return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); }); }; LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { var _this = this; @@ -51430,10 +52227,7 @@ var ts; */ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { - var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); + return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); }); }; /// NAMEORDOTTEDNAMESPAN /** @@ -51442,10 +52236,7 @@ var ts; */ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { var _this = this; - return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { - var spanInfo = _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); + return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); }); }; /** * STATEMENTSPAN @@ -51453,18 +52244,12 @@ var ts; */ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { - var spanInfo = _this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); + return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); }); }; /// SIGNATUREHELP LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); + return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position); }); }; /// GOTO DEFINITION /** @@ -51473,9 +52258,7 @@ var ts; */ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); }); }; /// GOTO Type /** @@ -51484,29 +52267,20 @@ var ts; */ LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getTypeDefinitionAtPosition(fileName, position); - }); + return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { - return _this.languageService.getRenameInfo(fileName, position); - }); + return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); }); }; LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { - return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); }; /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { - var textRanges = _this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); + return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); }); }; /// GET SMART INDENT LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { @@ -51519,21 +52293,15 @@ var ts; /// GET REFERENCES LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getReferencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { var _this = this; - return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { - return _this.languageService.findReferences(fileName, position); - }); + return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); }); }; LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getOccurrencesAtPosition(fileName, position); - }); + return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { var _this = this; @@ -51552,41 +52320,32 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { - var completion = _this.languageService.getCompletionsAtPosition(fileName, position); - return completion; - }); + return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position); }); }; /** Get a string based representation of a completion list entry details */ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { var _this = this; - return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { - var details = _this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); + return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { return _this.languageService.getCompletionEntryDetails(fileName, position, entryName); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; + return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; + return _this.languageService.getFormattingEditsForDocument(fileName, localOptions); }); }; LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; + return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); }); }; LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position) { @@ -51597,45 +52356,27 @@ var ts; /** Return a list of symbols that are interesting to navigate to */ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { var _this = this; - return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { - var items = _this.languageService.getNavigateToItems(searchValue, maxResultCount); - return items; - }); + return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount); }); }; LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) { var _this = this; - return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { - var items = _this.languageService.getNavigationBarItems(fileName); - return items; - }); + return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); }); }; LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) { var _this = this; - return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { - var items = _this.languageService.getOutliningSpans(fileName); - return items; - }); + return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); }); }; LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) { var _this = this; - return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { - var items = _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); + return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); }); }; /// Emit LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { var _this = this; - return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { - var output = _this.languageService.getEmitOutput(fileName); - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - output.emitOutputStatus = output.emitSkipped ? 1 : 0; - return output; - }); + return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { return _this.languageService.getEmitOutput(fileName); }); }; return LanguageServiceShimObject; - })(ShimBase); + }(ShimBase)); function convertClassifications(classifications) { return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; } @@ -51654,17 +52395,17 @@ var ts; /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - var items = classification.entries; var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; + for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) { + var item = _a[_i]; + result += item.length + "\n"; + result += item.classification + "\n"; } result += classification.finalLexState; return result; }; return ClassifierShimObject; - })(ShimBase); + }(ShimBase)); var CoreServicesShimObject = (function (_super) { __extends(CoreServicesShimObject, _super); function CoreServicesShimObject(factory, logger, host) { @@ -51723,24 +52464,22 @@ var ts; return { options: {}, files: [], - errors: [realizeDiagnostic(result.error, '\r\n')] + errors: [realizeDiagnostic(result.error, "\r\n")] }; } var configFile = ts.parseJsonConfigFileContent(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); return { options: configFile.options, files: configFile.fileNames, - errors: realizeDiagnostics(configFile.errors, '\r\n') + errors: realizeDiagnostics(configFile.errors, "\r\n") }; }); }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { - return this.forwardJSONCall("getDefaultCompilationSettings()", function () { - return ts.getDefaultCompilerOptions(); - }); + return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); }); }; return CoreServicesShimObject; - })(ShimBase); + }(ShimBase)); var TypeScriptServicesFactory = (function () { function TypeScriptServicesFactory() { this._shims = []; @@ -51802,12 +52541,14 @@ var ts; throw new Error("Invalid operation"); }; return TypeScriptServicesFactory; - })(); + }()); ts.TypeScriptServicesFactory = TypeScriptServicesFactory; if (typeof module !== "undefined" && module.exports) { module.exports = ts; } })(ts || (ts = {})); +/* tslint:enable:no-in-operator */ +/* tslint:enable:no-null */ /// TODO: this is used by VS, clean this up on both sides of the interface /* @internal */ var TypeScript; @@ -51817,5 +52558,9 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +/* tslint:disable:no-unused-variable */ +// 'toolsVersion' gets consumed by the managed side, so it's not unused. +// TODO: it should be moved into a namespace though. /* @internal */ -var toolsVersion = "1.6"; +var toolsVersion = "1.8"; +/* tslint:enable:no-unused-variable */ diff --git a/scripts/tslint/booleanTriviaRule.ts b/scripts/tslint/booleanTriviaRule.ts index 93c312ab870..756728a1a11 100644 --- a/scripts/tslint/booleanTriviaRule.ts +++ b/scripts/tslint/booleanTriviaRule.ts @@ -26,7 +26,9 @@ class BooleanTriviaWalker extends Lint.RuleWalker { for (let index = 0; index < targetParameters.length; index++) { const param = targetParameters[index]; const arg = node.arguments[index]; - if (!(arg && param)) continue; + if (!(arg && param)) { + continue; + } const argType = this.checker.getContextualType(arg); if (argType && (argType.getFlags() & ts.TypeFlags.Boolean)) { @@ -38,7 +40,9 @@ class BooleanTriviaWalker extends Lint.RuleWalker { if (ranges && ranges.length === 1 && ranges[0].kind === ts.SyntaxKind.MultiLineCommentTrivia) { triviaContent = arg.getFullText().slice(ranges[0].pos + 2, ranges[0].end - 2); // +/-2 to remove /**/ } - if (triviaContent !== param.getName()) { + + const paramName = param.getName(); + if (triviaContent !== paramName && triviaContent !== paramName + ":") { this.addFailure(this.createFailure(arg.getStart(source), arg.getWidth(source), Rule.FAILURE_STRING_FACTORY(param.getName(), triviaContent))); } } diff --git a/scripts/tslint/noIncrementDecrementRule.ts b/scripts/tslint/noIncrementDecrementRule.ts new file mode 100644 index 00000000000..75f4d2f5c08 --- /dev/null +++ b/scripts/tslint/noIncrementDecrementRule.ts @@ -0,0 +1,37 @@ +import * as Lint from "tslint/lib/lint"; +import * as ts from "typescript"; + + +export class Rule extends Lint.Rules.AbstractRule { + public static POSTFIX_FAILURE_STRING = "Don't use '++' or '--' postfix operators outside statements or for loops."; + public static PREFIX_FAILURE_STRING = "Don't use '++' or '--' prefix operators."; + + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return this.applyWithWalker(new IncrementDecrementWalker(sourceFile, this.getOptions())); + } +} + +class IncrementDecrementWalker extends Lint.RuleWalker { + + visitPostfixUnaryExpression(node: ts.PostfixUnaryExpression) { + super.visitPostfixUnaryExpression(node); + if (node.operator === ts.SyntaxKind.PlusPlusToken || node.operator == ts.SyntaxKind.MinusMinusToken) { + this.visitIncrementDecrement(node); + } + } + + visitPrefixUnaryExpression(node: ts.PrefixUnaryExpression) { + super.visitPrefixUnaryExpression(node); + if (node.operator === ts.SyntaxKind.PlusPlusToken || node.operator == ts.SyntaxKind.MinusMinusToken) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.PREFIX_FAILURE_STRING)); + } + } + + visitIncrementDecrement(node: ts.UnaryExpression) { + if (node.parent && (node.parent.kind === ts.SyntaxKind.ExpressionStatement || + node.parent.kind === ts.SyntaxKind.ForStatement)) { + return; + } + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.POSTFIX_FAILURE_STRING)); + } +} diff --git a/scripts/word2md.js b/scripts/word2md.js deleted file mode 100644 index e80275d5b2d..00000000000 --- a/scripts/word2md.js +++ /dev/null @@ -1,235 +0,0 @@ -// word2md - Word to Markdown conversion tool -// -// word2md converts a Microsoft Word document to Markdown formatted text. The tool uses the -// Word Automation APIs to start an instance of Word and access the contents of the document -// being converted. The tool must be run using the cscript.exe script host and requires Word -// to be installed on the target machine. The name of the document to convert must be specified -// as a command line argument and the resulting Markdown is written to standard output. The -// tool recognizes the specific Word styles used in the TypeScript Language Specification. -var sys = (function () { - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2 /*text*/; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1 /*binary*/; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - return { - args: args, - createObject: function (typeName) { return new ActiveXObject(typeName); }, - write: function (s) { - WScript.StdOut.Write(s); - }, - writeFile: function (fileName, data) { - fileStream.Open(); - binaryStream.Open(); - try { - // Write characters in UTF-8 encoding - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - // We don't want the BOM, skip it by setting the starting location to 3 (size of BOM). - fileStream.Position = 3; - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2 /*overwrite*/); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - }; -})(); -function convertDocumentToMarkdown(doc) { - var result = ""; - var lastStyle; - var lastInTable; - var tableColumnCount; - var tableCellIndex; - var columnAlignment = []; - function setProperties(target, properties) { - for (var name in properties) { - if (properties.hasOwnProperty(name)) { - var value = properties[name]; - if (typeof value === "object") { - setProperties(target[name], value); - } - else { - target[name] = value; - } - } - } - } - function findReplace(findText, findOptions, replaceText, replaceOptions) { - var find = doc.range().find; - find.clearFormatting(); - setProperties(find, findOptions); - var replace = find.replacement; - replace.clearFormatting(); - setProperties(replace, replaceOptions); - find.execute(findText, false, false, false, false, false, true, 0, true, replaceText, 2); - } - function fixHyperlinks() { - var count = doc.hyperlinks.count; - for (var i = 0; i < count; i++) { - var hyperlink = doc.hyperlinks.item(i + 1); - var address = hyperlink.address; - if (address && address.length > 0) { - var textToDisplay = hyperlink.textToDisplay; - hyperlink.textToDisplay = "[" + textToDisplay + "](" + address + ")"; - } - } - } - function write(s) { - result += s; - } - function writeTableHeader() { - for (var i = 0; i < tableColumnCount - 1; i++) { - switch (columnAlignment[i]) { - case 1: - write("|:---:"); - break; - case 2: - write("|---:"); - break; - default: - write("|---"); - } - } - write("|\n"); - } - function trimEndFormattingMarks(text) { - var i = text.length; - while (i > 0 && text.charCodeAt(i - 1) < 0x20) - i--; - return text.substr(0, i); - } - function writeBlockEnd() { - switch (lastStyle) { - case "Code": - write("```\n\n"); - break; - case "List Paragraph": - case "Table": - case "TOC": - write("\n"); - break; - } - } - function writeParagraph(p) { - var text = p.range.text; - var style = p.style.nameLocal; - var inTable = p.range.tables.count > 0; - var level = 1; - var sectionBreak = text.indexOf("\x0C") >= 0; - text = trimEndFormattingMarks(text); - if (inTable) { - style = "Table"; - } - else if (style.match(/\s\d$/)) { - level = +style.substr(style.length - 1); - style = style.substr(0, style.length - 2); - } - if (lastStyle && style !== lastStyle) { - writeBlockEnd(); - } - switch (style) { - case "Heading": - case "Appendix": - var section = p.range.listFormat.listString; - write("####".substr(0, level) + ' ' + section + " " + text + "\n\n"); - break; - case "Normal": - if (text.length) { - write(text + "\n\n"); - } - break; - case "List Paragraph": - write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); - break; - case "Grammar": - write("  " + text.replace(/\s\s\s/g, " ").replace(/\x0B/g, " \n   ") + "\n\n"); - break; - case "Code": - if (lastStyle !== "Code") { - write("```TypeScript\n"); - } - else { - write("\n"); - } - write(text.replace(/\x0B/g, " \n") + "\n"); - break; - case "Table": - if (!lastInTable) { - tableColumnCount = p.range.tables.item(1).columns.count + 1; - tableCellIndex = 0; - } - if (tableCellIndex < tableColumnCount) { - columnAlignment[tableCellIndex] = p.alignment; - } - write("|" + text); - tableCellIndex++; - if (tableCellIndex % tableColumnCount === 0) { - write("\n"); - if (tableCellIndex === tableColumnCount) { - writeTableHeader(); - } - } - break; - case "TOC Heading": - write("## " + text + "\n\n"); - break; - case "TOC": - var strings = text.split("\t"); - write(" ".substr(0, level * 2 - 2) + "* [" + strings[0] + " " + strings[1] + "](#" + strings[0] + ")\n"); - break; - } - if (sectionBreak) { - write("
\n\n"); - } - lastStyle = style; - lastInTable = inTable; - } - function writeDocument() { - var title = doc.builtInDocumentProperties.item(1) + ""; - if (title.length) { - write("# " + title + "\n\n"); - } - for (var p = doc.paragraphs.first; p; p = p.next()) { - writeParagraph(p); - } - writeBlockEnd(); - } - findReplace("<", {}, "<", {}); - findReplace("<", { style: "Code" }, "<", {}); - findReplace("<", { style: "Code Fragment" }, "<", {}); - findReplace("<", { style: "Terminal" }, "<", {}); - findReplace("", { font: { subscript: true } }, "^&", { font: { subscript: false } }); - findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 /* default font */ }); - findReplace("", { style: "Production" }, "*^&*", { style: -66 /* default font */ }); - findReplace("", { style: "Terminal" }, "`^&`", { style: -66 /* default font */ }); - findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } }); - findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } }); - doc.fields.toggleShowCodes(); - findReplace("^19 REF", {}, "[^&](#^&)", {}); - doc.fields.toggleShowCodes(); - fixHyperlinks(); - writeDocument(); - result = result.replace(/\x85/g, "\u2026"); - result = result.replace(/\x96/g, "\u2013"); - result = result.replace(/\x97/g, "\u2014"); - return result; -} -function main(args) { - if (args.length !== 2) { - sys.write("Syntax: word2md \n"); - return; - } - var app = sys.createObject("Word.Application"); - var doc = app.documents.open(args[0]); - sys.writeFile(args[1], convertDocumentToMarkdown(doc)); - doc.close(false); - app.quit(); -} -main(sys.args); -//# sourceMappingURL=file:///c:/ts/scripts/word2md.js.map \ No newline at end of file diff --git a/scripts/word2md.ts b/scripts/word2md.ts index ec9ed634b3c..f602c700ff9 100644 --- a/scripts/word2md.ts +++ b/scripts/word2md.ts @@ -72,6 +72,9 @@ module Word { listFormat: ListFormat; tables: Tables; text: string; + textRetrievalMode: { + includeHiddenText: boolean; + } words: Ranges; } @@ -258,13 +261,27 @@ function convertDocumentToMarkdown(doc: Word.Document): string { function writeParagraph(p: Word.Paragraph) { - var text = p.range.text; + var range = p.range; + var text = range.text; var style = p.style.nameLocal; - var inTable = p.range.tables.count > 0; + var inTable = range.tables.count > 0; var level = 1; var sectionBreak = text.indexOf("\x0C") >= 0; text = trimEndFormattingMarks(text); + if (text === "/") { + // An inline image shows up in the text as a "/". When we see a paragraph + // consisting of nothing but "/", we check to see if the paragraph contains + // hidden text and, if so, emit that instead. The hidden text is assumed to + // contain an appropriate markdown image link. + range.textRetrievalMode.includeHiddenText = true; + var fullText = range.text; + range.textRetrievalMode.includeHiddenText = false; + if (text !== fullText) { + text = "  " + fullText.substr(1); + } + } + if (inTable) { style = "Table"; } @@ -280,7 +297,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string { case "Heading": case "Appendix": - var section = p.range.listFormat.listString; + var section = range.listFormat.listString; write("####".substr(0, level) + '
' + section + " " + text + "\n\n"); break; @@ -291,7 +308,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string { break; case "List Paragraph": - write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); + write(" ".substr(0, range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); break; case "Grammar": @@ -310,7 +327,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string { case "Table": if (!lastInTable) { - tableColumnCount = p.range.tables.item(1).columns.count + 1; + tableColumnCount = range.tables.item(1).columns.count + 1; tableCellIndex = 0; } if (tableCellIndex < tableColumnCount) { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5b378d8af3f..173ffcb8fee 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7,7 +7,10 @@ namespace ts { let nextMergeId = 1; export function getNodeId(node: Node): number { - if (!node.id) node.id = nextNodeId++; + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } return node.id; } @@ -15,7 +18,8 @@ namespace ts { export function getSymbolId(symbol: Symbol): number { if (!symbol.id) { - symbol.id = nextSymbolId++; + symbol.id = nextSymbolId; + nextSymbolId++; } return symbol.id; @@ -61,6 +65,7 @@ namespace ts { getTypeCount: () => typeCount, isUndefinedSymbol: symbol => symbol === undefinedSymbol, isArgumentsSymbol: symbol => symbol === argumentsSymbol, + isUnknownSymbol: symbol => symbol === unknownSymbol, getDiagnostics, getGlobalDiagnostics, @@ -287,7 +292,10 @@ namespace ts { } function recordMergedSymbol(target: Symbol, source: Symbol) { - if (!source.mergeId) source.mergeId = nextMergeId++; + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } mergedSymbols[source.mergeId] = target; } @@ -1301,7 +1309,8 @@ namespace ts { function createType(flags: TypeFlags): Type { const result = new Type(checker, flags); - result.id = typeCount++; + result.id = typeCount; + typeCount++; return result; } @@ -1862,11 +1871,13 @@ namespace ts { } if (pos < end) { writePunctuation(writer, SyntaxKind.LessThanToken); - writeType(typeArguments[pos++], TypeFormatFlags.None); + writeType(typeArguments[pos], TypeFormatFlags.None); + pos++; while (pos < end) { writePunctuation(writer, SyntaxKind.CommaToken); writeSpace(writer); - writeType(typeArguments[pos++], TypeFormatFlags.None); + writeType(typeArguments[pos], TypeFormatFlags.None); + pos++; } writePunctuation(writer, SyntaxKind.GreaterThanToken); } @@ -2553,9 +2564,9 @@ namespace ts { // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration: VariableLikeDeclaration): Type { - // A variable declared in a for..in statement is always of type any + // A variable declared in a for..in statement is always of type string if (declaration.parent.parent.kind === SyntaxKind.ForInStatement) { - return anyType; + return stringType; } if (declaration.parent.parent.kind === SyntaxKind.ForOfStatement) { @@ -5719,7 +5730,7 @@ namespace ts { return Ternary.False; } let result = Ternary.True; - for (let i = 0, len = sourceSignatures.length; i < len; ++i) { + for (let i = 0, len = sourceSignatures.length; i < len; i++) { const related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreReturnTypes*/ false, isRelatedTo); if (!related) { return Ternary.False; @@ -7395,6 +7406,12 @@ namespace ts { } return type; } + else if (operator === SyntaxKind.AmpersandAmpersandToken || operator === SyntaxKind.CommaToken) { + if (node === binaryExpression.right) { + return getContextualType(binaryExpression); + } + } + return undefined; } @@ -7507,24 +7524,22 @@ namespace ts { return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForJsxExpression(expr: JsxExpression | JsxSpreadAttribute): Type { - // Contextual type only applies to JSX expressions that are in attribute assignments (not in 'Children' positions) - if (expr.parent.kind === SyntaxKind.JsxAttribute) { - const attrib = expr.parent; - const attrsType = getJsxElementAttributesType(attrib.parent); + function getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute) { + const kind = attribute.kind; + const jsxElement = attribute.parent as JsxOpeningLikeElement; + const attrsType = getJsxElementAttributesType(jsxElement); + + if (attribute.kind === SyntaxKind.JsxAttribute) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } - else { - return getTypeOfPropertyOfType(attrsType, attrib.name.text); - } + return getTypeOfPropertyOfType(attrsType, (attribute as JsxAttribute).name.text); + } + else if (attribute.kind === SyntaxKind.JsxSpreadAttribute) { + return attrsType; } - if (expr.kind === SyntaxKind.JsxSpreadAttribute) { - return getJsxElementAttributesType(expr.parent); - } - - return undefined; + Debug.fail(`Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[${kind}]`); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily @@ -7592,8 +7607,10 @@ namespace ts { case SyntaxKind.ParenthesizedExpression: return getContextualType(parent); case SyntaxKind.JsxExpression: + return getContextualType(parent); + case SyntaxKind.JsxAttribute: case SyntaxKind.JsxSpreadAttribute: - return getContextualTypeForJsxExpression(parent); + return getContextualTypeForJsxAttribute(parent); } return undefined; } @@ -7981,31 +7998,12 @@ namespace ts { return jsxElementType || anyType; } - function tagNamesAreEquivalent(lhs: EntityName, rhs: EntityName): boolean { - if (lhs.kind !== rhs.kind) { - return false; - } - - if (lhs.kind === SyntaxKind.Identifier) { - return (lhs).text === (rhs).text; - } - - return (lhs).right.text === (rhs).right.text && - tagNamesAreEquivalent((lhs).left, (rhs).left); - } - function checkJsxElement(node: JsxElement) { // Check attributes checkJsxOpeningLikeElement(node.openingElement); - // Check that the closing tag matches - if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { - error(node.closingElement, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNode(node.openingElement.tagName)); - } - else { - // Perform resolution on the closing tag so that rename/go to definition/etc work - getJsxElementTagSymbol(node.closingElement); - } + // Perform resolution on the closing tag so that rename/go to definition/etc work + getJsxElementTagSymbol(node.closingElement); // Check children for (const child of node.children) { @@ -8158,6 +8156,7 @@ namespace ts { if (compilerOptions.noImplicitAny) { error(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } @@ -8406,14 +8405,13 @@ namespace ts { checkGrammarJsxElement(node); checkJsxPreconditions(node); - // If we're compiling under --jsx react, the symbol 'React' should - // be marked as 'used' so we don't incorrectly elide its import. And if there - // is no 'React' symbol in scope, we should issue an error. - if (compilerOptions.jsx === JsxEmit.React) { - const reactSym = resolveName(node.tagName, "React", SymbolFlags.Value, Diagnostics.Cannot_find_name_0, "React"); - if (reactSym) { - getSymbolLinks(reactSym).referenced = true; - } + // The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there + // is no reactNamespace symbol in scope when targeting React emit, we should issue an error. + const reactRefErr = compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined; + const reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; + const reactSym = resolveName(node.tagName, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace); + if (reactSym) { + getSymbolLinks(reactSym).referenced = true; } const targetAttributesType = getJsxElementAttributesType(node); @@ -8611,6 +8609,56 @@ namespace ts { return true; } + /** + * Return the symbol of the for-in variable declared or referenced by the given for-in statement. + */ + function getForInVariableSymbol(node: ForInStatement): Symbol { + const initializer = node.initializer; + if (initializer.kind === SyntaxKind.VariableDeclarationList) { + const variable = (initializer).declarations[0]; + if (variable && !isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } + else if (initializer.kind === SyntaxKind.Identifier) { + return getResolvedSymbol(initializer); + } + return undefined; + } + + /** + * Return true if the given type is considered to have numeric property names. + */ + function hasNumericPropertyNames(type: Type) { + return getIndexTypeOfType(type, IndexKind.Number) && !getIndexTypeOfType(type, IndexKind.String); + } + + /** + * Return true if given node is an expression consisting of an identifier (possibly parenthesized) + * that references a for-in variable for an object with numeric property names. + */ + function isForInVariableForNumericPropertyNames(expr: Expression) { + const e = skipParenthesizedNodes(expr); + if (e.kind === SyntaxKind.Identifier) { + const symbol = getResolvedSymbol(e); + if (symbol.flags & SymbolFlags.Variable) { + let child: Node = expr; + let node = expr.parent; + while (node) { + if (node.kind === SyntaxKind.ForInStatement && + child === (node).statement && + getForInVariableSymbol(node) === symbol && + hasNumericPropertyNames(checkExpression((node).expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } + function checkIndexedAccess(node: ElementAccessExpression): Type { // Grammar checking if (!node.argumentExpression) { @@ -8671,7 +8719,7 @@ namespace ts { if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) { // Try to use a number indexer. - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike)) { + if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike) || isForInVariableForNumericPropertyNames(node.argumentExpression)) { const numberIndexType = getIndexTypeOfType(objectType, IndexKind.Number); if (numberIndexType) { return numberIndexType; @@ -8686,7 +8734,9 @@ namespace ts { // Fall back to any. if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + error(node, getIndexTypeOfType(objectType, IndexKind.Number) ? + Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number : + Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; @@ -12745,7 +12795,8 @@ namespace ts { } // For a binding pattern, validate the initializer and exit if (isBindingPattern(node.name)) { - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== SyntaxKind.ForInStatement) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -12755,7 +12806,8 @@ namespace ts { const type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== SyntaxKind.ForInStatement) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -13884,7 +13936,8 @@ namespace ts { } if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; + getNodeLinks(member).enumMemberValue = autoValue; + autoValue++; } } @@ -14446,7 +14499,16 @@ namespace ts { function checkExportSpecifier(node: ExportSpecifier) { checkAliasSymbol(node); if (!(node.parent.parent).moduleSpecifier) { - markExportAsReferenced(node); + const exportedName = node.propertyName || node.name; + // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) + const symbol = resolveName(exportedName, exportedName.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, + /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + if (symbol && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0]))) { + error(exportedName, Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 034b7022e82..247a204e9bd 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -54,6 +54,11 @@ namespace ts { description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_or_react, error: Diagnostics.Argument_for_jsx_must_be_preserve_or_react }, + { + name: "reactNamespace", + type: "string", + description: Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, { name: "listFiles", type: "boolean", @@ -334,7 +339,8 @@ namespace ts { function parseStrings(args: string[]) { let i = 0; while (i < args.length) { - let s = args[i++]; + let s = args[i]; + i++; if (s.charCodeAt(0) === CharacterCodes.at) { parseResponseFile(s.slice(1)); } @@ -356,18 +362,21 @@ namespace ts { switch (opt.type) { case "number": - options[opt.name] = parseInt(args[i++]); + options[opt.name] = parseInt(args[i]); + i++; break; case "boolean": options[opt.name] = true; break; case "string": - options[opt.name] = args[i++] || ""; + options[opt.name] = args[i] || ""; + i++; break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: let map = >opt.type; - let key = (args[i++] || "").toLowerCase(); + let key = (args[i] || "").toLowerCase(); + i++; if (hasProperty(map, key)) { options[opt.name] = map[key]; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index ad434d4cfad..1ae130f0f2d 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -244,9 +244,11 @@ namespace ts { const count = array.length; if (count > 0) { let pos = 0; - let result = arguments.length <= 2 ? array[pos++] : initial; + let result = arguments.length <= 2 ? array[pos] : initial; + pos++; while (pos < count) { - result = f(result, array[pos++]); + result = f(result, array[pos]); + pos++; } return result; } @@ -260,9 +262,11 @@ namespace ts { if (array) { let pos = array.length - 1; if (pos >= 0) { - let result = arguments.length <= 2 ? array[pos--] : initial; + let result = arguments.length <= 2 ? array[pos] : initial; + pos--; while (pos >= 0) { - result = f(result, array[pos--]); + result = f(result, array[pos]); + pos--; } return result; } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 578552df800..9a57b4b1a37 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -511,7 +511,8 @@ namespace ts { } let count = 0; while (true) { - const name = baseName + "_" + (++count); + count++; + const name = baseName + "_" + count; if (!hasProperty(currentIdentifiers, name)) { return name; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 72b14468797..fff6f75d20d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1771,34 +1771,38 @@ "category": "Error", "code": 2660 }, - "Invalid module name in augmentation, module '{0}' cannot be found.": { + "Cannot re-export name that is not defined in the module.": { "category": "Error", "code": 2661 }, - "Module augmentation cannot introduce new names in the top level scope.": { + "Invalid module name in augmentation, module '{0}' cannot be found.": { "category": "Error", "code": 2662 }, - "Exports are not permitted in module augmentations.": { + "Module augmentation cannot introduce new names in the top level scope.": { "category": "Error", "code": 2663 }, - "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.": { + "Exports are not permitted in module augmentations.": { "category": "Error", "code": 2664 }, - "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.": { + "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.": { "category": "Error", "code": 2665 }, - "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.": { + "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.": { "category": "Error", "code": 2666 }, - "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context.": { + "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.": { "category": "Error", "code": 2667 }, + "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context.": { + "category": "Error", + "code": 2668 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 @@ -2151,6 +2155,10 @@ "category": "Error", "code": 5058 }, + "Invalide value for '--reactNamespace'. '{0}' is not a valid identifier.": { + "category": "Error", + "code": 5059 + }, "Concatenate and emit output to single file.": { "category": "Message", @@ -2421,6 +2429,10 @@ "category": "Message", "code": 6083 }, + "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit": { + "category": "Message", + "code": 6084 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", @@ -2450,6 +2462,10 @@ "category": "Error", "code": 7013 }, + "Element implicitly has an 'any' type because index expression is not of type 'number'.": { + "category": "Error", + "code": 7015 + }, "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { "category": "Error", "code": 7016 @@ -2614,5 +2630,9 @@ "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": { "category": "Error", "code": 17007 + }, + "JSX element '{0}' has no corresponding closing tag.": { + "category": "Error", + "code": 17008 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 996dac118ef..c751693dfad 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -464,8 +464,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const writer = createTextWriter(newLine); const { write, writeTextOfNode, writeLine, increaseIndent, decreaseIndent } = writer; - const sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? createSourceMapWriter(host, writer) : getNullSourceMapWriter(); - const { setSourceFile, emitStart, emitEnd, emitPos } = sourceMap; + let sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? createSourceMapWriter(host, writer) : getNullSourceMapWriter(); + let { setSourceFile, emitStart, emitEnd, emitPos } = sourceMap; let currentSourceFile: SourceFile; let currentText: string; @@ -512,6 +512,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /** If removeComments is true, no leading-comments needed to be emitted **/ const emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos: number) { } : emitLeadingCommentsOfPositionWorker; + const setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer: SourceMapWriter) { }; + const moduleEmitDelegates: Map<(node: SourceFile, emitRelativePathAsModuleName?: boolean) => void> = { [ModuleKind.ES6]: emitES6Module, [ModuleKind.AMD]: emitAMDModule, @@ -1186,7 +1188,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitJsxElement(openingNode: JsxOpeningLikeElement, children?: JsxChild[]) { const syntheticReactRef = createSynthesizedNode(SyntaxKind.Identifier); - syntheticReactRef.text = "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; // Call React.createElement(tag, ... @@ -1975,7 +1977,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi result.expression = parenthesizeForAccess(expression); result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); result.name = name; - return result; } @@ -2568,7 +2569,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) { const tempArgumentExpression = createAndRecordTempVariable(TempFlags._i); (synthesizedLHS).argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true, leftHandSideExpression.expression); } else { (synthesizedLHS).argumentExpression = leftHandSideExpression.argumentExpression; @@ -2796,7 +2797,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * Returns false if nothing was written - this can happen for source file level variable declarations * in system modules where such variable declarations are hoisted. */ - function tryEmitStartOfVariableDeclarationList(decl: VariableDeclarationList, startPos?: number): boolean { + function tryEmitStartOfVariableDeclarationList(decl: VariableDeclarationList): boolean { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; @@ -2811,34 +2812,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return false; } - let tokenKind = SyntaxKind.VarKeyword; + emitStart(decl); if (decl && languageVersion >= ScriptTarget.ES6) { if (isLet(decl)) { - tokenKind = SyntaxKind.LetKeyword; + write("let "); } else if (isConst(decl)) { - tokenKind = SyntaxKind.ConstKeyword; + write("const "); + } + else { + write("var "); } - } - - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case SyntaxKind.VarKeyword: - write("var "); - break; - case SyntaxKind.LetKeyword: - write("let "); - break; - case SyntaxKind.ConstKeyword: - write("const "); - break; - } + write("var "); } - + // Note here we specifically dont emit end so that if we are going to emit binding pattern + // we can alter the source map correctly return true; } @@ -3177,7 +3167,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi endPos = emitToken(SyntaxKind.OpenParenToken, endPos); if (node.initializer && node.initializer.kind === SyntaxKind.VariableDeclarationList) { const variableDeclarationList = node.initializer; - const startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + const startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -3218,7 +3208,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { const variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } @@ -3305,21 +3295,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write("; "); // _i < _a.length; - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); // _i++) - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(SyntaxKind.CloseParenToken, node.expression.end); // Body @@ -3719,7 +3709,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param value an expression as a right-hand-side operand of the assignment * @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignment with comma */ - function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean) { + function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean, nodeForSourceMap: Node) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -3735,15 +3725,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } + // If this is first var declaration, we need to start at var/let/const keyword instead + // otherwise use nodeForSourceMap as the start position + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(() => { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } - write(" = "); - emit(value); + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, /*stopOverridingSpan*/true); if (exportChanged) { write(")"); @@ -3756,15 +3752,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param canDefineTempVariablesInPlace a boolean indicating whether you can define the temporary variable at an assignment location * @param shouldEmitCommaBeforeAssignment a boolean indicating whether an assignment should prefix with comma */ - function emitTempVariableAssignment(expression: Expression, canDefineTempVariablesInPlace: boolean, shouldEmitCommaBeforeAssignment: boolean): Identifier { + function emitTempVariableAssignment(expression: Expression, canDefineTempVariablesInPlace: boolean, shouldEmitCommaBeforeAssignment: boolean, sourceMapNode?: Node): Identifier { const identifier = createTempVariable(TempFlags.Auto); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root: Node) { + return root.kind === SyntaxKind.VariableDeclaration && + root.parent.kind === SyntaxKind.VariableDeclarationList && + (root.parent).declarations[0] === root; + } + function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; @@ -3787,6 +3789,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { Debug.assert(!isAssignmentExpressionStatement); + // If first variable declaration of variable statement correct the start location + if (isFirstVariableDeclaration(root)) { + // Use emit location of "var " as next emit start entry + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } @@ -3800,20 +3807,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param reuseIdentifierExpressions true if identifier expressions can simply be returned; * false if it is necessary to always emit an identifier. */ - function ensureIdentifier(expr: Expression, reuseIdentifierExpressions: boolean): Expression { + function ensureIdentifier(expr: Expression, reuseIdentifierExpressions: boolean, sourceMapNode: Node): Expression { if (expr.kind === SyntaxKind.Identifier && reuseIdentifierExpressions) { return expr; } - const identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + const identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value: Expression, defaultValue: Expression): Expression { + function createDefaultValueCheck(value: Expression, defaultValue: Expression, sourceMapNode: Node): Expression { // The value expression will be evaluated twice, so for anything but a simple identifier // we need to generate a temporary variable - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // If the temporary variable needs to be emitted use the source Map node for assignment of that statement + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); // Return the expression 'value === void 0 ? defaultValue : value' const equals = createSynthesizedNode(SyntaxKind.BinaryExpression); equals.left = value; @@ -3842,7 +3850,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let index: Expression; const nameIsComputed = propName.kind === SyntaxKind.ComputedPropertyName; if (nameIsComputed) { - index = ensureIdentifier((propName).expression, /*reuseIdentifierExpressions*/ false); + // TODO to handle when we look into sourcemaps for computed properties, for now use propName + index = ensureIdentifier((propName).expression, /*reuseIdentifierExpressions*/ false, propName); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -3866,61 +3875,66 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return call; } - function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression) { + function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression, sourceMapNode: Node) { const properties = target.properties; if (properties.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (const p of properties) { if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) { const propName = (p).name; const target = p.kind === SyntaxKind.ShorthandPropertyAssignment ? p : (p).initializer || propName; - emitDestructuringAssignment(target, createPropertyAccessForDestructuringProperty(value, propName)); + // Assignment for target = value.propName should highligh whole property, hence use p as source map node + emitDestructuringAssignment(target, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target: ArrayLiteralExpression, value: Expression) { + function emitArrayLiteralAssignment(target: ArrayLiteralExpression, value: Expression, sourceMapNode: Node) { const elements = target.elements; if (elements.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (let i = 0; i < elements.length; i++) { const e = elements[i]; if (e.kind !== SyntaxKind.OmittedExpression) { + // Assignment for target = value.propName should highligh whole property, hence use e as source map node if (e.kind !== SyntaxKind.SpreadElementExpression) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment((e).expression, createSliceCall(value, i)); + emitDestructuringAssignment((e).expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target: Expression | ShorthandPropertyAssignment, value: Expression) { + function emitDestructuringAssignment(target: Expression | ShorthandPropertyAssignment, value: Expression, sourceMapNode: Node) { + // When emitting target = value use source map node to highlight, including any temporary assignments needed for this if (target.kind === SyntaxKind.ShorthandPropertyAssignment) { if ((target).objectAssignmentInitializer) { - value = createDefaultValueCheck(value, (target).objectAssignmentInitializer); + value = createDefaultValueCheck(value, (target).objectAssignmentInitializer, sourceMapNode); } target = (target).name; } else if (target.kind === SyntaxKind.BinaryExpression && (target).operatorToken.kind === SyntaxKind.EqualsToken) { - value = createDefaultValueCheck(value, (target).right); + value = createDefaultValueCheck(value, (target).right, sourceMapNode); target = (target).left; } if (target.kind === SyntaxKind.ObjectLiteralExpression) { - emitObjectLiteralAssignment(target, value); + emitObjectLiteralAssignment(target, value, sourceMapNode); } else if (target.kind === SyntaxKind.ArrayLiteralExpression) { - emitArrayLiteralAssignment(target, value); + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, sourceMapNode); emitCount++; } } @@ -3933,14 +3947,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + // Source map node for root.left = root.right is root + // but if root is synthetic, which could be in below case, use the target which is { a } + // for ({a} of {a: string}) { + // } + emitDestructuringAssignment(target, value, nodeIsSynthesized(root) ? target : root); } else { if (root.parent.kind !== SyntaxKind.ParenthesizedExpression) { write("("); } - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); - emitDestructuringAssignment(target, value); + // Temporary assignment needed to emit root should highlight whole binary expression + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, root); + // Source map node for root.left = root.right is root + emitDestructuringAssignment(target, value, root); write(", "); emit(value); if (root.parent.kind !== SyntaxKind.ParenthesizedExpression) { @@ -3950,9 +3970,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function emitBindingElement(target: BindingElement | VariableDeclaration, value: Expression) { + // Any temporary assignments needed to emit target = value should point to target if (target.initializer) { // Combine value and initializer - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer @@ -3968,7 +3989,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0); + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0, target); } for (let i = 0; i < numElements; i++) { @@ -3990,7 +4011,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, target); emitCount++; } } @@ -5464,7 +5485,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi }); leadingComma = true; } - ++parameterIndex; + parameterIndex++; } } return argumentsWritten; @@ -6488,7 +6509,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let started = false; if (exportedDeclarations) { - for (let i = 0; i < exportedDeclarations.length; ++i) { + for (let i = 0; i < exportedDeclarations.length; i++) { // write name of exported declaration, i.e 'export var x...' writeExportedName(exportedDeclarations[i]); } @@ -6604,7 +6625,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi writeLine(); write("var "); const seen: Map = {}; - for (let i = 0; i < hoistedVars.length; ++i) { + for (let i = 0; i < hoistedVars.length; i++) { const local = hoistedVars[i]; const name = local.kind === SyntaxKind.Identifier ? local @@ -6816,7 +6837,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitSetters(exportStarFunction: string, dependencyGroups: DependencyGroup[]) { write("setters:["); - for (let i = 0; i < dependencyGroups.length; ++i) { + for (let i = 0; i < dependencyGroups.length; i++) { if (i !== 0) { write(","); } @@ -6864,7 +6885,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(`${exportFunctionForFile}({`); writeLine(); increaseIndent(); - for (let i = 0, len = (entry).exportClause.elements.length; i < len; ++i) { + for (let i = 0, len = (entry).exportClause.elements.length; i < len; i++) { if (i !== 0) { write(","); writeLine(); @@ -6909,7 +6930,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write("execute: function() {"); increaseIndent(); writeLine(); - for (let i = startIndex; i < node.statements.length; ++i) { + for (let i = startIndex; i < node.statements.length; i++) { const statement = node.statements[i]; switch (statement.kind) { // - function declarations are not emitted because they were already hoisted @@ -6971,7 +6992,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const groupIndices: Map = {}; const dependencyGroups: DependencyGroup[] = []; - for (let i = 0; i < externalImports.length; ++i) { + for (let i = 0; i < externalImports.length; i++) { const text = getExternalModuleNameText(externalImports[i], emitRelativePathAsModuleName); if (hasProperty(groupIndices, text)) { // deduplicate/group entries in dependency list by the dependency name @@ -7221,7 +7242,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // Replace entities like   result = result.replace(/&(\w+);/g, function(s: any, m: string) { if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + const ch = String.fromCharCode(entities[m]); + // " needs to be escaped + return ch === "\"" ? "\\\"" : ch; } else { return s; @@ -7294,7 +7317,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitDirectivePrologues(statements: Node[], startWithNewLine: boolean, ensureUseStrict?: boolean): number { let foundUseStrict = false; - for (let i = 0; i < statements.length; ++i) { + for (let i = 0; i < statements.length; i++) { if (isPrologueDirective(statements[i])) { if (isUseStrictPrologue(statements[i] as ExpressionStatement)) { foundUseStrict = true; @@ -7316,7 +7339,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function writeLines(text: string): void { const lines = text.split(/\r\n|\r|\n/g); - for (let i = 0; i < lines.length; ++i) { + for (let i = 0; i < lines.length; i++) { const line = lines[i]; if (line.length) { writeLine(); @@ -7432,6 +7455,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } + function changeSourceMapEmit(writer: SourceMapWriter) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + + function withTemporaryNoSourceMap(callback: () => void) { + const prevSourceMap = sourceMap; + setSourceMapWriterEmit(getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } + function isSpecializedCommentHandling(node: Node): boolean { switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f2ad8b88cf2..1491b887b95 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3497,6 +3497,20 @@ namespace ts { return finishNode(node); } + function tagNamesAreEquivalent(lhs: EntityName, rhs: EntityName): boolean { + if (lhs.kind !== rhs.kind) { + return false; + } + + if (lhs.kind === SyntaxKind.Identifier) { + return (lhs).text === (rhs).text; + } + + return (lhs).right.text === (rhs).right.text && + tagNamesAreEquivalent((lhs).left, (rhs).left); + } + + function parseJsxElementOrSelfClosingElement(inExpressionContext: boolean): JsxElement | JsxSelfClosingElement { const opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); let result: JsxElement | JsxSelfClosingElement; @@ -3506,6 +3520,11 @@ namespace ts { node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); + + if (!tagNamesAreEquivalent(node.openingElement.tagName, node.closingElement.tagName)) { + parseErrorAtPosition(node.closingElement.pos, node.closingElement.end - node.closingElement.pos, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, node.openingElement.tagName)); + } + result = finishNode(node); } else { @@ -3565,10 +3584,13 @@ namespace ts { while (true) { token = scanner.reScanJsxToken(); if (token === SyntaxKind.LessThanSlashToken) { + // Closing tag break; } else if (token === SyntaxKind.EndOfFileToken) { - parseErrorAtCurrentToken(Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, openingTagName)); + // If we hit EOF, issue the error at the tag that lacks the closing element + // rather than at the end of the file (which is useless) + parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTagName)); break; } result.push(parseJsxChild()); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index a97f5ee3d0c..fd964323fbb 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -53,13 +53,13 @@ namespace ts { if (getRootLength(moduleName) !== 0 || nameStartsWithDotSlashOrDotDotSlash(moduleName)) { const failedLookupLocations: string[] = []; const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); - let resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, host); + let resolvedFileName = loadNodeModuleFromFile(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); if (resolvedFileName) { return { resolvedModule: { resolvedFileName }, failedLookupLocations }; } - resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, host); + resolvedFileName = loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, /*onlyRecordFailures*/ false, host); return resolvedFileName ? { resolvedModule: { resolvedFileName }, failedLookupLocations } : { resolvedModule: undefined, failedLookupLocations }; @@ -69,12 +69,22 @@ namespace ts { } } - function loadNodeModuleFromFile(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { + /* @internal */ + export function directoryProbablyExists(directoryName: string, host: { directoryExists?: (directoryName: string) => boolean } ): boolean { + // if host does not support 'directoryExists' assume that directory will exist + return !host.directoryExists || host.directoryExists(directoryName); + } + + /** + * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary + * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. + */ + function loadNodeModuleFromFile(extensions: string[], candidate: string, failedLookupLocation: string[], onlyRecordFailures: boolean, host: ModuleResolutionHost): string { return forEach(extensions, tryLoad); function tryLoad(ext: string): string { const fileName = fileExtensionIs(candidate, ext) ? candidate : candidate + ext; - if (host.fileExists(fileName)) { + if (!onlyRecordFailures && host.fileExists(fileName)) { return fileName; } else { @@ -84,9 +94,10 @@ namespace ts { } } - function loadNodeModuleFromDirectory(extensions: string[], candidate: string, failedLookupLocation: string[], host: ModuleResolutionHost): string { + function loadNodeModuleFromDirectory(extensions: string[], candidate: string, failedLookupLocation: string[], onlyRecordFailures: boolean, host: ModuleResolutionHost): string { const packageJsonPath = combinePaths(candidate, "package.json"); - if (host.fileExists(packageJsonPath)) { + const directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, host); + if (directoryExists && host.fileExists(packageJsonPath)) { let jsonContent: { typings?: string }; @@ -100,7 +111,8 @@ namespace ts { } if (typeof jsonContent.typings === "string") { - const result = loadNodeModuleFromFile(extensions, normalizePath(combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host); + const path = normalizePath(combinePaths(candidate, jsonContent.typings)); + const result = loadNodeModuleFromFile(extensions, path, failedLookupLocation, !directoryProbablyExists(getDirectoryPath(path), host), host); if (result) { return result; } @@ -111,7 +123,7 @@ namespace ts { failedLookupLocation.push(packageJsonPath); } - return loadNodeModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocation, host); + return loadNodeModuleFromFile(extensions, combinePaths(candidate, "index"), failedLookupLocation, !directoryExists, host); } function loadModuleFromNodeModules(moduleName: string, directory: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { @@ -121,14 +133,15 @@ namespace ts { const baseName = getBaseFileName(directory); if (baseName !== "node_modules") { const nodeModulesFolder = combinePaths(directory, "node_modules"); + const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, host); const candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName)); // Load only typescript files irrespective of allowJs option if loading from node modules - let result = loadNodeModuleFromFile(supportedTypeScriptExtensions, candidate, failedLookupLocations, host); + let result = loadNodeModuleFromFile(supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } - result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, host); + result = loadNodeModuleFromDirectory(supportedTypeScriptExtensions, candidate, failedLookupLocations, !nodeModulesFolderExists, host); if (result) { return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations }; } @@ -281,7 +294,8 @@ namespace ts { getCanonicalFileName, getNewLine: () => newLine, fileExists: fileName => sys.fileExists(fileName), - readFile: fileName => sys.readFile(fileName) + readFile: fileName => sys.readFile(fileName), + directoryExists: directoryName => sys.directoryExists(directoryName) }; } @@ -522,7 +536,7 @@ namespace ts { } const resolutions = resolveModuleNamesWorker(moduleNames, getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct - for (let i = 0; i < moduleNames.length; ++i) { + for (let i = 0; i < moduleNames.length; i++) { const newResolution = resolutions[i]; const oldResolution = getResolvedModule(oldSourceFile, moduleNames[i]); const resolutionChanged = oldResolution @@ -550,7 +564,7 @@ namespace ts { } // update fileName -> file mapping - for (let i = 0, len = newSourceFiles.length; i < len; ++i) { + for (let i = 0, len = newSourceFiles.length; i < len; i++) { filesByName.set(filePaths[i], newSourceFiles[i]); } @@ -1348,6 +1362,10 @@ namespace ts { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators")); } + if (options.reactNamespace && !isIdentifier(options.reactNamespace, languageVersion)) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Invalide_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace)); + } + // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit) { const emitHost = getEmitHost(); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 3e9698eb740..7192ba6b40c 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -289,7 +289,8 @@ namespace ts { let pos = 0; let lineStart = 0; while (pos < text.length) { - const ch = text.charCodeAt(pos++); + const ch = text.charCodeAt(pos); + pos++; switch (ch) { case CharacterCodes.carriageReturn: if (text.charCodeAt(pos) === CharacterCodes.lineFeed) { @@ -688,6 +689,21 @@ namespace ts { ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion); } + /* @internal */ + export function isIdentifier(name: string, languageVersion: ScriptTarget): boolean { + if (!isIdentifierStart(name.charCodeAt(0), languageVersion)) { + return false; + } + + for (let i = 1, n = name.length; i < n; i++) { + if (!isIdentifierPart(name.charCodeAt(i), languageVersion)) { + return false; + } + } + + return true; + } + // Creates a scanner over a (possibly unspecified) range of a piece of text. export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, @@ -824,7 +840,8 @@ namespace ts { } function scanString(): string { - const quote = text.charCodeAt(pos++); + const quote = text.charCodeAt(pos); + pos++; let result = ""; let start = pos; while (true) { @@ -934,7 +951,8 @@ namespace ts { error(Diagnostics.Unexpected_end_of_text); return ""; } - const ch = text.charCodeAt(pos++); + const ch = text.charCodeAt(pos); + pos++; switch (ch) { case CharacterCodes._0: return "\0"; @@ -1183,7 +1201,8 @@ namespace ts { } return pos += 2, token = SyntaxKind.ExclamationEqualsToken; } - return pos++, token = SyntaxKind.ExclamationToken; + pos++; + return token = SyntaxKind.ExclamationToken; case CharacterCodes.doubleQuote: case CharacterCodes.singleQuote: tokenValue = scanString(); @@ -1194,7 +1213,8 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.PercentEqualsToken; } - return pos++, token = SyntaxKind.PercentToken; + pos++; + return token = SyntaxKind.PercentToken; case CharacterCodes.ampersand: if (text.charCodeAt(pos + 1) === CharacterCodes.ampersand) { return pos += 2, token = SyntaxKind.AmpersandAmpersandToken; @@ -1202,11 +1222,14 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.AmpersandEqualsToken; } - return pos++, token = SyntaxKind.AmpersandToken; + pos++; + return token = SyntaxKind.AmpersandToken; case CharacterCodes.openParen: - return pos++, token = SyntaxKind.OpenParenToken; + pos++; + return token = SyntaxKind.OpenParenToken; case CharacterCodes.closeParen: - return pos++, token = SyntaxKind.CloseParenToken; + pos++; + return token = SyntaxKind.CloseParenToken; case CharacterCodes.asterisk: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.AsteriskEqualsToken; @@ -1217,7 +1240,8 @@ namespace ts { } return pos += 2, token = SyntaxKind.AsteriskAsteriskToken; } - return pos++, token = SyntaxKind.AsteriskToken; + pos++; + return token = SyntaxKind.AsteriskToken; case CharacterCodes.plus: if (text.charCodeAt(pos + 1) === CharacterCodes.plus) { return pos += 2, token = SyntaxKind.PlusPlusToken; @@ -1225,9 +1249,11 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.PlusEqualsToken; } - return pos++, token = SyntaxKind.PlusToken; + pos++; + return token = SyntaxKind.PlusToken; case CharacterCodes.comma: - return pos++, token = SyntaxKind.CommaToken; + pos++; + return token = SyntaxKind.CommaToken; case CharacterCodes.minus: if (text.charCodeAt(pos + 1) === CharacterCodes.minus) { return pos += 2, token = SyntaxKind.MinusMinusToken; @@ -1235,7 +1261,8 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.MinusEqualsToken; } - return pos++, token = SyntaxKind.MinusToken; + pos++; + return token = SyntaxKind.MinusToken; case CharacterCodes.dot: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = scanNumber(); @@ -1244,7 +1271,8 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.dot && text.charCodeAt(pos + 2) === CharacterCodes.dot) { return pos += 3, token = SyntaxKind.DotDotDotToken; } - return pos++, token = SyntaxKind.DotToken; + pos++; + return token = SyntaxKind.DotToken; case CharacterCodes.slash: // Single-line comment if (text.charCodeAt(pos + 1) === CharacterCodes.slash) { @@ -1302,7 +1330,8 @@ namespace ts { return pos += 2, token = SyntaxKind.SlashEqualsToken; } - return pos++, token = SyntaxKind.SlashToken; + pos++; + return token = SyntaxKind.SlashToken; case CharacterCodes._0: if (pos + 2 < end && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { @@ -1355,9 +1384,11 @@ namespace ts { tokenValue = scanNumber(); return token = SyntaxKind.NumericLiteral; case CharacterCodes.colon: - return pos++, token = SyntaxKind.ColonToken; + pos++; + return token = SyntaxKind.ColonToken; case CharacterCodes.semicolon: - return pos++, token = SyntaxKind.SemicolonToken; + pos++; + return token = SyntaxKind.SemicolonToken; case CharacterCodes.lessThan: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -1383,7 +1414,8 @@ namespace ts { text.charCodeAt(pos + 2) !== CharacterCodes.asterisk) { return pos += 2, token = SyntaxKind.LessThanSlashToken; } - return pos++, token = SyntaxKind.LessThanToken; + pos++; + return token = SyntaxKind.LessThanToken; case CharacterCodes.equals: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -1404,7 +1436,8 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.greaterThan) { return pos += 2, token = SyntaxKind.EqualsGreaterThanToken; } - return pos++, token = SyntaxKind.EqualsToken; + pos++; + return token = SyntaxKind.EqualsToken; case CharacterCodes.greaterThan: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -1416,20 +1449,26 @@ namespace ts { } } - return pos++, token = SyntaxKind.GreaterThanToken; + pos++; + return token = SyntaxKind.GreaterThanToken; case CharacterCodes.question: - return pos++, token = SyntaxKind.QuestionToken; + pos++; + return token = SyntaxKind.QuestionToken; case CharacterCodes.openBracket: - return pos++, token = SyntaxKind.OpenBracketToken; + pos++; + return token = SyntaxKind.OpenBracketToken; case CharacterCodes.closeBracket: - return pos++, token = SyntaxKind.CloseBracketToken; + pos++; + return token = SyntaxKind.CloseBracketToken; case CharacterCodes.caret: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.CaretEqualsToken; } - return pos++, token = SyntaxKind.CaretToken; + pos++; + return token = SyntaxKind.CaretToken; case CharacterCodes.openBrace: - return pos++, token = SyntaxKind.OpenBraceToken; + pos++; + return token = SyntaxKind.OpenBraceToken; case CharacterCodes.bar: if (text.charCodeAt(pos + 1) === CharacterCodes.bar) { return pos += 2, token = SyntaxKind.BarBarToken; @@ -1437,13 +1476,17 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.BarEqualsToken; } - return pos++, token = SyntaxKind.BarToken; + pos++; + return token = SyntaxKind.BarToken; case CharacterCodes.closeBrace: - return pos++, token = SyntaxKind.CloseBraceToken; + pos++; + return token = SyntaxKind.CloseBraceToken; case CharacterCodes.tilde: - return pos++, token = SyntaxKind.TildeToken; + pos++; + return token = SyntaxKind.TildeToken; case CharacterCodes.at: - return pos++, token = SyntaxKind.AtToken; + pos++; + return token = SyntaxKind.AtToken; case CharacterCodes.backslash: let cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { @@ -1452,7 +1495,8 @@ namespace ts { return token = getIdentifierToken(); } error(Diagnostics.Invalid_character); - return pos++, token = SyntaxKind.Unknown; + pos++; + return token = SyntaxKind.Unknown; default: if (isIdentifierStart(ch, languageVersion)) { pos++; @@ -1473,7 +1517,8 @@ namespace ts { continue; } error(Diagnostics.Invalid_character); - return pos++, token = SyntaxKind.Unknown; + pos++; + return token = SyntaxKind.Unknown; } } } @@ -1490,10 +1535,12 @@ namespace ts { if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.GreaterThanGreaterThanEqualsToken; } - return pos++, token = SyntaxKind.GreaterThanGreaterThanToken; + pos++; + return token = SyntaxKind.GreaterThanGreaterThanToken; } if (text.charCodeAt(pos) === CharacterCodes.equals) { - return pos++, token = SyntaxKind.GreaterThanEqualsToken; + pos++; + return token = SyntaxKind.GreaterThanEqualsToken; } } return token; diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 50644201544..8abf1432b0c 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -7,7 +7,8 @@ namespace ts { setSourceFile(sourceFile: SourceFile): void; emitPos(pos: number): void; emitStart(range: TextRange): void; - emitEnd(range: TextRange): void; + emitEnd(range: TextRange, stopOverridingSpan?: boolean): void; + changeEmitSourcePos(): void; getText(): string; getSourceMappingURL(): string; initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void; @@ -22,8 +23,9 @@ namespace ts { getSourceMapData(): SourceMapData { return undefined; }, setSourceFile(sourceFile: SourceFile): void { }, emitStart(range: TextRange): void { }, - emitEnd(range: TextRange): void { }, + emitEnd(range: TextRange, stopOverridingSpan?: boolean): void { }, emitPos(pos: number): void { }, + changeEmitSourcePos(): void { }, getText(): string { return undefined; }, getSourceMappingURL(): string { return undefined; }, initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void { }, @@ -38,6 +40,8 @@ namespace ts { const compilerOptions = host.getCompilerOptions(); let currentSourceFile: SourceFile; let sourceMapDir: string; // The directory in which sourcemap will be + let stopOverridingSpan = false; + let modifyLastSourcePos = false; // Current source map file and its index in the sources list let sourceMapSourceIndex: number; @@ -56,6 +60,7 @@ namespace ts { emitPos, emitStart, emitEnd, + changeEmitSourcePos, getText, getSourceMappingURL, initialize, @@ -142,6 +147,45 @@ namespace ts { sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + // Reset the source pos + modifyLastSourcePos = false; + + // Change Last recorded Map with last encoded emit line and character + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + + // Pop sourceMapDecodedMappings to remove last entry + sourceMapData.sourceMapDecodedMappings.pop(); + + // Change the last encoded source map + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + + // TODO: Update lastEncodedNameIndex + // Since we dont support this any more, lets not worry about it right now. + // When we start supporting nameIndex, we will get back to this + + // Change the encoded source map + const sourceMapMappings = sourceMapData.sourceMapMappings; + let lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + const currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + // Separator for the entry found + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + // Last line separator found + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } + // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { @@ -178,6 +222,7 @@ namespace ts { // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { + Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -219,22 +264,36 @@ namespace ts { sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + + updateLastEncodedAndRecordedSpans(); + } + + function getStartPos(range: TextRange) { + const rangeHasDecorators = !!(range as Node).decorators; + return range.pos !== -1 ? skipTrivia(currentSourceFile.text, rangeHasDecorators ? (range as Node).decorators.end : range.pos) : -1; } function emitStart(range: TextRange) { - const rangeHasDecorators = !!(range as Node).decorators; - emitPos(range.pos !== -1 ? skipTrivia(currentSourceFile.text, rangeHasDecorators ? (range as Node).decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range: TextRange) { + function emitEnd(range: TextRange, stopOverridingEnd?: boolean) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + + function changeEmitSourcePos() { + Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile: SourceFile) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 7b5af130a69..5e9e7a88dda 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1741,6 +1741,7 @@ namespace ts { isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; + isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; @@ -2385,6 +2386,7 @@ namespace ts { inlineSourceMap?: boolean; inlineSources?: boolean; jsx?: JsxEmit; + reactNamespace?: string; listFiles?: boolean; locale?: string; mapRoot?: string; @@ -2652,6 +2654,8 @@ namespace ts { // readFile function is used to read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json' // to determine location of bundled typings for node module readFile(fileName: string): string; + + directoryExists?(directoryName: string): boolean; } export interface ResolvedModule { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index b49d011c616..c31a3f3248c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -92,7 +92,7 @@ namespace ts { return false; } - for (let i = 0; i < array1.length; ++i) { + for (let i = 0; i < array1.length; i++) { const equals = equaler ? equaler(array1[i], array2[i]) : array1[i] === array2[i]; if (!equals) { return false; @@ -1913,8 +1913,8 @@ namespace ts { writeTextOfNode, writeLiteral, writeLine, - increaseIndent: () => indent++, - decreaseIndent: () => indent--, + increaseIndent: () => { indent++; }, + decreaseIndent: () => { indent--; }, getIndent: () => indent, getTextPos: () => output.length, getLine: () => lineCount + 1, diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index a078b64543b..29a3383631d 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -317,6 +317,7 @@ namespace FourSlash { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, PlaceOpenBraceOnNewLineForFunctions: false, PlaceOpenBraceOnNewLineForControlBlocks: false, }; @@ -727,7 +728,7 @@ namespace FourSlash { // Count only the references in local files. Filter the ones in lib and other files. ts.forEach(references, entry => { if (localFiles.some((fileName) => fileName === entry.fileName)) { - ++referencesCount; + referencesCount++; } }); } @@ -1079,9 +1080,15 @@ namespace FourSlash { } public baselineCurrentFileBreakpointLocations() { + let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile]; + if (!baselineFile) { + baselineFile = this.activeFile.fileName.replace(this.basePath + "/breakpointValidation", "bpSpan"); + baselineFile = baselineFile.replace(".ts", ".baseline"); + + } Harness.Baseline.runBaseline( "Breakpoint Locations for " + this.activeFile.fileName, - this.testData.globalOptions[metadataOptionNames.baselineFile], + baselineFile, () => { return this.baselineCurrentFileLocations(pos => this.getBreakpointStatementLocation(pos)); }, @@ -1093,7 +1100,7 @@ namespace FourSlash { const emitFiles: FourSlashFile[] = []; // List of FourSlashFile that has emitThisFile flag on const allFourSlashFiles = this.testData.files; - for (let idx = 0; idx < allFourSlashFiles.length; ++idx) { + for (let idx = 0; idx < allFourSlashFiles.length; idx++) { const file = allFourSlashFiles[idx]; if (file.fileOptions[metadataOptionNames.emitThisFile] === "true") { // Find a file with the flag emitThisFile turned on @@ -1853,7 +1860,7 @@ namespace FourSlash { let item: ts.NavigateToItem = null; // Count only the match that match the same MatchKind - for (let i = 0; i < items.length; ++i) { + for (let i = 0; i < items.length; i++) { item = items[i]; if (!matchKind || item.matchKind === matchKind) { actual++; @@ -3284,6 +3291,30 @@ namespace FourSlashInterface { return getClassification("typeAliasName", text, position); } + export function jsxOpenTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxOpenTagName", text, position); + } + + export function jsxCloseTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxCloseTagName", text, position); + } + + export function jsxSelfClosingTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxSelfClosingTagName", text, position); + } + + export function jsxAttribute(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxAttribute", text, position); + } + + export function jsxText(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxText", text, position); + } + + export function jsxAttributeStringLiteralValue(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxAttributeStringLiteralValue", text, position); + } + function getClassification(type: string, text: string, position?: number) { return { classificationType: type, diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index fb5b6ce92aa..a0cac439729 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -267,6 +267,10 @@ namespace Harness.LanguageService { log(s: string): void { this.nativeHost.log(s); } trace(s: string): void { this.nativeHost.trace(s); } error(s: string): void { this.nativeHost.error(s); } + directoryExists(directoryName: string): boolean { + // for tests pessimistically assume that directory always exists + return true; + } } class ClassifierShimProxy implements ts.Classifier { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 52102663457..96fcfedc6b4 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -307,9 +307,10 @@ class ProjectRunner extends RunnerBase { // If the generated output file resides in the parent folder or is rooted path, // we need to instead create files that can live in the project reference folder // but make sure extension of these files matches with the fileName the compiler asked to write - diskRelativeName = "diskFile" + nonSubfolderDiskFiles++ + + diskRelativeName = "diskFile" + nonSubfolderDiskFiles + (Harness.Compiler.isDTS(fileName) ? ".d.ts" : Harness.Compiler.isJS(fileName) ? ".js" : ".js.map"); + nonSubfolderDiskFiles++; } if (Harness.Compiler.isJS(fileName)) { diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 0dff2cedc39..0144d752b99 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -321,6 +321,7 @@ interface AudioContext extends EventTarget { destination: AudioDestinationNode; listener: AudioListener; sampleRate: number; + state: string; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; @@ -2774,6 +2775,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec tagName: string; id: string; className: string; + innerHTML: string; getAttribute(name?: string): string; getAttributeNS(namespaceURI: string, localName: string): string; getAttributeNode(name: string): Attr; @@ -2969,7 +2971,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec removeAttributeNode(oldAttr: Attr): Attr; requestFullscreen(): void; requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; + setAttribute(name: string, value: string): void; setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; setAttributeNode(newAttr: Attr): Attr; setAttributeNodeNS(newAttr: Attr): Attr; @@ -5512,7 +5514,7 @@ interface HTMLMediaElement extends HTMLElement { * Gets or sets the current playback position, in seconds. */ preload: string; - readyState: any; + readyState: number; /** * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */ @@ -6169,6 +6171,7 @@ interface HTMLSelectElement extends HTMLElement { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; + selectedOptions: HTMLCollection; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 531dbf9e5ea..44e5e49f984 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -7,7 +7,7 @@ interface Symbol { /** Returns the primitive value of the specified object. */ valueOf(): Object; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Symbol"; } interface SymbolConstructor { @@ -565,7 +565,7 @@ interface IterableIterator extends Iterator { } interface GeneratorFunction extends Function { - + [Symbol.toStringTag]: "GeneratorFunction"; } interface GeneratorFunctionConstructor { @@ -690,7 +690,7 @@ interface Math { */ cbrt(x: number): number; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Math"; } interface Date { @@ -807,7 +807,7 @@ interface Map { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Map"; } interface MapConstructor { @@ -824,7 +824,7 @@ interface WeakMap { get(key: K): V; has(key: K): boolean; set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakMap"; } interface WeakMapConstructor { @@ -846,7 +846,7 @@ interface Set { size: number; values(): IterableIterator; [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Set"; } interface SetConstructor { @@ -862,7 +862,7 @@ interface WeakSet { clear(): void; delete(value: T): boolean; has(value: T): boolean; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "WeakSet"; } interface WeakSetConstructor { @@ -874,7 +874,7 @@ interface WeakSetConstructor { declare var WeakSet: WeakSetConstructor; interface JSON { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "JSON"; } /** @@ -884,11 +884,11 @@ interface JSON { * buffer as needed. */ interface ArrayBuffer { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "ArrayBuffer"; } interface DataView { - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "DataView"; } /** @@ -909,6 +909,7 @@ interface Int8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int8Array"; } interface Int8ArrayConstructor { @@ -941,6 +942,7 @@ interface Uint8Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "UInt8Array"; } interface Uint8ArrayConstructor { @@ -976,6 +978,7 @@ interface Uint8ClampedArray { values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint8ClampedArray"; } interface Uint8ClampedArrayConstructor { @@ -1013,6 +1016,7 @@ interface Int16Array { [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int16Array"; } interface Int16ArrayConstructor { @@ -1045,6 +1049,7 @@ interface Uint16Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint16Array"; } interface Uint16ArrayConstructor { @@ -1077,6 +1082,7 @@ interface Int32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Int32Array"; } interface Int32ArrayConstructor { @@ -1109,6 +1115,7 @@ interface Uint32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Uint32Array"; } interface Uint32ArrayConstructor { @@ -1141,6 +1148,7 @@ interface Float32Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float32Array"; } interface Float32ArrayConstructor { @@ -1173,6 +1181,7 @@ interface Float64Array { */ values(): IterableIterator; [Symbol.iterator](): IterableIterator; + [Symbol.toStringTag]: "Float64Array"; } interface Float64ArrayConstructor { @@ -1249,7 +1258,7 @@ interface Promise { catch(onrejected?: (reason: any) => T | PromiseLike): Promise; catch(onrejected?: (reason: any) => void): Promise; - [Symbol.toStringTag]: string; + [Symbol.toStringTag]: "Promise"; } interface PromiseConstructor { @@ -1272,15 +1281,15 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; all(values: Iterable>): Promise; /** diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5a1c85fc13c..76720ba2850 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -100,7 +100,8 @@ namespace ts.server { this.filenameToScript = createFileMap(); this.moduleResolutionHost = { fileExists: fileName => this.fileExists(fileName), - readFile: fileName => this.host.readFile(fileName) + readFile: fileName => this.host.readFile(fileName), + directoryExists: directoryName => this.host.directoryExists(directoryName) }; } @@ -718,7 +719,8 @@ namespace ts.server { else { for (const directory of project.directoriesWatchedForTsconfig) { // if the ref count for this directory watcher drops to 0, it's time to close it - if (!(--project.projectService.directoryWatchersRefCount[directory])) { + project.projectService.directoryWatchersRefCount[directory]--; + if (!project.projectService.directoryWatchersRefCount[directory]) { this.log("Close directory watcher for: " + directory); project.projectService.directoryWatchersForTsconfig[directory].close(); delete project.projectService.directoryWatchersForTsconfig[directory]; @@ -1330,6 +1332,7 @@ namespace ts.server { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, PlaceOpenBraceOnNewLineForFunctions: false, PlaceOpenBraceOnNewLineForControlBlocks: false, }; @@ -1730,7 +1733,8 @@ namespace ts.server { let count = 1; let pos = 0; this.index.every((ll, s, len) => { - starts[count++] = pos; + starts[count] = pos; + count++; pos += ll.text.length; return true; }, 0); @@ -1996,7 +2000,8 @@ namespace ts.server { while (adjustedStart >= childCharCount) { this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart); adjustedStart -= childCharCount; - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); } // Case I: both start and end of range in same subtree @@ -2011,14 +2016,16 @@ namespace ts.server { return; } let adjustedLength = rangeLength - (childCharCount - adjustedStart); - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); while (adjustedLength > childCharCount) { if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) { return; } adjustedLength -= childCharCount; - child = this.children[++childIndex]; + childIndex++; + child = this.children[childIndex]; childCharCount = child.charCount(); } if (adjustedLength > 0) { @@ -2142,7 +2149,8 @@ namespace ts.server { if (childIndex < clen) { splitNode = new LineNode(); while (childIndex < clen) { - splitNode.add(this.children[childIndex++]); + splitNode.add(this.children[childIndex]); + childIndex++; } splitNode.updateCounts(); } @@ -2183,7 +2191,9 @@ namespace ts.server { let nodeIndex = 0; childIndex++; while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) { - this.children[childIndex++] = nodes[nodeIndex++]; + this.children[childIndex] = nodes[nodeIndex]; + childIndex++; + nodeIndex++; } let splitNodes: LineNode[] = []; let splitNodeCount = 0; @@ -2196,7 +2206,8 @@ namespace ts.server { } let splitNode = splitNodes[0]; while (nodeIndex < nodeCount) { - splitNode.add(nodes[nodeIndex++]); + splitNode.add(nodes[nodeIndex]); + nodeIndex++; if (splitNode.children.length === lineCollectionCapacity) { splitNodeIndex++; splitNode = splitNodes[splitNodeIndex]; diff --git a/src/server/session.ts b/src/server/session.ts index 78686b79118..9b9bf35a4a5 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -263,7 +263,8 @@ namespace ts.server { let index = 0; const checkOne = () => { if (matchSeq(seq)) { - const checkSpec = checkList[index++]; + const checkSpec = checkList[index]; + index++; if (checkSpec.project.getSourceFileFromName(checkSpec.fileName, requireOpen)) { this.syntacticCheck(checkSpec.fileName, checkSpec.project); this.immediateId = setImmediate(() => { diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 31ab5d2adec..b7e909f69d8 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -45,6 +45,10 @@ namespace ts.BreakpointResolver { return createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } + function textSpanEndingAtNextToken(startNode: Node, previousTokenToFindNextEndToken: Node): TextSpan { + return textSpan(startNode, findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent)); + } + function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TextSpan { if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); @@ -66,33 +70,6 @@ namespace ts.BreakpointResolver { function spanInNode(node: Node): TextSpan { if (node) { - if (isExpression(node)) { - if (node.parent.kind === SyntaxKind.DoStatement) { - // Set span as if on while keyword - return spanInPreviousNode(node); - } - - if (node.parent.kind === SyntaxKind.Decorator) { - // Set breakpoint on the decorator emit - return spanInNode(node.parent); - } - - if (node.parent.kind === SyntaxKind.ForStatement) { - // For now lets set the span on this expression, fix it later - return textSpan(node); - } - - if (node.parent.kind === SyntaxKind.BinaryExpression && (node.parent).operatorToken.kind === SyntaxKind.CommaToken) { - // if this is comma expression, the breakpoint is possible in this expression - return textSpan(node); - } - - if (node.parent.kind === SyntaxKind.ArrowFunction && (node.parent).body === node) { - // If this is body of arrow function, it is allowed to have the breakpoint - return textSpan(node); - } - } - switch (node.kind) { case SyntaxKind.VariableStatement: // Span on first variable declaration @@ -120,7 +97,7 @@ namespace ts.BreakpointResolver { if (isFunctionBlock(node)) { return spanInFunctionBlock(node); } - // Fall through + // Fall through case SyntaxKind.ModuleBlock: return spanInBlock(node); @@ -137,7 +114,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: // Span on while(...) - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.DoStatement: // span in statement of the do statement @@ -149,7 +126,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.IfStatement: // set on if(..) span - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.LabeledStatement: // span in statement @@ -164,13 +141,16 @@ namespace ts.BreakpointResolver { return spanInForStatement(node); case SyntaxKind.ForInStatement: + // span of for (a in ...) + return textSpanEndingAtNextToken(node, (node).expression); + case SyntaxKind.ForOfStatement: - // span on for (a in ...) - return textSpan(node, findNextToken((node).expression, node)); + // span in initializer + return spanInInitializerOfForLike(node); case SyntaxKind.SwitchStatement: // span on switch(...) - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.CaseClause: case SyntaxKind.DefaultClause: @@ -210,8 +190,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.EnumMember: - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: + case SyntaxKind.BindingElement: // span on complete node return textSpan(node); @@ -222,6 +201,10 @@ namespace ts.BreakpointResolver { case SyntaxKind.Decorator: return spanInNodeArray(node.parent.decorators); + case SyntaxKind.ObjectBindingPattern: + case SyntaxKind.ArrayBindingPattern: + return spanInBindingPattern(node); + // No breakpoint in interface, type alias case SyntaxKind.InterfaceDeclaration: case SyntaxKind.TypeAliasDeclaration: @@ -234,14 +217,17 @@ namespace ts.BreakpointResolver { case SyntaxKind.CommaToken: return spanInPreviousNode(node) - + case SyntaxKind.OpenBraceToken: return spanInOpenBraceToken(node); case SyntaxKind.CloseBraceToken: return spanInCloseBraceToken(node); - case SyntaxKind.OpenParenToken: + case SyntaxKind.CloseBracketToken: + return spanInCloseBracketToken(node); + + case SyntaxKind.OpenParenToken: return spanInOpenParenToken(node); case SyntaxKind.CloseParenToken: @@ -263,15 +249,93 @@ namespace ts.BreakpointResolver { case SyntaxKind.FinallyKeyword: return spanInNextNode(node); + case SyntaxKind.OfKeyword: + return spanInOfKeyword(node); + default: - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent).name === node) { - return spanInNode((node.parent).initializer); + // Destructuring pattern in destructuring assignment + // [a, b, c] of + // [a, b, c] = expression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + + // Set breakpoint on identifier element of destructuring pattern + // a or ...c or d: x from + // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + if ((node.kind === SyntaxKind.Identifier || + node.kind == SyntaxKind.SpreadElementExpression || + node.kind === SyntaxKind.PropertyAssignment || + node.kind === SyntaxKind.ShorthandPropertyAssignment) && + isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); } + if (node.kind === SyntaxKind.BinaryExpression) { + const binaryExpression = node; + // Set breakpoint in destructuring pattern if its destructuring assignment + // [a, b, c] or {a, b, c} of + // [a, b, c] = expression or + // {a, b, c} = expression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern( + binaryExpression.left); + } + + if (binaryExpression.operatorToken.kind === SyntaxKind.EqualsToken && + isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + // Set breakpoint on assignment expression element of destructuring pattern + // a = expression of + // [a = expression, b, c] = someExpression or + // { a = expression, b, c } = someExpression + return textSpan(node); + } + + if (binaryExpression.operatorToken.kind === SyntaxKind.CommaToken) { + return spanInNode(binaryExpression.left); + } + } + + if (isExpression(node)) { + switch (node.parent.kind) { + case SyntaxKind.DoStatement: + // Set span as if on while keyword + return spanInPreviousNode(node); + + case SyntaxKind.Decorator: + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + + case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: + return textSpan(node); + + case SyntaxKind.BinaryExpression: + if ((node.parent).operatorToken.kind === SyntaxKind.CommaToken) { + // if this is comma expression, the breakpoint is possible in this expression + return textSpan(node); + } + break; + + case SyntaxKind.ArrowFunction: + if ((node.parent).body === node) { + // If this is body of arrow function, it is allowed to have the breakpoint + return textSpan(node); + } + break; + } + } + + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.kind === SyntaxKind.PropertyAssignment && + (node.parent).name === node && + !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode((node.parent).initializer); + } + // Breakpoint in type assertion goes to its operand if (node.parent.kind === SyntaxKind.TypeAssertionExpression && (node.parent).type === node) { - return spanInNode((node.parent).expression); + return spanInNextNode((node.parent).type); } // return type of function go to previous token @@ -279,48 +343,70 @@ namespace ts.BreakpointResolver { return spanInPreviousNode(node); } + // initializer of variable/parameter declaration go to previous node + if ((node.parent.kind === SyntaxKind.VariableDeclaration || + node.parent.kind === SyntaxKind.Parameter)) { + const paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + } + + if (node.parent.kind === SyntaxKind.BinaryExpression) { + const binaryExpression = node.parent; + if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && + (binaryExpression.right === node || + binaryExpression.operatorToken === node)) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + } + // Default go to parent to set the breakpoint return spanInNode(node.parent); } } + function textSpanFromVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { + let declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] === variableDeclaration) { + // First declaration - include let keyword + return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + else { + // Span only on this declaration + return textSpan(variableDeclaration); + } + } + function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement || - variableDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement) { + if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement) { return spanInNode(variableDeclaration.parent.parent); } - - let isParentVariableStatement = variableDeclaration.parent.parent.kind === SyntaxKind.VariableStatement; - let isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === SyntaxKind.ForStatement && contains(((variableDeclaration.parent.parent).initializer).declarations, variableDeclaration); - let declarations = isParentVariableStatement - ? (variableDeclaration.parent.parent).declarationList.declarations - : isDeclarationOfForStatement - ? ((variableDeclaration.parent.parent).initializer).declarations - : undefined; + + // If this is a destructuring pattern set breakpoint in binding pattern + if (isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); + } // Breakpoint is possible in variableDeclaration only if there is initialization - if (variableDeclaration.initializer || (variableDeclaration.flags & NodeFlags.Export)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - // First declaration - include let keyword - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - Debug.assert(isDeclarationOfForStatement); - // Include let keyword from for statement declarations in the span - return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - // Span only on this declaration - return textSpan(variableDeclaration); - } + // or its declaration from 'for of' + if (variableDeclaration.initializer || + (variableDeclaration.flags & NodeFlags.Export) || + variableDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement) { + return textSpanFromVariableDeclaration(variableDeclaration); } - else if (declarations && declarations[0] !== variableDeclaration) { + + let declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] !== variableDeclaration) { // If we cant set breakpoint on this declaration, set it on previous one - let indexOfCurrentDeclaration = indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + // Because the variable declaration may be binding pattern and + // we would like to set breakpoint in last binding element if thats the case, + // use preceding token instead + return spanInNode(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } @@ -331,7 +417,11 @@ namespace ts.BreakpointResolver { } function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (isBindingPattern(parameter.name)) { + // set breakpoint in binding pattern + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -388,11 +478,11 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: case SyntaxKind.IfStatement: case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } @@ -400,17 +490,23 @@ namespace ts.BreakpointResolver { return spanInNode(block.statements[0]); } + function spanInInitializerOfForLike(forLikeStaement: ForStatement | ForOfStatement | ForInStatement): TextSpan { + if (forLikeStaement.initializer.kind === SyntaxKind.VariableDeclarationList) { + // declaration list, set breakpoint in first declaration + let variableDeclarationList = forLikeStaement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } + else { + // Expression - set breakpoint in it + return spanInNode(forLikeStaement.initializer); + } + } + function spanInForStatement(forStatement: ForStatement): TextSpan { if (forStatement.initializer) { - if (forStatement.initializer.kind === SyntaxKind.VariableDeclarationList) { - let variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } + return spanInInitializerOfForLike(forStatement); } if (forStatement.condition) { @@ -421,6 +517,45 @@ namespace ts.BreakpointResolver { } } + function spanInBindingPattern(bindingPattern: BindingPattern): TextSpan { + // Set breakpoint in first binding element + let firstBindingElement = forEach(bindingPattern.elements, + element => element.kind !== SyntaxKind.OmittedExpression ? element : undefined); + + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + + // Empty binding pattern of binding element, set breakpoint on binding element + if (bindingPattern.parent.kind === SyntaxKind.BindingElement) { + return textSpan(bindingPattern.parent); + } + + // Variable declaration is used as the span + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node: DestructuringPattern): TextSpan { + Debug.assert(node.kind !== SyntaxKind.ArrayBindingPattern && node.kind !== SyntaxKind.ObjectBindingPattern); + const elements: NodeArray = + node.kind === SyntaxKind.ArrayLiteralExpression ? + (node).elements : + (node).properties; + + const firstBindingElement = forEach(elements, + element => element.kind !== SyntaxKind.OmittedExpression ? element : undefined); + + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + + // Could be ArrayLiteral from destructuring assignment or + // just nested element in another destructuring assignment + // set breakpoint on assignment when parent is destructuring assignment + // Otherwise set breakpoint for this element + return textSpan(node.parent.kind === SyntaxKind.BinaryExpression ? node.parent : node); + } + // Tokens: function spanInOpenBraceToken(node: Node): TextSpan { switch (node.parent.kind) { @@ -472,18 +607,52 @@ namespace ts.BreakpointResolver { } return undefined; + case SyntaxKind.ObjectBindingPattern: + // Breakpoint in last binding element or binding pattern if it contains no elements + let bindingPattern = node.parent; + return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); + // Default to parent node default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + let objectLiteral = node.parent; + return textSpan(lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node.parent); + } + } + + function spanInCloseBracketToken(node: Node): TextSpan { + switch (node.parent.kind) { + case SyntaxKind.ArrayBindingPattern: + // Breakpoint in last binding element or binding pattern if it contains no elements + let bindingPattern = node.parent; + return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); + + default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + let arrayLiteral = node.parent; + return textSpan(lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + + // Default to parent node return spanInNode(node.parent); } } function spanInOpenParenToken(node: Node): TextSpan { - if (node.parent.kind === SyntaxKind.DoStatement) { - // Go to while keyword and do action instead + if (node.parent.kind === SyntaxKind.DoStatement || // Go to while keyword and do action instead + node.parent.kind === SyntaxKind.CallExpression || + node.parent.kind === SyntaxKind.NewExpression) { return spanInPreviousNode(node); } + if (node.parent.kind === SyntaxKind.ParenthesizedExpression) { + return spanInNextNode(node); + } + // Default to parent node return spanInNode(node.parent); } @@ -502,6 +671,10 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement: case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.ParenthesizedExpression: return spanInPreviousNode(node); // Default to parent node @@ -512,7 +685,9 @@ namespace ts.BreakpointResolver { function spanInColonToken(node: Node): TextSpan { // Is this : specifying return annotation of the function declaration - if (isFunctionLike(node.parent) || node.parent.kind === SyntaxKind.PropertyAssignment) { + if (isFunctionLike(node.parent) || + node.parent.kind === SyntaxKind.PropertyAssignment || + node.parent.kind === SyntaxKind.Parameter) { return spanInPreviousNode(node); } @@ -521,7 +696,7 @@ namespace ts.BreakpointResolver { function spanInGreaterThanOrLessThanToken(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.TypeAssertionExpression) { - return spanInNode((node.parent).expression); + return spanInNextNode(node); } return spanInNode(node.parent); @@ -530,7 +705,17 @@ namespace ts.BreakpointResolver { function spanInWhileKeyword(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.DoStatement) { // Set span on while expression - return textSpan(node, findNextToken((node.parent).expression, node.parent)); + return textSpanEndingAtNextToken(node, (node.parent).expression); + } + + // Default to parent node + return spanInNode(node.parent); + } + + function spanInOfKeyword(node: Node): TextSpan { + if (node.parent.kind === SyntaxKind.ForOfStatement) { + // set using next token + return spanInNextNode(node); } // Default to parent node diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 55adb7b7233..53a8c2b4307 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -121,7 +121,7 @@ namespace ts.formatting { function findOutermostParent(position: number, expectedTokenKind: SyntaxKind, sourceFile: SourceFile): Node { let precedingToken = findPrecedingToken(position, sourceFile); - + // when it is claimed that trigger character was typed at given position // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed). // If this condition is not hold - then trigger character was typed in some other context, @@ -151,7 +151,7 @@ namespace ts.formatting { return current; } - + // Returns true if node is a element in some list in parent // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent: Node, node: Node): boolean { @@ -198,7 +198,7 @@ namespace ts.formatting { if (!errors.length) { return rangeHasNoErrors; } - + // pick only errors that fall in range let sorted = errors .filter(d => rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) @@ -341,6 +341,14 @@ namespace ts.formatting { processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } + if (!formattingScanner.isOnToken()) { + let leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (leadingTrivia) { + processTrivia(leadingTrivia, enclosingNode, enclosingNode, undefined); + trimTrailingWhitespacesForRemainingRange(); + } + } + formattingScanner.close(); return edits; @@ -360,7 +368,9 @@ namespace ts.formatting { range: TextRange, inheritedIndentation: number): number { - if (rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (rangeOverlapsWithStartEnd(range, startPos, endPos) || + rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { + if (inheritedIndentation !== Constants.Unknown) { return inheritedIndentation; } @@ -826,9 +836,7 @@ namespace ts.formatting { } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = - (rule.Operation.Action & (RuleAction.NewLine | RuleAction.Space)) && - rule.Flag !== RuleFlags.CanDeleteNewLines; + trimTrailingWhitespaces = !(rule.Operation.Action & RuleAction.Delete) && rule.Flag !== RuleFlags.CanDeleteNewLines; } else { trimTrailingWhitespaces = true; @@ -927,17 +935,41 @@ namespace ts.formatting { continue; } - let pos = lineEndPosition; - while (pos >= lineStartPosition && isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== lineEndPosition) { - Debug.assert(pos === lineStartPosition || !isWhiteSpace(sourceFile.text.charCodeAt(pos))); - recordDelete(pos + 1, lineEndPosition - pos); + let whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + Debug.assert(whitespaceStart === lineStartPosition || !isWhiteSpace(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); } } } + /** + * @param start The position of the first character in range + * @param end The position of the last character in range + */ + function getTrailingWhitespaceStartPosition(start: number, end: number) { + let pos = end; + while (pos >= start && isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + + /** + * Trimming will be done for lines after the previous range + */ + function trimTrailingWhitespacesForRemainingRange() { + let startPosition = previousRange ? previousRange.end : originalRange.pos; + + let startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line; + let endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; + + trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); + } + function newTextChange(start: number, len: number, newText: string): TextChange { return { span: createTextSpan(start, len), newText } } diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index 58e2f304482..7a4cb0924d8 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -5,21 +5,22 @@ namespace ts.formatting { const standardScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, LanguageVariant.Standard); const jsxScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, LanguageVariant.JSX); - + /** * Scanner that is currently used for formatting */ let scanner: Scanner; - + export interface FormattingScanner { advance(): void; isOnToken(): boolean; readTokenInfo(n: Node): TokenInfo; + getCurrentLeadingTrivia(): TextRangeWithKind[]; lastTrailingTriviaWasNewLine(): boolean; close(): void; } - const enum ScanAction{ + const enum ScanAction { Scan, RescanGreaterThanToken, RescanSlashToken, @@ -37,19 +38,20 @@ namespace ts.formatting { let wasNewLine: boolean = true; let leadingTrivia: TextRangeWithKind[]; let trailingTrivia: TextRangeWithKind[]; - + let savedPos: number; let lastScanAction: ScanAction; let lastTokenInfo: TokenInfo; return { - advance: advance, - readTokenInfo: readTokenInfo, - isOnToken: isOnToken, + advance, + readTokenInfo, + isOnToken, + getCurrentLeadingTrivia: () => leadingTrivia, lastTrailingTriviaWasNewLine: () => wasNewLine, close: () => { Debug.assert(scanner !== undefined); - + lastTokenInfo = undefined; scanner.setText(undefined); scanner = undefined; @@ -58,7 +60,7 @@ namespace ts.formatting { function advance(): void { Debug.assert(scanner !== undefined); - + lastTokenInfo = undefined; let isStarted = scanner.getStartPos() !== startPos; @@ -81,7 +83,7 @@ namespace ts.formatting { let t: SyntaxKind; let pos = scanner.getStartPos(); - + // Read leading trivia and token while (pos < endPos) { let t = scanner.getToken(); @@ -122,10 +124,10 @@ namespace ts.formatting { return false; } - + function shouldRescanJsxIdentifier(node: Node): boolean { if (node.parent) { - switch(node.parent.kind) { + switch (node.parent.kind) { case SyntaxKind.JsxAttribute: case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxClosingElement: @@ -133,7 +135,7 @@ namespace ts.formatting { return node.kind === SyntaxKind.Identifier; } } - + return false; } @@ -142,7 +144,7 @@ namespace ts.formatting { } function shouldRescanTemplateToken(container: Node): boolean { - return container.kind === SyntaxKind.TemplateMiddle || + return container.kind === SyntaxKind.TemplateMiddle || container.kind === SyntaxKind.TemplateTail; } @@ -152,11 +154,11 @@ namespace ts.formatting { function readTokenInfo(n: Node): TokenInfo { Debug.assert(scanner !== undefined); - + if (!isOnToken()) { // scanner is not on the token (either advance was not called yet or scanner is already past the end position) return { - leadingTrivia: leadingTrivia, + leadingTrivia, trailingTrivia: undefined, token: undefined }; @@ -164,7 +166,7 @@ namespace ts.formatting { // normally scanner returns the smallest available token // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. - let expectedScanAction = + let expectedScanAction = shouldRescanGreaterThanToken(n) ? ScanAction.RescanGreaterThanToken : shouldRescanSlashToken(n) @@ -226,7 +228,7 @@ namespace ts.formatting { if (trailingTrivia) { trailingTrivia = undefined; } - while(scanner.getStartPos() < endPos) { + while (scanner.getStartPos() < endPos) { currentToken = scanner.scan(); if (!isTrivia(currentToken)) { break; @@ -261,7 +263,7 @@ namespace ts.formatting { function isOnToken(): boolean { Debug.assert(scanner !== undefined); - + let current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); let startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); return startPos < endPos && current !== SyntaxKind.EndOfFileToken && !isTrivia(current); diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index de4761f57d2..2df78df01dc 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -219,9 +219,11 @@ namespace ts.formatting { public SpaceBetweenAsyncAndFunctionKeyword: Rule; // Template strings - public SpaceBetweenTagAndTemplateString: Rule; + public NoSpaceBetweenTagAndTemplateString: Rule; public NoSpaceAfterTemplateHeadAndMiddle: Rule; + public SpaceAfterTemplateHeadAndMiddle: Rule; public NoSpaceBeforeTemplateMiddleAndTail: Rule; + public SpaceBeforeTemplateMiddleAndTail: Rule; constructor() { /// @@ -376,9 +378,7 @@ namespace ts.formatting { this.SpaceBetweenAsyncAndFunctionKeyword = new Rule(RuleDescriptor.create1(SyntaxKind.AsyncKeyword, SyntaxKind.FunctionKeyword), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); // template string - this.SpaceBetweenTagAndTemplateString = new Rule(RuleDescriptor.create3(SyntaxKind.Identifier, Shared.TokenRange.FromTokens([SyntaxKind.NoSubstitutionTemplateLiteral, SyntaxKind.TemplateHead])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); - this.NoSpaceAfterTemplateHeadAndMiddle = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.TemplateHead, SyntaxKind.TemplateMiddle]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); - this.NoSpaceBeforeTemplateMiddleAndTail = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.TemplateMiddle, SyntaxKind.TemplateTail])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.NoSpaceBetweenTagAndTemplateString = new Rule(RuleDescriptor.create3(SyntaxKind.Identifier, Shared.TokenRange.FromTokens([SyntaxKind.NoSubstitutionTemplateLiteral, SyntaxKind.TemplateHead])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ @@ -406,7 +406,7 @@ namespace ts.formatting { this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, this.SpaceAfterVoidOperator, this.SpaceBetweenAsyncAndOpenParen, this.SpaceBetweenAsyncAndFunctionKeyword, - this.SpaceBetweenTagAndTemplateString, this.NoSpaceAfterTemplateHeadAndMiddle, this.NoSpaceBeforeTemplateMiddleAndTail, + this.NoSpaceBetweenTagAndTemplateString, // TypeScript-specific rules this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, @@ -444,7 +444,7 @@ namespace ts.formatting { /// // Insert space after comma delimiter - this.SpaceAfterComma = new Rule(RuleDescriptor.create3(SyntaxKind.CommaToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + this.SpaceAfterComma = new Rule(RuleDescriptor.create3(SyntaxKind.CommaToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNextTokenNotCloseBracket), RuleAction.Space)); this.NoSpaceAfterComma = new Rule(RuleDescriptor.create3(SyntaxKind.CommaToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); // Insert space before and after binary operators @@ -485,6 +485,12 @@ namespace ts.formatting { this.NoSpaceAfterOpenBracket = new Rule(RuleDescriptor.create3(SyntaxKind.OpenBracketToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); this.NoSpaceBeforeCloseBracket = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.CloseBracketToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + // Insert space after opening and before closing template string braces + this.NoSpaceAfterTemplateHeadAndMiddle = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.TemplateHead, SyntaxKind.TemplateMiddle]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.SpaceAfterTemplateHeadAndMiddle = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.TemplateHead, SyntaxKind.TemplateMiddle]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + this.NoSpaceBeforeTemplateMiddleAndTail = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.TemplateMiddle, SyntaxKind.TemplateTail])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.SpaceBeforeTemplateMiddleAndTail = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.TemplateMiddle, SyntaxKind.TemplateTail])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + // Insert space after function keyword for anonymous functions this.SpaceAfterAnonymousFunctionKeyword = new Rule(RuleDescriptor.create1(SyntaxKind.FunctionKeyword, SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); this.NoSpaceAfterAnonymousFunctionKeyword = new Rule(RuleDescriptor.create1(SyntaxKind.FunctionKeyword, SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Delete)); @@ -705,6 +711,10 @@ namespace ts.formatting { return context.currentTokenSpan.kind !== SyntaxKind.CommaToken; } + static IsNextTokenNotCloseBracket(context: FormattingContext): boolean { + return context.nextTokenSpan.kind !== SyntaxKind.CloseBracketToken; + } + static IsArrowFunctionContext(context: FormattingContext): boolean { return context.contextNode.kind === SyntaxKind.ArrowFunction; } diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index f6cf1de474b..48a783dd0c6 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -71,15 +71,24 @@ namespace ts.formatting { rules.push(this.globalRules.NoSpaceBetweenParens); } - if ( options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ) { - rules.push( this.globalRules.SpaceAfterOpenBracket ); - rules.push( this.globalRules.SpaceBeforeCloseBracket ); - rules.push( this.globalRules.NoSpaceBetweenBrackets ); + if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets) { + rules.push(this.globalRules.SpaceAfterOpenBracket); + rules.push(this.globalRules.SpaceBeforeCloseBracket); + rules.push(this.globalRules.NoSpaceBetweenBrackets); } else { - rules.push( this.globalRules.NoSpaceAfterOpenBracket ); - rules.push( this.globalRules.NoSpaceBeforeCloseBracket ); - rules.push( this.globalRules.NoSpaceBetweenBrackets ); + rules.push(this.globalRules.NoSpaceAfterOpenBracket); + rules.push(this.globalRules.NoSpaceBeforeCloseBracket); + rules.push(this.globalRules.NoSpaceBetweenBrackets); + } + + if (options.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces) { + rules.push(this.globalRules.SpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.SpaceBeforeTemplateMiddleAndTail); + } + else { + rules.push(this.globalRules.NoSpaceAfterTemplateHeadAndMiddle); + rules.push(this.globalRules.NoSpaceBeforeTemplateMiddleAndTail); } if (options.InsertSpaceAfterSemicolonInForStatements) { diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 067118fd7a8..8e0fef884e7 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -450,8 +450,9 @@ namespace ts.formatting { case SyntaxKind.ConditionalExpression: case SyntaxKind.ArrayBindingPattern: case SyntaxKind.ObjectBindingPattern: - case SyntaxKind.JsxElement: + case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxSelfClosingElement: + case SyntaxKind.JsxExpression: case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: @@ -467,6 +468,7 @@ namespace ts.formatting { return false; } + /* @internal */ export function nodeWillIndentChild(parent: TextRangeWithKind, child: TextRangeWithKind, indentByDefault: boolean) { let childKind = child ? child.kind : SyntaxKind.Unknown; switch (parent.kind) { @@ -484,6 +486,8 @@ namespace ts.formatting { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: return childKind !== SyntaxKind.Block; + case SyntaxKind.JsxElement: + return childKind !== SyntaxKind.JsxClosingElement; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 2a0abba8695..8022e2fad7a 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -3,19 +3,19 @@ namespace ts.NavigateTo { type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration }; export function getNavigateToItems(program: Program, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number): NavigateToItem[] { - let patternMatcher = createPatternMatcher(searchValue); + const patternMatcher = createPatternMatcher(searchValue); let rawItems: RawNavigateToItem[] = []; // This means "compare in a case insensitive manner." - let baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" }; + const baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" }; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] forEach(program.getSourceFiles(), sourceFile => { cancellationToken.throwIfCancellationRequested(); - let nameToDeclarations = sourceFile.getNamedDeclarations(); - for (let name in nameToDeclarations) { - let declarations = getProperty(nameToDeclarations, name); + const nameToDeclarations = sourceFile.getNamedDeclarations(); + for (const name in nameToDeclarations) { + const declarations = getProperty(nameToDeclarations, name); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. @@ -25,11 +25,11 @@ namespace ts.NavigateTo { continue; } - for (let declaration of declarations) { + for (const declaration of declarations) { // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. if (patternMatcher.patternContainsDots) { - let containers = getContainers(declaration); + const containers = getContainers(declaration); if (!containers) { return undefined; } @@ -41,8 +41,8 @@ namespace ts.NavigateTo { } } - let fileName = sourceFile.fileName; - let matchKind = bestMatchKind(matches); + const fileName = sourceFile.fileName; + const matchKind = bestMatchKind(matches); rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration }); } } @@ -54,7 +54,7 @@ namespace ts.NavigateTo { rawItems = rawItems.slice(0, maxResultCount); } - let items = map(rawItems, createNavigateToItem); + const items = map(rawItems, createNavigateToItem); return items; @@ -62,7 +62,7 @@ namespace ts.NavigateTo { Debug.assert(matches.length > 0); // This is a case sensitive match, only if all the submatches were case sensitive. - for (let match of matches) { + for (const match of matches) { if (!match.isCaseSensitive) { return false; } @@ -86,16 +86,16 @@ namespace ts.NavigateTo { function tryAddSingleDeclarationName(declaration: Declaration, containers: string[]) { if (declaration && declaration.name) { - let text = getTextOfIdentifierOrLiteral(declaration.name); + const text = getTextOfIdentifierOrLiteral(declaration.name); if (text !== undefined) { containers.unshift(text); } else if (declaration.name.kind === SyntaxKind.ComputedPropertyName) { - return tryAddComputedPropertyName((declaration.name).expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName((declaration.name).expression, containers, /*includeLastPortion*/ true); } else { // Don't know how to add this. - return false + return false; } } @@ -106,7 +106,7 @@ namespace ts.NavigateTo { // // [X.Y.Z]() { } function tryAddComputedPropertyName(expression: Expression, containers: string[], includeLastPortion: boolean): boolean { - let text = getTextOfIdentifierOrLiteral(expression); + const text = getTextOfIdentifierOrLiteral(expression); if (text !== undefined) { if (includeLastPortion) { containers.unshift(text); @@ -115,24 +115,24 @@ namespace ts.NavigateTo { } if (expression.kind === SyntaxKind.PropertyAccessExpression) { - let propertyAccess = expression; + const propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion:*/ true); + return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); } return false; } function getContainers(declaration: Declaration) { - let containers: string[] = []; + const containers: string[] = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. if (declaration.name.kind === SyntaxKind.ComputedPropertyName) { - if (!tryAddComputedPropertyName((declaration.name).expression, containers, /*includeLastPortion:*/ false)) { + if (!tryAddComputedPropertyName((declaration.name).expression, containers, /*includeLastPortion*/ false)) { return undefined; } } @@ -155,8 +155,8 @@ namespace ts.NavigateTo { Debug.assert(matches.length > 0); let bestMatchKind = PatternMatchKind.camelCase; - for (let match of matches) { - let kind = match.kind; + for (const match of matches) { + const kind = match.kind; if (kind < bestMatchKind) { bestMatchKind = kind; } @@ -171,13 +171,13 @@ namespace ts.NavigateTo { // We first sort case insensitively. So "Aaa" will come before "bar". // Then we sort case sensitively, so "aaa" will come before "Aaa". return i1.matchKind - i2.matchKind || - i1.name.localeCompare(i2.name, undefined, baseSensitivity) || + i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); } function createNavigateToItem(rawItem: RawNavigateToItem): NavigateToItem { - let declaration = rawItem.declaration; - let container = getContainerNode(declaration); + const declaration = rawItem.declaration; + const container = getContainerNode(declaration); return { name: rawItem.name, kind: getNodeKind(declaration), diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 08b089cd75e..fa4f46b5010 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,180 +1,179 @@ /* @internal */ -namespace ts { - export module OutliningElementsCollector { - export function collectElements(sourceFile: SourceFile): OutliningSpan[] { - let elements: OutliningSpan[] = []; - let collapseText = "..."; +namespace ts.OutliningElementsCollector { + export function collectElements(sourceFile: SourceFile): OutliningSpan[] { + const elements: OutliningSpan[] = []; + const collapseText = "..."; - function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) { - if (hintSpanNode && startElement && endElement) { - let span: OutliningSpan = { - textSpan: createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), - bannerText: collapseText, - autoCollapse: autoCollapse - }; - elements.push(span); - } + function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) { + if (hintSpanNode && startElement && endElement) { + const span: OutliningSpan = { + textSpan: createTextSpanFromBounds(startElement.pos, endElement.end), + hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); } + } - function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) { - if (commentSpan) { - let span: OutliningSpan = { - textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), - hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), - bannerText: collapseText, - autoCollapse: autoCollapse - }; - elements.push(span); - } + function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) { + if (commentSpan) { + const span: OutliningSpan = { + textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); } + } - function addOutliningForLeadingCommentsForNode(n: Node) { - let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + function addOutliningForLeadingCommentsForNode(n: Node) { + const comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); - if (comments) { - let firstSingleLineCommentStart = -1; - let lastSingleLineCommentEnd = -1; - let isFirstSingleLineComment = true; - let singleLineCommentCount = 0; + if (comments) { + let firstSingleLineCommentStart = -1; + let lastSingleLineCommentEnd = -1; + let isFirstSingleLineComment = true; + let singleLineCommentCount = 0; - for (let currentComment of comments) { + for (const currentComment of comments) { - // For single line comments, combine consecutive ones (2 or more) into - // a single span from the start of the first till the end of the last - if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) { - if (isFirstSingleLineComment) { - firstSingleLineCommentStart = currentComment.pos; - } - isFirstSingleLineComment = false; - lastSingleLineCommentEnd = currentComment.end; - singleLineCommentCount++; + // For single line comments, combine consecutive ones (2 or more) into + // a single span from the start of the first till the end of the last + if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; } - else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) { - combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); - addOutliningSpanComments(currentComment, /*autoCollapse*/ false); + isFirstSingleLineComment = false; + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + addOutliningSpanComments(currentComment, /*autoCollapse*/ false); - singleLineCommentCount = 0; - lastSingleLineCommentEnd = -1; - isFirstSingleLineComment = true; + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; + } + } + + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + + function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { + + // Only outline spans of two or more consecutive single line comments + if (count > 1) { + const multipleSingleLineComments = { + pos: start, + end: end, + kind: SyntaxKind.SingleLineCommentTrivia + }; + + addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); + } + } + + function autoCollapse(node: Node) { + return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction; + } + + let depth = 0; + const maxDepth = 20; + function walk(n: Node): void { + if (depth > maxDepth) { + return; + } + + if (isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } + + switch (n.kind) { + case SyntaxKind.Block: + if (!isFunctionBlock(n)) { + const parent = n.parent; + const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + + // Check if the block is standalone, or 'attached' to some parent statement. + // If the latter, we want to collaps the block, but consider its hint span + // to be the entire span of the parent. + if (parent.kind === SyntaxKind.DoStatement || + parent.kind === SyntaxKind.ForInStatement || + parent.kind === SyntaxKind.ForOfStatement || + parent.kind === SyntaxKind.ForStatement || + parent.kind === SyntaxKind.IfStatement || + parent.kind === SyntaxKind.WhileStatement || + parent.kind === SyntaxKind.WithStatement || + parent.kind === SyntaxKind.CatchClause) { + + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + break; } - } - - combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); - } - } - - function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { - // Only outline spans of two or more consecutive single line comments - if (count > 1) { - let multipleSingleLineComments = { - pos: start, - end: end, - kind: SyntaxKind.SingleLineCommentTrivia - } - - addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); - } - } - - function autoCollapse(node: Node) { - return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction; - } - - let depth = 0; - let maxDepth = 20; - function walk(n: Node): void { - if (depth > maxDepth) { - return; - } - - if (isDeclaration(n)) { - addOutliningForLeadingCommentsForNode(n); - } - - switch (n.kind) { - case SyntaxKind.Block: - if (!isFunctionBlock(n)) { - let parent = n.parent; - let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); - let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - - // Check if the block is standalone, or 'attached' to some parent statement. - // If the latter, we want to collaps the block, but consider its hint span - // to be the entire span of the parent. - if (parent.kind === SyntaxKind.DoStatement || - parent.kind === SyntaxKind.ForInStatement || - parent.kind === SyntaxKind.ForOfStatement || - parent.kind === SyntaxKind.ForStatement || - parent.kind === SyntaxKind.IfStatement || - parent.kind === SyntaxKind.WhileStatement || - parent.kind === SyntaxKind.WithStatement || - parent.kind === SyntaxKind.CatchClause) { + if (parent.kind === SyntaxKind.TryStatement) { + // Could be the try-block, or the finally-block. + const tryStatement = parent; + if (tryStatement.tryBlock === n) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } - - if (parent.kind === SyntaxKind.TryStatement) { - // Could be the try-block, or the finally-block. - let tryStatement = parent; - if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + else if (tryStatement.finallyBlock === n) { + const finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); + if (finallyKeyword) { + addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; } - else if (tryStatement.finallyBlock === n) { - let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); - if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); - break; - } - } - - // fall through. } - // Block was a standalone block. In this case we want to only collapse - // the span of the block, independent of any parent span. - let span = createTextSpanFromBounds(n.getStart(), n.end); - elements.push({ - textSpan: span, - hintSpan: span, - bannerText: collapseText, - autoCollapse: autoCollapse(n) - }); - break; + // fall through. } - // Fallthrough. - case SyntaxKind.ModuleBlock: { - let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); - let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + // Block was a standalone block. In this case we want to only collapse + // the span of the block, independent of any parent span. + const span = createTextSpanFromBounds(n.getStart(), n.end); + elements.push({ + textSpan: span, + hintSpan: span, + bannerText: collapseText, + autoCollapse: autoCollapse(n) + }); break; } - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.CaseBlock: { - let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); - let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); - break; - } - case SyntaxKind.ArrayLiteralExpression: - let openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile); - let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); - break; + // Fallthrough. + + case SyntaxKind.ModuleBlock: { + const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + break; } - depth++; - forEachChild(n, walk); - depth--; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.CaseBlock: { + const openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + break; + } + case SyntaxKind.ArrayLiteralExpression: + const openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile); + const closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); + break; } - - walk(sourceFile); - return elements; + depth++; + forEachChild(n, walk); + depth--; } + + walk(sourceFile); + return elements; } } \ No newline at end of file diff --git a/src/services/patternMatcher.ts b/src/services/patternMatcher.ts index ea433867c46..93cc5130d72 100644 --- a/src/services/patternMatcher.ts +++ b/src/services/patternMatcher.ts @@ -8,10 +8,10 @@ namespace ts { camelCase } - // Information about a match made by the pattern matcher between a candidate and the + // Information about a match made by the pattern matcher between a candidate and the // search pattern. export interface PatternMatch { - // What kind of match this was. Exact matches are better than prefix matches which are + // What kind of match this was. Exact matches are better than prefix matches which are // better than substring matches which are better than CamelCase matches. kind: PatternMatchKind; @@ -19,7 +19,7 @@ namespace ts { // it was a better match. camelCaseWeight?: number; - // If this was a match where all constituent parts of the candidate and search pattern + // If this was a match where all constituent parts of the candidate and search pattern // matched case sensitively or case insensitively. Case sensitive matches of the kind // are better matches than insensitive matches. isCaseSensitive: boolean; @@ -35,7 +35,7 @@ namespace ts { // once you no longer need it. export interface PatternMatcher { // Used to match a candidate against the last segment of a possibly dotted pattern. This - // is useful as a quick check to prevent having to compute a container before calling + // is useful as a quick check to prevent having to compute a container before calling // "getMatches". // // For example, if the search pattern is "ts.c.SK" and the candidate is "SyntaxKind", then @@ -55,8 +55,8 @@ namespace ts { } // First we break up the pattern given by dots. Each portion of the pattern between the - // dots is a 'Segment'. The 'Segment' contains information about the entire section of - // text between the dots, as well as information about any individual 'Words' that we + // dots is a 'Segment'. The 'Segment' contains information about the entire section of + // text between the dots, as well as information about any individual 'Words' that we // can break the segment into. A 'Word' is simply a contiguous sequence of characters // that can appear in a typescript identifier. So "GetKeyword" would be one word, while // "Get Keyword" would be two words. Once we have the individual 'words', we break those @@ -64,20 +64,20 @@ namespace ts { // word, it make character spans corresponding to "U", "I" and "Element". These spans // are then used when doing camel cased matches against candidate patterns. interface Segment { - // Information about the entire piece of text between the dots. For example, if the - // text between the dots is 'GetKeyword', then TotalTextChunk.Text will be 'GetKeyword' and + // Information about the entire piece of text between the dots. For example, if the + // text between the dots is 'GetKeyword', then TotalTextChunk.Text will be 'GetKeyword' and // TotalTextChunk.CharacterSpans will correspond to 'Get', 'Keyword'. totalTextChunk: TextChunk; - // Information about the subwords compromising the total word. For example, if the - // text between the dots is 'GetFoo KeywordBar', then the subwords will be 'GetFoo' - // and 'KeywordBar'. Those individual words will have CharacterSpans of ('Get' and - // 'Foo') and('Keyword' and 'Bar') respectively. + // Information about the subwords compromising the total word. For example, if the + // text between the dots is 'GetFoo KeywordBar', then the subwords will be 'GetFoo' + // and 'KeywordBar'. Those individual words will have CharacterSpans of ('Get' and + // 'Foo') and('Keyword' and 'Bar') respectively. subWordTextChunks: TextChunk[]; } - // Information about a chunk of text from the pattern. The chunk is a piece of text, with - // cached information about the character spans within in. Character spans are used for + // Information about a chunk of text from the pattern. The chunk is a piece of text, with + // cached information about the character spans within in. Character spans are used for // camel case matching. interface TextChunk { // The text of the chunk. This should be a contiguous sequence of character that could @@ -92,9 +92,9 @@ namespace ts { // for something entirely lowercase or not. isLowerCase: boolean; - // The spans in this text chunk that we think are of interest and should be matched + // The spans in this text chunk that we think are of interest and should be matched // independently. For example, if the chunk is for "UIElement" the the spans of interest - // correspond to "U", "I" and "Element". If "UIElement" isn't found as an exaxt, prefix. + // correspond to "U", "I" and "Element". If "UIElement" isn't found as an exact, prefix. // or substring match, then the character spans will be used to attempt a camel case match. characterSpans: TextSpan[]; } @@ -110,20 +110,19 @@ namespace ts { export function createPatternMatcher(pattern: string): PatternMatcher { // We'll often see the same candidate string many times when searching (For example, when - // we see the name of a module that is used everywhere, or the name of an overload). As - // such, we cache the information we compute about the candidate for the life of this + // we see the name of a module that is used everywhere, or the name of an overload). As + // such, we cache the information we compute about the candidate for the life of this // pattern matcher so we don't have to compute it multiple times. - let stringToWordSpans: Map = {}; + const stringToWordSpans: Map = {}; pattern = pattern.trim(); - let fullPatternSegment = createSegment(pattern); - let dotSeparatedSegments = pattern.split(".").map(p => createSegment(p.trim())); - let invalidPattern = dotSeparatedSegments.length === 0 || forEach(dotSeparatedSegments, segmentIsInvalid); + const dotSeparatedSegments = pattern.split(".").map(p => createSegment(p.trim())); + const invalidPattern = dotSeparatedSegments.length === 0 || forEach(dotSeparatedSegments, segmentIsInvalid); return { getMatches, - getMatchesForLastSegmentOfPattern, + getMatchesForLastSegmentOfPattern, patternContainsDots: dotSeparatedSegments.length > 1 }; @@ -131,7 +130,7 @@ namespace ts { function skipMatch(candidate: string) { return invalidPattern || !candidate; } - + function getMatchesForLastSegmentOfPattern(candidate: string): PatternMatch[] { if (skipMatch(candidate)) { return undefined; @@ -148,7 +147,7 @@ namespace ts { // First, check that the last part of the dot separated pattern matches the name of the // candidate. If not, then there's no point in proceeding and doing the more // expensive work. - let candidateMatch = matchSegment(candidate, lastOrUndefined(dotSeparatedSegments)); + const candidateMatch = matchSegment(candidate, lastOrUndefined(dotSeparatedSegments)); if (!candidateMatch) { return undefined; } @@ -165,16 +164,16 @@ namespace ts { // So far so good. Now break up the container for the candidate and check if all // the dotted parts match up correctly. - let totalMatch = candidateMatch; + const totalMatch = candidateMatch; for (let i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; - i--, j--) { + i -= 1, j -= 1) { - let segment = dotSeparatedSegments[i]; - let containerName = candidateContainers[j]; + const segment = dotSeparatedSegments[i]; + const containerName = candidateContainers[j]; - let containerMatch = matchSegment(containerName, segment); + const containerMatch = matchSegment(containerName, segment); if (!containerMatch) { // This container didn't match the pattern piece. So there's no match at all. return undefined; @@ -197,7 +196,7 @@ namespace ts { } function matchTextChunk(candidate: string, chunk: TextChunk, punctuationStripped: boolean): PatternMatch { - let index = indexOfIgnoringCase(candidate, chunk.textLowerCase); + const index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { // a) Check if the part matches the candidate entirely, in an case insensitive or @@ -211,18 +210,18 @@ namespace ts { } } - let isLowercase = chunk.isLowerCase; + const isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { // c) If the part is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of some // word part. That way we don't match something like 'Class' when the user types 'a'. // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). - let wordSpans = getWordSpans(candidate); - for (let span of wordSpans) { + const wordSpans = getWordSpans(candidate); + for (const span of wordSpans) { if (partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, /*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ false)); @@ -242,7 +241,7 @@ namespace ts { if (!isLowercase) { // e) If the part was not entirely lowercase, then attempt a camel cased match as well. if (chunk.characterSpans.length > 0) { - let candidateParts = getWordSpans(candidate); + const candidateParts = getWordSpans(candidate); let camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, /*ignoreCase:*/ false); if (camelCaseWeight !== undefined) { return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, /*isCaseSensitive:*/ true, /*camelCaseWeight:*/ camelCaseWeight); @@ -259,8 +258,8 @@ namespace ts { // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? // We could check every character boundary start of the candidate for the pattern. However, that's - // an m * n operation in the wost case. Instead, find the first instance of the pattern - // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to + // an m * n operation in the wost case. Instead, find the first instance of the pattern + // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to // filter the list based on a substring that starts on a capital letter and also with a lowercase one. // (Pattern: fogbar, Candidate: quuxfogbarFogBar). if (chunk.text.length < candidate.length) { @@ -275,7 +274,7 @@ namespace ts { function containsSpaceOrAsterisk(text: string): boolean { for (let i = 0; i < text.length; i++) { - let ch = text.charCodeAt(i); + const ch = text.charCodeAt(i); if (ch === CharacterCodes.space || ch === CharacterCodes.asterisk) { return true; } @@ -293,7 +292,7 @@ namespace ts { // Note: if the segment contains a space or an asterisk then we must assume that it's a // multi-word segment. if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { - let match = matchTextChunk(candidate, segment.totalTextChunk, /*punctuationStripped:*/ false); + const match = matchTextChunk(candidate, segment.totalTextChunk, /*punctuationStripped:*/ false); if (match) { return [match]; } @@ -317,7 +316,7 @@ namespace ts { // // c) If the word is entirely lowercase, then check if it is contained anywhere in the // candidate in a case insensitive manner. If so, return that there was a substring - // match. + // match. // // Note: We only have a substring match if the lowercase part is prefix match of // some word part. That way we don't match something like 'Class' when the user @@ -331,17 +330,17 @@ namespace ts { // e) If the word was not entirely lowercase, then attempt a camel cased match as // well. // - // f) The word is all lower case. Is it a case insensitive substring of the candidate starting + // f) The word is all lower case. Is it a case insensitive substring of the candidate starting // on a part boundary of the candidate? // // Only if all words have some sort of match is the pattern considered matched. - let subWordTextChunks = segment.subWordTextChunks; + const subWordTextChunks = segment.subWordTextChunks; let matches: PatternMatch[] = undefined; - for (let subWordTextChunk of subWordTextChunks) { + for (const subWordTextChunk of subWordTextChunks) { // Try to match the candidate with this word - let result = matchTextChunk(candidate, subWordTextChunk, /*punctuationStripped:*/ true); + const result = matchTextChunk(candidate, subWordTextChunk, /*punctuationStripped:*/ true); if (!result) { return undefined; } @@ -354,18 +353,18 @@ namespace ts { } function partStartsWith(candidate: string, candidateSpan: TextSpan, pattern: string, ignoreCase: boolean, patternSpan?: TextSpan): boolean { - let patternPartStart = patternSpan ? patternSpan.start : 0; - let patternPartLength = patternSpan ? patternSpan.length : pattern.length; + const patternPartStart = patternSpan ? patternSpan.start : 0; + const patternPartLength = patternSpan ? patternSpan.length : pattern.length; if (patternPartLength > candidateSpan.length) { // Pattern part is longer than the candidate part. There can never be a match. return false; } - + if (ignoreCase) { for (let i = 0; i < patternPartLength; i++) { - let ch1 = pattern.charCodeAt(patternPartStart + i); - let ch2 = candidate.charCodeAt(candidateSpan.start + i); + const ch1 = pattern.charCodeAt(patternPartStart + i); + const ch2 = candidate.charCodeAt(candidateSpan.start + i); if (toLowerCase(ch1) !== toLowerCase(ch2)) { return false; } @@ -373,8 +372,8 @@ namespace ts { } else { for (let i = 0; i < patternPartLength; i++) { - let ch1 = pattern.charCodeAt(patternPartStart + i); - let ch2 = candidate.charCodeAt(candidateSpan.start + i); + const ch1 = pattern.charCodeAt(patternPartStart + i); + const ch2 = candidate.charCodeAt(candidateSpan.start + i); if (ch1 !== ch2) { return false; } @@ -385,12 +384,12 @@ namespace ts { } function tryCamelCaseMatch(candidate: string, candidateParts: TextSpan[], chunk: TextChunk, ignoreCase: boolean): number { - let chunkCharacterSpans = chunk.characterSpans; + const chunkCharacterSpans = chunk.characterSpans; // Note: we may have more pattern parts than candidate parts. This is because multiple // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U - // and I will both match in UI. + // and I will both match in UI. let currentCandidate = 0; let currentChunkSpan = 0; @@ -426,14 +425,14 @@ namespace ts { // Consider the case of matching SiUI against SimpleUIElement. The candidate parts // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to - // still keep matching pattern parts against that candidate part. + // still keep matching pattern parts against that candidate part. for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { - let chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; + const chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { // We've already gotten one pattern part match in this candidate. We will // only continue trying to consumer pattern parts if the last part and this - // part are both upper case. + // part are both upper case. if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; @@ -470,55 +469,11 @@ namespace ts { } } - // Helper function to compare two matches to determine which is better. Matches are first - // ordered by kind (so all prefix matches always beat all substring matches). Then, if the - // match is a camel case match, the relative weights of the match are used to determine - // which is better (with a greater weight being better). Then if the match is of the same - // type, then a case sensitive match is considered better than an insensitive one. - function patternMatchCompareTo(match1: PatternMatch, match2: PatternMatch): number { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); - } - - function comparePunctuation(result1: PatternMatch, result2: PatternMatch) { - // Consider a match to be better if it was successful without stripping punctuation - // versus a match that had to strip punctuation to succeed. - if (result1.punctuationStripped !== result2.punctuationStripped) { - return result1.punctuationStripped ? 1 : -1; - } - - return 0; - } - - function compareCase(result1: PatternMatch, result2: PatternMatch) { - if (result1.isCaseSensitive !== result2.isCaseSensitive) { - return result1.isCaseSensitive ? -1 : 1; - } - - return 0; - } - - function compareType(result1: PatternMatch, result2: PatternMatch) { - return result1.kind - result2.kind; - } - - function compareCamelCase(result1: PatternMatch, result2: PatternMatch) { - if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { - // Swap the values here. If result1 has a higher weight, then we want it to come - // first. - return result2.camelCaseWeight - result1.camelCaseWeight; - } - - return 0; - } - function createSegment(text: string): Segment { return { totalTextChunk: createTextChunk(text), subWordTextChunks: breakPatternIntoTextChunks(text) - } + }; } // A segment is considered invalid if we couldn't find any words in it. @@ -536,9 +491,9 @@ namespace ts { return false; } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. - let str = String.fromCharCode(ch); + const str = String.fromCharCode(ch); return str === str.toUpperCase(); } @@ -553,22 +508,12 @@ namespace ts { } - // TODO: find a way to determine this for any unicode characters in a + // TODO: find a way to determine this for any unicode characters in a // non-allocating manner. - let str = String.fromCharCode(ch); + const str = String.fromCharCode(ch); return str === str.toLowerCase(); } - function containsUpperCaseLetter(string: string): boolean { - for (let i = 0, n = string.length; i < n; i++) { - if (isUpperCaseLetter(string.charCodeAt(i))) { - return true; - } - } - - return false; - } - function startsWith(string: string, search: string) { for (let i = 0, n = search.length; i < n; i++) { if (string.charCodeAt(i) !== search.charCodeAt(i)) { @@ -593,8 +538,8 @@ namespace ts { // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string: string, value: string, start: number): boolean { for (let i = 0, n = value.length; i < n; i++) { - let ch1 = toLowerCase(string.charCodeAt(i + start)); - let ch2 = value.charCodeAt(i); + const ch1 = toLowerCase(string.charCodeAt(i + start)); + const ch2 = value.charCodeAt(i); if (ch1 !== ch2) { return false; @@ -614,7 +559,7 @@ namespace ts { return ch; } - // TODO: find a way to compute this for any unicode characters in a + // TODO: find a way to compute this for any unicode characters in a // non-allocating manner. return String.fromCharCode(ch).toLowerCase().charCodeAt(0); } @@ -629,16 +574,17 @@ namespace ts { } function breakPatternIntoTextChunks(pattern: string): TextChunk[] { - let result: TextChunk[] = []; + const result: TextChunk[] = []; let wordStart = 0; let wordLength = 0; for (let i = 0; i < pattern.length; i++) { - let ch = pattern.charCodeAt(i); + const ch = pattern.charCodeAt(i); if (isWordChar(ch)) { - if (wordLength++ === 0) { + if (wordLength === 0) { wordStart = i; } + wordLength++; } else { if (wordLength > 0) { @@ -656,13 +602,13 @@ namespace ts { } function createTextChunk(text: string): TextChunk { - let textLowerCase = text.toLowerCase(); + const textLowerCase = text.toLowerCase(); return { text, textLowerCase, isLowerCase: text === textLowerCase, characterSpans: breakIntoCharacterSpans(text) - } + }; } /* @internal */ export function breakIntoCharacterSpans(identifier: string): TextSpan[] { @@ -674,15 +620,15 @@ namespace ts { } function breakIntoSpans(identifier: string, word: boolean): TextSpan[] { - let result: TextSpan[] = []; + const result: TextSpan[] = []; let wordStart = 0; for (let i = 1, n = identifier.length; i < n; i++) { - let lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); - let currentIsDigit = isDigit(identifier.charCodeAt(i)); + const lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); + const currentIsDigit = isDigit(identifier.charCodeAt(i)); - let hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); - let hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); + const hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); + const hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || @@ -738,7 +684,7 @@ namespace ts { function isAllPunctuation(identifier: string, start: number, end: number): boolean { for (let i = start; i < end; i++) { - let ch = identifier.charCodeAt(i); + const ch = identifier.charCodeAt(i); // We don't consider _ or $ as punctuation as there may be things with that name. if (!charIsPunctuation(ch) || ch === CharacterCodes._ || ch === CharacterCodes.$) { @@ -759,8 +705,8 @@ namespace ts { // etc. if (index !== wordStart && index + 1 < identifier.length) { - let currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - let nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); + const currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); + const nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { // We have a transition from an upper to a lower letter here. But we only @@ -786,12 +732,12 @@ namespace ts { } function transitionFromLowerToUpper(identifier: string, word: boolean, index: number): boolean { - let lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); - let currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); + const lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); + const currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); // See if the casing indicates we're starting a new word. Note: if we're breaking on // words, then just seeing an upper case character isn't enough. Instead, it has to - // be uppercase and the previous character can't be uppercase. + // be uppercase and the previous character can't be uppercase. // // For example, breaking "AddMetadata" on words would make: Add Metadata // @@ -802,7 +748,7 @@ namespace ts { // on characters would be: A M // // We break the search string on characters. But we break the symbol name on words. - let transition = word + const transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; return transition; diff --git a/src/services/services.ts b/src/services/services.ts index 044fd4d6b7a..c63b1534391 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -469,7 +469,8 @@ namespace ts { function pushDocCommentLineText(docComments: SymbolDisplayPart[], text: string, blankLineCount: number) { // Add the empty lines in between texts - while (blankLineCount--) { + while (blankLineCount) { + blankLineCount--; docComments.push(textPart("")); } @@ -1034,6 +1035,7 @@ namespace ts { * host specific questions using 'getScriptSnapshot'. */ resolveModuleNames?(moduleNames: string[], containingFile: string): ResolvedModule[]; + directoryExists?(directoryName: string): boolean; } // @@ -1217,6 +1219,7 @@ namespace ts { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; [s: string]: boolean | number | string; @@ -1614,6 +1617,9 @@ namespace ts { public static jsxOpenTagName = "jsx open tag name"; public static jsxCloseTagName = "jsx close tag name"; public static jsxSelfClosingTagName = "jsx self closing tag name"; + public static jsxAttribute = "jsx attribute"; + public static jsxText = "jsx text"; + public static jsxAttributeStringLiteralValue = "jsx attribute string literal value"; } export const enum ClassificationType { @@ -1638,6 +1644,9 @@ namespace ts { jsxOpenTagName = 19, jsxCloseTagName = 20, jsxSelfClosingTagName = 21, + jsxAttribute = 22, + jsxText = 23, + jsxAttributeStringLiteralValue = 24, } /// Language Service @@ -1911,7 +1920,8 @@ namespace ts { getCurrentDirectory: () => "", getNewLine: () => newLine, fileExists: (fileName): boolean => fileName === inputFileName, - readFile: (fileName): string => "" + readFile: (fileName): string => "", + directoryExists: directoryExists => true }; const program = createProgram([inputFileName], options, compilerHost); @@ -2768,6 +2778,10 @@ namespace ts { // stub missing host functionality const entry = hostCache.getOrCreateEntry(fileName); return entry && entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + }, + directoryExists: directoryName => { + Debug.assert(!host.resolveModuleNames); + return directoryProbablyExists(directoryName, host); } }; @@ -2972,15 +2986,9 @@ namespace ts { // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. if (performCharacterChecks) { - if (!isIdentifierStart(name.charCodeAt(0), target)) { + if (!isIdentifier(name, target)) { return undefined; } - - for (let i = 1, n = name.length; i < n; i++) { - if (!isIdentifierPart(name.charCodeAt(i), target)) { - return undefined; - } - } } return name; @@ -3098,6 +3106,7 @@ namespace ts { } else if (kind === SyntaxKind.SlashToken && contextToken.parent.kind === SyntaxKind.JsxClosingElement) { isStartingCloseTag = true; + location = contextToken; } } } @@ -3123,8 +3132,11 @@ namespace ts { } else if (isStartingCloseTag) { const tagName = (contextToken.parent.parent).openingElement.tagName; - symbols = [typeChecker.getSymbolAtLocation(tagName)]; + const tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } isMemberCompletion = true; isNewIdentifierLocation = false; } @@ -3830,7 +3842,23 @@ namespace ts { } else { if (!symbols || symbols.length === 0) { - return undefined; + if (sourceFile.languageVariant === LanguageVariant.JSX && + location.parent && location.parent.kind === SyntaxKind.JsxClosingElement) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x = ; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'span'. + + +!!! error TS1005: '; + ~~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'div'. + + +==== tests/cases/conformance/jsx/Error3.tsx (2 errors) ==== + let x3 =
; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + + + +!!! error TS1005: '
; + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~~~~ +!!! error TS17002: Expected corresponding JSX closing tag for 'div'. + + +!!! error TS1005: ' + ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. + ~~~~ +!!! error TS17008: JSX element 'span' has no corresponding closing tag. + + + +!!! error TS1005: '
; + +//// [Error2.tsx] +let x2 =
; + + +//// [Error3.tsx] +let x3 =
; + + +//// [Error4.tsx] +let x4 =
; + +//// [Error5.tsx] +let x5 =
+ + + +//// [file.jsx] +//// [Error1.jsx] +// Issue error about missing span closing tag, not missing div closing tag +var x1 =
; +; +//// [Error2.jsx] +var x2 =
; +//// [Error3.jsx] +var x3 =
; + +; +//// [Error4.jsx] +var x4 =
; +; +//// [Error5.jsx] +var x5 =
+ +; diff --git a/tests/baselines/reference/jsxReactTestSuite.symbols b/tests/baselines/reference/jsxReactTestSuite.symbols index b86054ac560..cca1dae915b 100644 --- a/tests/baselines/reference/jsxReactTestSuite.symbols +++ b/tests/baselines/reference/jsxReactTestSuite.symbols @@ -37,21 +37,36 @@ declare var hasOwnProperty:any; >hasOwnProperty : Symbol(hasOwnProperty, Decl(jsxReactTestSuite.tsx, 12, 11))
text
; +>div : Symbol(unknown) +>div : Symbol(unknown)
+>div : Symbol(unknown) + {this.props.children}
; +>div : Symbol(unknown)
+>div : Symbol(unknown) +

+>div : Symbol(unknown) +>br : Symbol(unknown) +>div : Symbol(unknown) + {foo}
{bar}
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) >foo : Symbol(foo, Decl(jsxReactTestSuite.tsx, 7, 11)) +>br : Symbol(unknown) >bar : Symbol(bar, Decl(jsxReactTestSuite.tsx, 8, 11)) >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
+>br : Symbol(unknown) +
; +>div : Symbol(unknown) @@ -74,6 +89,8 @@ var x = >x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
div : Symbol(unknown) + attr1={ >attr1 : Symbol(unknown) @@ -97,41 +114,64 @@ var x = >attr4 : Symbol(unknown)
; +>div : Symbol(unknown) (
+>div : Symbol(unknown) + {/* A comment at the beginning */} {/* A second comment at the beginning */} +>span : Symbol(unknown) + {/* A nested comment */} +>span : Symbol(unknown) + {/* A sandwiched comment */}
+>br : Symbol(unknown) + {/* A comment at the end */} {/* A second comment at the end */}
+>div : Symbol(unknown) + ); (
div : Symbol(unknown) + /* a multi-line comment */ attr1="foo"> >attr1 : Symbol(unknown) span : Symbol(unknown) + attr2="bar" >attr2 : Symbol(unknown) />
+>div : Symbol(unknown) + );
 
; +>div : Symbol(unknown) +>div : Symbol(unknown)
 
; +>div : Symbol(unknown) +>div : Symbol(unknown) testing; +>hasOwnProperty : Symbol(unknown) +>hasOwnProperty : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) @@ -158,6 +198,7 @@ var x = >sound : Symbol(unknown) ; +>font-face : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) @@ -165,6 +206,7 @@ var x = >y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11)) ; +>x-component : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) diff --git a/tests/baselines/reference/keywordInJsxIdentifier.symbols b/tests/baselines/reference/keywordInJsxIdentifier.symbols index 874d7801a7f..3cb977bee81 100644 --- a/tests/baselines/reference/keywordInJsxIdentifier.symbols +++ b/tests/baselines/reference/keywordInJsxIdentifier.symbols @@ -4,14 +4,18 @@ declare var React: any; >React : Symbol(React, Decl(keywordInJsxIdentifier.tsx, 1, 11)) ; +>foo : Symbol(unknown) >class-id : Symbol(unknown) ; +>foo : Symbol(unknown) >class : Symbol(unknown) ; +>foo : Symbol(unknown) >class-id : Symbol(unknown) ; +>foo : Symbol(unknown) >class : Symbol(unknown) diff --git a/tests/baselines/reference/letDeclarations-es5.types b/tests/baselines/reference/letDeclarations-es5.types index 005e0b26155..f6e8d418632 100644 --- a/tests/baselines/reference/letDeclarations-es5.types +++ b/tests/baselines/reference/letDeclarations-es5.types @@ -29,7 +29,7 @@ let l9 = 0, l10 :string = "", l11 = null; >null : null for(let l11 in {}) { } ->l11 : any +>l11 : string >{} : {} for(let l12 = 0; l12 < 9; l12++) { } diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types index 55be4326b19..bb20f895a14 100644 --- a/tests/baselines/reference/letDeclarations.types +++ b/tests/baselines/reference/letDeclarations.types @@ -29,7 +29,7 @@ let l9 = 0, l10 :string = "", l11 = null; >null : null for(let l11 in {}) { } ->l11 : any +>l11 : string >{} : {} for(let l12 = 0; l12 < 9; l12++) { } diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types index ac1ca3f27c9..095ae16b91e 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types @@ -2,7 +2,7 @@ // should not be an error for (var let in [1,2,3]) {} ->let : any +>let : string >[1,2,3] : number[] >1 : number >2 : number @@ -10,7 +10,7 @@ for (var let in [1,2,3]) {} { for (var let in [1,2,3]) {} ->let : any +>let : string >[1,2,3] : number[] >1 : number >2 : number diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types index 3c508bd8e2b..a5e2ce108db 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types @@ -2,7 +2,7 @@ // should not be an error for (var let in [1,2,3]) {} ->let : any +>let : string >[1,2,3] : number[] >1 : number >2 : number @@ -10,7 +10,7 @@ for (var let in [1,2,3]) {} { for (var let in [1,2,3]) {} ->let : any +>let : string >[1,2,3] : number[] >1 : number >2 : number diff --git a/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt index 1caeb8d5b5d..42d6a348d96 100644 --- a/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/map1.ts(7,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map2.ts(6,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map1.ts(7,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map2.ts(6,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. ==== tests/cases/compiler/map1.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/map2.ts(6,15): error TS2662: Module augmentation cannot int declare module "./observable" { interface I {x0} ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } ==== tests/cases/compiler/map2.ts (1 errors) ==== @@ -22,7 +22,7 @@ tests/cases/compiler/map2.ts(6,15): error TS2662: Module augmentation cannot int declare module "./observable" { interface I {x1} ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } diff --git a/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt index a0140f43cd2..b4ca1bfa667 100644 --- a/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt +++ b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/x.ts(7,9): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(8,9): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(9,11): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(10,10): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(10,14): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(11,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(12,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(15,11): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(16,14): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(17,10): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/x.ts(18,5): error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/x.ts(7,9): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(8,9): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(9,11): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,10): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,14): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(11,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(12,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(15,11): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(16,14): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(17,10): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(18,5): error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. tests/cases/compiler/x.ts(18,26): error TS2307: Cannot find module './x0'. -tests/cases/compiler/x.ts(19,5): error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/x.ts(19,5): error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. tests/cases/compiler/x.ts(19,21): error TS2307: Cannot find module './x0'. -tests/cases/compiler/x.ts(20,5): error TS2663: Exports are not permitted in module augmentations. +tests/cases/compiler/x.ts(20,5): error TS2664: Exports are not permitted in module augmentations. tests/cases/compiler/x.ts(20,19): error TS2307: Cannot find module './x0'. -tests/cases/compiler/x.ts(21,5): error TS2663: Exports are not permitted in module augmentations. +tests/cases/compiler/x.ts(21,5): error TS2664: Exports are not permitted in module augmentations. tests/cases/compiler/x.ts(21,21): error TS2307: Cannot find module './x0'. @@ -31,53 +31,53 @@ tests/cases/compiler/x.ts(21,21): error TS2307: Cannot find module './x0'. declare module "./observable" { var x: number; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. let y: number; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. const z: number; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. let {x1, y1}: {x1: number, y1: string} ~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. interface A { x } ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. namespace N { ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. export class C {} } class Cls {} ~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. function foo(): number; ~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. type T = number; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. import * as all from "./x0"; ~~~~~~ -!!! error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +!!! error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. ~~~~~~ !!! error TS2307: Cannot find module './x0'. import {a} from "./x0"; ~~~~~~ -!!! error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +!!! error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. ~~~~~~ !!! error TS2307: Cannot find module './x0'. export * from "./x0"; ~~~~~~ -!!! error TS2663: Exports are not permitted in module augmentations. +!!! error TS2664: Exports are not permitted in module augmentations. ~~~~~~ !!! error TS2307: Cannot find module './x0'. export {a} from "./x0"; ~~~~~~ -!!! error TS2663: Exports are not permitted in module augmentations. +!!! error TS2664: Exports are not permitted in module augmentations. ~~~~~~ !!! error TS2307: Cannot find module './x0'. } diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt index ae4fdc64972..bd5ce9d8a90 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/f1.ts(3,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/f2.ts(3,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f1.ts(3,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f2.ts(3,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. ==== tests/cases/compiler/f1.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/f2.ts(3,15): error TS2662: Module augmentation cannot intro declare global { interface Something {x} ~~~~~~~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } export {}; ==== tests/cases/compiler/f2.ts (1 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/f2.ts(3,15): error TS2662: Module augmentation cannot intro declare global { interface Something {y} ~~~~~~~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } export {}; ==== tests/cases/compiler/f3.ts (0 errors) ==== diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt index 4b46ccf5853..43b381b323b 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/f1.d.ts(4,19): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/f2.d.ts(3,19): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f1.d.ts(4,19): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f2.d.ts(3,19): error TS2663: Module augmentation cannot introduce new names in the top level scope. ==== tests/cases/compiler/f3.ts (0 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/f2.d.ts(3,19): error TS2662: Module augmentation cannot int global { interface Something {x} ~~~~~~~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } } ==== tests/cases/compiler/f2.d.ts (1 errors) ==== @@ -23,6 +23,6 @@ tests/cases/compiler/f2.d.ts(3,19): error TS2662: Module augmentation cannot int global { interface Something {y} ~~~~~~~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt index b73a62abd22..d3aa8b2b97d 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/moduleAugmentationGlobal6.ts(1,9): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal6.ts(1,9): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ==== tests/cases/compiler/moduleAugmentationGlobal6.ts (1 errors) ==== declare global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. interface Array { x } } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt index 3b386fc2216..dfcbcc7cc24 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. -tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. ==== tests/cases/compiler/moduleAugmentationGlobal6_1.ts (2 errors) ==== global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ~~~~~~ -!!! error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +!!! error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. interface Array { x } } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt index 1409c427b29..6f0aeb8ff60 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/moduleAugmentationGlobal7.ts(2,13): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal7.ts(2,13): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ==== tests/cases/compiler/moduleAugmentationGlobal7.ts (1 errors) ==== namespace A { declare global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. interface Array { x } } } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt index f25b66d3895..042f1d85e5c 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. -tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. ==== tests/cases/compiler/moduleAugmentationGlobal7_1.ts (2 errors) ==== namespace A { global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ~~~~~~ -!!! error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +!!! error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. interface Array { x } } } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt index 553d2b63f62..0370d75f0c4 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/moduleAugmentationGlobal8.ts(2,13): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal8.ts(2,13): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ==== tests/cases/compiler/moduleAugmentationGlobal8.ts (1 errors) ==== namespace A { declare global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. interface Array { x } } } diff --git a/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt index 255d7b90612..d647b881425 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt +++ b/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. -tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. ==== tests/cases/compiler/moduleAugmentationGlobal8_1.ts (2 errors) ==== namespace A { global { ~~~~~~ -!!! error TS2666: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +!!! error TS2667: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. ~~~~~~ -!!! error TS2667: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. +!!! error TS2668: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. interface Array { x } } } diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt b/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt index 36ce6768b09..360c89080a9 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/f3.ts(11,5): error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/f3.ts(11,5): error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. tests/cases/compiler/f3.ts(11,21): error TS2307: Cannot find module './f2'. -tests/cases/compiler/f3.ts(12,5): error TS2663: Exports are not permitted in module augmentations. +tests/cases/compiler/f3.ts(12,5): error TS2664: Exports are not permitted in module augmentations. tests/cases/compiler/f3.ts(12,21): error TS2307: Cannot find module './f2'. -tests/cases/compiler/f3.ts(13,12): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(13,12): error TS2663: Module augmentation cannot introduce new names in the top level scope. tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'I' is using private name 'N'. -tests/cases/compiler/f3.ts(14,12): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(14,12): error TS2663: Module augmentation cannot introduce new names in the top level scope. tests/cases/compiler/f3.ts(14,16): error TS4000: Import declaration 'C' is using private name 'N'. -tests/cases/compiler/f3.ts(16,15): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(16,15): error TS2663: Module augmentation cannot introduce new names in the top level scope. tests/cases/compiler/f4.ts(5,11): error TS2339: Property 'foo' does not exist on type 'A'. @@ -32,28 +32,28 @@ tests/cases/compiler/f4.ts(5,11): error TS2339: Property 'foo' does not exist on declare module "./f1" { import {B} from "./f2"; ~~~~~~ -!!! error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +!!! error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. ~~~~~~ !!! error TS2307: Cannot find module './f2'. export {B} from "./f2"; ~~~~~~ -!!! error TS2663: Exports are not permitted in module augmentations. +!!! error TS2664: Exports are not permitted in module augmentations. ~~~~~~ !!! error TS2307: Cannot find module './f2'. import I = N.Ifc; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~ !!! error TS4000: Import declaration 'I' is using private name 'N'. import C = N.Cls; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~ !!! error TS4000: Import declaration 'C' is using private name 'N'. // should have explicit export interface A { ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. foo(): B; bar(): I; baz(): C; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt b/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt index 7a127c3a680..6ce0c0a7500 100644 --- a/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/f3.ts(11,5): error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/f3.ts(11,5): error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. tests/cases/compiler/f3.ts(11,21): error TS2307: Cannot find module './f2'. -tests/cases/compiler/f3.ts(12,12): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(12,12): error TS2663: Module augmentation cannot introduce new names in the top level scope. tests/cases/compiler/f3.ts(12,16): error TS4000: Import declaration 'I' is using private name 'N'. -tests/cases/compiler/f3.ts(13,12): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(13,12): error TS2663: Module augmentation cannot introduce new names in the top level scope. tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'C' is using private name 'N'. @@ -28,17 +28,17 @@ tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'C' is using declare module "./f1" { import {B} from "./f2"; ~~~~~~ -!!! error TS2664: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +!!! error TS2665: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. ~~~~~~ !!! error TS2307: Cannot find module './f2'. import I = N.Ifc; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~ !!! error TS4000: Import declaration 'I' is using private name 'N'. import C = N.Cls; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~ !!! error TS4000: Import declaration 'C' is using private name 'N'. interface A { diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt index a39ae452679..04f444fe298 100644 --- a/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/map.ts(10,11): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map.ts(11,9): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map.ts(11,20): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map.ts(12,13): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map.ts(12,19): error TS2662: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/map.ts(13,12): error TS2662: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(10,11): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(11,9): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(11,20): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(12,13): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(12,19): error TS2663: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(13,12): error TS2663: Module augmentation cannot introduce new names in the top level scope. ==== tests/cases/compiler/map.ts (6 errors) ==== @@ -18,20 +18,20 @@ tests/cases/compiler/map.ts(13,12): error TS2662: Module augmentation cannot int } class Bar {} ~~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. let y: number, z: string; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. let {a: x, b: x1}: {a: number, b: number}; ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. ~~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. module Z {} ~ -!!! error TS2662: Module augmentation cannot introduce new names in the top level scope. +!!! error TS2663: Module augmentation cannot introduce new names in the top level scope. } ==== tests/cases/compiler/observable.ts (0 errors) ==== diff --git a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt index 8b75459ebd0..8f4cf616bda 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt +++ b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/noImplicitAnyIndexing.ts(13,26): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyIndexing.ts(13,26): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. tests/cases/compiler/noImplicitAnyIndexing.ts(20,9): error TS7017: Index signature of object type implicitly has an 'any' type. tests/cases/compiler/noImplicitAnyIndexing.ts(23,9): error TS7017: Index signature of object type implicitly has an 'any' type. tests/cases/compiler/noImplicitAnyIndexing.ts(31,10): error TS7017: Index signature of object type implicitly has an 'any' type. @@ -19,7 +19,7 @@ tests/cases/compiler/noImplicitAnyIndexing.ts(31,10): error TS7017: Index signat // Should be implicit 'any' ; property access fails, no string indexer. var strRepresentation3 = MyEmusEnum["monehh"]; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS7017: Index signature of object type implicitly has an 'any' type. +!!! error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; diff --git a/tests/baselines/reference/parserES5ForOfStatement19.errors.txt b/tests/baselines/reference/parserES5ForOfStatement19.errors.txt new file mode 100644 index 00000000000..9d0bb02f1ef --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement19.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts(1,16): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts (1 errors) ==== + for (var of in of) { } + ~~ +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement19.symbols b/tests/baselines/reference/parserES5ForOfStatement19.symbols deleted file mode 100644 index 93ba77e3db9..00000000000 --- a/tests/baselines/reference/parserES5ForOfStatement19.symbols +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts === -for (var of in of) { } ->of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) ->of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) - diff --git a/tests/baselines/reference/parserES5ForOfStatement19.types b/tests/baselines/reference/parserES5ForOfStatement19.types deleted file mode 100644 index 13abc7ae757..00000000000 --- a/tests/baselines/reference/parserES5ForOfStatement19.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts === -for (var of in of) { } ->of : any ->of : any - diff --git a/tests/baselines/reference/parserES5ForOfStatement20.errors.txt b/tests/baselines/reference/parserES5ForOfStatement20.errors.txt index 4aee32394b6..2bfc54590ad 100644 --- a/tests/baselines/reference/parserES5ForOfStatement20.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement20.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts(1,10): error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts(1,20): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts (2 errors) ==== for (var of = 0 in of) { } ~~ -!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. \ No newline at end of file +!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. + ~~ +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement19.errors.txt b/tests/baselines/reference/parserForOfStatement19.errors.txt new file mode 100644 index 00000000000..a111498efe7 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement19.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts(1,16): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts (1 errors) ==== + for (var of in of) { } + ~~ +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement19.symbols b/tests/baselines/reference/parserForOfStatement19.symbols deleted file mode 100644 index 1e123349e13..00000000000 --- a/tests/baselines/reference/parserForOfStatement19.symbols +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts === -for (var of in of) { } ->of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) ->of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) - diff --git a/tests/baselines/reference/parserForOfStatement19.types b/tests/baselines/reference/parserForOfStatement19.types deleted file mode 100644 index 6fcc5e8f792..00000000000 --- a/tests/baselines/reference/parserForOfStatement19.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts === -for (var of in of) { } ->of : any ->of : any - diff --git a/tests/baselines/reference/parserForOfStatement20.errors.txt b/tests/baselines/reference/parserForOfStatement20.errors.txt index 461f307f6b9..f2b6ac39a83 100644 --- a/tests/baselines/reference/parserForOfStatement20.errors.txt +++ b/tests/baselines/reference/parserForOfStatement20.errors.txt @@ -1,7 +1,10 @@ tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts(1,10): error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts(1,20): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts (2 errors) ==== for (var of = 0 in of) { } ~~ -!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. \ No newline at end of file +!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. + ~~ +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index 5fdf3b6f110..6d22bf6cb20 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyGloImportParseErrors.ts(22,5): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyGloImportParseErrors.ts(22,5): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. @@ -14,7 +14,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Impor tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2661: Invalid module name in augmentation, module 'abc3' cannot be found. +tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2662: Invalid module name in augmentation, module 'abc3' cannot be found. tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a namespace cannot reference a module. @@ -43,7 +43,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor export declare module "m1_M3_public" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -194,7 +194,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor } module "abc3" { ~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'abc3' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'abc3' cannot be found. } } diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index f0a48427708..19852096f4f 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyImportParseErrors.ts(22,5): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(22,5): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. @@ -7,7 +7,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import de tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(106,5): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(106,5): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in a namespace cannot reference a module. @@ -16,35 +16,35 @@ tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import d tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS2307: Cannot find module 'm2_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(180,1): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. -tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2661: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. -tests/cases/compiler/privacyImportParseErrors.ts(198,1): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. -tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2661: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(180,1): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2662: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(198,1): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2662: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(218,34): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(238,34): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(251,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(252,40): error TS2307: Cannot find module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(255,1): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. -tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2661: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(255,1): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2662: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(258,45): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(261,39): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(264,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(277,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2661: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2662: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(287,46): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(290,40): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(293,41): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(306,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2661: Invalid module name in augmentation, module 'anotherParseError' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2662: Invalid module name in augmentation, module 'anotherParseError' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -tests/cases/compiler/privacyImportParseErrors.ts(326,1): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(326,1): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2661: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2662: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(328,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -79,7 +79,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m1_M3_public" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -181,7 +181,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m2_M3_public" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -273,9 +273,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M2_public" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. export function f1(); export class c1 { } @@ -295,9 +295,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M4_private" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. export function f1(); export class c1 { } @@ -364,9 +364,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "use_glo_M1_public" { ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. import use_glo_M1_public = glo_M1_public; export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; export var use_glo_M1_public_v2_public: use_glo_M1_public; @@ -407,7 +407,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "use_glo_M3_private" { ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. import use_glo_M3_private = glo_M3_private; export var use_glo_M3_private_v1_public: { new (): use_glo_M3_private.c1; }; export var use_glo_M3_private_v2_public: use_glo_M3_private; @@ -447,7 +447,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "anotherParseError" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'anotherParseError' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'anotherParseError' cannot be found. module m2 { declare module "abc" { ~~~~~~~ @@ -471,11 +471,11 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare export module "anotherParseError2" { ~~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. module m2 { declare module "abc" { ~~~~~~~ diff --git a/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt new file mode 100644 index 00000000000..0ebeed05b28 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt @@ -0,0 +1,57 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(5,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(5,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(8,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(9,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(10,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(11,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare var x: number; + declare var x1: number; + declare let {a, b}: {a: number, b: number}; + +==== tests/cases/compiler/file2.ts (12 errors) ==== + export {x, x as y}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {x1, x1 as y1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + + export {a, a as a1}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {b, b as b1}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + + + export {x as z}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {x1 as z1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {a as a2}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {b as b2}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration1.js b/tests/baselines/reference/reExportGlobalDeclaration1.js new file mode 100644 index 00000000000..c0db9a0eaf3 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration1.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration1.ts] //// + +//// [file1.d.ts] + +declare var x: number; +declare var x1: number; +declare let {a, b}: {a: number, b: number}; + +//// [file2.ts] +export {x, x as y}; +export {x1, x1 as y1}; + +export {a, a as a1}; +export {b, b as b1}; + + +export {x as z}; +export {x1 as z1}; +export {a as a2}; +export {b as b2}; + + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt new file mode 100644 index 00000000000..17a3e2ad565 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare interface I1 { + x: number + } + + declare interface I2 { + x: number + } + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {I1, I1 as II1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I2, I2 as II2}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I1 as III1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I2 as III2}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration2.js b/tests/baselines/reference/reExportGlobalDeclaration2.js new file mode 100644 index 00000000000..160a9b28f54 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration2.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration2.ts] //// + +//// [file1.d.ts] + +declare interface I1 { + x: number +} + +declare interface I2 { + x: number +} + +//// [file2.ts] +export {I1, I1 as II1}; +export {I2, I2 as II2}; +export {I1 as III1}; +export {I2 as III2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt new file mode 100644 index 00000000000..d99c184518c --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,14): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,14): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare namespace NS1 { + export var foo: number; + } + + declare namespace NS2 { + export var foo: number; + } + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {NS1, NS1 as NNS1}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS2, NS2 as NNS2}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS1 as NNNS1}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS2 as NNNS2}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration3.js b/tests/baselines/reference/reExportGlobalDeclaration3.js new file mode 100644 index 00000000000..e1b85b6b8d5 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration3.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration3.ts] //// + +//// [file1.d.ts] + +declare namespace NS1 { + export var foo: number; +} + +declare namespace NS2 { + export var foo: number; +} + +//// [file2.ts] +export {NS1, NS1 as NNS1}; +export {NS2, NS2 as NNS2}; +export {NS1 as NNNS1}; +export {NS2 as NNNS2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt new file mode 100644 index 00000000000..5e250a5fc57 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,15): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,15): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare class Cls1 { + x: number + } + declare class Cls2 { + x: number + } + + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {Cls1, Cls1 as CCls1}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls2, Cls2 as CCls2}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls1 as CCCls1}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls2 as CCCls2}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration4.js b/tests/baselines/reference/reExportGlobalDeclaration4.js new file mode 100644 index 00000000000..09d6b760790 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration4.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration4.ts] //// + +//// [file1.d.ts] + +declare class Cls1 { + x: number +} +declare class Cls2 { + x: number +} + + +//// [file2.ts] +export {Cls1, Cls1 as CCls1}; +export {Cls2, Cls2 as CCls2}; +export {Cls1 as CCCls1}; +export {Cls2 as CCCls2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.js b/tests/baselines/reference/reactNamespaceImportPresevation.js new file mode 100644 index 00000000000..5c44674d031 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceImportPresevation.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reactNamespaceImportPresevation.tsx] //// + +//// [modules.d.ts] + +declare module "my-React-Lib" { + var a: any; + export = a; +} + +//// [test.tsx] +import * as myReactLib from "my-React-Lib"; // should not be elided +declare var foo: any; + +; + + +//// [test.jsx] +"use strict"; +var myReactLib = require("my-React-Lib"); // should not be elided +; diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.symbols b/tests/baselines/reference/reactNamespaceImportPresevation.symbols new file mode 100644 index 00000000000..e2f530d31ba --- /dev/null +++ b/tests/baselines/reference/reactNamespaceImportPresevation.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "my-React-Lib" { + var a: any; +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) + + export = a; +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) +} + +=== tests/cases/compiler/test.tsx === +import * as myReactLib from "my-React-Lib"; // should not be elided +>myReactLib : Symbol(myReactLib, Decl(test.tsx, 0, 6)) + +declare var foo: any; +>foo : Symbol(foo, Decl(test.tsx, 1, 11)) + +; +>foo : Symbol(unknown) +>data : Symbol(unknown) + diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.types b/tests/baselines/reference/reactNamespaceImportPresevation.types new file mode 100644 index 00000000000..adb1d60d2d5 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceImportPresevation.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "my-React-Lib" { + var a: any; +>a : any + + export = a; +>a : any +} + +=== tests/cases/compiler/test.tsx === +import * as myReactLib from "my-React-Lib"; // should not be elided +>myReactLib : any + +declare var foo: any; +>foo : any + +; +> : any +>foo : any +>data : any + diff --git a/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt b/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt new file mode 100644 index 00000000000..e08ec520867 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceInvalidInput.errors.txt @@ -0,0 +1,11 @@ +error TS5059: Invalide value for '--reactNamespace'. 'my-React-Lib' is not a valid identifier. +tests/cases/compiler/reactNamespaceInvalidInput.tsx(2,2): error TS2304: Cannot find name 'my-React-Lib'. + + +!!! error TS5059: Invalide value for '--reactNamespace'. 'my-React-Lib' is not a valid identifier. +==== tests/cases/compiler/reactNamespaceInvalidInput.tsx (1 errors) ==== + + ; + ~~~ +!!! error TS2304: Cannot find name 'my-React-Lib'. + \ No newline at end of file diff --git a/tests/baselines/reference/reactNamespaceInvalidInput.js b/tests/baselines/reference/reactNamespaceInvalidInput.js new file mode 100644 index 00000000000..bf079d6b9a8 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceInvalidInput.js @@ -0,0 +1,7 @@ +//// [reactNamespaceInvalidInput.tsx] + +; + + +//// [reactNamespaceInvalidInput.js] +my-React-Lib.createElement("foo", {data: true}); diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.js b/tests/baselines/reference/reactNamespaceJSXEmit.js new file mode 100644 index 00000000000..26967d56b7b --- /dev/null +++ b/tests/baselines/reference/reactNamespaceJSXEmit.js @@ -0,0 +1,20 @@ +//// [reactNamespaceJSXEmit.tsx] + +declare var myReactLib: any; +declare var foo: any; +declare var Bar: any; +declare var x: any; + +; +; +; +; +; + + +//// [reactNamespaceJSXEmit.js] +myReactLib.createElement("foo", {data: true}); +myReactLib.createElement(Bar, {x: x}); +myReactLib.createElement("x-component", null); +myReactLib.createElement(Bar, myReactLib.__spread({}, x)); +myReactLib.createElement(Bar, myReactLib.__spread({}, x, {y: 2})); diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.symbols b/tests/baselines/reference/reactNamespaceJSXEmit.symbols new file mode 100644 index 00000000000..3ca5b91e538 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceJSXEmit.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/reactNamespaceJSXEmit.tsx === + +declare var myReactLib: any; +>myReactLib : Symbol(myReactLib, Decl(reactNamespaceJSXEmit.tsx, 1, 11)) + +declare var foo: any; +>foo : Symbol(foo, Decl(reactNamespaceJSXEmit.tsx, 2, 11)) + +declare var Bar: any; +>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11)) + +declare var x: any; +>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) + +; +>foo : Symbol(unknown) +>data : Symbol(unknown) + +; +>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11)) +>x : Symbol(unknown) +>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) + +; +>x-component : Symbol(unknown) + +; +>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11)) +>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) + +; +>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11)) +>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) +>y : Symbol(unknown) + diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.types b/tests/baselines/reference/reactNamespaceJSXEmit.types new file mode 100644 index 00000000000..06c803ef7fd --- /dev/null +++ b/tests/baselines/reference/reactNamespaceJSXEmit.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/reactNamespaceJSXEmit.tsx === + +declare var myReactLib: any; +>myReactLib : any + +declare var foo: any; +>foo : any + +declare var Bar: any; +>Bar : any + +declare var x: any; +>x : any + +; +> : any +>foo : any +>data : any + +; +> : any +>Bar : any +>x : any +>x : any + +; +> : any +>x-component : any + +; +> : any +>Bar : any +>x : any + +; +> : any +>Bar : any +>x : any +>y : any +>2 : number + diff --git a/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt b/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt new file mode 100644 index 00000000000..f87d223f824 --- /dev/null +++ b/tests/baselines/reference/reactNamespaceMissingDeclaration.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/reactNamespaceMissingDeclaration.tsx(3,2): error TS2304: Cannot find name 'myReactLib'. + + +==== tests/cases/compiler/reactNamespaceMissingDeclaration.tsx (1 errors) ==== + + // Error myReactLib not declared + + ~~~ +!!! error TS2304: Cannot find name 'myReactLib'. \ No newline at end of file diff --git a/tests/baselines/reference/reactNamespaceMissingDeclaration.js b/tests/baselines/reference/reactNamespaceMissingDeclaration.js new file mode 100644 index 00000000000..d972f319f8f --- /dev/null +++ b/tests/baselines/reference/reactNamespaceMissingDeclaration.js @@ -0,0 +1,8 @@ +//// [reactNamespaceMissingDeclaration.tsx] + +// Error myReactLib not declared + + +//// [reactNamespaceMissingDeclaration.js] +// Error myReactLib not declared +myReactLib.createElement("foo", {data: true}); diff --git a/tests/baselines/reference/recursiveLetConst.errors.txt b/tests/baselines/reference/recursiveLetConst.errors.txt index 88ecb379e5e..6d3f15880bb 100644 --- a/tests/baselines/reference/recursiveLetConst.errors.txt +++ b/tests/baselines/reference/recursiveLetConst.errors.txt @@ -5,13 +5,14 @@ tests/cases/compiler/recursiveLetConst.ts(5,14): error TS2448: Block-scoped vari tests/cases/compiler/recursiveLetConst.ts(6,14): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(7,1): error TS7027: Unreachable code detected. tests/cases/compiler/recursiveLetConst.ts(7,16): error TS2448: Block-scoped variable 'v' used before its declaration. +tests/cases/compiler/recursiveLetConst.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/compiler/recursiveLetConst.ts(8,15): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(9,15): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(10,17): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(11,11): error TS2448: Block-scoped variable 'x2' used before its declaration. -==== tests/cases/compiler/recursiveLetConst.ts (11 errors) ==== +==== tests/cases/compiler/recursiveLetConst.ts (12 errors) ==== 'use strict' let x = x + 1; ~ @@ -35,6 +36,8 @@ tests/cases/compiler/recursiveLetConst.ts(11,11): error TS2448: Block-scoped var !!! error TS2448: Block-scoped variable 'v' used before its declaration. for (let v in v) { } ~ +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. for (let v of v) { } ~ diff --git a/tests/baselines/reference/sourceMapSample.js.map b/tests/baselines/reference/sourceMapSample.js.map index 2429a04c88b..0617ba4c1ba 100644 --- a/tests/baselines/reference/sourceMapSample.js.map +++ b/tests/baselines/reference/sourceMapSample.js.map @@ -1,2 +1,2 @@ //// [sourceMapSample.js.map] -{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,WAA0B,CAA1B,sBAA0B,CAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file +{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,WAA0B,CAA1B,sBAA0B,CAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.sourcemap.txt b/tests/baselines/reference/sourceMapSample.sourcemap.txt index 0fb03dacf48..5b3251226b9 100644 --- a/tests/baselines/reference/sourceMapSample.sourcemap.txt +++ b/tests/baselines/reference/sourceMapSample.sourcemap.txt @@ -525,64 +525,61 @@ sourceFile:sourceMapSample.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^^^^^^^^^^^^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ -21> ^^-> +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ +20> ^^-> 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> restGreetings -14> . -15> length -16> ; -17> i -18> ++ -19> ) -20> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> restGreetings +13> . +14> length +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) 2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) 3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) 4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 21) Source(24, 17) + SourceIndex(0) -6 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -7 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -8 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -9 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -10>Emitted(27, 29) Source(24, 25) + SourceIndex(0) -11>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -12>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -13>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -14>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -15>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -16>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -17>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -18>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -19>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -20>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) +11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) +12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) +19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -720,63 +717,60 @@ sourceFile:sourceMapSample.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> b -14> . -15> length -16> ; -17> j -18> ++ -19> ) -20> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> b +13> . +14> length +15> ; +16> j +17> ++ +18> ) +19> { 1->Emitted(33, 9) Source(32, 5) + SourceIndex(0) 2 >Emitted(33, 12) Source(32, 8) + SourceIndex(0) 3 >Emitted(33, 13) Source(32, 9) + SourceIndex(0) 4 >Emitted(33, 14) Source(32, 10) + SourceIndex(0) -5 >Emitted(33, 17) Source(32, 13) + SourceIndex(0) -6 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) -7 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) -8 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) -9 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) -10>Emitted(33, 25) Source(32, 21) + SourceIndex(0) -11>Emitted(33, 26) Source(32, 22) + SourceIndex(0) -12>Emitted(33, 29) Source(32, 25) + SourceIndex(0) -13>Emitted(33, 30) Source(32, 26) + SourceIndex(0) -14>Emitted(33, 31) Source(32, 27) + SourceIndex(0) -15>Emitted(33, 37) Source(32, 33) + SourceIndex(0) -16>Emitted(33, 39) Source(32, 35) + SourceIndex(0) -17>Emitted(33, 40) Source(32, 36) + SourceIndex(0) -18>Emitted(33, 42) Source(32, 38) + SourceIndex(0) -19>Emitted(33, 44) Source(32, 40) + SourceIndex(0) -20>Emitted(33, 45) Source(32, 41) + SourceIndex(0) +5 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) +6 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) +7 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) +8 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) +9 >Emitted(33, 25) Source(32, 21) + SourceIndex(0) +10>Emitted(33, 26) Source(32, 22) + SourceIndex(0) +11>Emitted(33, 29) Source(32, 25) + SourceIndex(0) +12>Emitted(33, 30) Source(32, 26) + SourceIndex(0) +13>Emitted(33, 31) Source(32, 27) + SourceIndex(0) +14>Emitted(33, 37) Source(32, 33) + SourceIndex(0) +15>Emitted(33, 39) Source(32, 35) + SourceIndex(0) +16>Emitted(33, 40) Source(32, 36) + SourceIndex(0) +17>Emitted(33, 42) Source(32, 38) + SourceIndex(0) +18>Emitted(33, 44) Source(32, 40) + SourceIndex(0) +19>Emitted(33, 45) Source(32, 41) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index 08ed68ebca7..bddc7694f10 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js.map +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClasses.js.map] -{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,WAA8C,CAA9C,sBAA8C,CAA9C,IAA8C;gBAA9C,cAAiB,mBAAmB,yBAAU;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,WAA8C,CAA9C,sBAA8C,CAA9C,IAA8C;gBAA9C,cAAiB,mBAAmB,yBAAU;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index 4501ec5d872..29ad93cf74d 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -545,64 +545,61 @@ sourceFile:sourceMapValidationClasses.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^^^^^^^^^^^^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ -21> ^^-> +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ +20> ^^-> 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> restGreetings -14> . -15> length -16> ; -17> i -18> ++ -19> ) -20> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> restGreetings +13> . +14> length +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) 2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) 3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) 4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 21) Source(24, 17) + SourceIndex(0) -6 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -7 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -8 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -9 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -10>Emitted(27, 29) Source(24, 25) + SourceIndex(0) -11>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -12>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -13>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -14>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -15>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -16>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -17>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -18>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -19>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -20>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) +11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) +12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) +19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -749,63 +746,60 @@ sourceFile:sourceMapValidationClasses.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1 > > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> b -14> . -15> length -16> ; -17> j -18> ++ -19> ) -20> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> b +13> . +14> length +15> ; +16> j +17> ++ +18> ) +19> { 1 >Emitted(34, 9) Source(33, 5) + SourceIndex(0) 2 >Emitted(34, 12) Source(33, 8) + SourceIndex(0) 3 >Emitted(34, 13) Source(33, 9) + SourceIndex(0) 4 >Emitted(34, 14) Source(33, 10) + SourceIndex(0) -5 >Emitted(34, 17) Source(33, 13) + SourceIndex(0) -6 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) -7 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) -8 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) -9 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) -10>Emitted(34, 25) Source(33, 21) + SourceIndex(0) -11>Emitted(34, 26) Source(33, 22) + SourceIndex(0) -12>Emitted(34, 29) Source(33, 25) + SourceIndex(0) -13>Emitted(34, 30) Source(33, 26) + SourceIndex(0) -14>Emitted(34, 31) Source(33, 27) + SourceIndex(0) -15>Emitted(34, 37) Source(33, 33) + SourceIndex(0) -16>Emitted(34, 39) Source(33, 35) + SourceIndex(0) -17>Emitted(34, 40) Source(33, 36) + SourceIndex(0) -18>Emitted(34, 42) Source(33, 38) + SourceIndex(0) -19>Emitted(34, 44) Source(33, 40) + SourceIndex(0) -20>Emitted(34, 45) Source(33, 41) + SourceIndex(0) +5 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) +6 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) +7 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) +8 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) +9 >Emitted(34, 25) Source(33, 21) + SourceIndex(0) +10>Emitted(34, 26) Source(33, 22) + SourceIndex(0) +11>Emitted(34, 29) Source(33, 25) + SourceIndex(0) +12>Emitted(34, 30) Source(33, 26) + SourceIndex(0) +13>Emitted(34, 31) Source(33, 27) + SourceIndex(0) +14>Emitted(34, 37) Source(33, 33) + SourceIndex(0) +15>Emitted(34, 39) Source(33, 35) + SourceIndex(0) +16>Emitted(34, 40) Source(33, 36) + SourceIndex(0) +17>Emitted(34, 42) Source(33, 38) + SourceIndex(0) +18>Emitted(34, 44) Source(33, 40) + SourceIndex(0) +19>Emitted(34, 45) Source(33, 41) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js new file mode 100644 index 00000000000..407af9c08a0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js @@ -0,0 +1,177 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +for (var nameA = robotA[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var numberB = robotA[0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var numberB = getRobot()[0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var nameB = multiRobotA[0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var nameB = getMultiRobot()[0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (var multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (var multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map new file mode 100644 index 00000000000..0ee4a2092e7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,qBAAK,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA0B,EAAnB,aAAK,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA0C,EAAnC,aAAK,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,uBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAA0D,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAA8E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,uBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,2CAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,0BAAK,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,8BAAK,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,kDAAK,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,wBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA4C,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA4D,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAAgE,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAAoF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,wBAAQ,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA0C,EAArC,gBAAQ,EAAE,wBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA0D,EAArD,gBAAQ,EAAE,wBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAM,0CAAkB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,8CAAkB,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,kEAAkB,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..e7ee5c01f2c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt @@ -0,0 +1,2711 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>for (var nameA = robotA[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let [, +5 > nameA +6 > ] = robotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +5 >Emitted(10, 27) Source(18, 18) + SourceIndex(0) +6 >Emitted(10, 29) Source(18, 30) + SourceIndex(0) +7 >Emitted(10, 30) Source(18, 31) + SourceIndex(0) +8 >Emitted(10, 33) Source(18, 34) + SourceIndex(0) +9 >Emitted(10, 34) Source(18, 35) + SourceIndex(0) +10>Emitted(10, 36) Source(18, 37) + SourceIndex(0) +11>Emitted(10, 37) Source(18, 38) + SourceIndex(0) +12>Emitted(10, 40) Source(18, 41) + SourceIndex(0) +13>Emitted(10, 41) Source(18, 42) + SourceIndex(0) +14>Emitted(10, 43) Source(18, 44) + SourceIndex(0) +15>Emitted(10, 44) Source(18, 45) + SourceIndex(0) +16>Emitted(10, 46) Source(18, 47) + SourceIndex(0) +17>Emitted(10, 48) Source(18, 49) + SourceIndex(0) +18>Emitted(10, 49) Source(18, 50) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) +--- +>>>for (var _a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA] = getRobot() +7 > +8 > nameA +9 > ] = getRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 6) + SourceIndex(0) +5 >Emitted(13, 10) Source(21, 6) + SourceIndex(0) +6 >Emitted(13, 25) Source(21, 32) + SourceIndex(0) +7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +8 >Emitted(13, 40) Source(21, 18) + SourceIndex(0) +9 >Emitted(13, 42) Source(21, 34) + SourceIndex(0) +10>Emitted(13, 43) Source(21, 35) + SourceIndex(0) +11>Emitted(13, 46) Source(21, 38) + SourceIndex(0) +12>Emitted(13, 47) Source(21, 39) + SourceIndex(0) +13>Emitted(13, 49) Source(21, 41) + SourceIndex(0) +14>Emitted(13, 50) Source(21, 42) + SourceIndex(0) +15>Emitted(13, 53) Source(21, 45) + SourceIndex(0) +16>Emitted(13, 54) Source(21, 46) + SourceIndex(0) +17>Emitted(13, 56) Source(21, 48) + SourceIndex(0) +18>Emitted(13, 57) Source(21, 49) + SourceIndex(0) +19>Emitted(13, 59) Source(21, 51) + SourceIndex(0) +20>Emitted(13, 61) Source(21, 53) + SourceIndex(0) +21>Emitted(13, 62) Source(21, 54) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA] = [2, "trimmer", "trimming"] +7 > +8 > nameA +9 > ] = [2, "trimmer", "trimming"], +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(16, 10) Source(24, 6) + SourceIndex(0) +6 >Emitted(16, 41) Source(24, 48) + SourceIndex(0) +7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +8 >Emitted(16, 56) Source(24, 18) + SourceIndex(0) +9 >Emitted(16, 58) Source(24, 50) + SourceIndex(0) +10>Emitted(16, 59) Source(24, 51) + SourceIndex(0) +11>Emitted(16, 62) Source(24, 54) + SourceIndex(0) +12>Emitted(16, 63) Source(24, 55) + SourceIndex(0) +13>Emitted(16, 65) Source(24, 57) + SourceIndex(0) +14>Emitted(16, 66) Source(24, 58) + SourceIndex(0) +15>Emitted(16, 69) Source(24, 61) + SourceIndex(0) +16>Emitted(16, 70) Source(24, 62) + SourceIndex(0) +17>Emitted(16, 72) Source(24, 64) + SourceIndex(0) +18>Emitted(16, 73) Source(24, 65) + SourceIndex(0) +19>Emitted(16, 75) Source(24, 67) + SourceIndex(0) +20>Emitted(16, 77) Source(24, 69) + SourceIndex(0) +21>Emitted(16, 78) Source(24, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(17, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let [, +5 > [primarySkillA, secondarySkillA] +6 > +7 > primarySkillA +8 > , +9 > secondarySkillA +10> ]] = multiRobotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +5 >Emitted(19, 29) Source(27, 45) + SourceIndex(0) +6 >Emitted(19, 31) Source(27, 14) + SourceIndex(0) +7 >Emitted(19, 52) Source(27, 27) + SourceIndex(0) +8 >Emitted(19, 54) Source(27, 29) + SourceIndex(0) +9 >Emitted(19, 77) Source(27, 44) + SourceIndex(0) +10>Emitted(19, 79) Source(27, 62) + SourceIndex(0) +11>Emitted(19, 80) Source(27, 63) + SourceIndex(0) +12>Emitted(19, 83) Source(27, 66) + SourceIndex(0) +13>Emitted(19, 84) Source(27, 67) + SourceIndex(0) +14>Emitted(19, 86) Source(27, 69) + SourceIndex(0) +15>Emitted(19, 87) Source(27, 70) + SourceIndex(0) +16>Emitted(19, 90) Source(27, 73) + SourceIndex(0) +17>Emitted(19, 91) Source(27, 74) + SourceIndex(0) +18>Emitted(19, 93) Source(27, 76) + SourceIndex(0) +19>Emitted(19, 94) Source(27, 77) + SourceIndex(0) +20>Emitted(19, 96) Source(27, 79) + SourceIndex(0) +21>Emitted(19, 98) Source(27, 81) + SourceIndex(0) +22>Emitted(19, 99) Source(27, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(20, 30) Source(28, 30) + SourceIndex(0) +7 >Emitted(20, 31) Source(28, 31) + SourceIndex(0) +8 >Emitted(20, 32) Source(28, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = getMultiRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(22, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(22, 10) Source(30, 6) + SourceIndex(0) +6 >Emitted(22, 30) Source(30, 64) + SourceIndex(0) +7 >Emitted(22, 32) Source(30, 13) + SourceIndex(0) +8 >Emitted(22, 42) Source(30, 45) + SourceIndex(0) +9 >Emitted(22, 44) Source(30, 14) + SourceIndex(0) +10>Emitted(22, 65) Source(30, 27) + SourceIndex(0) +11>Emitted(22, 67) Source(30, 29) + SourceIndex(0) +12>Emitted(22, 90) Source(30, 44) + SourceIndex(0) +13>Emitted(22, 92) Source(30, 66) + SourceIndex(0) +14>Emitted(22, 93) Source(30, 67) + SourceIndex(0) +15>Emitted(22, 96) Source(30, 70) + SourceIndex(0) +16>Emitted(22, 97) Source(30, 71) + SourceIndex(0) +17>Emitted(22, 99) Source(30, 73) + SourceIndex(0) +18>Emitted(22, 100) Source(30, 74) + SourceIndex(0) +19>Emitted(22, 103) Source(30, 77) + SourceIndex(0) +20>Emitted(22, 104) Source(30, 78) + SourceIndex(0) +21>Emitted(22, 106) Source(30, 80) + SourceIndex(0) +22>Emitted(22, 107) Source(30, 81) + SourceIndex(0) +23>Emitted(22, 109) Source(30, 83) + SourceIndex(0) +24>Emitted(22, 111) Source(30, 85) + SourceIndex(0) +25>Emitted(22, 112) Source(30, 86) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(23, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(23, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(23, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = ["trimmer", ["trimming", "edging"]], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(25, 10) Source(33, 6) + SourceIndex(0) +6 >Emitted(25, 50) Source(33, 84) + SourceIndex(0) +7 >Emitted(25, 52) Source(33, 13) + SourceIndex(0) +8 >Emitted(25, 62) Source(33, 45) + SourceIndex(0) +9 >Emitted(25, 64) Source(33, 14) + SourceIndex(0) +10>Emitted(25, 85) Source(33, 27) + SourceIndex(0) +11>Emitted(25, 87) Source(33, 29) + SourceIndex(0) +12>Emitted(25, 110) Source(33, 44) + SourceIndex(0) +13>Emitted(25, 112) Source(33, 86) + SourceIndex(0) +14>Emitted(25, 113) Source(33, 87) + SourceIndex(0) +15>Emitted(25, 116) Source(33, 90) + SourceIndex(0) +16>Emitted(25, 117) Source(33, 91) + SourceIndex(0) +17>Emitted(25, 119) Source(33, 93) + SourceIndex(0) +18>Emitted(25, 120) Source(33, 94) + SourceIndex(0) +19>Emitted(25, 123) Source(33, 97) + SourceIndex(0) +20>Emitted(25, 124) Source(33, 98) + SourceIndex(0) +21>Emitted(25, 126) Source(33, 100) + SourceIndex(0) +22>Emitted(25, 127) Source(33, 101) + SourceIndex(0) +23>Emitted(25, 129) Source(33, 103) + SourceIndex(0) +24>Emitted(25, 131) Source(33, 105) + SourceIndex(0) +25>Emitted(25, 132) Source(33, 106) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(26, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(26, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(26, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var numberB = robotA[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = robotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(28, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(37, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(37, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(37, 11) + SourceIndex(0) +5 >Emitted(28, 29) Source(37, 18) + SourceIndex(0) +6 >Emitted(28, 31) Source(37, 30) + SourceIndex(0) +7 >Emitted(28, 32) Source(37, 31) + SourceIndex(0) +8 >Emitted(28, 35) Source(37, 34) + SourceIndex(0) +9 >Emitted(28, 36) Source(37, 35) + SourceIndex(0) +10>Emitted(28, 38) Source(37, 37) + SourceIndex(0) +11>Emitted(28, 39) Source(37, 38) + SourceIndex(0) +12>Emitted(28, 42) Source(37, 41) + SourceIndex(0) +13>Emitted(28, 43) Source(37, 42) + SourceIndex(0) +14>Emitted(28, 45) Source(37, 44) + SourceIndex(0) +15>Emitted(28, 46) Source(37, 45) + SourceIndex(0) +16>Emitted(28, 48) Source(37, 47) + SourceIndex(0) +17>Emitted(28, 50) Source(37, 49) + SourceIndex(0) +18>Emitted(28, 51) Source(37, 50) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(29, 5) Source(38, 5) + SourceIndex(0) +2 >Emitted(29, 12) Source(38, 12) + SourceIndex(0) +3 >Emitted(29, 13) Source(38, 13) + SourceIndex(0) +4 >Emitted(29, 16) Source(38, 16) + SourceIndex(0) +5 >Emitted(29, 17) Source(38, 17) + SourceIndex(0) +6 >Emitted(29, 24) Source(38, 24) + SourceIndex(0) +7 >Emitted(29, 25) Source(38, 25) + SourceIndex(0) +8 >Emitted(29, 26) Source(38, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(30, 2) Source(39, 2) + SourceIndex(0) +--- +>>>for (var numberB = getRobot()[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(31, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(31, 4) Source(40, 4) + SourceIndex(0) +3 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +4 >Emitted(31, 6) Source(40, 11) + SourceIndex(0) +5 >Emitted(31, 33) Source(40, 18) + SourceIndex(0) +6 >Emitted(31, 35) Source(40, 34) + SourceIndex(0) +7 >Emitted(31, 36) Source(40, 35) + SourceIndex(0) +8 >Emitted(31, 39) Source(40, 38) + SourceIndex(0) +9 >Emitted(31, 40) Source(40, 39) + SourceIndex(0) +10>Emitted(31, 42) Source(40, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(40, 42) + SourceIndex(0) +12>Emitted(31, 46) Source(40, 45) + SourceIndex(0) +13>Emitted(31, 47) Source(40, 46) + SourceIndex(0) +14>Emitted(31, 49) Source(40, 48) + SourceIndex(0) +15>Emitted(31, 50) Source(40, 49) + SourceIndex(0) +16>Emitted(31, 52) Source(40, 51) + SourceIndex(0) +17>Emitted(31, 54) Source(40, 53) + SourceIndex(0) +18>Emitted(31, 55) Source(40, 54) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(32, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(32, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(32, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(32, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(32, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(32, 24) Source(41, 24) + SourceIndex(0) +7 >Emitted(32, 25) Source(41, 25) + SourceIndex(0) +8 >Emitted(32, 26) Source(41, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(33, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(33, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = [2, "trimmer", "trimming"], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(34, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(34, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(34, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(34, 6) Source(43, 11) + SourceIndex(0) +5 >Emitted(34, 49) Source(43, 18) + SourceIndex(0) +6 >Emitted(34, 51) Source(43, 50) + SourceIndex(0) +7 >Emitted(34, 52) Source(43, 51) + SourceIndex(0) +8 >Emitted(34, 55) Source(43, 54) + SourceIndex(0) +9 >Emitted(34, 56) Source(43, 55) + SourceIndex(0) +10>Emitted(34, 58) Source(43, 57) + SourceIndex(0) +11>Emitted(34, 59) Source(43, 58) + SourceIndex(0) +12>Emitted(34, 62) Source(43, 61) + SourceIndex(0) +13>Emitted(34, 63) Source(43, 62) + SourceIndex(0) +14>Emitted(34, 65) Source(43, 64) + SourceIndex(0) +15>Emitted(34, 66) Source(43, 65) + SourceIndex(0) +16>Emitted(34, 68) Source(43, 67) + SourceIndex(0) +17>Emitted(34, 70) Source(43, 69) + SourceIndex(0) +18>Emitted(34, 71) Source(43, 70) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(35, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(35, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(35, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(35, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(36, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(36, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var nameB = multiRobotA[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = multiRobotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(37, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(46, 11) + SourceIndex(0) +5 >Emitted(37, 32) Source(46, 16) + SourceIndex(0) +6 >Emitted(37, 34) Source(46, 33) + SourceIndex(0) +7 >Emitted(37, 35) Source(46, 34) + SourceIndex(0) +8 >Emitted(37, 38) Source(46, 37) + SourceIndex(0) +9 >Emitted(37, 39) Source(46, 38) + SourceIndex(0) +10>Emitted(37, 41) Source(46, 40) + SourceIndex(0) +11>Emitted(37, 42) Source(46, 41) + SourceIndex(0) +12>Emitted(37, 45) Source(46, 44) + SourceIndex(0) +13>Emitted(37, 46) Source(46, 45) + SourceIndex(0) +14>Emitted(37, 48) Source(46, 47) + SourceIndex(0) +15>Emitted(37, 49) Source(46, 48) + SourceIndex(0) +16>Emitted(37, 51) Source(46, 50) + SourceIndex(0) +17>Emitted(37, 53) Source(46, 52) + SourceIndex(0) +18>Emitted(37, 54) Source(46, 53) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(38, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(38, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(38, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(38, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(38, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(38, 22) Source(47, 22) + SourceIndex(0) +7 >Emitted(38, 23) Source(47, 23) + SourceIndex(0) +8 >Emitted(38, 24) Source(47, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(39, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(39, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var nameB = getMultiRobot()[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(40, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(40, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(40, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(40, 6) Source(49, 11) + SourceIndex(0) +5 >Emitted(40, 36) Source(49, 16) + SourceIndex(0) +6 >Emitted(40, 38) Source(49, 37) + SourceIndex(0) +7 >Emitted(40, 39) Source(49, 38) + SourceIndex(0) +8 >Emitted(40, 42) Source(49, 41) + SourceIndex(0) +9 >Emitted(40, 43) Source(49, 42) + SourceIndex(0) +10>Emitted(40, 45) Source(49, 44) + SourceIndex(0) +11>Emitted(40, 46) Source(49, 45) + SourceIndex(0) +12>Emitted(40, 49) Source(49, 48) + SourceIndex(0) +13>Emitted(40, 50) Source(49, 49) + SourceIndex(0) +14>Emitted(40, 52) Source(49, 51) + SourceIndex(0) +15>Emitted(40, 53) Source(49, 52) + SourceIndex(0) +16>Emitted(40, 55) Source(49, 54) + SourceIndex(0) +17>Emitted(40, 57) Source(49, 56) + SourceIndex(0) +18>Emitted(40, 58) Source(49, 57) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(41, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(42, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(42, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(43, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(52, 11) + SourceIndex(0) +5 >Emitted(43, 56) Source(52, 16) + SourceIndex(0) +6 >Emitted(43, 58) Source(52, 57) + SourceIndex(0) +7 >Emitted(43, 59) Source(52, 58) + SourceIndex(0) +8 >Emitted(43, 62) Source(52, 61) + SourceIndex(0) +9 >Emitted(43, 63) Source(52, 62) + SourceIndex(0) +10>Emitted(43, 65) Source(52, 64) + SourceIndex(0) +11>Emitted(43, 66) Source(52, 65) + SourceIndex(0) +12>Emitted(43, 69) Source(52, 68) + SourceIndex(0) +13>Emitted(43, 70) Source(52, 69) + SourceIndex(0) +14>Emitted(43, 72) Source(52, 71) + SourceIndex(0) +15>Emitted(43, 73) Source(52, 72) + SourceIndex(0) +16>Emitted(43, 75) Source(52, 74) + SourceIndex(0) +17>Emitted(43, 77) Source(52, 76) + SourceIndex(0) +18>Emitted(43, 78) Source(52, 77) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(44, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(44, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(44, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(44, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(44, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(44, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(44, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(44, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(45, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(45, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA2 +6 > , +7 > nameA2 +8 > , +9 > skillA2 +10> ] = robotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(46, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(46, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(46, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(46, 6) Source(56, 11) + SourceIndex(0) +5 >Emitted(46, 30) Source(56, 19) + SourceIndex(0) +6 >Emitted(46, 32) Source(56, 21) + SourceIndex(0) +7 >Emitted(46, 50) Source(56, 27) + SourceIndex(0) +8 >Emitted(46, 52) Source(56, 29) + SourceIndex(0) +9 >Emitted(46, 71) Source(56, 36) + SourceIndex(0) +10>Emitted(46, 73) Source(56, 48) + SourceIndex(0) +11>Emitted(46, 74) Source(56, 49) + SourceIndex(0) +12>Emitted(46, 77) Source(56, 52) + SourceIndex(0) +13>Emitted(46, 78) Source(56, 53) + SourceIndex(0) +14>Emitted(46, 80) Source(56, 55) + SourceIndex(0) +15>Emitted(46, 81) Source(56, 56) + SourceIndex(0) +16>Emitted(46, 84) Source(56, 59) + SourceIndex(0) +17>Emitted(46, 85) Source(56, 60) + SourceIndex(0) +18>Emitted(46, 87) Source(56, 62) + SourceIndex(0) +19>Emitted(46, 88) Source(56, 63) + SourceIndex(0) +20>Emitted(46, 90) Source(56, 65) + SourceIndex(0) +21>Emitted(46, 92) Source(56, 67) + SourceIndex(0) +22>Emitted(46, 93) Source(56, 68) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(47, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(47, 23) Source(57, 23) + SourceIndex(0) +7 >Emitted(47, 24) Source(57, 24) + SourceIndex(0) +8 >Emitted(47, 25) Source(57, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2, nameA2, skillA2] = getRobot() +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = getRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(49, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(59, 6) + SourceIndex(0) +5 >Emitted(49, 10) Source(59, 6) + SourceIndex(0) +6 >Emitted(49, 25) Source(59, 50) + SourceIndex(0) +7 >Emitted(49, 27) Source(59, 11) + SourceIndex(0) +8 >Emitted(49, 43) Source(59, 19) + SourceIndex(0) +9 >Emitted(49, 45) Source(59, 21) + SourceIndex(0) +10>Emitted(49, 59) Source(59, 27) + SourceIndex(0) +11>Emitted(49, 61) Source(59, 29) + SourceIndex(0) +12>Emitted(49, 76) Source(59, 36) + SourceIndex(0) +13>Emitted(49, 78) Source(59, 52) + SourceIndex(0) +14>Emitted(49, 79) Source(59, 53) + SourceIndex(0) +15>Emitted(49, 82) Source(59, 56) + SourceIndex(0) +16>Emitted(49, 83) Source(59, 57) + SourceIndex(0) +17>Emitted(49, 85) Source(59, 59) + SourceIndex(0) +18>Emitted(49, 86) Source(59, 60) + SourceIndex(0) +19>Emitted(49, 89) Source(59, 63) + SourceIndex(0) +20>Emitted(49, 90) Source(59, 64) + SourceIndex(0) +21>Emitted(49, 92) Source(59, 66) + SourceIndex(0) +22>Emitted(49, 93) Source(59, 67) + SourceIndex(0) +23>Emitted(49, 95) Source(59, 69) + SourceIndex(0) +24>Emitted(49, 97) Source(59, 71) + SourceIndex(0) +25>Emitted(49, 98) Source(59, 72) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(50, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(50, 23) Source(60, 23) + SourceIndex(0) +7 >Emitted(50, 24) Source(60, 24) + SourceIndex(0) +8 >Emitted(50, 25) Source(60, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = [2, "trimmer", "trimming"], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(52, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(52, 10) Source(62, 6) + SourceIndex(0) +6 >Emitted(52, 41) Source(62, 66) + SourceIndex(0) +7 >Emitted(52, 43) Source(62, 11) + SourceIndex(0) +8 >Emitted(52, 59) Source(62, 19) + SourceIndex(0) +9 >Emitted(52, 61) Source(62, 21) + SourceIndex(0) +10>Emitted(52, 75) Source(62, 27) + SourceIndex(0) +11>Emitted(52, 77) Source(62, 29) + SourceIndex(0) +12>Emitted(52, 92) Source(62, 36) + SourceIndex(0) +13>Emitted(52, 94) Source(62, 68) + SourceIndex(0) +14>Emitted(52, 95) Source(62, 69) + SourceIndex(0) +15>Emitted(52, 98) Source(62, 72) + SourceIndex(0) +16>Emitted(52, 99) Source(62, 73) + SourceIndex(0) +17>Emitted(52, 101) Source(62, 75) + SourceIndex(0) +18>Emitted(52, 102) Source(62, 76) + SourceIndex(0) +19>Emitted(52, 105) Source(62, 79) + SourceIndex(0) +20>Emitted(52, 106) Source(62, 80) + SourceIndex(0) +21>Emitted(52, 108) Source(62, 82) + SourceIndex(0) +22>Emitted(52, 109) Source(62, 83) + SourceIndex(0) +23>Emitted(52, 111) Source(62, 85) + SourceIndex(0) +24>Emitted(52, 113) Source(62, 87) + SourceIndex(0) +25>Emitted(52, 114) Source(62, 88) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(53, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(53, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(53, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameMA +6 > , +7 > [primarySkillA, secondarySkillA] +8 > +9 > primarySkillA +10> , +11> secondarySkillA +12> ]] = multiRobotA, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(55, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(65, 11) + SourceIndex(0) +5 >Emitted(55, 33) Source(65, 17) + SourceIndex(0) +6 >Emitted(55, 35) Source(65, 19) + SourceIndex(0) +7 >Emitted(55, 54) Source(65, 51) + SourceIndex(0) +8 >Emitted(55, 56) Source(65, 20) + SourceIndex(0) +9 >Emitted(55, 77) Source(65, 33) + SourceIndex(0) +10>Emitted(55, 79) Source(65, 35) + SourceIndex(0) +11>Emitted(55, 102) Source(65, 50) + SourceIndex(0) +12>Emitted(55, 104) Source(65, 68) + SourceIndex(0) +13>Emitted(55, 105) Source(65, 69) + SourceIndex(0) +14>Emitted(55, 108) Source(65, 72) + SourceIndex(0) +15>Emitted(55, 109) Source(65, 73) + SourceIndex(0) +16>Emitted(55, 111) Source(65, 75) + SourceIndex(0) +17>Emitted(55, 112) Source(65, 76) + SourceIndex(0) +18>Emitted(55, 115) Source(65, 79) + SourceIndex(0) +19>Emitted(55, 116) Source(65, 80) + SourceIndex(0) +20>Emitted(55, 118) Source(65, 82) + SourceIndex(0) +21>Emitted(55, 119) Source(65, 83) + SourceIndex(0) +22>Emitted(55, 121) Source(65, 85) + SourceIndex(0) +23>Emitted(55, 123) Source(65, 87) + SourceIndex(0) +24>Emitted(55, 124) Source(65, 88) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(56, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(56, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(56, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = getMultiRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(58, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(58, 10) Source(68, 6) + SourceIndex(0) +6 >Emitted(58, 30) Source(68, 70) + SourceIndex(0) +7 >Emitted(58, 32) Source(68, 11) + SourceIndex(0) +8 >Emitted(58, 46) Source(68, 17) + SourceIndex(0) +9 >Emitted(58, 48) Source(68, 19) + SourceIndex(0) +10>Emitted(58, 58) Source(68, 51) + SourceIndex(0) +11>Emitted(58, 60) Source(68, 20) + SourceIndex(0) +12>Emitted(58, 81) Source(68, 33) + SourceIndex(0) +13>Emitted(58, 83) Source(68, 35) + SourceIndex(0) +14>Emitted(58, 106) Source(68, 50) + SourceIndex(0) +15>Emitted(58, 108) Source(68, 72) + SourceIndex(0) +16>Emitted(58, 109) Source(68, 73) + SourceIndex(0) +17>Emitted(58, 112) Source(68, 76) + SourceIndex(0) +18>Emitted(58, 113) Source(68, 77) + SourceIndex(0) +19>Emitted(58, 115) Source(68, 79) + SourceIndex(0) +20>Emitted(58, 116) Source(68, 80) + SourceIndex(0) +21>Emitted(58, 119) Source(68, 83) + SourceIndex(0) +22>Emitted(58, 120) Source(68, 84) + SourceIndex(0) +23>Emitted(58, 122) Source(68, 86) + SourceIndex(0) +24>Emitted(58, 123) Source(68, 87) + SourceIndex(0) +25>Emitted(58, 125) Source(68, 89) + SourceIndex(0) +26>Emitted(58, 127) Source(68, 91) + SourceIndex(0) +27>Emitted(58, 128) Source(68, 92) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(59, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(59, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(59, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = ["trimmer", ["trimming", "edging"]], +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(61, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(61, 10) Source(71, 6) + SourceIndex(0) +6 >Emitted(61, 50) Source(71, 90) + SourceIndex(0) +7 >Emitted(61, 52) Source(71, 11) + SourceIndex(0) +8 >Emitted(61, 66) Source(71, 17) + SourceIndex(0) +9 >Emitted(61, 68) Source(71, 19) + SourceIndex(0) +10>Emitted(61, 78) Source(71, 51) + SourceIndex(0) +11>Emitted(61, 80) Source(71, 20) + SourceIndex(0) +12>Emitted(61, 101) Source(71, 33) + SourceIndex(0) +13>Emitted(61, 103) Source(71, 35) + SourceIndex(0) +14>Emitted(61, 126) Source(71, 50) + SourceIndex(0) +15>Emitted(61, 128) Source(71, 92) + SourceIndex(0) +16>Emitted(61, 129) Source(71, 93) + SourceIndex(0) +17>Emitted(61, 132) Source(71, 96) + SourceIndex(0) +18>Emitted(61, 133) Source(71, 97) + SourceIndex(0) +19>Emitted(61, 135) Source(71, 99) + SourceIndex(0) +20>Emitted(61, 136) Source(71, 100) + SourceIndex(0) +21>Emitted(61, 139) Source(71, 103) + SourceIndex(0) +22>Emitted(61, 140) Source(71, 104) + SourceIndex(0) +23>Emitted(61, 142) Source(71, 106) + SourceIndex(0) +24>Emitted(61, 143) Source(71, 107) + SourceIndex(0) +25>Emitted(61, 145) Source(71, 109) + SourceIndex(0) +26>Emitted(61, 147) Source(71, 111) + SourceIndex(0) +27>Emitted(61, 148) Source(71, 112) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(62, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(62, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(62, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA3 +6 > , +7 > ...robotAInfo +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(64, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(75, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(75, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(75, 11) + SourceIndex(0) +5 >Emitted(64, 30) Source(75, 19) + SourceIndex(0) +6 >Emitted(64, 32) Source(75, 21) + SourceIndex(0) +7 >Emitted(64, 60) Source(75, 34) + SourceIndex(0) +8 >Emitted(64, 62) Source(75, 46) + SourceIndex(0) +9 >Emitted(64, 63) Source(75, 47) + SourceIndex(0) +10>Emitted(64, 66) Source(75, 50) + SourceIndex(0) +11>Emitted(64, 67) Source(75, 51) + SourceIndex(0) +12>Emitted(64, 69) Source(75, 53) + SourceIndex(0) +13>Emitted(64, 70) Source(75, 54) + SourceIndex(0) +14>Emitted(64, 73) Source(75, 57) + SourceIndex(0) +15>Emitted(64, 74) Source(75, 58) + SourceIndex(0) +16>Emitted(64, 76) Source(75, 60) + SourceIndex(0) +17>Emitted(64, 77) Source(75, 61) + SourceIndex(0) +18>Emitted(64, 79) Source(75, 63) + SourceIndex(0) +19>Emitted(64, 81) Source(75, 65) + SourceIndex(0) +20>Emitted(64, 82) Source(75, 66) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(65, 5) Source(76, 5) + SourceIndex(0) +2 >Emitted(65, 12) Source(76, 12) + SourceIndex(0) +3 >Emitted(65, 13) Source(76, 13) + SourceIndex(0) +4 >Emitted(65, 16) Source(76, 16) + SourceIndex(0) +5 >Emitted(65, 17) Source(76, 17) + SourceIndex(0) +6 >Emitted(65, 25) Source(76, 25) + SourceIndex(0) +7 >Emitted(65, 26) Source(76, 26) + SourceIndex(0) +8 >Emitted(65, 27) Source(76, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(66, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(66, 2) Source(77, 2) + SourceIndex(0) +--- +>>>for (var _q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3, ...robotAInfo] = getRobot() +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(67, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(67, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(67, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(67, 6) Source(78, 6) + SourceIndex(0) +5 >Emitted(67, 10) Source(78, 6) + SourceIndex(0) +6 >Emitted(67, 25) Source(78, 48) + SourceIndex(0) +7 >Emitted(67, 27) Source(78, 11) + SourceIndex(0) +8 >Emitted(67, 43) Source(78, 19) + SourceIndex(0) +9 >Emitted(67, 45) Source(78, 21) + SourceIndex(0) +10>Emitted(67, 69) Source(78, 34) + SourceIndex(0) +11>Emitted(67, 71) Source(78, 50) + SourceIndex(0) +12>Emitted(67, 72) Source(78, 51) + SourceIndex(0) +13>Emitted(67, 75) Source(78, 54) + SourceIndex(0) +14>Emitted(67, 76) Source(78, 55) + SourceIndex(0) +15>Emitted(67, 78) Source(78, 57) + SourceIndex(0) +16>Emitted(67, 79) Source(78, 58) + SourceIndex(0) +17>Emitted(67, 82) Source(78, 61) + SourceIndex(0) +18>Emitted(67, 83) Source(78, 62) + SourceIndex(0) +19>Emitted(67, 85) Source(78, 64) + SourceIndex(0) +20>Emitted(67, 86) Source(78, 65) + SourceIndex(0) +21>Emitted(67, 88) Source(78, 67) + SourceIndex(0) +22>Emitted(67, 90) Source(78, 69) + SourceIndex(0) +23>Emitted(67, 91) Source(78, 70) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(68, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(68, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(68, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(68, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(69, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(69, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(70, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(70, 10) Source(81, 6) + SourceIndex(0) +6 >Emitted(70, 41) Source(81, 64) + SourceIndex(0) +7 >Emitted(70, 43) Source(81, 11) + SourceIndex(0) +8 >Emitted(70, 59) Source(81, 19) + SourceIndex(0) +9 >Emitted(70, 61) Source(81, 21) + SourceIndex(0) +10>Emitted(70, 85) Source(81, 34) + SourceIndex(0) +11>Emitted(70, 87) Source(81, 66) + SourceIndex(0) +12>Emitted(70, 88) Source(81, 67) + SourceIndex(0) +13>Emitted(70, 91) Source(81, 70) + SourceIndex(0) +14>Emitted(70, 92) Source(81, 71) + SourceIndex(0) +15>Emitted(70, 94) Source(81, 73) + SourceIndex(0) +16>Emitted(70, 95) Source(81, 74) + SourceIndex(0) +17>Emitted(70, 98) Source(81, 77) + SourceIndex(0) +18>Emitted(70, 99) Source(81, 78) + SourceIndex(0) +19>Emitted(70, 101) Source(81, 80) + SourceIndex(0) +20>Emitted(70, 102) Source(81, 81) + SourceIndex(0) +21>Emitted(70, 104) Source(81, 83) + SourceIndex(0) +22>Emitted(70, 106) Source(81, 85) + SourceIndex(0) +23>Emitted(70, 107) Source(81, 86) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(71, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(71, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(71, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(72, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(72, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = multiRobotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(73, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(84, 11) + SourceIndex(0) +5 >Emitted(73, 48) Source(84, 29) + SourceIndex(0) +6 >Emitted(73, 50) Source(84, 46) + SourceIndex(0) +7 >Emitted(73, 51) Source(84, 47) + SourceIndex(0) +8 >Emitted(73, 54) Source(84, 50) + SourceIndex(0) +9 >Emitted(73, 55) Source(84, 51) + SourceIndex(0) +10>Emitted(73, 57) Source(84, 53) + SourceIndex(0) +11>Emitted(73, 58) Source(84, 54) + SourceIndex(0) +12>Emitted(73, 61) Source(84, 57) + SourceIndex(0) +13>Emitted(73, 62) Source(84, 58) + SourceIndex(0) +14>Emitted(73, 64) Source(84, 60) + SourceIndex(0) +15>Emitted(73, 65) Source(84, 61) + SourceIndex(0) +16>Emitted(73, 67) Source(84, 63) + SourceIndex(0) +17>Emitted(73, 69) Source(84, 65) + SourceIndex(0) +18>Emitted(73, 70) Source(84, 66) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(74, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(74, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(74, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(74, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(74, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(74, 32) Source(85, 32) + SourceIndex(0) +7 >Emitted(74, 33) Source(85, 33) + SourceIndex(0) +8 >Emitted(74, 34) Source(85, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(75, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(75, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(76, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(76, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(76, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(76, 6) Source(87, 11) + SourceIndex(0) +5 >Emitted(76, 52) Source(87, 29) + SourceIndex(0) +6 >Emitted(76, 54) Source(87, 50) + SourceIndex(0) +7 >Emitted(76, 55) Source(87, 51) + SourceIndex(0) +8 >Emitted(76, 58) Source(87, 54) + SourceIndex(0) +9 >Emitted(76, 59) Source(87, 55) + SourceIndex(0) +10>Emitted(76, 61) Source(87, 57) + SourceIndex(0) +11>Emitted(76, 62) Source(87, 58) + SourceIndex(0) +12>Emitted(76, 65) Source(87, 61) + SourceIndex(0) +13>Emitted(76, 66) Source(87, 62) + SourceIndex(0) +14>Emitted(76, 68) Source(87, 64) + SourceIndex(0) +15>Emitted(76, 69) Source(87, 65) + SourceIndex(0) +16>Emitted(76, 71) Source(87, 67) + SourceIndex(0) +17>Emitted(76, 73) Source(87, 69) + SourceIndex(0) +18>Emitted(76, 74) Source(87, 70) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(77, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(77, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(77, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(77, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(77, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(77, 32) Source(88, 32) + SourceIndex(0) +7 >Emitted(77, 33) Source(88, 33) + SourceIndex(0) +8 >Emitted(77, 34) Source(88, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(78, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(78, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(79, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(79, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(79, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(79, 6) Source(90, 11) + SourceIndex(0) +5 >Emitted(79, 72) Source(90, 29) + SourceIndex(0) +6 >Emitted(79, 74) Source(90, 70) + SourceIndex(0) +7 >Emitted(79, 75) Source(90, 71) + SourceIndex(0) +8 >Emitted(79, 78) Source(90, 74) + SourceIndex(0) +9 >Emitted(79, 79) Source(90, 75) + SourceIndex(0) +10>Emitted(79, 81) Source(90, 77) + SourceIndex(0) +11>Emitted(79, 82) Source(90, 78) + SourceIndex(0) +12>Emitted(79, 85) Source(90, 81) + SourceIndex(0) +13>Emitted(79, 86) Source(90, 82) + SourceIndex(0) +14>Emitted(79, 88) Source(90, 84) + SourceIndex(0) +15>Emitted(79, 89) Source(90, 85) + SourceIndex(0) +16>Emitted(79, 91) Source(90, 87) + SourceIndex(0) +17>Emitted(79, 93) Source(90, 89) + SourceIndex(0) +18>Emitted(79, 94) Source(90, 90) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(80, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(80, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(80, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(80, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(81, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(81, 2) Source(92, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols new file mode 100644 index 00000000000..4e2131ff295 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols @@ -0,0 +1,365 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 11)) +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 11)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 11)) +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 11)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 11)) +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 27)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 27)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 27)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 13)) +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 10)) +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 10)) +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 10)) +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 10)) +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 10)) +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 10)) +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 27)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 19)) +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 27)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 19)) +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 27)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 19)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 33)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 33)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 10)) +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 10)) +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 19)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 10)) +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 19)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 10)) +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 10)) +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 10)) +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types new file mode 100644 index 00000000000..fbe264eeeae --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types @@ -0,0 +1,549 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { +> : undefined +>nameA : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +> : undefined +>nameA : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +> : undefined +>nameA : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { +>numberB : number +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : number +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : (number | string)[] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number | string +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : (string | string[])[] +>["trimmer", ["trimming", "edging"]] : (string | string[])[] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | string[])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js new file mode 100644 index 00000000000..aad4d79ddd1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js @@ -0,0 +1,189 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForArrayBindingPattern2.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +var i; +for ((nameA = robotA[1], robotA), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_a = getRobot(), nameA = _a[1], _a), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = [2, "trimmer", "trimming"], nameA = _b[1], _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((numberB = robotA[0], robotA), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_h = getRobot(), numberB = _h[0], _h), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_j = [2, "trimmer", "trimming"], numberB = _j[0], _j), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((nameB = multiRobotA[0], multiRobotA), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_k = getMultiRobot(), nameB = _k[0], _k), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((multiRobotAInfo = multiRobotA.slice(0), multiRobotA), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ((_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ((_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map new file mode 100644 index 00000000000..046cd61ad40 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAC,CAAG,iBAAK,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsB,EAAnB,aAAK,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAsC,EAAnC,aAAK,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAG,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAoB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAwC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,mBAAO,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsB,EAArB,eAAO,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAsC,EAArC,eAAO,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,sBAAK,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAyB,EAAxB,aAAK,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA6C,EAA5C,aAAK,KAAuC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAoB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAwC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,oBAAQ,EAAE,4BAAa,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA6D,EAA5D,gBAAQ,EAAE,wBAAa,KAAqC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,sCAAkB,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAsC,EAArC,6BAAkB,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA6E,EAA5E,6BAAkB,KAA0D,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..186dc717e61 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,3037 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(18, 20) + SourceIndex(0) +5 >Emitted(10, 25) Source(18, 41) + SourceIndex(0) +6 >Emitted(10, 27) Source(18, 43) + SourceIndex(0) +7 >Emitted(10, 42) Source(18, 66) + SourceIndex(0) +8 >Emitted(10, 43) Source(18, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(11, 12) Source(19, 20) + SourceIndex(0) +4 >Emitted(11, 14) Source(19, 22) + SourceIndex(0) +5 >Emitted(11, 19) Source(19, 35) + SourceIndex(0) +6 >Emitted(11, 20) Source(19, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 21) + SourceIndex(0) +4 >Emitted(12, 15) Source(20, 23) + SourceIndex(0) +5 >Emitted(12, 21) Source(20, 37) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 39) + SourceIndex(0) +7 >Emitted(12, 30) Source(20, 54) + SourceIndex(0) +8 >Emitted(12, 32) Source(20, 56) + SourceIndex(0) +9 >Emitted(12, 38) Source(20, 70) + SourceIndex(0) +10>Emitted(12, 39) Source(20, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 13) Source(21, 21) + SourceIndex(0) +4 >Emitted(13, 15) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 54) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 56) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 102) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 103) + SourceIndex(0) +--- +>>>var i; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > i: number +4 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 14) + SourceIndex(0) +4 >Emitted(14, 7) Source(22, 15) + SourceIndex(0) +--- +>>>for ((nameA = robotA[1], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [, +6 > nameA +7 > ] = +8 > robotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(15, 7) Source(24, 9) + SourceIndex(0) +6 >Emitted(15, 24) Source(24, 14) + SourceIndex(0) +7 >Emitted(15, 26) Source(24, 18) + SourceIndex(0) +8 >Emitted(15, 32) Source(24, 24) + SourceIndex(0) +9 >Emitted(15, 33) Source(24, 24) + SourceIndex(0) +10>Emitted(15, 35) Source(24, 26) + SourceIndex(0) +11>Emitted(15, 36) Source(24, 27) + SourceIndex(0) +12>Emitted(15, 39) Source(24, 30) + SourceIndex(0) +13>Emitted(15, 40) Source(24, 31) + SourceIndex(0) +14>Emitted(15, 42) Source(24, 33) + SourceIndex(0) +15>Emitted(15, 43) Source(24, 34) + SourceIndex(0) +16>Emitted(15, 46) Source(24, 37) + SourceIndex(0) +17>Emitted(15, 47) Source(24, 38) + SourceIndex(0) +18>Emitted(15, 49) Source(24, 40) + SourceIndex(0) +19>Emitted(15, 50) Source(24, 41) + SourceIndex(0) +20>Emitted(15, 52) Source(24, 43) + SourceIndex(0) +21>Emitted(15, 54) Source(24, 45) + SourceIndex(0) +22>Emitted(15, 55) Source(24, 46) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for ((_a = getRobot(), nameA = _a[1], _a), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA] = getRobot() +7 > +8 > nameA +9 > ] = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +5 >Emitted(18, 7) Source(27, 6) + SourceIndex(0) +6 >Emitted(18, 22) Source(27, 28) + SourceIndex(0) +7 >Emitted(18, 24) Source(27, 9) + SourceIndex(0) +8 >Emitted(18, 37) Source(27, 14) + SourceIndex(0) +9 >Emitted(18, 42) Source(27, 28) + SourceIndex(0) +10>Emitted(18, 44) Source(27, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(27, 31) + SourceIndex(0) +12>Emitted(18, 48) Source(27, 34) + SourceIndex(0) +13>Emitted(18, 49) Source(27, 35) + SourceIndex(0) +14>Emitted(18, 51) Source(27, 37) + SourceIndex(0) +15>Emitted(18, 52) Source(27, 38) + SourceIndex(0) +16>Emitted(18, 55) Source(27, 41) + SourceIndex(0) +17>Emitted(18, 56) Source(27, 42) + SourceIndex(0) +18>Emitted(18, 58) Source(27, 44) + SourceIndex(0) +19>Emitted(18, 59) Source(27, 45) + SourceIndex(0) +20>Emitted(18, 61) Source(27, 47) + SourceIndex(0) +21>Emitted(18, 63) Source(27, 49) + SourceIndex(0) +22>Emitted(18, 64) Source(27, 50) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for ((_b = [2, "trimmer", "trimming"], nameA = _b[1], _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA] = [2, "trimmer", "trimming"] +7 > +8 > nameA +9 > ] = [2, "trimmer", "trimming"] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(21, 7) Source(30, 6) + SourceIndex(0) +6 >Emitted(21, 38) Source(30, 44) + SourceIndex(0) +7 >Emitted(21, 40) Source(30, 9) + SourceIndex(0) +8 >Emitted(21, 53) Source(30, 14) + SourceIndex(0) +9 >Emitted(21, 58) Source(30, 44) + SourceIndex(0) +10>Emitted(21, 60) Source(30, 46) + SourceIndex(0) +11>Emitted(21, 61) Source(30, 47) + SourceIndex(0) +12>Emitted(21, 64) Source(30, 50) + SourceIndex(0) +13>Emitted(21, 65) Source(30, 51) + SourceIndex(0) +14>Emitted(21, 67) Source(30, 53) + SourceIndex(0) +15>Emitted(21, 68) Source(30, 54) + SourceIndex(0) +16>Emitted(21, 71) Source(30, 57) + SourceIndex(0) +17>Emitted(21, 72) Source(30, 58) + SourceIndex(0) +18>Emitted(21, 74) Source(30, 60) + SourceIndex(0) +19>Emitted(21, 75) Source(30, 61) + SourceIndex(0) +20>Emitted(21, 77) Source(30, 63) + SourceIndex(0) +21>Emitted(21, 79) Source(30, 65) + SourceIndex(0) +22>Emitted(21, 80) Source(30, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(31, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(31, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for ((_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [, +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +11> ]] = +12> multiRobotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(24, 7) Source(33, 9) + SourceIndex(0) +6 >Emitted(24, 26) Source(33, 41) + SourceIndex(0) +7 >Emitted(24, 28) Source(33, 10) + SourceIndex(0) +8 >Emitted(24, 49) Source(33, 23) + SourceIndex(0) +9 >Emitted(24, 51) Source(33, 25) + SourceIndex(0) +10>Emitted(24, 74) Source(33, 40) + SourceIndex(0) +11>Emitted(24, 76) Source(33, 45) + SourceIndex(0) +12>Emitted(24, 87) Source(33, 56) + SourceIndex(0) +13>Emitted(24, 88) Source(33, 56) + SourceIndex(0) +14>Emitted(24, 90) Source(33, 58) + SourceIndex(0) +15>Emitted(24, 91) Source(33, 59) + SourceIndex(0) +16>Emitted(24, 94) Source(33, 62) + SourceIndex(0) +17>Emitted(24, 95) Source(33, 63) + SourceIndex(0) +18>Emitted(24, 97) Source(33, 65) + SourceIndex(0) +19>Emitted(24, 98) Source(33, 66) + SourceIndex(0) +20>Emitted(24, 101) Source(33, 69) + SourceIndex(0) +21>Emitted(24, 102) Source(33, 70) + SourceIndex(0) +22>Emitted(24, 104) Source(33, 72) + SourceIndex(0) +23>Emitted(24, 105) Source(33, 73) + SourceIndex(0) +24>Emitted(24, 107) Source(33, 75) + SourceIndex(0) +25>Emitted(24, 109) Source(33, 77) + SourceIndex(0) +26>Emitted(24, 110) Source(33, 78) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(25, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(25, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(25, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for ((_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(27, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(36, 6) + SourceIndex(0) +5 >Emitted(27, 7) Source(36, 6) + SourceIndex(0) +6 >Emitted(27, 27) Source(36, 60) + SourceIndex(0) +7 >Emitted(27, 29) Source(36, 9) + SourceIndex(0) +8 >Emitted(27, 39) Source(36, 41) + SourceIndex(0) +9 >Emitted(27, 41) Source(36, 10) + SourceIndex(0) +10>Emitted(27, 62) Source(36, 23) + SourceIndex(0) +11>Emitted(27, 64) Source(36, 25) + SourceIndex(0) +12>Emitted(27, 87) Source(36, 40) + SourceIndex(0) +13>Emitted(27, 92) Source(36, 60) + SourceIndex(0) +14>Emitted(27, 94) Source(36, 62) + SourceIndex(0) +15>Emitted(27, 95) Source(36, 63) + SourceIndex(0) +16>Emitted(27, 98) Source(36, 66) + SourceIndex(0) +17>Emitted(27, 99) Source(36, 67) + SourceIndex(0) +18>Emitted(27, 101) Source(36, 69) + SourceIndex(0) +19>Emitted(27, 102) Source(36, 70) + SourceIndex(0) +20>Emitted(27, 105) Source(36, 73) + SourceIndex(0) +21>Emitted(27, 106) Source(36, 74) + SourceIndex(0) +22>Emitted(27, 108) Source(36, 76) + SourceIndex(0) +23>Emitted(27, 109) Source(36, 77) + SourceIndex(0) +24>Emitted(27, 111) Source(36, 79) + SourceIndex(0) +25>Emitted(27, 113) Source(36, 81) + SourceIndex(0) +26>Emitted(27, 114) Source(36, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(28, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(28, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(28, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for ((_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = ["trimmer", ["trimming", "edging"]] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(30, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(39, 6) + SourceIndex(0) +6 >Emitted(30, 47) Source(39, 80) + SourceIndex(0) +7 >Emitted(30, 49) Source(39, 9) + SourceIndex(0) +8 >Emitted(30, 59) Source(39, 41) + SourceIndex(0) +9 >Emitted(30, 61) Source(39, 10) + SourceIndex(0) +10>Emitted(30, 82) Source(39, 23) + SourceIndex(0) +11>Emitted(30, 84) Source(39, 25) + SourceIndex(0) +12>Emitted(30, 107) Source(39, 40) + SourceIndex(0) +13>Emitted(30, 112) Source(39, 80) + SourceIndex(0) +14>Emitted(30, 114) Source(39, 82) + SourceIndex(0) +15>Emitted(30, 115) Source(39, 83) + SourceIndex(0) +16>Emitted(30, 118) Source(39, 86) + SourceIndex(0) +17>Emitted(30, 119) Source(39, 87) + SourceIndex(0) +18>Emitted(30, 121) Source(39, 89) + SourceIndex(0) +19>Emitted(30, 122) Source(39, 90) + SourceIndex(0) +20>Emitted(30, 125) Source(39, 93) + SourceIndex(0) +21>Emitted(30, 126) Source(39, 94) + SourceIndex(0) +22>Emitted(30, 128) Source(39, 96) + SourceIndex(0) +23>Emitted(30, 129) Source(39, 97) + SourceIndex(0) +24>Emitted(30, 131) Source(39, 99) + SourceIndex(0) +25>Emitted(30, 133) Source(39, 101) + SourceIndex(0) +26>Emitted(30, 134) Source(39, 102) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(40, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(40, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(40, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for ((numberB = robotA[0], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberB +7 > ] = +8 > robotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(33, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(43, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(43, 7) + SourceIndex(0) +6 >Emitted(33, 26) Source(43, 14) + SourceIndex(0) +7 >Emitted(33, 28) Source(43, 18) + SourceIndex(0) +8 >Emitted(33, 34) Source(43, 24) + SourceIndex(0) +9 >Emitted(33, 35) Source(43, 24) + SourceIndex(0) +10>Emitted(33, 37) Source(43, 26) + SourceIndex(0) +11>Emitted(33, 38) Source(43, 27) + SourceIndex(0) +12>Emitted(33, 41) Source(43, 30) + SourceIndex(0) +13>Emitted(33, 42) Source(43, 31) + SourceIndex(0) +14>Emitted(33, 44) Source(43, 33) + SourceIndex(0) +15>Emitted(33, 45) Source(43, 34) + SourceIndex(0) +16>Emitted(33, 48) Source(43, 37) + SourceIndex(0) +17>Emitted(33, 49) Source(43, 38) + SourceIndex(0) +18>Emitted(33, 51) Source(43, 40) + SourceIndex(0) +19>Emitted(33, 52) Source(43, 41) + SourceIndex(0) +20>Emitted(33, 54) Source(43, 43) + SourceIndex(0) +21>Emitted(33, 56) Source(43, 45) + SourceIndex(0) +22>Emitted(33, 57) Source(43, 46) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(34, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(34, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(34, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(34, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for ((_h = getRobot(), numberB = _h[0], _h), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB] = getRobot() +7 > +8 > numberB +9 > ] = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(36, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(46, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(46, 6) + SourceIndex(0) +6 >Emitted(36, 22) Source(46, 28) + SourceIndex(0) +7 >Emitted(36, 24) Source(46, 7) + SourceIndex(0) +8 >Emitted(36, 39) Source(46, 14) + SourceIndex(0) +9 >Emitted(36, 44) Source(46, 28) + SourceIndex(0) +10>Emitted(36, 46) Source(46, 30) + SourceIndex(0) +11>Emitted(36, 47) Source(46, 31) + SourceIndex(0) +12>Emitted(36, 50) Source(46, 34) + SourceIndex(0) +13>Emitted(36, 51) Source(46, 35) + SourceIndex(0) +14>Emitted(36, 53) Source(46, 37) + SourceIndex(0) +15>Emitted(36, 54) Source(46, 38) + SourceIndex(0) +16>Emitted(36, 57) Source(46, 41) + SourceIndex(0) +17>Emitted(36, 58) Source(46, 42) + SourceIndex(0) +18>Emitted(36, 60) Source(46, 44) + SourceIndex(0) +19>Emitted(36, 61) Source(46, 45) + SourceIndex(0) +20>Emitted(36, 63) Source(46, 47) + SourceIndex(0) +21>Emitted(36, 65) Source(46, 49) + SourceIndex(0) +22>Emitted(36, 66) Source(46, 50) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(37, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(37, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(37, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(37, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for ((_j = [2, "trimmer", "trimming"], numberB = _j[0], _j), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB] = [2, "trimmer", "trimming"] +7 > +8 > numberB +9 > ] = [2, "trimmer", "trimming"] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(39, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(49, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(49, 6) + SourceIndex(0) +6 >Emitted(39, 38) Source(49, 44) + SourceIndex(0) +7 >Emitted(39, 40) Source(49, 7) + SourceIndex(0) +8 >Emitted(39, 55) Source(49, 14) + SourceIndex(0) +9 >Emitted(39, 60) Source(49, 44) + SourceIndex(0) +10>Emitted(39, 62) Source(49, 46) + SourceIndex(0) +11>Emitted(39, 63) Source(49, 47) + SourceIndex(0) +12>Emitted(39, 66) Source(49, 50) + SourceIndex(0) +13>Emitted(39, 67) Source(49, 51) + SourceIndex(0) +14>Emitted(39, 69) Source(49, 53) + SourceIndex(0) +15>Emitted(39, 70) Source(49, 54) + SourceIndex(0) +16>Emitted(39, 73) Source(49, 57) + SourceIndex(0) +17>Emitted(39, 74) Source(49, 58) + SourceIndex(0) +18>Emitted(39, 76) Source(49, 60) + SourceIndex(0) +19>Emitted(39, 77) Source(49, 61) + SourceIndex(0) +20>Emitted(39, 79) Source(49, 63) + SourceIndex(0) +21>Emitted(39, 81) Source(49, 65) + SourceIndex(0) +22>Emitted(39, 82) Source(49, 66) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(40, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(40, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(40, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(40, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for ((nameB = multiRobotA[0], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameB +7 > ] = +8 > multiRobotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(42, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(52, 7) + SourceIndex(0) +6 >Emitted(42, 29) Source(52, 12) + SourceIndex(0) +7 >Emitted(42, 31) Source(52, 16) + SourceIndex(0) +8 >Emitted(42, 42) Source(52, 27) + SourceIndex(0) +9 >Emitted(42, 43) Source(52, 27) + SourceIndex(0) +10>Emitted(42, 45) Source(52, 29) + SourceIndex(0) +11>Emitted(42, 46) Source(52, 30) + SourceIndex(0) +12>Emitted(42, 49) Source(52, 33) + SourceIndex(0) +13>Emitted(42, 50) Source(52, 34) + SourceIndex(0) +14>Emitted(42, 52) Source(52, 36) + SourceIndex(0) +15>Emitted(42, 53) Source(52, 37) + SourceIndex(0) +16>Emitted(42, 56) Source(52, 40) + SourceIndex(0) +17>Emitted(42, 57) Source(52, 41) + SourceIndex(0) +18>Emitted(42, 59) Source(52, 43) + SourceIndex(0) +19>Emitted(42, 60) Source(52, 44) + SourceIndex(0) +20>Emitted(42, 62) Source(52, 46) + SourceIndex(0) +21>Emitted(42, 64) Source(52, 48) + SourceIndex(0) +22>Emitted(42, 65) Source(52, 49) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), nameB = _k[0], _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB] = getMultiRobot() +7 > +8 > nameB +9 > ] = getMultiRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(45, 27) Source(55, 31) + SourceIndex(0) +7 >Emitted(45, 29) Source(55, 7) + SourceIndex(0) +8 >Emitted(45, 42) Source(55, 12) + SourceIndex(0) +9 >Emitted(45, 47) Source(55, 31) + SourceIndex(0) +10>Emitted(45, 49) Source(55, 33) + SourceIndex(0) +11>Emitted(45, 50) Source(55, 34) + SourceIndex(0) +12>Emitted(45, 53) Source(55, 37) + SourceIndex(0) +13>Emitted(45, 54) Source(55, 38) + SourceIndex(0) +14>Emitted(45, 56) Source(55, 40) + SourceIndex(0) +15>Emitted(45, 57) Source(55, 41) + SourceIndex(0) +16>Emitted(45, 60) Source(55, 44) + SourceIndex(0) +17>Emitted(45, 61) Source(55, 45) + SourceIndex(0) +18>Emitted(45, 63) Source(55, 47) + SourceIndex(0) +19>Emitted(45, 64) Source(55, 48) + SourceIndex(0) +20>Emitted(45, 66) Source(55, 50) + SourceIndex(0) +21>Emitted(45, 68) Source(55, 52) + SourceIndex(0) +22>Emitted(45, 69) Source(55, 53) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(46, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(46, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(46, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(46, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(46, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(46, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(46, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(46, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(47, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(47, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameB +9 > ] = ["trimmer", ["trimming", "edging"]] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(48, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(48, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(48, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(48, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(48, 7) Source(58, 6) + SourceIndex(0) +6 >Emitted(48, 47) Source(58, 51) + SourceIndex(0) +7 >Emitted(48, 49) Source(58, 7) + SourceIndex(0) +8 >Emitted(48, 62) Source(58, 12) + SourceIndex(0) +9 >Emitted(48, 67) Source(58, 51) + SourceIndex(0) +10>Emitted(48, 69) Source(58, 53) + SourceIndex(0) +11>Emitted(48, 70) Source(58, 54) + SourceIndex(0) +12>Emitted(48, 73) Source(58, 57) + SourceIndex(0) +13>Emitted(48, 74) Source(58, 58) + SourceIndex(0) +14>Emitted(48, 76) Source(58, 60) + SourceIndex(0) +15>Emitted(48, 77) Source(58, 61) + SourceIndex(0) +16>Emitted(48, 80) Source(58, 64) + SourceIndex(0) +17>Emitted(48, 81) Source(58, 65) + SourceIndex(0) +18>Emitted(48, 83) Source(58, 67) + SourceIndex(0) +19>Emitted(48, 84) Source(58, 68) + SourceIndex(0) +20>Emitted(48, 86) Source(58, 70) + SourceIndex(0) +21>Emitted(48, 88) Source(58, 72) + SourceIndex(0) +22>Emitted(48, 89) Source(58, 73) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(50, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA2 +7 > , +8 > nameA2 +9 > , +10> skillA2 +11> ] = +12> robotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(51, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(51, 7) Source(62, 7) + SourceIndex(0) +6 >Emitted(51, 27) Source(62, 15) + SourceIndex(0) +7 >Emitted(51, 29) Source(62, 17) + SourceIndex(0) +8 >Emitted(51, 47) Source(62, 23) + SourceIndex(0) +9 >Emitted(51, 49) Source(62, 25) + SourceIndex(0) +10>Emitted(51, 68) Source(62, 32) + SourceIndex(0) +11>Emitted(51, 70) Source(62, 36) + SourceIndex(0) +12>Emitted(51, 76) Source(62, 42) + SourceIndex(0) +13>Emitted(51, 77) Source(62, 42) + SourceIndex(0) +14>Emitted(51, 79) Source(62, 44) + SourceIndex(0) +15>Emitted(51, 80) Source(62, 45) + SourceIndex(0) +16>Emitted(51, 83) Source(62, 48) + SourceIndex(0) +17>Emitted(51, 84) Source(62, 49) + SourceIndex(0) +18>Emitted(51, 86) Source(62, 51) + SourceIndex(0) +19>Emitted(51, 87) Source(62, 52) + SourceIndex(0) +20>Emitted(51, 90) Source(62, 55) + SourceIndex(0) +21>Emitted(51, 91) Source(62, 56) + SourceIndex(0) +22>Emitted(51, 93) Source(62, 58) + SourceIndex(0) +23>Emitted(51, 94) Source(62, 59) + SourceIndex(0) +24>Emitted(51, 96) Source(62, 61) + SourceIndex(0) +25>Emitted(51, 98) Source(62, 63) + SourceIndex(0) +26>Emitted(51, 99) Source(62, 64) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(52, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(52, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(52, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(52, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(52, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(52, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(52, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(52, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(53, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(53, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for ((_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2, nameA2, skillA2] = getRobot() +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = getRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(54, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(54, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(54, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(54, 6) Source(65, 6) + SourceIndex(0) +5 >Emitted(54, 7) Source(65, 6) + SourceIndex(0) +6 >Emitted(54, 22) Source(65, 46) + SourceIndex(0) +7 >Emitted(54, 24) Source(65, 7) + SourceIndex(0) +8 >Emitted(54, 40) Source(65, 15) + SourceIndex(0) +9 >Emitted(54, 42) Source(65, 17) + SourceIndex(0) +10>Emitted(54, 56) Source(65, 23) + SourceIndex(0) +11>Emitted(54, 58) Source(65, 25) + SourceIndex(0) +12>Emitted(54, 73) Source(65, 32) + SourceIndex(0) +13>Emitted(54, 78) Source(65, 46) + SourceIndex(0) +14>Emitted(54, 80) Source(65, 48) + SourceIndex(0) +15>Emitted(54, 81) Source(65, 49) + SourceIndex(0) +16>Emitted(54, 84) Source(65, 52) + SourceIndex(0) +17>Emitted(54, 85) Source(65, 53) + SourceIndex(0) +18>Emitted(54, 87) Source(65, 55) + SourceIndex(0) +19>Emitted(54, 88) Source(65, 56) + SourceIndex(0) +20>Emitted(54, 91) Source(65, 59) + SourceIndex(0) +21>Emitted(54, 92) Source(65, 60) + SourceIndex(0) +22>Emitted(54, 94) Source(65, 62) + SourceIndex(0) +23>Emitted(54, 95) Source(65, 63) + SourceIndex(0) +24>Emitted(54, 97) Source(65, 65) + SourceIndex(0) +25>Emitted(54, 99) Source(65, 67) + SourceIndex(0) +26>Emitted(54, 100) Source(65, 68) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(55, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(55, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(55, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(55, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(56, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(56, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for ((_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = [2, "trimmer", "trimming"] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(57, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(57, 7) Source(68, 6) + SourceIndex(0) +6 >Emitted(57, 38) Source(68, 62) + SourceIndex(0) +7 >Emitted(57, 40) Source(68, 7) + SourceIndex(0) +8 >Emitted(57, 56) Source(68, 15) + SourceIndex(0) +9 >Emitted(57, 58) Source(68, 17) + SourceIndex(0) +10>Emitted(57, 72) Source(68, 23) + SourceIndex(0) +11>Emitted(57, 74) Source(68, 25) + SourceIndex(0) +12>Emitted(57, 89) Source(68, 32) + SourceIndex(0) +13>Emitted(57, 94) Source(68, 62) + SourceIndex(0) +14>Emitted(57, 96) Source(68, 64) + SourceIndex(0) +15>Emitted(57, 97) Source(68, 65) + SourceIndex(0) +16>Emitted(57, 100) Source(68, 68) + SourceIndex(0) +17>Emitted(57, 101) Source(68, 69) + SourceIndex(0) +18>Emitted(57, 103) Source(68, 71) + SourceIndex(0) +19>Emitted(57, 104) Source(68, 72) + SourceIndex(0) +20>Emitted(57, 107) Source(68, 75) + SourceIndex(0) +21>Emitted(57, 108) Source(68, 76) + SourceIndex(0) +22>Emitted(57, 110) Source(68, 78) + SourceIndex(0) +23>Emitted(57, 111) Source(68, 79) + SourceIndex(0) +24>Emitted(57, 113) Source(68, 81) + SourceIndex(0) +25>Emitted(57, 115) Source(68, 83) + SourceIndex(0) +26>Emitted(57, 116) Source(68, 84) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(58, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(58, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(58, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(58, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(59, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(59, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for ((nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameMA +7 > , +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = +14> multiRobotA +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(60, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(60, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(60, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(60, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(60, 7) Source(71, 7) + SourceIndex(0) +6 >Emitted(60, 30) Source(71, 13) + SourceIndex(0) +7 >Emitted(60, 32) Source(71, 15) + SourceIndex(0) +8 >Emitted(60, 51) Source(71, 47) + SourceIndex(0) +9 >Emitted(60, 53) Source(71, 16) + SourceIndex(0) +10>Emitted(60, 74) Source(71, 29) + SourceIndex(0) +11>Emitted(60, 76) Source(71, 31) + SourceIndex(0) +12>Emitted(60, 99) Source(71, 46) + SourceIndex(0) +13>Emitted(60, 101) Source(71, 51) + SourceIndex(0) +14>Emitted(60, 112) Source(71, 62) + SourceIndex(0) +15>Emitted(60, 113) Source(71, 62) + SourceIndex(0) +16>Emitted(60, 115) Source(71, 64) + SourceIndex(0) +17>Emitted(60, 116) Source(71, 65) + SourceIndex(0) +18>Emitted(60, 119) Source(71, 68) + SourceIndex(0) +19>Emitted(60, 120) Source(71, 69) + SourceIndex(0) +20>Emitted(60, 122) Source(71, 71) + SourceIndex(0) +21>Emitted(60, 123) Source(71, 72) + SourceIndex(0) +22>Emitted(60, 126) Source(71, 75) + SourceIndex(0) +23>Emitted(60, 127) Source(71, 76) + SourceIndex(0) +24>Emitted(60, 129) Source(71, 78) + SourceIndex(0) +25>Emitted(60, 130) Source(71, 79) + SourceIndex(0) +26>Emitted(60, 132) Source(71, 81) + SourceIndex(0) +27>Emitted(60, 134) Source(71, 83) + SourceIndex(0) +28>Emitted(60, 135) Source(71, 84) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(61, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(61, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(61, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(61, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(61, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(61, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(61, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(61, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(62, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(62, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(63, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(63, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(63, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(63, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(63, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(63, 27) Source(74, 66) + SourceIndex(0) +7 >Emitted(63, 29) Source(74, 7) + SourceIndex(0) +8 >Emitted(63, 43) Source(74, 13) + SourceIndex(0) +9 >Emitted(63, 45) Source(74, 15) + SourceIndex(0) +10>Emitted(63, 55) Source(74, 47) + SourceIndex(0) +11>Emitted(63, 57) Source(74, 16) + SourceIndex(0) +12>Emitted(63, 78) Source(74, 29) + SourceIndex(0) +13>Emitted(63, 80) Source(74, 31) + SourceIndex(0) +14>Emitted(63, 103) Source(74, 46) + SourceIndex(0) +15>Emitted(63, 108) Source(74, 66) + SourceIndex(0) +16>Emitted(63, 110) Source(74, 68) + SourceIndex(0) +17>Emitted(63, 111) Source(74, 69) + SourceIndex(0) +18>Emitted(63, 114) Source(74, 72) + SourceIndex(0) +19>Emitted(63, 115) Source(74, 73) + SourceIndex(0) +20>Emitted(63, 117) Source(74, 75) + SourceIndex(0) +21>Emitted(63, 118) Source(74, 76) + SourceIndex(0) +22>Emitted(63, 121) Source(74, 79) + SourceIndex(0) +23>Emitted(63, 122) Source(74, 80) + SourceIndex(0) +24>Emitted(63, 124) Source(74, 82) + SourceIndex(0) +25>Emitted(63, 125) Source(74, 83) + SourceIndex(0) +26>Emitted(63, 127) Source(74, 85) + SourceIndex(0) +27>Emitted(63, 129) Source(74, 87) + SourceIndex(0) +28>Emitted(63, 130) Source(74, 88) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(64, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(64, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(64, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(65, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(65, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = ["trimmer", ["trimming", "edging"]] +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(66, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(66, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(66, 47) Source(77, 86) + SourceIndex(0) +7 >Emitted(66, 49) Source(77, 7) + SourceIndex(0) +8 >Emitted(66, 63) Source(77, 13) + SourceIndex(0) +9 >Emitted(66, 65) Source(77, 15) + SourceIndex(0) +10>Emitted(66, 75) Source(77, 47) + SourceIndex(0) +11>Emitted(66, 77) Source(77, 16) + SourceIndex(0) +12>Emitted(66, 98) Source(77, 29) + SourceIndex(0) +13>Emitted(66, 100) Source(77, 31) + SourceIndex(0) +14>Emitted(66, 123) Source(77, 46) + SourceIndex(0) +15>Emitted(66, 128) Source(77, 86) + SourceIndex(0) +16>Emitted(66, 130) Source(77, 88) + SourceIndex(0) +17>Emitted(66, 131) Source(77, 89) + SourceIndex(0) +18>Emitted(66, 134) Source(77, 92) + SourceIndex(0) +19>Emitted(66, 135) Source(77, 93) + SourceIndex(0) +20>Emitted(66, 137) Source(77, 95) + SourceIndex(0) +21>Emitted(66, 138) Source(77, 96) + SourceIndex(0) +22>Emitted(66, 141) Source(77, 99) + SourceIndex(0) +23>Emitted(66, 142) Source(77, 100) + SourceIndex(0) +24>Emitted(66, 144) Source(77, 102) + SourceIndex(0) +25>Emitted(66, 145) Source(77, 103) + SourceIndex(0) +26>Emitted(66, 147) Source(77, 105) + SourceIndex(0) +27>Emitted(66, 149) Source(77, 107) + SourceIndex(0) +28>Emitted(66, 150) Source(77, 108) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(67, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(78, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(78, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(78, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(68, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(68, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for ((numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA3 +7 > , +8 > ...robotAInfo +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(69, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(69, 7) Source(81, 7) + SourceIndex(0) +6 >Emitted(69, 27) Source(81, 15) + SourceIndex(0) +7 >Emitted(69, 29) Source(81, 17) + SourceIndex(0) +8 >Emitted(69, 57) Source(81, 30) + SourceIndex(0) +9 >Emitted(69, 59) Source(81, 34) + SourceIndex(0) +10>Emitted(69, 65) Source(81, 40) + SourceIndex(0) +11>Emitted(69, 66) Source(81, 40) + SourceIndex(0) +12>Emitted(69, 68) Source(81, 42) + SourceIndex(0) +13>Emitted(69, 69) Source(81, 43) + SourceIndex(0) +14>Emitted(69, 72) Source(81, 46) + SourceIndex(0) +15>Emitted(69, 73) Source(81, 47) + SourceIndex(0) +16>Emitted(69, 75) Source(81, 49) + SourceIndex(0) +17>Emitted(69, 76) Source(81, 50) + SourceIndex(0) +18>Emitted(69, 79) Source(81, 53) + SourceIndex(0) +19>Emitted(69, 80) Source(81, 54) + SourceIndex(0) +20>Emitted(69, 82) Source(81, 56) + SourceIndex(0) +21>Emitted(69, 83) Source(81, 57) + SourceIndex(0) +22>Emitted(69, 85) Source(81, 59) + SourceIndex(0) +23>Emitted(69, 87) Source(81, 61) + SourceIndex(0) +24>Emitted(69, 88) Source(81, 62) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(70, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(70, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(70, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(70, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(70, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(70, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(70, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(70, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(71, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(71, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for ((_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3, ...robotAInfo] = getRobot() +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(72, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(72, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(72, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(72, 6) Source(84, 6) + SourceIndex(0) +5 >Emitted(72, 7) Source(84, 6) + SourceIndex(0) +6 >Emitted(72, 22) Source(84, 44) + SourceIndex(0) +7 >Emitted(72, 24) Source(84, 7) + SourceIndex(0) +8 >Emitted(72, 40) Source(84, 15) + SourceIndex(0) +9 >Emitted(72, 42) Source(84, 17) + SourceIndex(0) +10>Emitted(72, 66) Source(84, 30) + SourceIndex(0) +11>Emitted(72, 71) Source(84, 44) + SourceIndex(0) +12>Emitted(72, 73) Source(84, 46) + SourceIndex(0) +13>Emitted(72, 74) Source(84, 47) + SourceIndex(0) +14>Emitted(72, 77) Source(84, 50) + SourceIndex(0) +15>Emitted(72, 78) Source(84, 51) + SourceIndex(0) +16>Emitted(72, 80) Source(84, 53) + SourceIndex(0) +17>Emitted(72, 81) Source(84, 54) + SourceIndex(0) +18>Emitted(72, 84) Source(84, 57) + SourceIndex(0) +19>Emitted(72, 85) Source(84, 58) + SourceIndex(0) +20>Emitted(72, 87) Source(84, 60) + SourceIndex(0) +21>Emitted(72, 88) Source(84, 61) + SourceIndex(0) +22>Emitted(72, 90) Source(84, 63) + SourceIndex(0) +23>Emitted(72, 92) Source(84, 65) + SourceIndex(0) +24>Emitted(72, 93) Source(84, 66) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(73, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(73, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(73, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(73, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(73, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(73, 25) Source(85, 25) + SourceIndex(0) +7 >Emitted(73, 26) Source(85, 26) + SourceIndex(0) +8 >Emitted(73, 27) Source(85, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(74, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(74, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for ((_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(75, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(75, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(75, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(75, 6) Source(87, 6) + SourceIndex(0) +5 >Emitted(75, 7) Source(87, 6) + SourceIndex(0) +6 >Emitted(75, 38) Source(87, 67) + SourceIndex(0) +7 >Emitted(75, 40) Source(87, 7) + SourceIndex(0) +8 >Emitted(75, 56) Source(87, 15) + SourceIndex(0) +9 >Emitted(75, 58) Source(87, 17) + SourceIndex(0) +10>Emitted(75, 82) Source(87, 30) + SourceIndex(0) +11>Emitted(75, 87) Source(87, 67) + SourceIndex(0) +12>Emitted(75, 89) Source(87, 69) + SourceIndex(0) +13>Emitted(75, 90) Source(87, 70) + SourceIndex(0) +14>Emitted(75, 93) Source(87, 73) + SourceIndex(0) +15>Emitted(75, 94) Source(87, 74) + SourceIndex(0) +16>Emitted(75, 96) Source(87, 76) + SourceIndex(0) +17>Emitted(75, 97) Source(87, 77) + SourceIndex(0) +18>Emitted(75, 100) Source(87, 80) + SourceIndex(0) +19>Emitted(75, 101) Source(87, 81) + SourceIndex(0) +20>Emitted(75, 103) Source(87, 83) + SourceIndex(0) +21>Emitted(75, 104) Source(87, 84) + SourceIndex(0) +22>Emitted(75, 106) Source(87, 86) + SourceIndex(0) +23>Emitted(75, 108) Source(87, 88) + SourceIndex(0) +24>Emitted(75, 109) Source(87, 89) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(76, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(76, 25) Source(88, 25) + SourceIndex(0) +7 >Emitted(76, 26) Source(88, 26) + SourceIndex(0) +8 >Emitted(76, 27) Source(88, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(77, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(77, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for ((multiRobotAInfo = multiRobotA.slice(0), multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > ...multiRobotAInfo +7 > ] = +8 > multiRobotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(78, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(90, 6) + SourceIndex(0) +5 >Emitted(78, 7) Source(90, 7) + SourceIndex(0) +6 >Emitted(78, 45) Source(90, 25) + SourceIndex(0) +7 >Emitted(78, 47) Source(90, 29) + SourceIndex(0) +8 >Emitted(78, 58) Source(90, 40) + SourceIndex(0) +9 >Emitted(78, 59) Source(90, 40) + SourceIndex(0) +10>Emitted(78, 61) Source(90, 42) + SourceIndex(0) +11>Emitted(78, 62) Source(90, 43) + SourceIndex(0) +12>Emitted(78, 65) Source(90, 46) + SourceIndex(0) +13>Emitted(78, 66) Source(90, 47) + SourceIndex(0) +14>Emitted(78, 68) Source(90, 49) + SourceIndex(0) +15>Emitted(78, 69) Source(90, 50) + SourceIndex(0) +16>Emitted(78, 72) Source(90, 53) + SourceIndex(0) +17>Emitted(78, 73) Source(90, 54) + SourceIndex(0) +18>Emitted(78, 75) Source(90, 56) + SourceIndex(0) +19>Emitted(78, 76) Source(90, 57) + SourceIndex(0) +20>Emitted(78, 78) Source(90, 59) + SourceIndex(0) +21>Emitted(78, 80) Source(90, 61) + SourceIndex(0) +22>Emitted(78, 81) Source(90, 62) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(79, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(79, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(79, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(79, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(80, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(80, 2) Source(92, 2) + SourceIndex(0) +--- +>>>for ((_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [...multiRobotAInfo] = getMultiRobot() +7 > +8 > ...multiRobotAInfo +9 > ] = getMultiRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(81, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(93, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(93, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(93, 6) + SourceIndex(0) +5 >Emitted(81, 7) Source(93, 6) + SourceIndex(0) +6 >Emitted(81, 27) Source(93, 44) + SourceIndex(0) +7 >Emitted(81, 29) Source(93, 7) + SourceIndex(0) +8 >Emitted(81, 58) Source(93, 25) + SourceIndex(0) +9 >Emitted(81, 63) Source(93, 44) + SourceIndex(0) +10>Emitted(81, 65) Source(93, 46) + SourceIndex(0) +11>Emitted(81, 66) Source(93, 47) + SourceIndex(0) +12>Emitted(81, 69) Source(93, 50) + SourceIndex(0) +13>Emitted(81, 70) Source(93, 51) + SourceIndex(0) +14>Emitted(81, 72) Source(93, 53) + SourceIndex(0) +15>Emitted(81, 73) Source(93, 54) + SourceIndex(0) +16>Emitted(81, 76) Source(93, 57) + SourceIndex(0) +17>Emitted(81, 77) Source(93, 58) + SourceIndex(0) +18>Emitted(81, 79) Source(93, 60) + SourceIndex(0) +19>Emitted(81, 80) Source(93, 61) + SourceIndex(0) +20>Emitted(81, 82) Source(93, 63) + SourceIndex(0) +21>Emitted(81, 84) Source(93, 65) + SourceIndex(0) +22>Emitted(81, 85) Source(93, 66) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(82, 5) Source(94, 5) + SourceIndex(0) +2 >Emitted(82, 12) Source(94, 12) + SourceIndex(0) +3 >Emitted(82, 13) Source(94, 13) + SourceIndex(0) +4 >Emitted(82, 16) Source(94, 16) + SourceIndex(0) +5 >Emitted(82, 17) Source(94, 17) + SourceIndex(0) +6 >Emitted(82, 32) Source(94, 32) + SourceIndex(0) +7 >Emitted(82, 33) Source(94, 33) + SourceIndex(0) +8 >Emitted(82, 34) Source(94, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(83, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(83, 2) Source(95, 2) + SourceIndex(0) +--- +>>>for ((_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] +7 > +8 > ...multiRobotAInfo +9 > ] = ["trimmer", ["trimming", "edging"]] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(84, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(84, 4) Source(96, 4) + SourceIndex(0) +3 >Emitted(84, 5) Source(96, 5) + SourceIndex(0) +4 >Emitted(84, 6) Source(96, 6) + SourceIndex(0) +5 >Emitted(84, 7) Source(96, 6) + SourceIndex(0) +6 >Emitted(84, 47) Source(96, 83) + SourceIndex(0) +7 >Emitted(84, 49) Source(96, 7) + SourceIndex(0) +8 >Emitted(84, 78) Source(96, 25) + SourceIndex(0) +9 >Emitted(84, 83) Source(96, 83) + SourceIndex(0) +10>Emitted(84, 85) Source(96, 85) + SourceIndex(0) +11>Emitted(84, 86) Source(96, 86) + SourceIndex(0) +12>Emitted(84, 89) Source(96, 89) + SourceIndex(0) +13>Emitted(84, 90) Source(96, 90) + SourceIndex(0) +14>Emitted(84, 92) Source(96, 92) + SourceIndex(0) +15>Emitted(84, 93) Source(96, 93) + SourceIndex(0) +16>Emitted(84, 96) Source(96, 96) + SourceIndex(0) +17>Emitted(84, 97) Source(96, 97) + SourceIndex(0) +18>Emitted(84, 99) Source(96, 99) + SourceIndex(0) +19>Emitted(84, 100) Source(96, 100) + SourceIndex(0) +20>Emitted(84, 102) Source(96, 102) + SourceIndex(0) +21>Emitted(84, 104) Source(96, 104) + SourceIndex(0) +22>Emitted(84, 105) Source(96, 105) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(85, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(85, 32) Source(97, 32) + SourceIndex(0) +7 >Emitted(85, 33) Source(97, 33) + SourceIndex(0) +8 >Emitted(85, 34) Source(97, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(98, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols new file mode 100644 index 00000000000..5c269a42043 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols @@ -0,0 +1,390 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) + +let i: number; +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + +for ([, nameA] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types new file mode 100644 index 00000000000..a50f506262d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types @@ -0,0 +1,684 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +let i: number; +>i : number + +for ([, nameA] = robotA, i = 0; i < 1; i++) { +>[, nameA] = robotA, i = 0 : number +>[, nameA] = robotA : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +>[, nameA] = getRobot(), i = 0 : number +>[, nameA] = getRobot() : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[, nameA] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { +>[numberB] = robotA, i = 0 : number +>[numberB] = robotA : [number, string, string] +>[numberB] : [number] +>numberB : number +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { +>[numberB] = getRobot(), i = 0 : number +>[numberB] = getRobot() : [number, string, string] +>[numberB] : [number] +>numberB : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberB] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] : [number] +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +>[nameB] = multiRobotA, i = 0 : number +>[nameB] = multiRobotA : [string, [string, string]] +>[nameB] : [string] +>nameB : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameB] = getMultiRobot(), i = 0 : number +>[nameB] = getMultiRobot() : [string, [string, string]] +>[nameB] : [string] +>nameB : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB] : [string] +>nameB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = robotA, i = 0 : number +>[numberA2, nameA2, skillA2] = robotA : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = getRobot(), i = 0 : number +>[numberA2, nameA2, skillA2] = getRobot() : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = robotA, i = 0 : number +>[numberA3, ...robotAInfo] = robotA : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3, ...robotAInfo] = getRobot() : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>[...multiRobotAInfo] = multiRobotA, i = 0 : number +>[...multiRobotAInfo] = multiRobotA : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>[...multiRobotAInfo] = getMultiRobot(), i = 0 : number +>[...multiRobotAInfo] = getMultiRobot() : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..24701d01b08 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js @@ -0,0 +1,184 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +for (var _a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _12 = multiRobotA[0], nameMA = _12 === void 0 ? "noName" : _12, _13 = multiRobotA[1], _14 = _13 === void 0 ? ["none", "none"] : _13, _15 = _14[0], primarySkillA = _15 === void 0 ? "primary" : _15, _16 = _14[1], secondarySkillA = _16 === void 0 ? "secondary" : _16, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _17 = getMultiRobot(), _18 = _17[0], nameMA = _18 === void 0 ? "noName" : _18, _19 = _17[1], _20 = _19 === void 0 ? ["none", "none"] : _19, _21 = _20[0], primarySkillA = _21 === void 0 ? "primary" : _21, _22 = _20[1], secondarySkillA = _22 === void 0 ? "secondary" : _22, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _23 = ["trimmer", ["trimming", "edging"]], _24 = _23[0], nameMA = _24 === void 0 ? "noName" : _24, _25 = _23[1], _26 = _25 === void 0 ? ["none", "none"] : _25, _27 = _26[0], primarySkillA = _27 === void 0 ? "primary" : _27, _28 = _26[1], secondarySkillA = _28 === void 0 ? "secondary" : _28, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _29 = robotA[0], numberA3 = _29 === void 0 ? -1 : _29, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _30 = getRobot(), _31 = _30[0], numberA3 = _31 === void 0 ? -1 : _31, robotAInfo = _30.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _32 = [2, "trimmer", "trimming"], _33 = _32[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = _32.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..28053eaf603 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,kBAAa,EAAb,mCAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAmC,EAA5B,UAAc,EAAd,mCAAc,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAAmD,EAA5C,UAAc,EAAd,mCAAc,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,uBAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAGkC,EAH3B,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAGsD,EAH/C,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,kBAAY,EAAZ,iCAAY,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,sBAAY,EAAZ,iCAAY,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,sCAAY,EAAZ,iCAAY,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,uBAAc,EAAd,mCAAc,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAc,EAAd,mCAAc,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,+CAAc,EAAd,mCAAc,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,kBAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAoE,EAA/D,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAAoF,EAA/E,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,wBAAiB,EAAjB,wCAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEpB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,qBAKe,EALV,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEf,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,yCAKmC,EAL9B,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,mBAAa,EAAb,oCAAa,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,gBAA+C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,gCAA+D,EAA1D,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..764825e68a2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2752 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, string[]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>for (var _a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [, +5 > nameA ="name" +6 > +7 > nameA ="name" +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +5 >Emitted(10, 24) Source(18, 26) + SourceIndex(0) +6 >Emitted(10, 26) Source(18, 13) + SourceIndex(0) +7 >Emitted(10, 61) Source(18, 26) + SourceIndex(0) +8 >Emitted(10, 63) Source(18, 38) + SourceIndex(0) +9 >Emitted(10, 64) Source(18, 39) + SourceIndex(0) +10>Emitted(10, 67) Source(18, 42) + SourceIndex(0) +11>Emitted(10, 68) Source(18, 43) + SourceIndex(0) +12>Emitted(10, 70) Source(18, 45) + SourceIndex(0) +13>Emitted(10, 71) Source(18, 46) + SourceIndex(0) +14>Emitted(10, 74) Source(18, 49) + SourceIndex(0) +15>Emitted(10, 75) Source(18, 50) + SourceIndex(0) +16>Emitted(10, 77) Source(18, 52) + SourceIndex(0) +17>Emitted(10, 78) Source(18, 53) + SourceIndex(0) +18>Emitted(10, 80) Source(18, 55) + SourceIndex(0) +19>Emitted(10, 82) Source(18, 57) + SourceIndex(0) +20>Emitted(10, 83) Source(18, 58) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) +--- +>>>for (var _b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA = "name"] = getRobot() +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 6) + SourceIndex(0) +5 >Emitted(13, 10) Source(21, 6) + SourceIndex(0) +6 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 27) + SourceIndex(0) +9 >Emitted(13, 39) Source(21, 13) + SourceIndex(0) +10>Emitted(13, 74) Source(21, 27) + SourceIndex(0) +11>Emitted(13, 76) Source(21, 43) + SourceIndex(0) +12>Emitted(13, 77) Source(21, 44) + SourceIndex(0) +13>Emitted(13, 80) Source(21, 47) + SourceIndex(0) +14>Emitted(13, 81) Source(21, 48) + SourceIndex(0) +15>Emitted(13, 83) Source(21, 50) + SourceIndex(0) +16>Emitted(13, 84) Source(21, 51) + SourceIndex(0) +17>Emitted(13, 87) Source(21, 54) + SourceIndex(0) +18>Emitted(13, 88) Source(21, 55) + SourceIndex(0) +19>Emitted(13, 90) Source(21, 57) + SourceIndex(0) +20>Emitted(13, 91) Source(21, 58) + SourceIndex(0) +21>Emitted(13, 93) Source(21, 60) + SourceIndex(0) +22>Emitted(13, 95) Source(21, 62) + SourceIndex(0) +23>Emitted(13, 96) Source(21, 63) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA = "name"] = [2, "trimmer", "trimming"] +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(16, 10) Source(24, 6) + SourceIndex(0) +6 >Emitted(16, 41) Source(24, 57) + SourceIndex(0) +7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +8 >Emitted(16, 53) Source(24, 27) + SourceIndex(0) +9 >Emitted(16, 55) Source(24, 13) + SourceIndex(0) +10>Emitted(16, 90) Source(24, 27) + SourceIndex(0) +11>Emitted(16, 92) Source(24, 59) + SourceIndex(0) +12>Emitted(16, 93) Source(24, 60) + SourceIndex(0) +13>Emitted(16, 96) Source(24, 63) + SourceIndex(0) +14>Emitted(16, 97) Source(24, 64) + SourceIndex(0) +15>Emitted(16, 99) Source(24, 66) + SourceIndex(0) +16>Emitted(16, 100) Source(24, 67) + SourceIndex(0) +17>Emitted(16, 103) Source(24, 70) + SourceIndex(0) +18>Emitted(16, 104) Source(24, 71) + SourceIndex(0) +19>Emitted(16, 106) Source(24, 73) + SourceIndex(0) +20>Emitted(16, 107) Source(24, 74) + SourceIndex(0) +21>Emitted(16, 109) Source(24, 76) + SourceIndex(0) +22>Emitted(16, 111) Source(24, 78) + SourceIndex(0) +23>Emitted(16, 112) Source(24, 79) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(17, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let [, +5 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +6 > +7 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +8 > +9 > primarySkillA = "primary" +10> +11> primarySkillA = "primary" +12> , + > +13> secondarySkillA = "secondary" +14> +15> secondarySkillA = "secondary" +16> + > ] = ["none", "none"]] = multiRobotA, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +5 >Emitted(19, 29) Source(30, 21) + SourceIndex(0) +6 >Emitted(19, 31) Source(27, 13) + SourceIndex(0) +7 >Emitted(19, 73) Source(30, 21) + SourceIndex(0) +8 >Emitted(19, 75) Source(28, 5) + SourceIndex(0) +9 >Emitted(19, 85) Source(28, 30) + SourceIndex(0) +10>Emitted(19, 87) Source(28, 5) + SourceIndex(0) +11>Emitted(19, 133) Source(28, 30) + SourceIndex(0) +12>Emitted(19, 135) Source(29, 5) + SourceIndex(0) +13>Emitted(19, 145) Source(29, 34) + SourceIndex(0) +14>Emitted(19, 147) Source(29, 5) + SourceIndex(0) +15>Emitted(19, 197) Source(29, 34) + SourceIndex(0) +16>Emitted(19, 199) Source(30, 38) + SourceIndex(0) +17>Emitted(19, 200) Source(30, 39) + SourceIndex(0) +18>Emitted(19, 203) Source(30, 42) + SourceIndex(0) +19>Emitted(19, 204) Source(30, 43) + SourceIndex(0) +20>Emitted(19, 206) Source(30, 45) + SourceIndex(0) +21>Emitted(19, 207) Source(30, 46) + SourceIndex(0) +22>Emitted(19, 210) Source(30, 49) + SourceIndex(0) +23>Emitted(19, 211) Source(30, 50) + SourceIndex(0) +24>Emitted(19, 213) Source(30, 52) + SourceIndex(0) +25>Emitted(19, 214) Source(30, 53) + SourceIndex(0) +26>Emitted(19, 216) Source(30, 55) + SourceIndex(0) +27>Emitted(19, 218) Source(30, 57) + SourceIndex(0) +28>Emitted(19, 219) Source(30, 58) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(20, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(20, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(20, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(21, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = getMultiRobot() +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = getMultiRobot(), +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(22, 10) Source(33, 6) + SourceIndex(0) +6 >Emitted(22, 30) Source(36, 40) + SourceIndex(0) +7 >Emitted(22, 32) Source(33, 13) + SourceIndex(0) +8 >Emitted(22, 42) Source(36, 21) + SourceIndex(0) +9 >Emitted(22, 44) Source(33, 13) + SourceIndex(0) +10>Emitted(22, 86) Source(36, 21) + SourceIndex(0) +11>Emitted(22, 88) Source(34, 5) + SourceIndex(0) +12>Emitted(22, 98) Source(34, 30) + SourceIndex(0) +13>Emitted(22, 100) Source(34, 5) + SourceIndex(0) +14>Emitted(22, 146) Source(34, 30) + SourceIndex(0) +15>Emitted(22, 148) Source(35, 5) + SourceIndex(0) +16>Emitted(22, 158) Source(35, 34) + SourceIndex(0) +17>Emitted(22, 160) Source(35, 5) + SourceIndex(0) +18>Emitted(22, 210) Source(35, 34) + SourceIndex(0) +19>Emitted(22, 212) Source(36, 42) + SourceIndex(0) +20>Emitted(22, 213) Source(36, 43) + SourceIndex(0) +21>Emitted(22, 216) Source(36, 46) + SourceIndex(0) +22>Emitted(22, 217) Source(36, 47) + SourceIndex(0) +23>Emitted(22, 219) Source(36, 49) + SourceIndex(0) +24>Emitted(22, 220) Source(36, 50) + SourceIndex(0) +25>Emitted(22, 223) Source(36, 53) + SourceIndex(0) +26>Emitted(22, 224) Source(36, 54) + SourceIndex(0) +27>Emitted(22, 226) Source(36, 56) + SourceIndex(0) +28>Emitted(22, 227) Source(36, 57) + SourceIndex(0) +29>Emitted(22, 229) Source(36, 59) + SourceIndex(0) +30>Emitted(22, 231) Source(36, 61) + SourceIndex(0) +31>Emitted(22, 232) Source(36, 62) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(23, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(23, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(23, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(24, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(24, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for (var _q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(25, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(25, 10) Source(39, 6) + SourceIndex(0) +6 >Emitted(25, 50) Source(42, 60) + SourceIndex(0) +7 >Emitted(25, 52) Source(39, 13) + SourceIndex(0) +8 >Emitted(25, 62) Source(42, 21) + SourceIndex(0) +9 >Emitted(25, 64) Source(39, 13) + SourceIndex(0) +10>Emitted(25, 106) Source(42, 21) + SourceIndex(0) +11>Emitted(25, 108) Source(40, 5) + SourceIndex(0) +12>Emitted(25, 118) Source(40, 30) + SourceIndex(0) +13>Emitted(25, 120) Source(40, 5) + SourceIndex(0) +14>Emitted(25, 166) Source(40, 30) + SourceIndex(0) +15>Emitted(25, 168) Source(41, 5) + SourceIndex(0) +16>Emitted(25, 178) Source(41, 34) + SourceIndex(0) +17>Emitted(25, 180) Source(41, 5) + SourceIndex(0) +18>Emitted(25, 230) Source(41, 34) + SourceIndex(0) +19>Emitted(25, 232) Source(42, 62) + SourceIndex(0) +20>Emitted(25, 233) Source(42, 63) + SourceIndex(0) +21>Emitted(25, 236) Source(42, 66) + SourceIndex(0) +22>Emitted(25, 237) Source(42, 67) + SourceIndex(0) +23>Emitted(25, 239) Source(42, 69) + SourceIndex(0) +24>Emitted(25, 240) Source(42, 70) + SourceIndex(0) +25>Emitted(25, 243) Source(42, 73) + SourceIndex(0) +26>Emitted(25, 244) Source(42, 74) + SourceIndex(0) +27>Emitted(25, 246) Source(42, 76) + SourceIndex(0) +28>Emitted(25, 247) Source(42, 77) + SourceIndex(0) +29>Emitted(25, 249) Source(42, 79) + SourceIndex(0) +30>Emitted(25, 251) Source(42, 81) + SourceIndex(0) +31>Emitted(25, 252) Source(42, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(26, 30) Source(43, 30) + SourceIndex(0) +7 >Emitted(26, 31) Source(43, 31) + SourceIndex(0) +8 >Emitted(26, 32) Source(43, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for (var _v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(28, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(46, 11) + SourceIndex(0) +5 >Emitted(28, 24) Source(46, 23) + SourceIndex(0) +6 >Emitted(28, 26) Source(46, 11) + SourceIndex(0) +7 >Emitted(28, 59) Source(46, 23) + SourceIndex(0) +8 >Emitted(28, 61) Source(46, 35) + SourceIndex(0) +9 >Emitted(28, 62) Source(46, 36) + SourceIndex(0) +10>Emitted(28, 65) Source(46, 39) + SourceIndex(0) +11>Emitted(28, 66) Source(46, 40) + SourceIndex(0) +12>Emitted(28, 68) Source(46, 42) + SourceIndex(0) +13>Emitted(28, 69) Source(46, 43) + SourceIndex(0) +14>Emitted(28, 72) Source(46, 46) + SourceIndex(0) +15>Emitted(28, 73) Source(46, 47) + SourceIndex(0) +16>Emitted(28, 75) Source(46, 49) + SourceIndex(0) +17>Emitted(28, 76) Source(46, 50) + SourceIndex(0) +18>Emitted(28, 78) Source(46, 52) + SourceIndex(0) +19>Emitted(28, 80) Source(46, 54) + SourceIndex(0) +20>Emitted(28, 81) Source(46, 55) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(29, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(29, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(29, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(29, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(29, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(29, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(29, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(29, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(30, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(31, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(31, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(31, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(31, 6) Source(49, 11) + SourceIndex(0) +5 >Emitted(31, 28) Source(49, 23) + SourceIndex(0) +6 >Emitted(31, 30) Source(49, 11) + SourceIndex(0) +7 >Emitted(31, 63) Source(49, 23) + SourceIndex(0) +8 >Emitted(31, 65) Source(49, 39) + SourceIndex(0) +9 >Emitted(31, 66) Source(49, 40) + SourceIndex(0) +10>Emitted(31, 69) Source(49, 43) + SourceIndex(0) +11>Emitted(31, 70) Source(49, 44) + SourceIndex(0) +12>Emitted(31, 72) Source(49, 46) + SourceIndex(0) +13>Emitted(31, 73) Source(49, 47) + SourceIndex(0) +14>Emitted(31, 76) Source(49, 50) + SourceIndex(0) +15>Emitted(31, 77) Source(49, 51) + SourceIndex(0) +16>Emitted(31, 79) Source(49, 53) + SourceIndex(0) +17>Emitted(31, 80) Source(49, 54) + SourceIndex(0) +18>Emitted(31, 82) Source(49, 56) + SourceIndex(0) +19>Emitted(31, 84) Source(49, 58) + SourceIndex(0) +20>Emitted(31, 85) Source(49, 59) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(32, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(32, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(32, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(32, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(32, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(32, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(32, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(32, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(33, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(33, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = [2, "trimmer", "trimming"], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(34, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(34, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(34, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(34, 6) Source(52, 11) + SourceIndex(0) +5 >Emitted(34, 44) Source(52, 23) + SourceIndex(0) +6 >Emitted(34, 46) Source(52, 11) + SourceIndex(0) +7 >Emitted(34, 79) Source(52, 23) + SourceIndex(0) +8 >Emitted(34, 81) Source(52, 55) + SourceIndex(0) +9 >Emitted(34, 82) Source(52, 56) + SourceIndex(0) +10>Emitted(34, 85) Source(52, 59) + SourceIndex(0) +11>Emitted(34, 86) Source(52, 60) + SourceIndex(0) +12>Emitted(34, 88) Source(52, 62) + SourceIndex(0) +13>Emitted(34, 89) Source(52, 63) + SourceIndex(0) +14>Emitted(34, 92) Source(52, 66) + SourceIndex(0) +15>Emitted(34, 93) Source(52, 67) + SourceIndex(0) +16>Emitted(34, 95) Source(52, 69) + SourceIndex(0) +17>Emitted(34, 96) Source(52, 70) + SourceIndex(0) +18>Emitted(34, 98) Source(52, 72) + SourceIndex(0) +19>Emitted(34, 100) Source(52, 74) + SourceIndex(0) +20>Emitted(34, 101) Source(52, 75) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(35, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(35, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(35, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(36, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = multiRobotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(37, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(55, 11) + SourceIndex(0) +5 >Emitted(37, 29) Source(55, 25) + SourceIndex(0) +6 >Emitted(37, 31) Source(55, 11) + SourceIndex(0) +7 >Emitted(37, 66) Source(55, 25) + SourceIndex(0) +8 >Emitted(37, 68) Source(55, 42) + SourceIndex(0) +9 >Emitted(37, 69) Source(55, 43) + SourceIndex(0) +10>Emitted(37, 72) Source(55, 46) + SourceIndex(0) +11>Emitted(37, 73) Source(55, 47) + SourceIndex(0) +12>Emitted(37, 75) Source(55, 49) + SourceIndex(0) +13>Emitted(37, 76) Source(55, 50) + SourceIndex(0) +14>Emitted(37, 79) Source(55, 53) + SourceIndex(0) +15>Emitted(37, 80) Source(55, 54) + SourceIndex(0) +16>Emitted(37, 82) Source(55, 56) + SourceIndex(0) +17>Emitted(37, 83) Source(55, 57) + SourceIndex(0) +18>Emitted(37, 85) Source(55, 59) + SourceIndex(0) +19>Emitted(37, 87) Source(55, 61) + SourceIndex(0) +20>Emitted(37, 88) Source(55, 62) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(38, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(38, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(38, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(38, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(38, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(38, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(38, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(38, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(39, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(39, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = getMultiRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(40, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(40, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(40, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(40, 6) Source(58, 11) + SourceIndex(0) +5 >Emitted(40, 33) Source(58, 25) + SourceIndex(0) +6 >Emitted(40, 35) Source(58, 11) + SourceIndex(0) +7 >Emitted(40, 70) Source(58, 25) + SourceIndex(0) +8 >Emitted(40, 72) Source(58, 46) + SourceIndex(0) +9 >Emitted(40, 73) Source(58, 47) + SourceIndex(0) +10>Emitted(40, 76) Source(58, 50) + SourceIndex(0) +11>Emitted(40, 77) Source(58, 51) + SourceIndex(0) +12>Emitted(40, 79) Source(58, 53) + SourceIndex(0) +13>Emitted(40, 80) Source(58, 54) + SourceIndex(0) +14>Emitted(40, 83) Source(58, 57) + SourceIndex(0) +15>Emitted(40, 84) Source(58, 58) + SourceIndex(0) +16>Emitted(40, 86) Source(58, 60) + SourceIndex(0) +17>Emitted(40, 87) Source(58, 61) + SourceIndex(0) +18>Emitted(40, 89) Source(58, 63) + SourceIndex(0) +19>Emitted(40, 91) Source(58, 65) + SourceIndex(0) +20>Emitted(40, 92) Source(58, 66) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(41, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(42, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(42, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = ["trimmer", ["trimming", "edging"]], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(43, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(61, 11) + SourceIndex(0) +5 >Emitted(43, 53) Source(61, 25) + SourceIndex(0) +6 >Emitted(43, 55) Source(61, 11) + SourceIndex(0) +7 >Emitted(43, 90) Source(61, 25) + SourceIndex(0) +8 >Emitted(43, 92) Source(61, 66) + SourceIndex(0) +9 >Emitted(43, 93) Source(61, 67) + SourceIndex(0) +10>Emitted(43, 96) Source(61, 70) + SourceIndex(0) +11>Emitted(43, 97) Source(61, 71) + SourceIndex(0) +12>Emitted(43, 99) Source(61, 73) + SourceIndex(0) +13>Emitted(43, 100) Source(61, 74) + SourceIndex(0) +14>Emitted(43, 103) Source(61, 77) + SourceIndex(0) +15>Emitted(43, 104) Source(61, 78) + SourceIndex(0) +16>Emitted(43, 106) Source(61, 80) + SourceIndex(0) +17>Emitted(43, 107) Source(61, 81) + SourceIndex(0) +18>Emitted(43, 109) Source(61, 83) + SourceIndex(0) +19>Emitted(43, 111) Source(61, 85) + SourceIndex(0) +20>Emitted(43, 112) Source(61, 86) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(44, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(44, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(44, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(44, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(44, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(44, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(44, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(44, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(45, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(45, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA2 = -1 +6 > +7 > numberA2 = -1 +8 > , +9 > nameA2 = "name" +10> +11> nameA2 = "name" +12> , +13> skillA2 = "skill" +14> +15> skillA2 = "skill" +16> ] = robotA, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(46, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(46, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(46, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(46, 6) Source(65, 11) + SourceIndex(0) +5 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) +6 >Emitted(46, 26) Source(65, 11) + SourceIndex(0) +7 >Emitted(46, 60) Source(65, 24) + SourceIndex(0) +8 >Emitted(46, 62) Source(65, 26) + SourceIndex(0) +9 >Emitted(46, 76) Source(65, 41) + SourceIndex(0) +10>Emitted(46, 78) Source(65, 26) + SourceIndex(0) +11>Emitted(46, 114) Source(65, 41) + SourceIndex(0) +12>Emitted(46, 116) Source(65, 43) + SourceIndex(0) +13>Emitted(46, 130) Source(65, 60) + SourceIndex(0) +14>Emitted(46, 132) Source(65, 43) + SourceIndex(0) +15>Emitted(46, 170) Source(65, 60) + SourceIndex(0) +16>Emitted(46, 172) Source(65, 72) + SourceIndex(0) +17>Emitted(46, 173) Source(65, 73) + SourceIndex(0) +18>Emitted(46, 176) Source(65, 76) + SourceIndex(0) +19>Emitted(46, 177) Source(65, 77) + SourceIndex(0) +20>Emitted(46, 179) Source(65, 79) + SourceIndex(0) +21>Emitted(46, 180) Source(65, 80) + SourceIndex(0) +22>Emitted(46, 183) Source(65, 83) + SourceIndex(0) +23>Emitted(46, 184) Source(65, 84) + SourceIndex(0) +24>Emitted(46, 186) Source(65, 86) + SourceIndex(0) +25>Emitted(46, 187) Source(65, 87) + SourceIndex(0) +26>Emitted(46, 189) Source(65, 89) + SourceIndex(0) +27>Emitted(46, 191) Source(65, 91) + SourceIndex(0) +28>Emitted(46, 192) Source(65, 92) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(47, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(47, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(47, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(47, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = getRobot(), +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(49, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(49, 10) Source(68, 6) + SourceIndex(0) +6 >Emitted(49, 25) Source(68, 74) + SourceIndex(0) +7 >Emitted(49, 27) Source(68, 11) + SourceIndex(0) +8 >Emitted(49, 37) Source(68, 24) + SourceIndex(0) +9 >Emitted(49, 39) Source(68, 11) + SourceIndex(0) +10>Emitted(49, 73) Source(68, 24) + SourceIndex(0) +11>Emitted(49, 75) Source(68, 26) + SourceIndex(0) +12>Emitted(49, 85) Source(68, 41) + SourceIndex(0) +13>Emitted(49, 87) Source(68, 26) + SourceIndex(0) +14>Emitted(49, 123) Source(68, 41) + SourceIndex(0) +15>Emitted(49, 125) Source(68, 43) + SourceIndex(0) +16>Emitted(49, 135) Source(68, 60) + SourceIndex(0) +17>Emitted(49, 137) Source(68, 43) + SourceIndex(0) +18>Emitted(49, 175) Source(68, 60) + SourceIndex(0) +19>Emitted(49, 177) Source(68, 76) + SourceIndex(0) +20>Emitted(49, 178) Source(68, 77) + SourceIndex(0) +21>Emitted(49, 181) Source(68, 80) + SourceIndex(0) +22>Emitted(49, 182) Source(68, 81) + SourceIndex(0) +23>Emitted(49, 184) Source(68, 83) + SourceIndex(0) +24>Emitted(49, 185) Source(68, 84) + SourceIndex(0) +25>Emitted(49, 188) Source(68, 87) + SourceIndex(0) +26>Emitted(49, 189) Source(68, 88) + SourceIndex(0) +27>Emitted(49, 191) Source(68, 90) + SourceIndex(0) +28>Emitted(49, 192) Source(68, 91) + SourceIndex(0) +29>Emitted(49, 194) Source(68, 93) + SourceIndex(0) +30>Emitted(49, 196) Source(68, 95) + SourceIndex(0) +31>Emitted(49, 197) Source(68, 96) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(50, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(50, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(50, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(50, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = [2, "trimmer", "trimming"], +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(52, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(52, 10) Source(71, 6) + SourceIndex(0) +6 >Emitted(52, 41) Source(71, 90) + SourceIndex(0) +7 >Emitted(52, 43) Source(71, 11) + SourceIndex(0) +8 >Emitted(52, 53) Source(71, 24) + SourceIndex(0) +9 >Emitted(52, 55) Source(71, 11) + SourceIndex(0) +10>Emitted(52, 89) Source(71, 24) + SourceIndex(0) +11>Emitted(52, 91) Source(71, 26) + SourceIndex(0) +12>Emitted(52, 102) Source(71, 41) + SourceIndex(0) +13>Emitted(52, 104) Source(71, 26) + SourceIndex(0) +14>Emitted(52, 142) Source(71, 41) + SourceIndex(0) +15>Emitted(52, 144) Source(71, 43) + SourceIndex(0) +16>Emitted(52, 155) Source(71, 60) + SourceIndex(0) +17>Emitted(52, 157) Source(71, 43) + SourceIndex(0) +18>Emitted(52, 197) Source(71, 60) + SourceIndex(0) +19>Emitted(52, 199) Source(71, 92) + SourceIndex(0) +20>Emitted(52, 200) Source(71, 93) + SourceIndex(0) +21>Emitted(52, 203) Source(71, 96) + SourceIndex(0) +22>Emitted(52, 204) Source(71, 97) + SourceIndex(0) +23>Emitted(52, 206) Source(71, 99) + SourceIndex(0) +24>Emitted(52, 207) Source(71, 100) + SourceIndex(0) +25>Emitted(52, 210) Source(71, 103) + SourceIndex(0) +26>Emitted(52, 211) Source(71, 104) + SourceIndex(0) +27>Emitted(52, 213) Source(71, 106) + SourceIndex(0) +28>Emitted(52, 214) Source(71, 107) + SourceIndex(0) +29>Emitted(52, 216) Source(71, 109) + SourceIndex(0) +30>Emitted(52, 218) Source(71, 111) + SourceIndex(0) +31>Emitted(52, 219) Source(71, 112) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(53, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(53, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(53, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(53, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _12 = multiRobotA[0], nameMA = _12 === void 0 ? "noName" : _12, _13 = multiRobotA[1], _14 = _13 === void 0 ? ["none", "none"] : _13, _15 = _14[0], primarySkillA = _15 === void 0 ? "primary" : _15, _16 = _14[1], secondarySkillA = _16 === void 0 ? "secondary" : _16, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let + > [ +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , + > +9 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +10> +11> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , + > +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> + > ] = ["none", "none"] + > ] = multiRobotA, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(55, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(75, 6) + SourceIndex(0) +5 >Emitted(55, 30) Source(75, 23) + SourceIndex(0) +6 >Emitted(55, 32) Source(75, 6) + SourceIndex(0) +7 >Emitted(55, 72) Source(75, 23) + SourceIndex(0) +8 >Emitted(55, 74) Source(76, 9) + SourceIndex(0) +9 >Emitted(55, 94) Source(79, 29) + SourceIndex(0) +10>Emitted(55, 96) Source(76, 9) + SourceIndex(0) +11>Emitted(55, 141) Source(79, 29) + SourceIndex(0) +12>Emitted(55, 143) Source(77, 13) + SourceIndex(0) +13>Emitted(55, 155) Source(77, 38) + SourceIndex(0) +14>Emitted(55, 157) Source(77, 13) + SourceIndex(0) +15>Emitted(55, 205) Source(77, 38) + SourceIndex(0) +16>Emitted(55, 207) Source(78, 13) + SourceIndex(0) +17>Emitted(55, 219) Source(78, 42) + SourceIndex(0) +18>Emitted(55, 221) Source(78, 13) + SourceIndex(0) +19>Emitted(55, 273) Source(78, 42) + SourceIndex(0) +20>Emitted(55, 275) Source(80, 22) + SourceIndex(0) +21>Emitted(55, 276) Source(80, 23) + SourceIndex(0) +22>Emitted(55, 279) Source(80, 26) + SourceIndex(0) +23>Emitted(55, 280) Source(80, 27) + SourceIndex(0) +24>Emitted(55, 282) Source(80, 29) + SourceIndex(0) +25>Emitted(55, 283) Source(80, 30) + SourceIndex(0) +26>Emitted(55, 286) Source(80, 33) + SourceIndex(0) +27>Emitted(55, 287) Source(80, 34) + SourceIndex(0) +28>Emitted(55, 289) Source(80, 36) + SourceIndex(0) +29>Emitted(55, 290) Source(80, 37) + SourceIndex(0) +30>Emitted(55, 292) Source(80, 39) + SourceIndex(0) +31>Emitted(55, 294) Source(80, 41) + SourceIndex(0) +32>Emitted(55, 295) Source(80, 42) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(56, 23) Source(81, 23) + SourceIndex(0) +7 >Emitted(56, 24) Source(81, 24) + SourceIndex(0) +8 >Emitted(56, 25) Source(81, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for (var _17 = getMultiRobot(), _18 = _17[0], nameMA = _18 === void 0 ? "noName" : _18, _19 = _17[1], _20 = _19 === void 0 ? ["none", "none"] : _19, _21 = _20[0], primarySkillA = _21 === void 0 ? "primary" : _21, _22 = _20[1], secondarySkillA = _22 === void 0 ? "secondary" : _22, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = getMultiRobot() +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = getMultiRobot(), +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(58, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(83, 6) + SourceIndex(0) +5 >Emitted(58, 10) Source(83, 6) + SourceIndex(0) +6 >Emitted(58, 31) Source(88, 21) + SourceIndex(0) +7 >Emitted(58, 33) Source(83, 11) + SourceIndex(0) +8 >Emitted(58, 45) Source(83, 28) + SourceIndex(0) +9 >Emitted(58, 47) Source(83, 11) + SourceIndex(0) +10>Emitted(58, 87) Source(83, 28) + SourceIndex(0) +11>Emitted(58, 89) Source(84, 5) + SourceIndex(0) +12>Emitted(58, 101) Source(87, 25) + SourceIndex(0) +13>Emitted(58, 103) Source(84, 5) + SourceIndex(0) +14>Emitted(58, 148) Source(87, 25) + SourceIndex(0) +15>Emitted(58, 150) Source(85, 9) + SourceIndex(0) +16>Emitted(58, 162) Source(85, 34) + SourceIndex(0) +17>Emitted(58, 164) Source(85, 9) + SourceIndex(0) +18>Emitted(58, 212) Source(85, 34) + SourceIndex(0) +19>Emitted(58, 214) Source(86, 9) + SourceIndex(0) +20>Emitted(58, 226) Source(86, 38) + SourceIndex(0) +21>Emitted(58, 228) Source(86, 9) + SourceIndex(0) +22>Emitted(58, 280) Source(86, 38) + SourceIndex(0) +23>Emitted(58, 282) Source(88, 23) + SourceIndex(0) +24>Emitted(58, 283) Source(88, 24) + SourceIndex(0) +25>Emitted(58, 286) Source(88, 27) + SourceIndex(0) +26>Emitted(58, 287) Source(88, 28) + SourceIndex(0) +27>Emitted(58, 289) Source(88, 30) + SourceIndex(0) +28>Emitted(58, 290) Source(88, 31) + SourceIndex(0) +29>Emitted(58, 293) Source(88, 34) + SourceIndex(0) +30>Emitted(58, 294) Source(88, 35) + SourceIndex(0) +31>Emitted(58, 296) Source(88, 37) + SourceIndex(0) +32>Emitted(58, 297) Source(88, 38) + SourceIndex(0) +33>Emitted(58, 299) Source(88, 40) + SourceIndex(0) +34>Emitted(58, 301) Source(88, 42) + SourceIndex(0) +35>Emitted(58, 302) Source(88, 43) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(59, 23) Source(89, 23) + SourceIndex(0) +7 >Emitted(59, 24) Source(89, 24) + SourceIndex(0) +8 >Emitted(59, 25) Source(89, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for (var _23 = ["trimmer", ["trimming", "edging"]], _24 = _23[0], nameMA = _24 === void 0 ? "noName" : _24, _25 = _23[1], _26 = _25 === void 0 ? ["none", "none"] : _25, _27 = _26[0], primarySkillA = _27 === void 0 ? "primary" : _27, _28 = _26[1], secondarySkillA = _28 === void 0 ? "secondary" : _28, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]], +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(61, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(91, 6) + SourceIndex(0) +5 >Emitted(61, 10) Source(91, 6) + SourceIndex(0) +6 >Emitted(61, 51) Source(96, 41) + SourceIndex(0) +7 >Emitted(61, 53) Source(91, 11) + SourceIndex(0) +8 >Emitted(61, 65) Source(91, 28) + SourceIndex(0) +9 >Emitted(61, 67) Source(91, 11) + SourceIndex(0) +10>Emitted(61, 107) Source(91, 28) + SourceIndex(0) +11>Emitted(61, 109) Source(92, 5) + SourceIndex(0) +12>Emitted(61, 121) Source(95, 25) + SourceIndex(0) +13>Emitted(61, 123) Source(92, 5) + SourceIndex(0) +14>Emitted(61, 168) Source(95, 25) + SourceIndex(0) +15>Emitted(61, 170) Source(93, 9) + SourceIndex(0) +16>Emitted(61, 182) Source(93, 34) + SourceIndex(0) +17>Emitted(61, 184) Source(93, 9) + SourceIndex(0) +18>Emitted(61, 232) Source(93, 34) + SourceIndex(0) +19>Emitted(61, 234) Source(94, 9) + SourceIndex(0) +20>Emitted(61, 246) Source(94, 38) + SourceIndex(0) +21>Emitted(61, 248) Source(94, 9) + SourceIndex(0) +22>Emitted(61, 300) Source(94, 38) + SourceIndex(0) +23>Emitted(61, 302) Source(96, 43) + SourceIndex(0) +24>Emitted(61, 303) Source(96, 44) + SourceIndex(0) +25>Emitted(61, 306) Source(96, 47) + SourceIndex(0) +26>Emitted(61, 307) Source(96, 48) + SourceIndex(0) +27>Emitted(61, 309) Source(96, 50) + SourceIndex(0) +28>Emitted(61, 310) Source(96, 51) + SourceIndex(0) +29>Emitted(61, 313) Source(96, 54) + SourceIndex(0) +30>Emitted(61, 314) Source(96, 55) + SourceIndex(0) +31>Emitted(61, 316) Source(96, 57) + SourceIndex(0) +32>Emitted(61, 317) Source(96, 58) + SourceIndex(0) +33>Emitted(61, 319) Source(96, 60) + SourceIndex(0) +34>Emitted(61, 321) Source(96, 62) + SourceIndex(0) +35>Emitted(61, 322) Source(96, 63) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(62, 23) Source(97, 23) + SourceIndex(0) +7 >Emitted(62, 24) Source(97, 24) + SourceIndex(0) +8 >Emitted(62, 25) Source(97, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(98, 2) + SourceIndex(0) +--- +>>>for (var _29 = robotA[0], numberA3 = _29 === void 0 ? -1 : _29, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA3 = -1 +6 > +7 > numberA3 = -1 +8 > , +9 > ...robotAInfo +10> ] = robotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(64, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(100, 11) + SourceIndex(0) +5 >Emitted(64, 25) Source(100, 24) + SourceIndex(0) +6 >Emitted(64, 27) Source(100, 11) + SourceIndex(0) +7 >Emitted(64, 63) Source(100, 24) + SourceIndex(0) +8 >Emitted(64, 65) Source(100, 26) + SourceIndex(0) +9 >Emitted(64, 93) Source(100, 39) + SourceIndex(0) +10>Emitted(64, 95) Source(100, 51) + SourceIndex(0) +11>Emitted(64, 96) Source(100, 52) + SourceIndex(0) +12>Emitted(64, 99) Source(100, 55) + SourceIndex(0) +13>Emitted(64, 100) Source(100, 56) + SourceIndex(0) +14>Emitted(64, 102) Source(100, 58) + SourceIndex(0) +15>Emitted(64, 103) Source(100, 59) + SourceIndex(0) +16>Emitted(64, 106) Source(100, 62) + SourceIndex(0) +17>Emitted(64, 107) Source(100, 63) + SourceIndex(0) +18>Emitted(64, 109) Source(100, 65) + SourceIndex(0) +19>Emitted(64, 110) Source(100, 66) + SourceIndex(0) +20>Emitted(64, 112) Source(100, 68) + SourceIndex(0) +21>Emitted(64, 114) Source(100, 70) + SourceIndex(0) +22>Emitted(64, 115) Source(100, 71) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(65, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(65, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(65, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(65, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(65, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(65, 25) Source(101, 25) + SourceIndex(0) +7 >Emitted(65, 26) Source(101, 26) + SourceIndex(0) +8 >Emitted(65, 27) Source(101, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(66, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(66, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for (var _30 = getRobot(), _31 = _30[0], numberA3 = _31 === void 0 ? -1 : _31, robotAInfo = _30.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3 = -1, ...robotAInfo] = getRobot() +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = getRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(67, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(67, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(67, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(67, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(67, 10) Source(103, 6) + SourceIndex(0) +6 >Emitted(67, 26) Source(103, 53) + SourceIndex(0) +7 >Emitted(67, 28) Source(103, 11) + SourceIndex(0) +8 >Emitted(67, 40) Source(103, 24) + SourceIndex(0) +9 >Emitted(67, 42) Source(103, 11) + SourceIndex(0) +10>Emitted(67, 78) Source(103, 24) + SourceIndex(0) +11>Emitted(67, 80) Source(103, 26) + SourceIndex(0) +12>Emitted(67, 105) Source(103, 39) + SourceIndex(0) +13>Emitted(67, 107) Source(103, 55) + SourceIndex(0) +14>Emitted(67, 108) Source(103, 56) + SourceIndex(0) +15>Emitted(67, 111) Source(103, 59) + SourceIndex(0) +16>Emitted(67, 112) Source(103, 60) + SourceIndex(0) +17>Emitted(67, 114) Source(103, 62) + SourceIndex(0) +18>Emitted(67, 115) Source(103, 63) + SourceIndex(0) +19>Emitted(67, 118) Source(103, 66) + SourceIndex(0) +20>Emitted(67, 119) Source(103, 67) + SourceIndex(0) +21>Emitted(67, 121) Source(103, 69) + SourceIndex(0) +22>Emitted(67, 122) Source(103, 70) + SourceIndex(0) +23>Emitted(67, 124) Source(103, 72) + SourceIndex(0) +24>Emitted(67, 126) Source(103, 74) + SourceIndex(0) +25>Emitted(67, 127) Source(103, 75) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(68, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(68, 25) Source(104, 25) + SourceIndex(0) +7 >Emitted(68, 26) Source(104, 26) + SourceIndex(0) +8 >Emitted(68, 27) Source(104, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(69, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(69, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for (var _32 = [2, "trimmer", "trimming"], _33 = _32[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = _32.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = [2, "trimmer", "trimming"], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(70, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(70, 10) Source(106, 6) + SourceIndex(0) +6 >Emitted(70, 42) Source(106, 69) + SourceIndex(0) +7 >Emitted(70, 44) Source(106, 11) + SourceIndex(0) +8 >Emitted(70, 56) Source(106, 24) + SourceIndex(0) +9 >Emitted(70, 58) Source(106, 11) + SourceIndex(0) +10>Emitted(70, 94) Source(106, 24) + SourceIndex(0) +11>Emitted(70, 96) Source(106, 26) + SourceIndex(0) +12>Emitted(70, 121) Source(106, 39) + SourceIndex(0) +13>Emitted(70, 123) Source(106, 71) + SourceIndex(0) +14>Emitted(70, 124) Source(106, 72) + SourceIndex(0) +15>Emitted(70, 127) Source(106, 75) + SourceIndex(0) +16>Emitted(70, 128) Source(106, 76) + SourceIndex(0) +17>Emitted(70, 130) Source(106, 78) + SourceIndex(0) +18>Emitted(70, 131) Source(106, 79) + SourceIndex(0) +19>Emitted(70, 134) Source(106, 82) + SourceIndex(0) +20>Emitted(70, 135) Source(106, 83) + SourceIndex(0) +21>Emitted(70, 137) Source(106, 85) + SourceIndex(0) +22>Emitted(70, 138) Source(106, 86) + SourceIndex(0) +23>Emitted(70, 140) Source(106, 88) + SourceIndex(0) +24>Emitted(70, 142) Source(106, 90) + SourceIndex(0) +25>Emitted(70, 143) Source(106, 91) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(71, 25) Source(107, 25) + SourceIndex(0) +7 >Emitted(71, 26) Source(107, 26) + SourceIndex(0) +8 >Emitted(71, 27) Source(107, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(72, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(72, 2) Source(108, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..523cde331fc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,367 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 2, 1)) + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 11)) +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 11)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 11)) +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 11)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 11)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 26, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 27, 30)) + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 26, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 32, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 33, 30)) + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 32, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 38, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 39, 30)) + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 38, 13)) +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 10)) +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 10)) +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 10)) +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 10)) +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 10)) +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 10)) +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 41)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 24)) +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 41)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 24)) +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 24)) +} +for (let + [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 74, 5)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 75, 9)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 76, 38)) + + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 74, 5)) +} +for (let [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 82, 10)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 83, 5)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 84, 34)) + + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 82, 10)) +} +for (let [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 90, 10)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 91, 5)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 92, 34)) + + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 90, 10)) +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 24)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 24)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 24)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..245328296eb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types @@ -0,0 +1,599 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, string[]] + + return multiRobotA; +>multiRobotA : [string, string[]] +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let + [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : number | string +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : (number | string)[] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number | string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..fb2fa4f81f8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js @@ -0,0 +1,196 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +var i; +for ((_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _16 = multiRobotA[0], nameMA_1 = _16 === void 0 ? "noName" : _16, _17 = multiRobotA[1], _18 = _17 === void 0 ? ["none", "none"] : _17, _19 = _18[0], primarySkillA_1 = _19 === void 0 ? "primary" : _19, _20 = _18[1], secondarySkillA_1 = _20 === void 0 ? "secondary" : _20, i_1 = 0; i_1 < 1; i_1++) { + console.log(nameMA_1); +} +for ((_21 = getMultiRobot(), _22 = _21[0], nameMA = _22 === void 0 ? "noName" : _22, _23 = _21[1], _24 = _23 === void 0 ? ["none", "none"] : _23, _25 = _24[0], primarySkillA = _25 === void 0 ? "primary" : _25, _26 = _24[1], secondarySkillA = _26 === void 0 ? "secondary" : _26, _21), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_27 = ["trimmer", ["trimming", "edging"]], _28 = _27[0], nameMA = _28 === void 0 ? "noName" : _28, _29 = _27[1], _30 = _29 === void 0 ? ["none", "none"] : _29, _31 = _30[0], primarySkillA = _31 === void 0 ? "primary" : _31, _32 = _30[1], secondarySkillA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_33 = robotA[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_34 = getRobot(), _35 = _34[0], numberA3 = _35 === void 0 ? -1 : _35, robotAInfo = _34.slice(1), _34), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_36 = [2, "trimmer", "trimming"], _37 = _36[0], numberA3 = _37 === void 0 ? -1 : _37, robotAInfo = _36.slice(1), _36), i = 0; i < 1; i++) { + console.log(numberA3); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37; +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..6446d14319e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAC,CAAG,cAAc,EAAd,mCAAc,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA+B,EAA5B,UAAc,EAAd,mCAAc,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAG,mBAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACT,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAGkC,EAH/B,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,KACM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAGsD,EAHnD,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,KAC0B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,cAAY,EAAZ,iCAAY,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA2B,EAA1B,UAAY,EAAZ,iCAAY,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA2C,EAA1C,UAAY,EAAZ,iCAAY,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,mBAAc,EAAd,mCAAc,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAkC,EAAjC,UAAc,EAAd,mCAAc,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAAsD,EAArD,UAAc,EAAd,mCAAc,KAAuC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gCAAgF,EAA/E,YAAa,EAAb,oCAAa,EAAE,YAAe,EAAf,sCAAe,EAAE,YAAiB,EAAjB,wCAAiB,MAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,wBAAiB,EAAjB,0CAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,kDAAyB,EACzB,YAA6B,EAA7B,sDAA6B,EAEpB,GAAC,GAAG,CAAC,EAAE,GAAC,GAAG,CAAC,EAAE,GAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAKc,EALb,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,MAElB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,yCAKkC,EALjC,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,MAEE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,MAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gCAAkE,EAAjE,YAAa,EAAb,oCAAa,EAAE,yBAAa,MAAqC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..bab5f369194 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3030 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(18, 20) + SourceIndex(0) +5 >Emitted(10, 25) Source(18, 41) + SourceIndex(0) +6 >Emitted(10, 27) Source(18, 43) + SourceIndex(0) +7 >Emitted(10, 42) Source(18, 66) + SourceIndex(0) +8 >Emitted(10, 43) Source(18, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(11, 12) Source(19, 20) + SourceIndex(0) +4 >Emitted(11, 14) Source(19, 22) + SourceIndex(0) +5 >Emitted(11, 19) Source(19, 35) + SourceIndex(0) +6 >Emitted(11, 20) Source(19, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 21) + SourceIndex(0) +4 >Emitted(12, 15) Source(20, 23) + SourceIndex(0) +5 >Emitted(12, 21) Source(20, 37) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 39) + SourceIndex(0) +7 >Emitted(12, 30) Source(20, 54) + SourceIndex(0) +8 >Emitted(12, 32) Source(20, 56) + SourceIndex(0) +9 >Emitted(12, 38) Source(20, 70) + SourceIndex(0) +10>Emitted(12, 39) Source(20, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 13) Source(21, 21) + SourceIndex(0) +4 >Emitted(13, 15) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 54) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 56) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 102) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 103) + SourceIndex(0) +--- +>>>var i; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > i: number +4 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 14) + SourceIndex(0) +4 >Emitted(14, 7) Source(22, 15) + SourceIndex(0) +--- +>>>for ((_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [, +6 > nameA = "name" +7 > +8 > nameA = "name" +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(15, 7) Source(24, 9) + SourceIndex(0) +6 >Emitted(15, 21) Source(24, 23) + SourceIndex(0) +7 >Emitted(15, 23) Source(24, 9) + SourceIndex(0) +8 >Emitted(15, 58) Source(24, 23) + SourceIndex(0) +9 >Emitted(15, 60) Source(24, 27) + SourceIndex(0) +10>Emitted(15, 66) Source(24, 33) + SourceIndex(0) +11>Emitted(15, 67) Source(24, 33) + SourceIndex(0) +12>Emitted(15, 69) Source(24, 35) + SourceIndex(0) +13>Emitted(15, 70) Source(24, 36) + SourceIndex(0) +14>Emitted(15, 73) Source(24, 39) + SourceIndex(0) +15>Emitted(15, 74) Source(24, 40) + SourceIndex(0) +16>Emitted(15, 76) Source(24, 42) + SourceIndex(0) +17>Emitted(15, 77) Source(24, 43) + SourceIndex(0) +18>Emitted(15, 80) Source(24, 46) + SourceIndex(0) +19>Emitted(15, 81) Source(24, 47) + SourceIndex(0) +20>Emitted(15, 83) Source(24, 49) + SourceIndex(0) +21>Emitted(15, 84) Source(24, 50) + SourceIndex(0) +22>Emitted(15, 86) Source(24, 52) + SourceIndex(0) +23>Emitted(15, 88) Source(24, 54) + SourceIndex(0) +24>Emitted(15, 89) Source(24, 55) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for ((_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA = "name"] = getRobot() +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +5 >Emitted(18, 7) Source(27, 6) + SourceIndex(0) +6 >Emitted(18, 22) Source(27, 37) + SourceIndex(0) +7 >Emitted(18, 24) Source(27, 9) + SourceIndex(0) +8 >Emitted(18, 34) Source(27, 23) + SourceIndex(0) +9 >Emitted(18, 36) Source(27, 9) + SourceIndex(0) +10>Emitted(18, 71) Source(27, 23) + SourceIndex(0) +11>Emitted(18, 76) Source(27, 37) + SourceIndex(0) +12>Emitted(18, 78) Source(27, 39) + SourceIndex(0) +13>Emitted(18, 79) Source(27, 40) + SourceIndex(0) +14>Emitted(18, 82) Source(27, 43) + SourceIndex(0) +15>Emitted(18, 83) Source(27, 44) + SourceIndex(0) +16>Emitted(18, 85) Source(27, 46) + SourceIndex(0) +17>Emitted(18, 86) Source(27, 47) + SourceIndex(0) +18>Emitted(18, 89) Source(27, 50) + SourceIndex(0) +19>Emitted(18, 90) Source(27, 51) + SourceIndex(0) +20>Emitted(18, 92) Source(27, 53) + SourceIndex(0) +21>Emitted(18, 93) Source(27, 54) + SourceIndex(0) +22>Emitted(18, 95) Source(27, 56) + SourceIndex(0) +23>Emitted(18, 97) Source(27, 58) + SourceIndex(0) +24>Emitted(18, 98) Source(27, 59) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for ((_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA = "name"] = [2, "trimmer", "trimming"] +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(21, 7) Source(30, 6) + SourceIndex(0) +6 >Emitted(21, 38) Source(30, 53) + SourceIndex(0) +7 >Emitted(21, 40) Source(30, 9) + SourceIndex(0) +8 >Emitted(21, 50) Source(30, 23) + SourceIndex(0) +9 >Emitted(21, 52) Source(30, 9) + SourceIndex(0) +10>Emitted(21, 87) Source(30, 23) + SourceIndex(0) +11>Emitted(21, 92) Source(30, 53) + SourceIndex(0) +12>Emitted(21, 94) Source(30, 55) + SourceIndex(0) +13>Emitted(21, 95) Source(30, 56) + SourceIndex(0) +14>Emitted(21, 98) Source(30, 59) + SourceIndex(0) +15>Emitted(21, 99) Source(30, 60) + SourceIndex(0) +16>Emitted(21, 101) Source(30, 62) + SourceIndex(0) +17>Emitted(21, 102) Source(30, 63) + SourceIndex(0) +18>Emitted(21, 105) Source(30, 66) + SourceIndex(0) +19>Emitted(21, 106) Source(30, 67) + SourceIndex(0) +20>Emitted(21, 108) Source(30, 69) + SourceIndex(0) +21>Emitted(21, 109) Source(30, 70) + SourceIndex(0) +22>Emitted(21, 111) Source(30, 72) + SourceIndex(0) +23>Emitted(21, 113) Source(30, 74) + SourceIndex(0) +24>Emitted(21, 114) Source(30, 75) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(31, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(31, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for ((_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [, +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , + > +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +17> + > ] = ["none", "none"]] = +18> multiRobotA +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(24, 7) Source(33, 9) + SourceIndex(0) +6 >Emitted(24, 26) Source(36, 21) + SourceIndex(0) +7 >Emitted(24, 28) Source(33, 9) + SourceIndex(0) +8 >Emitted(24, 70) Source(36, 21) + SourceIndex(0) +9 >Emitted(24, 72) Source(34, 5) + SourceIndex(0) +10>Emitted(24, 82) Source(34, 30) + SourceIndex(0) +11>Emitted(24, 84) Source(34, 5) + SourceIndex(0) +12>Emitted(24, 130) Source(34, 30) + SourceIndex(0) +13>Emitted(24, 132) Source(35, 5) + SourceIndex(0) +14>Emitted(24, 142) Source(35, 34) + SourceIndex(0) +15>Emitted(24, 144) Source(35, 5) + SourceIndex(0) +16>Emitted(24, 194) Source(35, 34) + SourceIndex(0) +17>Emitted(24, 196) Source(36, 25) + SourceIndex(0) +18>Emitted(24, 207) Source(36, 36) + SourceIndex(0) +19>Emitted(24, 208) Source(36, 36) + SourceIndex(0) +20>Emitted(24, 210) Source(36, 38) + SourceIndex(0) +21>Emitted(24, 211) Source(36, 39) + SourceIndex(0) +22>Emitted(24, 214) Source(36, 42) + SourceIndex(0) +23>Emitted(24, 215) Source(36, 43) + SourceIndex(0) +24>Emitted(24, 217) Source(36, 45) + SourceIndex(0) +25>Emitted(24, 218) Source(36, 46) + SourceIndex(0) +26>Emitted(24, 221) Source(36, 49) + SourceIndex(0) +27>Emitted(24, 222) Source(36, 50) + SourceIndex(0) +28>Emitted(24, 224) Source(36, 52) + SourceIndex(0) +29>Emitted(24, 225) Source(36, 53) + SourceIndex(0) +30>Emitted(24, 227) Source(36, 55) + SourceIndex(0) +31>Emitted(24, 229) Source(36, 57) + SourceIndex(0) +32>Emitted(24, 230) Source(36, 58) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(25, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(25, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(25, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = getMultiRobot() +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(27, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(27, 7) Source(39, 6) + SourceIndex(0) +6 >Emitted(27, 27) Source(42, 40) + SourceIndex(0) +7 >Emitted(27, 29) Source(39, 9) + SourceIndex(0) +8 >Emitted(27, 39) Source(42, 21) + SourceIndex(0) +9 >Emitted(27, 41) Source(39, 9) + SourceIndex(0) +10>Emitted(27, 83) Source(42, 21) + SourceIndex(0) +11>Emitted(27, 85) Source(40, 5) + SourceIndex(0) +12>Emitted(27, 95) Source(40, 30) + SourceIndex(0) +13>Emitted(27, 97) Source(40, 5) + SourceIndex(0) +14>Emitted(27, 143) Source(40, 30) + SourceIndex(0) +15>Emitted(27, 145) Source(41, 5) + SourceIndex(0) +16>Emitted(27, 155) Source(41, 34) + SourceIndex(0) +17>Emitted(27, 157) Source(41, 5) + SourceIndex(0) +18>Emitted(27, 207) Source(41, 34) + SourceIndex(0) +19>Emitted(27, 212) Source(42, 40) + SourceIndex(0) +20>Emitted(27, 214) Source(42, 42) + SourceIndex(0) +21>Emitted(27, 215) Source(42, 43) + SourceIndex(0) +22>Emitted(27, 218) Source(42, 46) + SourceIndex(0) +23>Emitted(27, 219) Source(42, 47) + SourceIndex(0) +24>Emitted(27, 221) Source(42, 49) + SourceIndex(0) +25>Emitted(27, 222) Source(42, 50) + SourceIndex(0) +26>Emitted(27, 225) Source(42, 53) + SourceIndex(0) +27>Emitted(27, 226) Source(42, 54) + SourceIndex(0) +28>Emitted(27, 228) Source(42, 56) + SourceIndex(0) +29>Emitted(27, 229) Source(42, 57) + SourceIndex(0) +30>Emitted(27, 231) Source(42, 59) + SourceIndex(0) +31>Emitted(27, 233) Source(42, 61) + SourceIndex(0) +32>Emitted(27, 234) Source(42, 62) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(28, 30) Source(43, 30) + SourceIndex(0) +7 >Emitted(28, 31) Source(43, 31) + SourceIndex(0) +8 >Emitted(28, 32) Source(43, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for ((_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(30, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(45, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(45, 6) + SourceIndex(0) +6 >Emitted(30, 47) Source(48, 60) + SourceIndex(0) +7 >Emitted(30, 49) Source(45, 9) + SourceIndex(0) +8 >Emitted(30, 59) Source(48, 21) + SourceIndex(0) +9 >Emitted(30, 61) Source(45, 9) + SourceIndex(0) +10>Emitted(30, 103) Source(48, 21) + SourceIndex(0) +11>Emitted(30, 105) Source(46, 5) + SourceIndex(0) +12>Emitted(30, 115) Source(46, 30) + SourceIndex(0) +13>Emitted(30, 117) Source(46, 5) + SourceIndex(0) +14>Emitted(30, 163) Source(46, 30) + SourceIndex(0) +15>Emitted(30, 165) Source(47, 5) + SourceIndex(0) +16>Emitted(30, 175) Source(47, 34) + SourceIndex(0) +17>Emitted(30, 177) Source(47, 5) + SourceIndex(0) +18>Emitted(30, 227) Source(47, 34) + SourceIndex(0) +19>Emitted(30, 232) Source(48, 60) + SourceIndex(0) +20>Emitted(30, 234) Source(48, 62) + SourceIndex(0) +21>Emitted(30, 235) Source(48, 63) + SourceIndex(0) +22>Emitted(30, 238) Source(48, 66) + SourceIndex(0) +23>Emitted(30, 239) Source(48, 67) + SourceIndex(0) +24>Emitted(30, 241) Source(48, 69) + SourceIndex(0) +25>Emitted(30, 242) Source(48, 70) + SourceIndex(0) +26>Emitted(30, 245) Source(48, 73) + SourceIndex(0) +27>Emitted(30, 246) Source(48, 74) + SourceIndex(0) +28>Emitted(30, 248) Source(48, 76) + SourceIndex(0) +29>Emitted(30, 249) Source(48, 77) + SourceIndex(0) +30>Emitted(30, 251) Source(48, 79) + SourceIndex(0) +31>Emitted(30, 253) Source(48, 81) + SourceIndex(0) +32>Emitted(30, 254) Source(48, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(49, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(49, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(49, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for ((_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberB = -1 +7 > +8 > numberB = -1 +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(52, 7) + SourceIndex(0) +6 >Emitted(33, 21) Source(52, 19) + SourceIndex(0) +7 >Emitted(33, 23) Source(52, 7) + SourceIndex(0) +8 >Emitted(33, 56) Source(52, 19) + SourceIndex(0) +9 >Emitted(33, 58) Source(52, 23) + SourceIndex(0) +10>Emitted(33, 64) Source(52, 29) + SourceIndex(0) +11>Emitted(33, 65) Source(52, 29) + SourceIndex(0) +12>Emitted(33, 67) Source(52, 31) + SourceIndex(0) +13>Emitted(33, 68) Source(52, 32) + SourceIndex(0) +14>Emitted(33, 71) Source(52, 35) + SourceIndex(0) +15>Emitted(33, 72) Source(52, 36) + SourceIndex(0) +16>Emitted(33, 74) Source(52, 38) + SourceIndex(0) +17>Emitted(33, 75) Source(52, 39) + SourceIndex(0) +18>Emitted(33, 78) Source(52, 42) + SourceIndex(0) +19>Emitted(33, 79) Source(52, 43) + SourceIndex(0) +20>Emitted(33, 81) Source(52, 45) + SourceIndex(0) +21>Emitted(33, 82) Source(52, 46) + SourceIndex(0) +22>Emitted(33, 84) Source(52, 48) + SourceIndex(0) +23>Emitted(33, 86) Source(52, 50) + SourceIndex(0) +24>Emitted(33, 87) Source(52, 51) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(34, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(34, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(34, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(34, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB = -1] = getRobot() +7 > +8 > numberB = -1 +9 > +10> numberB = -1 +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(36, 22) Source(55, 33) + SourceIndex(0) +7 >Emitted(36, 24) Source(55, 7) + SourceIndex(0) +8 >Emitted(36, 34) Source(55, 19) + SourceIndex(0) +9 >Emitted(36, 36) Source(55, 7) + SourceIndex(0) +10>Emitted(36, 69) Source(55, 19) + SourceIndex(0) +11>Emitted(36, 74) Source(55, 33) + SourceIndex(0) +12>Emitted(36, 76) Source(55, 35) + SourceIndex(0) +13>Emitted(36, 77) Source(55, 36) + SourceIndex(0) +14>Emitted(36, 80) Source(55, 39) + SourceIndex(0) +15>Emitted(36, 81) Source(55, 40) + SourceIndex(0) +16>Emitted(36, 83) Source(55, 42) + SourceIndex(0) +17>Emitted(36, 84) Source(55, 43) + SourceIndex(0) +18>Emitted(36, 87) Source(55, 46) + SourceIndex(0) +19>Emitted(36, 88) Source(55, 47) + SourceIndex(0) +20>Emitted(36, 90) Source(55, 49) + SourceIndex(0) +21>Emitted(36, 91) Source(55, 50) + SourceIndex(0) +22>Emitted(36, 93) Source(55, 52) + SourceIndex(0) +23>Emitted(36, 95) Source(55, 54) + SourceIndex(0) +24>Emitted(36, 96) Source(55, 55) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(37, 24) Source(56, 24) + SourceIndex(0) +7 >Emitted(37, 25) Source(56, 25) + SourceIndex(0) +8 >Emitted(37, 26) Source(56, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB = -1] = [2, "trimmer", "trimming"] +7 > +8 > numberB = -1 +9 > +10> numberB = -1 +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(58, 6) + SourceIndex(0) +6 >Emitted(39, 38) Source(58, 49) + SourceIndex(0) +7 >Emitted(39, 40) Source(58, 7) + SourceIndex(0) +8 >Emitted(39, 50) Source(58, 19) + SourceIndex(0) +9 >Emitted(39, 52) Source(58, 7) + SourceIndex(0) +10>Emitted(39, 85) Source(58, 19) + SourceIndex(0) +11>Emitted(39, 90) Source(58, 49) + SourceIndex(0) +12>Emitted(39, 92) Source(58, 51) + SourceIndex(0) +13>Emitted(39, 93) Source(58, 52) + SourceIndex(0) +14>Emitted(39, 96) Source(58, 55) + SourceIndex(0) +15>Emitted(39, 97) Source(58, 56) + SourceIndex(0) +16>Emitted(39, 99) Source(58, 58) + SourceIndex(0) +17>Emitted(39, 100) Source(58, 59) + SourceIndex(0) +18>Emitted(39, 103) Source(58, 62) + SourceIndex(0) +19>Emitted(39, 104) Source(58, 63) + SourceIndex(0) +20>Emitted(39, 106) Source(58, 65) + SourceIndex(0) +21>Emitted(39, 107) Source(58, 66) + SourceIndex(0) +22>Emitted(39, 109) Source(58, 68) + SourceIndex(0) +23>Emitted(39, 111) Source(58, 70) + SourceIndex(0) +24>Emitted(39, 112) Source(58, 71) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(40, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(40, 24) Source(59, 24) + SourceIndex(0) +7 >Emitted(40, 25) Source(59, 25) + SourceIndex(0) +8 >Emitted(40, 26) Source(59, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameB = "name" +7 > +8 > nameB = "name" +9 > ] = +10> multiRobotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(61, 7) + SourceIndex(0) +6 >Emitted(42, 26) Source(61, 21) + SourceIndex(0) +7 >Emitted(42, 28) Source(61, 7) + SourceIndex(0) +8 >Emitted(42, 63) Source(61, 21) + SourceIndex(0) +9 >Emitted(42, 65) Source(61, 25) + SourceIndex(0) +10>Emitted(42, 76) Source(61, 36) + SourceIndex(0) +11>Emitted(42, 77) Source(61, 36) + SourceIndex(0) +12>Emitted(42, 79) Source(61, 38) + SourceIndex(0) +13>Emitted(42, 80) Source(61, 39) + SourceIndex(0) +14>Emitted(42, 83) Source(61, 42) + SourceIndex(0) +15>Emitted(42, 84) Source(61, 43) + SourceIndex(0) +16>Emitted(42, 86) Source(61, 45) + SourceIndex(0) +17>Emitted(42, 87) Source(61, 46) + SourceIndex(0) +18>Emitted(42, 90) Source(61, 49) + SourceIndex(0) +19>Emitted(42, 91) Source(61, 50) + SourceIndex(0) +20>Emitted(42, 93) Source(61, 52) + SourceIndex(0) +21>Emitted(42, 94) Source(61, 53) + SourceIndex(0) +22>Emitted(42, 96) Source(61, 55) + SourceIndex(0) +23>Emitted(42, 98) Source(61, 57) + SourceIndex(0) +24>Emitted(42, 99) Source(61, 58) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for ((_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB = "name"] = getMultiRobot() +7 > +8 > nameB = "name" +9 > +10> nameB = "name" +11> ] = getMultiRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(64, 6) + SourceIndex(0) +6 >Emitted(45, 27) Source(64, 40) + SourceIndex(0) +7 >Emitted(45, 29) Source(64, 7) + SourceIndex(0) +8 >Emitted(45, 39) Source(64, 21) + SourceIndex(0) +9 >Emitted(45, 41) Source(64, 7) + SourceIndex(0) +10>Emitted(45, 76) Source(64, 21) + SourceIndex(0) +11>Emitted(45, 81) Source(64, 40) + SourceIndex(0) +12>Emitted(45, 83) Source(64, 42) + SourceIndex(0) +13>Emitted(45, 84) Source(64, 43) + SourceIndex(0) +14>Emitted(45, 87) Source(64, 46) + SourceIndex(0) +15>Emitted(45, 88) Source(64, 47) + SourceIndex(0) +16>Emitted(45, 90) Source(64, 49) + SourceIndex(0) +17>Emitted(45, 91) Source(64, 50) + SourceIndex(0) +18>Emitted(45, 94) Source(64, 53) + SourceIndex(0) +19>Emitted(45, 95) Source(64, 54) + SourceIndex(0) +20>Emitted(45, 97) Source(64, 56) + SourceIndex(0) +21>Emitted(45, 98) Source(64, 57) + SourceIndex(0) +22>Emitted(45, 100) Source(64, 59) + SourceIndex(0) +23>Emitted(45, 102) Source(64, 61) + SourceIndex(0) +24>Emitted(45, 103) Source(64, 62) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(46, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(46, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(46, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(46, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(46, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(46, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(46, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(47, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(47, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for ((_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB = "name"] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameB = "name" +9 > +10> nameB = "name" +11> ] = ["trimmer", ["trimming", "edging"]] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(48, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(48, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(48, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(48, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(48, 7) Source(67, 6) + SourceIndex(0) +6 >Emitted(48, 47) Source(67, 60) + SourceIndex(0) +7 >Emitted(48, 49) Source(67, 7) + SourceIndex(0) +8 >Emitted(48, 59) Source(67, 21) + SourceIndex(0) +9 >Emitted(48, 61) Source(67, 7) + SourceIndex(0) +10>Emitted(48, 96) Source(67, 21) + SourceIndex(0) +11>Emitted(48, 101) Source(67, 60) + SourceIndex(0) +12>Emitted(48, 103) Source(67, 62) + SourceIndex(0) +13>Emitted(48, 104) Source(67, 63) + SourceIndex(0) +14>Emitted(48, 107) Source(67, 66) + SourceIndex(0) +15>Emitted(48, 108) Source(67, 67) + SourceIndex(0) +16>Emitted(48, 110) Source(67, 69) + SourceIndex(0) +17>Emitted(48, 111) Source(67, 70) + SourceIndex(0) +18>Emitted(48, 114) Source(67, 73) + SourceIndex(0) +19>Emitted(48, 115) Source(67, 74) + SourceIndex(0) +20>Emitted(48, 117) Source(67, 76) + SourceIndex(0) +21>Emitted(48, 118) Source(67, 77) + SourceIndex(0) +22>Emitted(48, 120) Source(67, 79) + SourceIndex(0) +23>Emitted(48, 122) Source(67, 81) + SourceIndex(0) +24>Emitted(48, 123) Source(67, 82) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(49, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(50, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(50, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for ((_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA2 = -1 +7 > +8 > numberA2 = -1 +9 > , +10> nameA2 = "name" +11> +12> nameA2 = "name" +13> , +14> skillA2 = "skill" +15> +16> skillA2 = "skill" +17> ] = +18> robotA +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(51, 7) Source(71, 7) + SourceIndex(0) +6 >Emitted(51, 21) Source(71, 20) + SourceIndex(0) +7 >Emitted(51, 23) Source(71, 7) + SourceIndex(0) +8 >Emitted(51, 57) Source(71, 20) + SourceIndex(0) +9 >Emitted(51, 59) Source(71, 22) + SourceIndex(0) +10>Emitted(51, 73) Source(71, 37) + SourceIndex(0) +11>Emitted(51, 75) Source(71, 22) + SourceIndex(0) +12>Emitted(51, 111) Source(71, 37) + SourceIndex(0) +13>Emitted(51, 113) Source(71, 39) + SourceIndex(0) +14>Emitted(51, 127) Source(71, 56) + SourceIndex(0) +15>Emitted(51, 129) Source(71, 39) + SourceIndex(0) +16>Emitted(51, 167) Source(71, 56) + SourceIndex(0) +17>Emitted(51, 169) Source(71, 60) + SourceIndex(0) +18>Emitted(51, 175) Source(71, 66) + SourceIndex(0) +19>Emitted(51, 176) Source(71, 66) + SourceIndex(0) +20>Emitted(51, 178) Source(71, 68) + SourceIndex(0) +21>Emitted(51, 179) Source(71, 69) + SourceIndex(0) +22>Emitted(51, 182) Source(71, 72) + SourceIndex(0) +23>Emitted(51, 183) Source(71, 73) + SourceIndex(0) +24>Emitted(51, 185) Source(71, 75) + SourceIndex(0) +25>Emitted(51, 186) Source(71, 76) + SourceIndex(0) +26>Emitted(51, 189) Source(71, 79) + SourceIndex(0) +27>Emitted(51, 190) Source(71, 80) + SourceIndex(0) +28>Emitted(51, 192) Source(71, 82) + SourceIndex(0) +29>Emitted(51, 193) Source(71, 83) + SourceIndex(0) +30>Emitted(51, 195) Source(71, 85) + SourceIndex(0) +31>Emitted(51, 197) Source(71, 87) + SourceIndex(0) +32>Emitted(51, 198) Source(71, 88) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(52, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(52, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(52, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(52, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(52, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(52, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(52, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(52, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(53, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(53, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = getRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(54, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(54, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(54, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(54, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(54, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(54, 22) Source(74, 70) + SourceIndex(0) +7 >Emitted(54, 24) Source(74, 7) + SourceIndex(0) +8 >Emitted(54, 34) Source(74, 20) + SourceIndex(0) +9 >Emitted(54, 36) Source(74, 7) + SourceIndex(0) +10>Emitted(54, 70) Source(74, 20) + SourceIndex(0) +11>Emitted(54, 72) Source(74, 22) + SourceIndex(0) +12>Emitted(54, 83) Source(74, 37) + SourceIndex(0) +13>Emitted(54, 85) Source(74, 22) + SourceIndex(0) +14>Emitted(54, 123) Source(74, 37) + SourceIndex(0) +15>Emitted(54, 125) Source(74, 39) + SourceIndex(0) +16>Emitted(54, 136) Source(74, 56) + SourceIndex(0) +17>Emitted(54, 138) Source(74, 39) + SourceIndex(0) +18>Emitted(54, 178) Source(74, 56) + SourceIndex(0) +19>Emitted(54, 183) Source(74, 70) + SourceIndex(0) +20>Emitted(54, 185) Source(74, 72) + SourceIndex(0) +21>Emitted(54, 186) Source(74, 73) + SourceIndex(0) +22>Emitted(54, 189) Source(74, 76) + SourceIndex(0) +23>Emitted(54, 190) Source(74, 77) + SourceIndex(0) +24>Emitted(54, 192) Source(74, 79) + SourceIndex(0) +25>Emitted(54, 193) Source(74, 80) + SourceIndex(0) +26>Emitted(54, 196) Source(74, 83) + SourceIndex(0) +27>Emitted(54, 197) Source(74, 84) + SourceIndex(0) +28>Emitted(54, 199) Source(74, 86) + SourceIndex(0) +29>Emitted(54, 200) Source(74, 87) + SourceIndex(0) +30>Emitted(54, 202) Source(74, 89) + SourceIndex(0) +31>Emitted(54, 204) Source(74, 91) + SourceIndex(0) +32>Emitted(54, 205) Source(74, 92) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(55, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(55, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(55, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(55, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(56, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(56, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = [2, "trimmer", "trimming"] +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(57, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(57, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(57, 39) Source(77, 86) + SourceIndex(0) +7 >Emitted(57, 41) Source(77, 7) + SourceIndex(0) +8 >Emitted(57, 53) Source(77, 20) + SourceIndex(0) +9 >Emitted(57, 55) Source(77, 7) + SourceIndex(0) +10>Emitted(57, 91) Source(77, 20) + SourceIndex(0) +11>Emitted(57, 93) Source(77, 22) + SourceIndex(0) +12>Emitted(57, 105) Source(77, 37) + SourceIndex(0) +13>Emitted(57, 107) Source(77, 22) + SourceIndex(0) +14>Emitted(57, 145) Source(77, 37) + SourceIndex(0) +15>Emitted(57, 147) Source(77, 39) + SourceIndex(0) +16>Emitted(57, 159) Source(77, 56) + SourceIndex(0) +17>Emitted(57, 161) Source(77, 39) + SourceIndex(0) +18>Emitted(57, 201) Source(77, 56) + SourceIndex(0) +19>Emitted(57, 207) Source(77, 86) + SourceIndex(0) +20>Emitted(57, 209) Source(77, 88) + SourceIndex(0) +21>Emitted(57, 210) Source(77, 89) + SourceIndex(0) +22>Emitted(57, 213) Source(77, 92) + SourceIndex(0) +23>Emitted(57, 214) Source(77, 93) + SourceIndex(0) +24>Emitted(57, 216) Source(77, 95) + SourceIndex(0) +25>Emitted(57, 217) Source(77, 96) + SourceIndex(0) +26>Emitted(57, 220) Source(77, 99) + SourceIndex(0) +27>Emitted(57, 221) Source(77, 100) + SourceIndex(0) +28>Emitted(57, 223) Source(77, 102) + SourceIndex(0) +29>Emitted(57, 224) Source(77, 103) + SourceIndex(0) +30>Emitted(57, 226) Source(77, 105) + SourceIndex(0) +31>Emitted(57, 228) Source(77, 107) + SourceIndex(0) +32>Emitted(57, 229) Source(77, 108) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(58, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(58, 23) Source(78, 23) + SourceIndex(0) +7 >Emitted(58, 24) Source(78, 24) + SourceIndex(0) +8 >Emitted(58, 25) Source(78, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(59, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(59, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for (var _16 = multiRobotA[0], nameMA_1 = _16 === void 0 ? "noName" : _16, _17 = multiRobotA[1], _18 = _17 === void 0 ? ["none", "none"] : _17, _19 = _18[0], primarySkillA_1 = _19 === void 0 ? "primary" : _19, _20 = _18[1], secondarySkillA_1 = _20 === void 0 ? "secondary" : _20, i_1 = 0; i_1 < 1; i_1++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^^^ +22> ^^^ +23> ^ +24> ^^ +25> ^^^ +26> ^^^ +27> ^ +28> ^^ +29> ^^^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let + > [ +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , + > +9 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +10> +11> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , + > +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> + > ] = ["none", "none"] + > ] = multiRobotA, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(60, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(60, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(60, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(60, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(60, 30) Source(81, 23) + SourceIndex(0) +6 >Emitted(60, 32) Source(81, 6) + SourceIndex(0) +7 >Emitted(60, 74) Source(81, 23) + SourceIndex(0) +8 >Emitted(60, 76) Source(82, 9) + SourceIndex(0) +9 >Emitted(60, 96) Source(85, 29) + SourceIndex(0) +10>Emitted(60, 98) Source(82, 9) + SourceIndex(0) +11>Emitted(60, 143) Source(85, 29) + SourceIndex(0) +12>Emitted(60, 145) Source(83, 13) + SourceIndex(0) +13>Emitted(60, 157) Source(83, 38) + SourceIndex(0) +14>Emitted(60, 159) Source(83, 13) + SourceIndex(0) +15>Emitted(60, 209) Source(83, 38) + SourceIndex(0) +16>Emitted(60, 211) Source(84, 13) + SourceIndex(0) +17>Emitted(60, 223) Source(84, 42) + SourceIndex(0) +18>Emitted(60, 225) Source(84, 13) + SourceIndex(0) +19>Emitted(60, 279) Source(84, 42) + SourceIndex(0) +20>Emitted(60, 281) Source(86, 22) + SourceIndex(0) +21>Emitted(60, 284) Source(86, 23) + SourceIndex(0) +22>Emitted(60, 287) Source(86, 26) + SourceIndex(0) +23>Emitted(60, 288) Source(86, 27) + SourceIndex(0) +24>Emitted(60, 290) Source(86, 29) + SourceIndex(0) +25>Emitted(60, 293) Source(86, 30) + SourceIndex(0) +26>Emitted(60, 296) Source(86, 33) + SourceIndex(0) +27>Emitted(60, 297) Source(86, 34) + SourceIndex(0) +28>Emitted(60, 299) Source(86, 36) + SourceIndex(0) +29>Emitted(60, 302) Source(86, 37) + SourceIndex(0) +30>Emitted(60, 304) Source(86, 39) + SourceIndex(0) +31>Emitted(60, 306) Source(86, 41) + SourceIndex(0) +32>Emitted(60, 307) Source(86, 42) + SourceIndex(0) +--- +>>> console.log(nameMA_1); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(61, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(61, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(61, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(61, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(61, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(61, 25) Source(87, 23) + SourceIndex(0) +7 >Emitted(61, 26) Source(87, 24) + SourceIndex(0) +8 >Emitted(61, 27) Source(87, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(62, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(62, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for ((_21 = getMultiRobot(), _22 = _21[0], nameMA = _22 === void 0 ? "noName" : _22, _23 = _21[1], _24 = _23 === void 0 ? ["none", "none"] : _23, _25 = _24[0], primarySkillA = _25 === void 0 ? "primary" : _25, _26 = _24[1], secondarySkillA = _26 === void 0 ? "secondary" : _26, _21), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = getMultiRobot() +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(63, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(63, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(63, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(63, 6) Source(89, 6) + SourceIndex(0) +5 >Emitted(63, 7) Source(89, 6) + SourceIndex(0) +6 >Emitted(63, 28) Source(94, 20) + SourceIndex(0) +7 >Emitted(63, 30) Source(89, 7) + SourceIndex(0) +8 >Emitted(63, 42) Source(89, 24) + SourceIndex(0) +9 >Emitted(63, 44) Source(89, 7) + SourceIndex(0) +10>Emitted(63, 84) Source(89, 24) + SourceIndex(0) +11>Emitted(63, 86) Source(90, 5) + SourceIndex(0) +12>Emitted(63, 98) Source(93, 25) + SourceIndex(0) +13>Emitted(63, 100) Source(90, 5) + SourceIndex(0) +14>Emitted(63, 145) Source(93, 25) + SourceIndex(0) +15>Emitted(63, 147) Source(91, 9) + SourceIndex(0) +16>Emitted(63, 159) Source(91, 34) + SourceIndex(0) +17>Emitted(63, 161) Source(91, 9) + SourceIndex(0) +18>Emitted(63, 209) Source(91, 34) + SourceIndex(0) +19>Emitted(63, 211) Source(92, 9) + SourceIndex(0) +20>Emitted(63, 223) Source(92, 38) + SourceIndex(0) +21>Emitted(63, 225) Source(92, 9) + SourceIndex(0) +22>Emitted(63, 277) Source(92, 38) + SourceIndex(0) +23>Emitted(63, 283) Source(94, 20) + SourceIndex(0) +24>Emitted(63, 285) Source(94, 22) + SourceIndex(0) +25>Emitted(63, 286) Source(94, 23) + SourceIndex(0) +26>Emitted(63, 289) Source(94, 26) + SourceIndex(0) +27>Emitted(63, 290) Source(94, 27) + SourceIndex(0) +28>Emitted(63, 292) Source(94, 29) + SourceIndex(0) +29>Emitted(63, 293) Source(94, 30) + SourceIndex(0) +30>Emitted(63, 296) Source(94, 33) + SourceIndex(0) +31>Emitted(63, 297) Source(94, 34) + SourceIndex(0) +32>Emitted(63, 299) Source(94, 36) + SourceIndex(0) +33>Emitted(63, 300) Source(94, 37) + SourceIndex(0) +34>Emitted(63, 302) Source(94, 39) + SourceIndex(0) +35>Emitted(63, 304) Source(94, 41) + SourceIndex(0) +36>Emitted(63, 305) Source(94, 42) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(64, 23) Source(95, 23) + SourceIndex(0) +7 >Emitted(64, 24) Source(95, 24) + SourceIndex(0) +8 >Emitted(64, 25) Source(95, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(65, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(65, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for ((_27 = ["trimmer", ["trimming", "edging"]], _28 = _27[0], nameMA = _28 === void 0 ? "noName" : _28, _29 = _27[1], _30 = _29 === void 0 ? ["none", "none"] : _29, _31 = _30[0], primarySkillA = _31 === void 0 ? "primary" : _31, _32 = _30[1], secondarySkillA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(66, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(97, 6) + SourceIndex(0) +5 >Emitted(66, 7) Source(97, 6) + SourceIndex(0) +6 >Emitted(66, 48) Source(102, 40) + SourceIndex(0) +7 >Emitted(66, 50) Source(97, 7) + SourceIndex(0) +8 >Emitted(66, 62) Source(97, 24) + SourceIndex(0) +9 >Emitted(66, 64) Source(97, 7) + SourceIndex(0) +10>Emitted(66, 104) Source(97, 24) + SourceIndex(0) +11>Emitted(66, 106) Source(98, 5) + SourceIndex(0) +12>Emitted(66, 118) Source(101, 25) + SourceIndex(0) +13>Emitted(66, 120) Source(98, 5) + SourceIndex(0) +14>Emitted(66, 165) Source(101, 25) + SourceIndex(0) +15>Emitted(66, 167) Source(99, 9) + SourceIndex(0) +16>Emitted(66, 179) Source(99, 34) + SourceIndex(0) +17>Emitted(66, 181) Source(99, 9) + SourceIndex(0) +18>Emitted(66, 229) Source(99, 34) + SourceIndex(0) +19>Emitted(66, 231) Source(100, 9) + SourceIndex(0) +20>Emitted(66, 243) Source(100, 38) + SourceIndex(0) +21>Emitted(66, 245) Source(100, 9) + SourceIndex(0) +22>Emitted(66, 297) Source(100, 38) + SourceIndex(0) +23>Emitted(66, 303) Source(102, 40) + SourceIndex(0) +24>Emitted(66, 305) Source(102, 42) + SourceIndex(0) +25>Emitted(66, 306) Source(102, 43) + SourceIndex(0) +26>Emitted(66, 309) Source(102, 46) + SourceIndex(0) +27>Emitted(66, 310) Source(102, 47) + SourceIndex(0) +28>Emitted(66, 312) Source(102, 49) + SourceIndex(0) +29>Emitted(66, 313) Source(102, 50) + SourceIndex(0) +30>Emitted(66, 316) Source(102, 53) + SourceIndex(0) +31>Emitted(66, 317) Source(102, 54) + SourceIndex(0) +32>Emitted(66, 319) Source(102, 56) + SourceIndex(0) +33>Emitted(66, 320) Source(102, 57) + SourceIndex(0) +34>Emitted(66, 322) Source(102, 59) + SourceIndex(0) +35>Emitted(66, 324) Source(102, 61) + SourceIndex(0) +36>Emitted(66, 325) Source(102, 62) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(67, 5) Source(103, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(103, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(103, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(103, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(103, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(103, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(103, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(103, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(68, 1) Source(104, 1) + SourceIndex(0) +2 >Emitted(68, 2) Source(104, 2) + SourceIndex(0) +--- +>>>for ((_33 = robotA[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA3 = -1 +7 > +8 > numberA3 = -1 +9 > , +10> ...robotAInfo +11> ] = +12> robotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(69, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(69, 7) Source(106, 7) + SourceIndex(0) +6 >Emitted(69, 22) Source(106, 20) + SourceIndex(0) +7 >Emitted(69, 24) Source(106, 7) + SourceIndex(0) +8 >Emitted(69, 60) Source(106, 20) + SourceIndex(0) +9 >Emitted(69, 62) Source(106, 22) + SourceIndex(0) +10>Emitted(69, 90) Source(106, 35) + SourceIndex(0) +11>Emitted(69, 92) Source(106, 39) + SourceIndex(0) +12>Emitted(69, 98) Source(106, 45) + SourceIndex(0) +13>Emitted(69, 99) Source(106, 45) + SourceIndex(0) +14>Emitted(69, 101) Source(106, 47) + SourceIndex(0) +15>Emitted(69, 102) Source(106, 48) + SourceIndex(0) +16>Emitted(69, 105) Source(106, 51) + SourceIndex(0) +17>Emitted(69, 106) Source(106, 52) + SourceIndex(0) +18>Emitted(69, 108) Source(106, 54) + SourceIndex(0) +19>Emitted(69, 109) Source(106, 55) + SourceIndex(0) +20>Emitted(69, 112) Source(106, 58) + SourceIndex(0) +21>Emitted(69, 113) Source(106, 59) + SourceIndex(0) +22>Emitted(69, 115) Source(106, 61) + SourceIndex(0) +23>Emitted(69, 116) Source(106, 62) + SourceIndex(0) +24>Emitted(69, 118) Source(106, 64) + SourceIndex(0) +25>Emitted(69, 120) Source(106, 66) + SourceIndex(0) +26>Emitted(69, 121) Source(106, 67) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(70, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(70, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(70, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(70, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(70, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(70, 25) Source(107, 25) + SourceIndex(0) +7 >Emitted(70, 26) Source(107, 26) + SourceIndex(0) +8 >Emitted(70, 27) Source(107, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(71, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(71, 2) Source(108, 2) + SourceIndex(0) +--- +>>>for ((_34 = getRobot(), _35 = _34[0], numberA3 = _35 === void 0 ? -1 : _35, robotAInfo = _34.slice(1), _34), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3 = -1, ...robotAInfo] = getRobot() +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = getRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(72, 1) Source(109, 1) + SourceIndex(0) +2 >Emitted(72, 4) Source(109, 4) + SourceIndex(0) +3 >Emitted(72, 5) Source(109, 5) + SourceIndex(0) +4 >Emitted(72, 6) Source(109, 6) + SourceIndex(0) +5 >Emitted(72, 7) Source(109, 6) + SourceIndex(0) +6 >Emitted(72, 23) Source(109, 49) + SourceIndex(0) +7 >Emitted(72, 25) Source(109, 7) + SourceIndex(0) +8 >Emitted(72, 37) Source(109, 20) + SourceIndex(0) +9 >Emitted(72, 39) Source(109, 7) + SourceIndex(0) +10>Emitted(72, 75) Source(109, 20) + SourceIndex(0) +11>Emitted(72, 77) Source(109, 22) + SourceIndex(0) +12>Emitted(72, 102) Source(109, 35) + SourceIndex(0) +13>Emitted(72, 108) Source(109, 49) + SourceIndex(0) +14>Emitted(72, 110) Source(109, 51) + SourceIndex(0) +15>Emitted(72, 111) Source(109, 52) + SourceIndex(0) +16>Emitted(72, 114) Source(109, 55) + SourceIndex(0) +17>Emitted(72, 115) Source(109, 56) + SourceIndex(0) +18>Emitted(72, 117) Source(109, 58) + SourceIndex(0) +19>Emitted(72, 118) Source(109, 59) + SourceIndex(0) +20>Emitted(72, 121) Source(109, 62) + SourceIndex(0) +21>Emitted(72, 122) Source(109, 63) + SourceIndex(0) +22>Emitted(72, 124) Source(109, 65) + SourceIndex(0) +23>Emitted(72, 125) Source(109, 66) + SourceIndex(0) +24>Emitted(72, 127) Source(109, 68) + SourceIndex(0) +25>Emitted(72, 129) Source(109, 70) + SourceIndex(0) +26>Emitted(72, 130) Source(109, 71) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(73, 5) Source(110, 5) + SourceIndex(0) +2 >Emitted(73, 12) Source(110, 12) + SourceIndex(0) +3 >Emitted(73, 13) Source(110, 13) + SourceIndex(0) +4 >Emitted(73, 16) Source(110, 16) + SourceIndex(0) +5 >Emitted(73, 17) Source(110, 17) + SourceIndex(0) +6 >Emitted(73, 25) Source(110, 25) + SourceIndex(0) +7 >Emitted(73, 26) Source(110, 26) + SourceIndex(0) +8 >Emitted(73, 27) Source(110, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(74, 1) Source(111, 1) + SourceIndex(0) +2 >Emitted(74, 2) Source(111, 2) + SourceIndex(0) +--- +>>>for ((_36 = [2, "trimmer", "trimming"], _37 = _36[0], numberA3 = _37 === void 0 ? -1 : _37, robotAInfo = _36.slice(1), _36), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = [2, "trimmer", "trimming"] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(75, 1) Source(112, 1) + SourceIndex(0) +2 >Emitted(75, 4) Source(112, 4) + SourceIndex(0) +3 >Emitted(75, 5) Source(112, 5) + SourceIndex(0) +4 >Emitted(75, 6) Source(112, 6) + SourceIndex(0) +5 >Emitted(75, 7) Source(112, 6) + SourceIndex(0) +6 >Emitted(75, 39) Source(112, 72) + SourceIndex(0) +7 >Emitted(75, 41) Source(112, 7) + SourceIndex(0) +8 >Emitted(75, 53) Source(112, 20) + SourceIndex(0) +9 >Emitted(75, 55) Source(112, 7) + SourceIndex(0) +10>Emitted(75, 91) Source(112, 20) + SourceIndex(0) +11>Emitted(75, 93) Source(112, 22) + SourceIndex(0) +12>Emitted(75, 118) Source(112, 35) + SourceIndex(0) +13>Emitted(75, 124) Source(112, 72) + SourceIndex(0) +14>Emitted(75, 126) Source(112, 74) + SourceIndex(0) +15>Emitted(75, 127) Source(112, 75) + SourceIndex(0) +16>Emitted(75, 130) Source(112, 78) + SourceIndex(0) +17>Emitted(75, 131) Source(112, 79) + SourceIndex(0) +18>Emitted(75, 133) Source(112, 81) + SourceIndex(0) +19>Emitted(75, 134) Source(112, 82) + SourceIndex(0) +20>Emitted(75, 137) Source(112, 85) + SourceIndex(0) +21>Emitted(75, 138) Source(112, 86) + SourceIndex(0) +22>Emitted(75, 140) Source(112, 88) + SourceIndex(0) +23>Emitted(75, 141) Source(112, 89) + SourceIndex(0) +24>Emitted(75, 143) Source(112, 91) + SourceIndex(0) +25>Emitted(75, 145) Source(112, 93) + SourceIndex(0) +26>Emitted(75, 146) Source(112, 94) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(76, 5) Source(113, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(113, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(113, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(113, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(113, 17) + SourceIndex(0) +6 >Emitted(76, 25) Source(113, 25) + SourceIndex(0) +7 >Emitted(76, 26) Source(113, 26) + SourceIndex(0) +8 >Emitted(76, 27) Source(113, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(77, 1) Source(114, 1) + SourceIndex(0) +2 >Emitted(77, 2) Source(114, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..3acec61f78b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,391 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 54)) + +let i: number; +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for (let + [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 80, 5)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 81, 9)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 82, 38)) + + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 80, 5)) +} +for ([nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) +} +for ([nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..3bef86dcf80 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types @@ -0,0 +1,752 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +let i: number; +>i : number + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +>[, nameA = "name"] = robotA, i = 0 : number +>[, nameA = "name"] = robotA : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>[, nameA = "name"] = getRobot(), i = 0 : number +>[, nameA = "name"] = getRobot() : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +>[numberB = -1] = robotA, i = 0 : number +>[numberB = -1] = robotA : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>[numberB = -1] = getRobot(), i = 0 : number +>[numberB = -1] = getRobot() : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>[nameB = "name"] = multiRobotA, i = 0 : number +>[nameB = "name"] = multiRobotA : [string, [string, string]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameB = "name"] = getMultiRobot(), i = 0 : number +>[nameB = "name"] = getMultiRobot() : [string, [string, string]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let + [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string + + [ +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string + + [ +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : number +>[numberA3 = -1, ...robotAInfo] = robotA : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3 = -1, ...robotAInfo] = getRobot() : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js new file mode 100644 index 00000000000..ca29b2eabd8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js @@ -0,0 +1,114 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPattern.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +for (var nameA = robot.name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = getRobot().name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map new file mode 100644 index 00000000000..d9f2e446f04 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,sBAAW,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAW,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,uDAAW,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAO,0BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,+BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,yFAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAEzD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,sBAAW,EAAE,oBAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA8C,EAAzC,eAAW,EAAE,iBAAa,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,2CAAiF,EAA5E,eAAW,EAAE,iBAAa,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAA0F,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,8EACoF,EAD/E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAErE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..61689b46799 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt @@ -0,0 +1,1490 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>for (var nameA = robot.name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = robot, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +5 >Emitted(9, 28) Source(26, 22) + SourceIndex(0) +6 >Emitted(9, 30) Source(26, 34) + SourceIndex(0) +7 >Emitted(9, 31) Source(26, 35) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 38) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 39) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 41) + SourceIndex(0) +11>Emitted(9, 38) Source(26, 42) + SourceIndex(0) +12>Emitted(9, 41) Source(26, 45) + SourceIndex(0) +13>Emitted(9, 42) Source(26, 46) + SourceIndex(0) +14>Emitted(9, 44) Source(26, 48) + SourceIndex(0) +15>Emitted(9, 45) Source(26, 49) + SourceIndex(0) +16>Emitted(9, 47) Source(26, 51) + SourceIndex(0) +17>Emitted(9, 49) Source(26, 53) + SourceIndex(0) +18>Emitted(9, 50) Source(26, 54) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var nameA = getRobot().name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +5 >Emitted(12, 33) Source(29, 22) + SourceIndex(0) +6 >Emitted(12, 35) Source(29, 39) + SourceIndex(0) +7 >Emitted(12, 36) Source(29, 40) + SourceIndex(0) +8 >Emitted(12, 39) Source(29, 43) + SourceIndex(0) +9 >Emitted(12, 40) Source(29, 44) + SourceIndex(0) +10>Emitted(12, 42) Source(29, 46) + SourceIndex(0) +11>Emitted(12, 43) Source(29, 47) + SourceIndex(0) +12>Emitted(12, 46) Source(29, 50) + SourceIndex(0) +13>Emitted(12, 47) Source(29, 51) + SourceIndex(0) +14>Emitted(12, 49) Source(29, 53) + SourceIndex(0) +15>Emitted(12, 50) Source(29, 54) + SourceIndex(0) +16>Emitted(12, 52) Source(29, 56) + SourceIndex(0) +17>Emitted(12, 54) Source(29, 58) + SourceIndex(0) +18>Emitted(12, 55) Source(29, 59) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(13, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(13, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(13, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = { name: "trimmer", skill: "trimming" }, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +5 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) +6 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) +7 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) +8 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) +9 >Emitted(15, 68) Source(32, 79) + SourceIndex(0) +10>Emitted(15, 70) Source(32, 81) + SourceIndex(0) +11>Emitted(15, 71) Source(32, 82) + SourceIndex(0) +12>Emitted(15, 74) Source(32, 85) + SourceIndex(0) +13>Emitted(15, 75) Source(32, 86) + SourceIndex(0) +14>Emitted(15, 77) Source(32, 88) + SourceIndex(0) +15>Emitted(15, 78) Source(32, 89) + SourceIndex(0) +16>Emitted(15, 80) Source(32, 91) + SourceIndex(0) +17>Emitted(15, 82) Source(32, 93) + SourceIndex(0) +18>Emitted(15, 83) Source(32, 94) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = multiRobot, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 12) + SourceIndex(0) +5 >Emitted(18, 32) Source(35, 64) + SourceIndex(0) +6 >Emitted(18, 34) Source(35, 22) + SourceIndex(0) +7 >Emitted(18, 55) Source(35, 39) + SourceIndex(0) +8 >Emitted(18, 57) Source(35, 41) + SourceIndex(0) +9 >Emitted(18, 82) Source(35, 62) + SourceIndex(0) +10>Emitted(18, 84) Source(35, 81) + SourceIndex(0) +11>Emitted(18, 85) Source(35, 82) + SourceIndex(0) +12>Emitted(18, 88) Source(35, 85) + SourceIndex(0) +13>Emitted(18, 89) Source(35, 86) + SourceIndex(0) +14>Emitted(18, 91) Source(35, 88) + SourceIndex(0) +15>Emitted(18, 92) Source(35, 89) + SourceIndex(0) +16>Emitted(18, 95) Source(35, 92) + SourceIndex(0) +17>Emitted(18, 96) Source(35, 93) + SourceIndex(0) +18>Emitted(18, 98) Source(35, 95) + SourceIndex(0) +19>Emitted(18, 99) Source(35, 96) + SourceIndex(0) +20>Emitted(18, 101) Source(35, 98) + SourceIndex(0) +21>Emitted(18, 103) Source(35, 100) + SourceIndex(0) +22>Emitted(18, 104) Source(35, 101) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(19, 25) Source(36, 25) + SourceIndex(0) +7 >Emitted(19, 26) Source(36, 26) + SourceIndex(0) +8 >Emitted(19, 27) Source(36, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = getMultiRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(21, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(38, 12) + SourceIndex(0) +5 >Emitted(21, 37) Source(38, 64) + SourceIndex(0) +6 >Emitted(21, 39) Source(38, 22) + SourceIndex(0) +7 >Emitted(21, 60) Source(38, 39) + SourceIndex(0) +8 >Emitted(21, 62) Source(38, 41) + SourceIndex(0) +9 >Emitted(21, 87) Source(38, 62) + SourceIndex(0) +10>Emitted(21, 89) Source(38, 86) + SourceIndex(0) +11>Emitted(21, 90) Source(38, 87) + SourceIndex(0) +12>Emitted(21, 93) Source(38, 90) + SourceIndex(0) +13>Emitted(21, 94) Source(38, 91) + SourceIndex(0) +14>Emitted(21, 96) Source(38, 93) + SourceIndex(0) +15>Emitted(21, 97) Source(38, 94) + SourceIndex(0) +16>Emitted(21, 100) Source(38, 97) + SourceIndex(0) +17>Emitted(21, 101) Source(38, 98) + SourceIndex(0) +18>Emitted(21, 103) Source(38, 100) + SourceIndex(0) +19>Emitted(21, 104) Source(38, 101) + SourceIndex(0) +20>Emitted(21, 106) Source(38, 103) + SourceIndex(0) +21>Emitted(21, 108) Source(38, 105) + SourceIndex(0) +22>Emitted(21, 109) Source(38, 106) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(22, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(22, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) +5 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) +6 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) +7 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) +8 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) +9 >Emitted(24, 145) Source(41, 62) + SourceIndex(0) +10>Emitted(24, 147) Source(43, 5) + SourceIndex(0) +11>Emitted(24, 148) Source(43, 6) + SourceIndex(0) +12>Emitted(24, 151) Source(43, 9) + SourceIndex(0) +13>Emitted(24, 152) Source(43, 10) + SourceIndex(0) +14>Emitted(24, 154) Source(43, 12) + SourceIndex(0) +15>Emitted(24, 155) Source(43, 13) + SourceIndex(0) +16>Emitted(24, 158) Source(43, 16) + SourceIndex(0) +17>Emitted(24, 159) Source(43, 17) + SourceIndex(0) +18>Emitted(24, 161) Source(43, 19) + SourceIndex(0) +19>Emitted(24, 162) Source(43, 20) + SourceIndex(0) +20>Emitted(24, 164) Source(43, 22) + SourceIndex(0) +21>Emitted(24, 166) Source(43, 24) + SourceIndex(0) +22>Emitted(24, 167) Source(43, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(25, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(25, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(25, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > , +7 > skill: skillA +8 > } = robot, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(27, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(47, 11) + SourceIndex(0) +5 >Emitted(27, 28) Source(47, 22) + SourceIndex(0) +6 >Emitted(27, 30) Source(47, 24) + SourceIndex(0) +7 >Emitted(27, 50) Source(47, 37) + SourceIndex(0) +8 >Emitted(27, 52) Source(47, 49) + SourceIndex(0) +9 >Emitted(27, 53) Source(47, 50) + SourceIndex(0) +10>Emitted(27, 56) Source(47, 53) + SourceIndex(0) +11>Emitted(27, 57) Source(47, 54) + SourceIndex(0) +12>Emitted(27, 59) Source(47, 56) + SourceIndex(0) +13>Emitted(27, 60) Source(47, 57) + SourceIndex(0) +14>Emitted(27, 63) Source(47, 60) + SourceIndex(0) +15>Emitted(27, 64) Source(47, 61) + SourceIndex(0) +16>Emitted(27, 66) Source(47, 63) + SourceIndex(0) +17>Emitted(27, 67) Source(47, 64) + SourceIndex(0) +18>Emitted(27, 69) Source(47, 66) + SourceIndex(0) +19>Emitted(27, 71) Source(47, 68) + SourceIndex(0) +20>Emitted(27, 72) Source(47, 69) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(48, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(48, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(48, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(48, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(48, 17) + SourceIndex(0) +6 >Emitted(28, 22) Source(48, 22) + SourceIndex(0) +7 >Emitted(28, 23) Source(48, 23) + SourceIndex(0) +8 >Emitted(28, 24) Source(48, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(49, 2) + SourceIndex(0) +--- +>>>for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skill: skillA } = getRobot() +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(30, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(50, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(50, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(50, 6) + SourceIndex(0) +5 >Emitted(30, 10) Source(50, 6) + SourceIndex(0) +6 >Emitted(30, 25) Source(50, 52) + SourceIndex(0) +7 >Emitted(30, 27) Source(50, 11) + SourceIndex(0) +8 >Emitted(30, 42) Source(50, 22) + SourceIndex(0) +9 >Emitted(30, 44) Source(50, 24) + SourceIndex(0) +10>Emitted(30, 61) Source(50, 37) + SourceIndex(0) +11>Emitted(30, 63) Source(50, 54) + SourceIndex(0) +12>Emitted(30, 64) Source(50, 55) + SourceIndex(0) +13>Emitted(30, 67) Source(50, 58) + SourceIndex(0) +14>Emitted(30, 68) Source(50, 59) + SourceIndex(0) +15>Emitted(30, 70) Source(50, 61) + SourceIndex(0) +16>Emitted(30, 71) Source(50, 62) + SourceIndex(0) +17>Emitted(30, 74) Source(50, 65) + SourceIndex(0) +18>Emitted(30, 75) Source(50, 66) + SourceIndex(0) +19>Emitted(30, 77) Source(50, 68) + SourceIndex(0) +20>Emitted(30, 78) Source(50, 69) + SourceIndex(0) +21>Emitted(30, 80) Source(50, 71) + SourceIndex(0) +22>Emitted(30, 82) Source(50, 73) + SourceIndex(0) +23>Emitted(30, 83) Source(50, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(51, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(51, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(51, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(51, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(51, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(51, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(51, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(52, 2) + SourceIndex(0) +--- +>>>for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = { name: "trimmer", skill: "trimming" }, +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(33, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(53, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(53, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(53, 6) + SourceIndex(0) +5 >Emitted(33, 10) Source(53, 6) + SourceIndex(0) +6 >Emitted(33, 53) Source(53, 87) + SourceIndex(0) +7 >Emitted(33, 55) Source(53, 11) + SourceIndex(0) +8 >Emitted(33, 70) Source(53, 22) + SourceIndex(0) +9 >Emitted(33, 72) Source(53, 24) + SourceIndex(0) +10>Emitted(33, 89) Source(53, 37) + SourceIndex(0) +11>Emitted(33, 91) Source(53, 89) + SourceIndex(0) +12>Emitted(33, 92) Source(53, 90) + SourceIndex(0) +13>Emitted(33, 95) Source(53, 93) + SourceIndex(0) +14>Emitted(33, 96) Source(53, 94) + SourceIndex(0) +15>Emitted(33, 98) Source(53, 96) + SourceIndex(0) +16>Emitted(33, 99) Source(53, 97) + SourceIndex(0) +17>Emitted(33, 102) Source(53, 100) + SourceIndex(0) +18>Emitted(33, 103) Source(53, 101) + SourceIndex(0) +19>Emitted(33, 105) Source(53, 103) + SourceIndex(0) +20>Emitted(33, 106) Source(53, 104) + SourceIndex(0) +21>Emitted(33, 108) Source(53, 106) + SourceIndex(0) +22>Emitted(33, 110) Source(53, 108) + SourceIndex(0) +23>Emitted(33, 111) Source(53, 109) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(54, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(54, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(54, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(54, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(54, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(54, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(54, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(54, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(55, 2) + SourceIndex(0) +--- +>>>for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > , +7 > skills: { primary: primaryA, secondary: secondaryA } +8 > +9 > primary: primaryA +10> , +11> secondary: secondaryA +12> } } = multiRobot, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(56, 11) + SourceIndex(0) +5 >Emitted(36, 33) Source(56, 22) + SourceIndex(0) +6 >Emitted(36, 35) Source(56, 24) + SourceIndex(0) +7 >Emitted(36, 57) Source(56, 76) + SourceIndex(0) +8 >Emitted(36, 59) Source(56, 34) + SourceIndex(0) +9 >Emitted(36, 80) Source(56, 51) + SourceIndex(0) +10>Emitted(36, 82) Source(56, 53) + SourceIndex(0) +11>Emitted(36, 107) Source(56, 74) + SourceIndex(0) +12>Emitted(36, 109) Source(56, 93) + SourceIndex(0) +13>Emitted(36, 110) Source(56, 94) + SourceIndex(0) +14>Emitted(36, 113) Source(56, 97) + SourceIndex(0) +15>Emitted(36, 114) Source(56, 98) + SourceIndex(0) +16>Emitted(36, 116) Source(56, 100) + SourceIndex(0) +17>Emitted(36, 117) Source(56, 101) + SourceIndex(0) +18>Emitted(36, 120) Source(56, 104) + SourceIndex(0) +19>Emitted(36, 121) Source(56, 105) + SourceIndex(0) +20>Emitted(36, 123) Source(56, 107) + SourceIndex(0) +21>Emitted(36, 124) Source(56, 108) + SourceIndex(0) +22>Emitted(36, 126) Source(56, 110) + SourceIndex(0) +23>Emitted(36, 128) Source(56, 112) + SourceIndex(0) +24>Emitted(36, 129) Source(56, 113) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(37, 25) Source(57, 25) + SourceIndex(0) +7 >Emitted(37, 26) Source(57, 26) + SourceIndex(0) +8 >Emitted(37, 27) Source(57, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = getMultiRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(39, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(59, 6) + SourceIndex(0) +5 >Emitted(39, 10) Source(59, 6) + SourceIndex(0) +6 >Emitted(39, 30) Source(59, 96) + SourceIndex(0) +7 >Emitted(39, 32) Source(59, 11) + SourceIndex(0) +8 >Emitted(39, 47) Source(59, 22) + SourceIndex(0) +9 >Emitted(39, 49) Source(59, 24) + SourceIndex(0) +10>Emitted(39, 63) Source(59, 76) + SourceIndex(0) +11>Emitted(39, 65) Source(59, 34) + SourceIndex(0) +12>Emitted(39, 86) Source(59, 51) + SourceIndex(0) +13>Emitted(39, 88) Source(59, 53) + SourceIndex(0) +14>Emitted(39, 113) Source(59, 74) + SourceIndex(0) +15>Emitted(39, 115) Source(59, 98) + SourceIndex(0) +16>Emitted(39, 116) Source(59, 99) + SourceIndex(0) +17>Emitted(39, 119) Source(59, 102) + SourceIndex(0) +18>Emitted(39, 120) Source(59, 103) + SourceIndex(0) +19>Emitted(39, 122) Source(59, 105) + SourceIndex(0) +20>Emitted(39, 123) Source(59, 106) + SourceIndex(0) +21>Emitted(39, 126) Source(59, 109) + SourceIndex(0) +22>Emitted(39, 127) Source(59, 110) + SourceIndex(0) +23>Emitted(39, 129) Source(59, 112) + SourceIndex(0) +24>Emitted(39, 130) Source(59, 113) + SourceIndex(0) +25>Emitted(39, 132) Source(59, 115) + SourceIndex(0) +26>Emitted(39, 134) Source(59, 117) + SourceIndex(0) +27>Emitted(39, 135) Source(59, 118) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(60, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(60, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(60, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(42, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(42, 10) Source(62, 6) + SourceIndex(0) +6 >Emitted(42, 88) Source(63, 90) + SourceIndex(0) +7 >Emitted(42, 90) Source(62, 11) + SourceIndex(0) +8 >Emitted(42, 105) Source(62, 22) + SourceIndex(0) +9 >Emitted(42, 107) Source(62, 24) + SourceIndex(0) +10>Emitted(42, 121) Source(62, 76) + SourceIndex(0) +11>Emitted(42, 123) Source(62, 34) + SourceIndex(0) +12>Emitted(42, 144) Source(62, 51) + SourceIndex(0) +13>Emitted(42, 146) Source(62, 53) + SourceIndex(0) +14>Emitted(42, 171) Source(62, 74) + SourceIndex(0) +15>Emitted(42, 173) Source(64, 5) + SourceIndex(0) +16>Emitted(42, 174) Source(64, 6) + SourceIndex(0) +17>Emitted(42, 177) Source(64, 9) + SourceIndex(0) +18>Emitted(42, 178) Source(64, 10) + SourceIndex(0) +19>Emitted(42, 180) Source(64, 12) + SourceIndex(0) +20>Emitted(42, 181) Source(64, 13) + SourceIndex(0) +21>Emitted(42, 184) Source(64, 16) + SourceIndex(0) +22>Emitted(42, 185) Source(64, 17) + SourceIndex(0) +23>Emitted(42, 187) Source(64, 19) + SourceIndex(0) +24>Emitted(42, 188) Source(64, 20) + SourceIndex(0) +25>Emitted(42, 190) Source(64, 22) + SourceIndex(0) +26>Emitted(42, 192) Source(64, 24) + SourceIndex(0) +27>Emitted(42, 193) Source(64, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(65, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(65, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(65, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(66, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols new file mode 100644 index 00000000000..7037783e9a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols @@ -0,0 +1,282 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10)) +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10)) +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 51)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 39)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 39)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 39)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20)) +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 22)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10)) +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 22)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10)) +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 22)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 51)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 51)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types new file mode 100644 index 00000000000..21a7122e564 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types @@ -0,0 +1,374 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js new file mode 100644 index 00000000000..f7073765d04 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js @@ -0,0 +1,201 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPattern2.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for ((nameA = robot.name, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_a = getRobot(), nameA = _a.name, _a), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((name = robot.name, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_h = getRobot(), name = _h.name, _h), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((nameA = robot.name, skillA = robot.skill, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((name = robot.name, skill = robot.skill, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_x = getRobot(), name = _x.name, skill = _x.skill, _x), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2), + i = 0; i < 1; i++) { + console.log(primaryA); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map new file mode 100644 index 00000000000..cb6d6d9fe4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAC,CAAE,kBAAW,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA4B,EAA1B,eAAW,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA+D,EAA7D,eAAW,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA0E,EAAxE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KACgC;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,iBAAI,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAqB,EAAnB,cAAI,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAwD,EAAtD,cAAI,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAoD,EAAlD,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KACsD;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAC,CAAE,kBAAW,EAAE,oBAAa,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA2C,EAAzC,eAAW,EAAE,iBAAa,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA8E,EAA5E,eAAW,EAAE,iBAAa,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAuF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KACmB;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,iBAAI,EAAE,mBAAK,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA4B,EAA1B,cAAI,EAAE,gBAAK,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA+D,EAA7D,cAAI,EAAE,gBAAK,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAAI,EAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA0D,EAAxD,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KACgD;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..3744cc2e7ab --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt @@ -0,0 +1,3073 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 18) + SourceIndex(0) +4 >Emitted(9, 12) Source(26, 20) + SourceIndex(0) +5 >Emitted(9, 20) Source(26, 36) + SourceIndex(0) +6 >Emitted(9, 22) Source(26, 38) + SourceIndex(0) +7 >Emitted(9, 32) Source(26, 56) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 58) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 67) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 69) + SourceIndex(0) +11>Emitted(9, 43) Source(26, 83) + SourceIndex(0) +12>Emitted(9, 44) Source(26, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(10, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(10, 9) Source(27, 17) + SourceIndex(0) +4 >Emitted(10, 11) Source(27, 19) + SourceIndex(0) +5 >Emitted(10, 18) Source(27, 34) + SourceIndex(0) +6 >Emitted(10, 20) Source(27, 36) + SourceIndex(0) +7 >Emitted(10, 29) Source(27, 53) + SourceIndex(0) +8 >Emitted(10, 31) Source(27, 55) + SourceIndex(0) +9 >Emitted(10, 36) Source(27, 68) + SourceIndex(0) +10>Emitted(10, 37) Source(27, 69) + SourceIndex(0) +--- +>>>for ((nameA = robot.name, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > } = +8 > robot +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(11, 6) Source(29, 6) + SourceIndex(0) +5 >Emitted(11, 7) Source(29, 8) + SourceIndex(0) +6 >Emitted(11, 25) Source(29, 19) + SourceIndex(0) +7 >Emitted(11, 27) Source(29, 24) + SourceIndex(0) +8 >Emitted(11, 32) Source(29, 29) + SourceIndex(0) +9 >Emitted(11, 33) Source(29, 29) + SourceIndex(0) +10>Emitted(11, 35) Source(29, 31) + SourceIndex(0) +11>Emitted(11, 36) Source(29, 32) + SourceIndex(0) +12>Emitted(11, 39) Source(29, 35) + SourceIndex(0) +13>Emitted(11, 40) Source(29, 36) + SourceIndex(0) +14>Emitted(11, 42) Source(29, 38) + SourceIndex(0) +15>Emitted(11, 43) Source(29, 39) + SourceIndex(0) +16>Emitted(11, 46) Source(29, 42) + SourceIndex(0) +17>Emitted(11, 47) Source(29, 43) + SourceIndex(0) +18>Emitted(11, 49) Source(29, 45) + SourceIndex(0) +19>Emitted(11, 50) Source(29, 46) + SourceIndex(0) +20>Emitted(11, 52) Source(29, 48) + SourceIndex(0) +21>Emitted(11, 54) Source(29, 50) + SourceIndex(0) +22>Emitted(11, 55) Source(29, 51) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for ((_a = getRobot(), nameA = _a.name, _a), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA } = getRobot() +7 > +8 > name: nameA +9 > } = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +5 >Emitted(14, 7) Source(32, 6) + SourceIndex(0) +6 >Emitted(14, 22) Source(32, 34) + SourceIndex(0) +7 >Emitted(14, 24) Source(32, 8) + SourceIndex(0) +8 >Emitted(14, 39) Source(32, 19) + SourceIndex(0) +9 >Emitted(14, 44) Source(32, 34) + SourceIndex(0) +10>Emitted(14, 46) Source(32, 36) + SourceIndex(0) +11>Emitted(14, 47) Source(32, 37) + SourceIndex(0) +12>Emitted(14, 50) Source(32, 40) + SourceIndex(0) +13>Emitted(14, 51) Source(32, 41) + SourceIndex(0) +14>Emitted(14, 53) Source(32, 43) + SourceIndex(0) +15>Emitted(14, 54) Source(32, 44) + SourceIndex(0) +16>Emitted(14, 57) Source(32, 47) + SourceIndex(0) +17>Emitted(14, 58) Source(32, 48) + SourceIndex(0) +18>Emitted(14, 60) Source(32, 50) + SourceIndex(0) +19>Emitted(14, 61) Source(32, 51) + SourceIndex(0) +20>Emitted(14, 63) Source(32, 53) + SourceIndex(0) +21>Emitted(14, 65) Source(32, 55) + SourceIndex(0) +22>Emitted(14, 66) Source(32, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for ((_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > } = { name: "trimmer", skill: "trimming" } +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +5 >Emitted(17, 7) Source(35, 6) + SourceIndex(0) +6 >Emitted(17, 50) Source(35, 69) + SourceIndex(0) +7 >Emitted(17, 52) Source(35, 8) + SourceIndex(0) +8 >Emitted(17, 67) Source(35, 19) + SourceIndex(0) +9 >Emitted(17, 72) Source(35, 69) + SourceIndex(0) +10>Emitted(17, 74) Source(35, 71) + SourceIndex(0) +11>Emitted(17, 75) Source(35, 72) + SourceIndex(0) +12>Emitted(17, 78) Source(35, 75) + SourceIndex(0) +13>Emitted(17, 79) Source(35, 76) + SourceIndex(0) +14>Emitted(17, 81) Source(35, 78) + SourceIndex(0) +15>Emitted(17, 82) Source(35, 79) + SourceIndex(0) +16>Emitted(17, 85) Source(35, 82) + SourceIndex(0) +17>Emitted(17, 86) Source(35, 83) + SourceIndex(0) +18>Emitted(17, 88) Source(35, 85) + SourceIndex(0) +19>Emitted(17, 89) Source(35, 86) + SourceIndex(0) +20>Emitted(17, 91) Source(35, 88) + SourceIndex(0) +21>Emitted(17, 93) Source(35, 90) + SourceIndex(0) +22>Emitted(17, 94) Source(35, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for ((_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +11> } } = +12> multiRobot +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 6) + SourceIndex(0) +5 >Emitted(20, 7) Source(38, 8) + SourceIndex(0) +6 >Emitted(20, 29) Source(38, 60) + SourceIndex(0) +7 >Emitted(20, 31) Source(38, 18) + SourceIndex(0) +8 >Emitted(20, 52) Source(38, 35) + SourceIndex(0) +9 >Emitted(20, 54) Source(38, 37) + SourceIndex(0) +10>Emitted(20, 79) Source(38, 58) + SourceIndex(0) +11>Emitted(20, 81) Source(38, 65) + SourceIndex(0) +12>Emitted(20, 91) Source(38, 75) + SourceIndex(0) +13>Emitted(20, 92) Source(38, 75) + SourceIndex(0) +14>Emitted(20, 94) Source(38, 77) + SourceIndex(0) +15>Emitted(20, 95) Source(38, 78) + SourceIndex(0) +16>Emitted(20, 98) Source(38, 81) + SourceIndex(0) +17>Emitted(20, 99) Source(38, 82) + SourceIndex(0) +18>Emitted(20, 101) Source(38, 84) + SourceIndex(0) +19>Emitted(20, 102) Source(38, 85) + SourceIndex(0) +20>Emitted(20, 105) Source(38, 88) + SourceIndex(0) +21>Emitted(20, 106) Source(38, 89) + SourceIndex(0) +22>Emitted(20, 108) Source(38, 91) + SourceIndex(0) +23>Emitted(20, 109) Source(38, 92) + SourceIndex(0) +24>Emitted(20, 111) Source(38, 94) + SourceIndex(0) +25>Emitted(20, 113) Source(38, 96) + SourceIndex(0) +26>Emitted(20, 114) Source(38, 97) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(21, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(21, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(21, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(21, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(21, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(21, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(21, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(22, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(22, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for ((_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(23, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(23, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(23, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(23, 6) Source(41, 6) + SourceIndex(0) +5 >Emitted(23, 7) Source(41, 6) + SourceIndex(0) +6 >Emitted(23, 27) Source(41, 80) + SourceIndex(0) +7 >Emitted(23, 29) Source(41, 8) + SourceIndex(0) +8 >Emitted(23, 43) Source(41, 60) + SourceIndex(0) +9 >Emitted(23, 45) Source(41, 18) + SourceIndex(0) +10>Emitted(23, 66) Source(41, 35) + SourceIndex(0) +11>Emitted(23, 68) Source(41, 37) + SourceIndex(0) +12>Emitted(23, 93) Source(41, 58) + SourceIndex(0) +13>Emitted(23, 98) Source(41, 80) + SourceIndex(0) +14>Emitted(23, 100) Source(41, 82) + SourceIndex(0) +15>Emitted(23, 101) Source(41, 83) + SourceIndex(0) +16>Emitted(23, 104) Source(41, 86) + SourceIndex(0) +17>Emitted(23, 105) Source(41, 87) + SourceIndex(0) +18>Emitted(23, 107) Source(41, 89) + SourceIndex(0) +19>Emitted(23, 108) Source(41, 90) + SourceIndex(0) +20>Emitted(23, 111) Source(41, 93) + SourceIndex(0) +21>Emitted(23, 112) Source(41, 94) + SourceIndex(0) +22>Emitted(23, 114) Source(41, 96) + SourceIndex(0) +23>Emitted(23, 115) Source(41, 97) + SourceIndex(0) +24>Emitted(23, 117) Source(41, 99) + SourceIndex(0) +25>Emitted(23, 119) Source(41, 101) + SourceIndex(0) +26>Emitted(23, 120) Source(41, 102) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(25, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(25, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for ((_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(26, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(44, 6) + SourceIndex(0) +5 >Emitted(26, 7) Source(44, 6) + SourceIndex(0) +6 >Emitted(26, 85) Source(45, 90) + SourceIndex(0) +7 >Emitted(26, 87) Source(44, 8) + SourceIndex(0) +8 >Emitted(26, 101) Source(44, 60) + SourceIndex(0) +9 >Emitted(26, 103) Source(44, 18) + SourceIndex(0) +10>Emitted(26, 124) Source(44, 35) + SourceIndex(0) +11>Emitted(26, 126) Source(44, 37) + SourceIndex(0) +12>Emitted(26, 151) Source(44, 58) + SourceIndex(0) +13>Emitted(26, 156) Source(45, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(27, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(27, 6) Source(46, 6) + SourceIndex(0) +3 >Emitted(27, 9) Source(46, 9) + SourceIndex(0) +4 >Emitted(27, 10) Source(46, 10) + SourceIndex(0) +5 >Emitted(27, 12) Source(46, 12) + SourceIndex(0) +6 >Emitted(27, 13) Source(46, 13) + SourceIndex(0) +7 >Emitted(27, 16) Source(46, 16) + SourceIndex(0) +8 >Emitted(27, 17) Source(46, 17) + SourceIndex(0) +9 >Emitted(27, 19) Source(46, 19) + SourceIndex(0) +10>Emitted(27, 20) Source(46, 20) + SourceIndex(0) +11>Emitted(27, 22) Source(46, 22) + SourceIndex(0) +12>Emitted(27, 24) Source(46, 24) + SourceIndex(0) +13>Emitted(27, 25) Source(46, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(28, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(47, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(47, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(47, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for ((name = robot.name, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > } = +8 > robot +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(30, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(49, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(49, 8) + SourceIndex(0) +6 >Emitted(30, 24) Source(49, 12) + SourceIndex(0) +7 >Emitted(30, 26) Source(49, 17) + SourceIndex(0) +8 >Emitted(30, 31) Source(49, 22) + SourceIndex(0) +9 >Emitted(30, 32) Source(49, 22) + SourceIndex(0) +10>Emitted(30, 34) Source(49, 24) + SourceIndex(0) +11>Emitted(30, 35) Source(49, 25) + SourceIndex(0) +12>Emitted(30, 38) Source(49, 28) + SourceIndex(0) +13>Emitted(30, 39) Source(49, 29) + SourceIndex(0) +14>Emitted(30, 41) Source(49, 31) + SourceIndex(0) +15>Emitted(30, 42) Source(49, 32) + SourceIndex(0) +16>Emitted(30, 45) Source(49, 35) + SourceIndex(0) +17>Emitted(30, 46) Source(49, 36) + SourceIndex(0) +18>Emitted(30, 48) Source(49, 38) + SourceIndex(0) +19>Emitted(30, 49) Source(49, 39) + SourceIndex(0) +20>Emitted(30, 51) Source(49, 41) + SourceIndex(0) +21>Emitted(30, 53) Source(49, 43) + SourceIndex(0) +22>Emitted(30, 54) Source(49, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for ((_h = getRobot(), name = _h.name, _h), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name } = getRobot() +7 > +8 > name +9 > } = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(52, 6) + SourceIndex(0) +6 >Emitted(33, 22) Source(52, 27) + SourceIndex(0) +7 >Emitted(33, 24) Source(52, 8) + SourceIndex(0) +8 >Emitted(33, 38) Source(52, 12) + SourceIndex(0) +9 >Emitted(33, 43) Source(52, 27) + SourceIndex(0) +10>Emitted(33, 45) Source(52, 29) + SourceIndex(0) +11>Emitted(33, 46) Source(52, 30) + SourceIndex(0) +12>Emitted(33, 49) Source(52, 33) + SourceIndex(0) +13>Emitted(33, 50) Source(52, 34) + SourceIndex(0) +14>Emitted(33, 52) Source(52, 36) + SourceIndex(0) +15>Emitted(33, 53) Source(52, 37) + SourceIndex(0) +16>Emitted(33, 56) Source(52, 40) + SourceIndex(0) +17>Emitted(33, 57) Source(52, 41) + SourceIndex(0) +18>Emitted(33, 59) Source(52, 43) + SourceIndex(0) +19>Emitted(33, 60) Source(52, 44) + SourceIndex(0) +20>Emitted(33, 62) Source(52, 46) + SourceIndex(0) +21>Emitted(33, 64) Source(52, 48) + SourceIndex(0) +22>Emitted(33, 65) Source(52, 49) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name } = { name: "trimmer", skill: "trimming" } +7 > +8 > name +9 > } = { name: "trimmer", skill: "trimming" } +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(36, 50) Source(55, 62) + SourceIndex(0) +7 >Emitted(36, 52) Source(55, 8) + SourceIndex(0) +8 >Emitted(36, 66) Source(55, 12) + SourceIndex(0) +9 >Emitted(36, 71) Source(55, 62) + SourceIndex(0) +10>Emitted(36, 73) Source(55, 64) + SourceIndex(0) +11>Emitted(36, 74) Source(55, 65) + SourceIndex(0) +12>Emitted(36, 77) Source(55, 68) + SourceIndex(0) +13>Emitted(36, 78) Source(55, 69) + SourceIndex(0) +14>Emitted(36, 80) Source(55, 71) + SourceIndex(0) +15>Emitted(36, 81) Source(55, 72) + SourceIndex(0) +16>Emitted(36, 84) Source(55, 75) + SourceIndex(0) +17>Emitted(36, 85) Source(55, 76) + SourceIndex(0) +18>Emitted(36, 87) Source(55, 78) + SourceIndex(0) +19>Emitted(36, 88) Source(55, 79) + SourceIndex(0) +20>Emitted(36, 90) Source(55, 81) + SourceIndex(0) +21>Emitted(36, 92) Source(55, 83) + SourceIndex(0) +22>Emitted(36, 93) Source(55, 84) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +11> } } = +12> multiRobot +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(58, 8) + SourceIndex(0) +6 >Emitted(39, 29) Source(58, 38) + SourceIndex(0) +7 >Emitted(39, 31) Source(58, 18) + SourceIndex(0) +8 >Emitted(39, 51) Source(58, 25) + SourceIndex(0) +9 >Emitted(39, 53) Source(58, 27) + SourceIndex(0) +10>Emitted(39, 77) Source(58, 36) + SourceIndex(0) +11>Emitted(39, 79) Source(58, 43) + SourceIndex(0) +12>Emitted(39, 89) Source(58, 53) + SourceIndex(0) +13>Emitted(39, 90) Source(58, 53) + SourceIndex(0) +14>Emitted(39, 92) Source(58, 55) + SourceIndex(0) +15>Emitted(39, 93) Source(58, 56) + SourceIndex(0) +16>Emitted(39, 96) Source(58, 59) + SourceIndex(0) +17>Emitted(39, 97) Source(58, 60) + SourceIndex(0) +18>Emitted(39, 99) Source(58, 62) + SourceIndex(0) +19>Emitted(39, 100) Source(58, 63) + SourceIndex(0) +20>Emitted(39, 103) Source(58, 66) + SourceIndex(0) +21>Emitted(39, 104) Source(58, 67) + SourceIndex(0) +22>Emitted(39, 106) Source(58, 69) + SourceIndex(0) +23>Emitted(39, 107) Source(58, 70) + SourceIndex(0) +24>Emitted(39, 109) Source(58, 72) + SourceIndex(0) +25>Emitted(39, 111) Source(58, 74) + SourceIndex(0) +26>Emitted(39, 112) Source(58, 75) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(59, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(59, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(59, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary, secondary } } = getMultiRobot() +7 > +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(61, 6) + SourceIndex(0) +6 >Emitted(42, 27) Source(61, 58) + SourceIndex(0) +7 >Emitted(42, 29) Source(61, 8) + SourceIndex(0) +8 >Emitted(42, 43) Source(61, 38) + SourceIndex(0) +9 >Emitted(42, 45) Source(61, 18) + SourceIndex(0) +10>Emitted(42, 65) Source(61, 25) + SourceIndex(0) +11>Emitted(42, 67) Source(61, 27) + SourceIndex(0) +12>Emitted(42, 91) Source(61, 36) + SourceIndex(0) +13>Emitted(42, 96) Source(61, 58) + SourceIndex(0) +14>Emitted(42, 98) Source(61, 60) + SourceIndex(0) +15>Emitted(42, 99) Source(61, 61) + SourceIndex(0) +16>Emitted(42, 102) Source(61, 64) + SourceIndex(0) +17>Emitted(42, 103) Source(61, 65) + SourceIndex(0) +18>Emitted(42, 105) Source(61, 67) + SourceIndex(0) +19>Emitted(42, 106) Source(61, 68) + SourceIndex(0) +20>Emitted(42, 109) Source(61, 71) + SourceIndex(0) +21>Emitted(42, 110) Source(61, 72) + SourceIndex(0) +22>Emitted(42, 112) Source(61, 74) + SourceIndex(0) +23>Emitted(42, 113) Source(61, 75) + SourceIndex(0) +24>Emitted(42, 115) Source(61, 77) + SourceIndex(0) +25>Emitted(42, 117) Source(61, 79) + SourceIndex(0) +26>Emitted(42, 118) Source(61, 80) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(62, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(62, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(62, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for ((_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary, secondary } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(64, 6) + SourceIndex(0) +6 >Emitted(45, 85) Source(65, 90) + SourceIndex(0) +7 >Emitted(45, 87) Source(64, 8) + SourceIndex(0) +8 >Emitted(45, 101) Source(64, 38) + SourceIndex(0) +9 >Emitted(45, 103) Source(64, 18) + SourceIndex(0) +10>Emitted(45, 123) Source(64, 25) + SourceIndex(0) +11>Emitted(45, 125) Source(64, 27) + SourceIndex(0) +12>Emitted(45, 149) Source(64, 36) + SourceIndex(0) +13>Emitted(45, 154) Source(65, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(46, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(66, 6) + SourceIndex(0) +3 >Emitted(46, 9) Source(66, 9) + SourceIndex(0) +4 >Emitted(46, 10) Source(66, 10) + SourceIndex(0) +5 >Emitted(46, 12) Source(66, 12) + SourceIndex(0) +6 >Emitted(46, 13) Source(66, 13) + SourceIndex(0) +7 >Emitted(46, 16) Source(66, 16) + SourceIndex(0) +8 >Emitted(46, 17) Source(66, 17) + SourceIndex(0) +9 >Emitted(46, 19) Source(66, 19) + SourceIndex(0) +10>Emitted(46, 20) Source(66, 20) + SourceIndex(0) +11>Emitted(46, 22) Source(66, 22) + SourceIndex(0) +12>Emitted(46, 24) Source(66, 24) + SourceIndex(0) +13>Emitted(46, 25) Source(66, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(47, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(67, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(67, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(67, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(67, 17) + SourceIndex(0) +6 >Emitted(47, 25) Source(67, 25) + SourceIndex(0) +7 >Emitted(47, 26) Source(67, 26) + SourceIndex(0) +8 >Emitted(47, 27) Source(67, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(68, 2) + SourceIndex(0) +--- +>>>for ((nameA = robot.name, skillA = robot.skill, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > , +8 > skill: skillA +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(49, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(49, 7) Source(71, 8) + SourceIndex(0) +6 >Emitted(49, 25) Source(71, 19) + SourceIndex(0) +7 >Emitted(49, 27) Source(71, 21) + SourceIndex(0) +8 >Emitted(49, 47) Source(71, 34) + SourceIndex(0) +9 >Emitted(49, 49) Source(71, 39) + SourceIndex(0) +10>Emitted(49, 54) Source(71, 44) + SourceIndex(0) +11>Emitted(49, 55) Source(71, 44) + SourceIndex(0) +12>Emitted(49, 57) Source(71, 46) + SourceIndex(0) +13>Emitted(49, 58) Source(71, 47) + SourceIndex(0) +14>Emitted(49, 61) Source(71, 50) + SourceIndex(0) +15>Emitted(49, 62) Source(71, 51) + SourceIndex(0) +16>Emitted(49, 64) Source(71, 53) + SourceIndex(0) +17>Emitted(49, 65) Source(71, 54) + SourceIndex(0) +18>Emitted(49, 68) Source(71, 57) + SourceIndex(0) +19>Emitted(49, 69) Source(71, 58) + SourceIndex(0) +20>Emitted(49, 71) Source(71, 60) + SourceIndex(0) +21>Emitted(49, 72) Source(71, 61) + SourceIndex(0) +22>Emitted(49, 74) Source(71, 63) + SourceIndex(0) +23>Emitted(49, 76) Source(71, 65) + SourceIndex(0) +24>Emitted(49, 77) Source(71, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(50, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(50, 22) Source(72, 22) + SourceIndex(0) +7 >Emitted(50, 23) Source(72, 23) + SourceIndex(0) +8 >Emitted(50, 24) Source(72, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skill: skillA } = getRobot() +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(52, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(52, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(52, 22) Source(74, 49) + SourceIndex(0) +7 >Emitted(52, 24) Source(74, 8) + SourceIndex(0) +8 >Emitted(52, 39) Source(74, 19) + SourceIndex(0) +9 >Emitted(52, 41) Source(74, 21) + SourceIndex(0) +10>Emitted(52, 58) Source(74, 34) + SourceIndex(0) +11>Emitted(52, 63) Source(74, 49) + SourceIndex(0) +12>Emitted(52, 65) Source(74, 51) + SourceIndex(0) +13>Emitted(52, 66) Source(74, 52) + SourceIndex(0) +14>Emitted(52, 69) Source(74, 55) + SourceIndex(0) +15>Emitted(52, 70) Source(74, 56) + SourceIndex(0) +16>Emitted(52, 72) Source(74, 58) + SourceIndex(0) +17>Emitted(52, 73) Source(74, 59) + SourceIndex(0) +18>Emitted(52, 76) Source(74, 62) + SourceIndex(0) +19>Emitted(52, 77) Source(74, 63) + SourceIndex(0) +20>Emitted(52, 79) Source(74, 65) + SourceIndex(0) +21>Emitted(52, 80) Source(74, 66) + SourceIndex(0) +22>Emitted(52, 82) Source(74, 68) + SourceIndex(0) +23>Emitted(52, 84) Source(74, 70) + SourceIndex(0) +24>Emitted(52, 85) Source(74, 71) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(75, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(75, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(75, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(55, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(55, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(55, 50) Source(77, 84) + SourceIndex(0) +7 >Emitted(55, 52) Source(77, 8) + SourceIndex(0) +8 >Emitted(55, 67) Source(77, 19) + SourceIndex(0) +9 >Emitted(55, 69) Source(77, 21) + SourceIndex(0) +10>Emitted(55, 86) Source(77, 34) + SourceIndex(0) +11>Emitted(55, 91) Source(77, 84) + SourceIndex(0) +12>Emitted(55, 93) Source(77, 86) + SourceIndex(0) +13>Emitted(55, 94) Source(77, 87) + SourceIndex(0) +14>Emitted(55, 97) Source(77, 90) + SourceIndex(0) +15>Emitted(55, 98) Source(77, 91) + SourceIndex(0) +16>Emitted(55, 100) Source(77, 93) + SourceIndex(0) +17>Emitted(55, 101) Source(77, 94) + SourceIndex(0) +18>Emitted(55, 104) Source(77, 97) + SourceIndex(0) +19>Emitted(55, 105) Source(77, 98) + SourceIndex(0) +20>Emitted(55, 107) Source(77, 100) + SourceIndex(0) +21>Emitted(55, 108) Source(77, 101) + SourceIndex(0) +22>Emitted(55, 110) Source(77, 103) + SourceIndex(0) +23>Emitted(55, 112) Source(77, 105) + SourceIndex(0) +24>Emitted(55, 113) Source(77, 106) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(56, 22) Source(78, 22) + SourceIndex(0) +7 >Emitted(56, 23) Source(78, 23) + SourceIndex(0) +8 >Emitted(56, 24) Source(78, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for ((nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > , +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = +14> multiRobot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(58, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(80, 6) + SourceIndex(0) +5 >Emitted(58, 7) Source(80, 8) + SourceIndex(0) +6 >Emitted(58, 30) Source(80, 19) + SourceIndex(0) +7 >Emitted(58, 32) Source(80, 21) + SourceIndex(0) +8 >Emitted(58, 54) Source(80, 73) + SourceIndex(0) +9 >Emitted(58, 56) Source(80, 31) + SourceIndex(0) +10>Emitted(58, 77) Source(80, 48) + SourceIndex(0) +11>Emitted(58, 79) Source(80, 50) + SourceIndex(0) +12>Emitted(58, 104) Source(80, 71) + SourceIndex(0) +13>Emitted(58, 106) Source(80, 78) + SourceIndex(0) +14>Emitted(58, 116) Source(80, 88) + SourceIndex(0) +15>Emitted(58, 117) Source(80, 88) + SourceIndex(0) +16>Emitted(58, 119) Source(80, 90) + SourceIndex(0) +17>Emitted(58, 120) Source(80, 91) + SourceIndex(0) +18>Emitted(58, 123) Source(80, 94) + SourceIndex(0) +19>Emitted(58, 124) Source(80, 95) + SourceIndex(0) +20>Emitted(58, 126) Source(80, 97) + SourceIndex(0) +21>Emitted(58, 127) Source(80, 98) + SourceIndex(0) +22>Emitted(58, 130) Source(80, 101) + SourceIndex(0) +23>Emitted(58, 131) Source(80, 102) + SourceIndex(0) +24>Emitted(58, 133) Source(80, 104) + SourceIndex(0) +25>Emitted(58, 134) Source(80, 105) + SourceIndex(0) +26>Emitted(58, 136) Source(80, 107) + SourceIndex(0) +27>Emitted(58, 138) Source(80, 109) + SourceIndex(0) +28>Emitted(58, 139) Source(80, 110) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(59, 25) Source(81, 25) + SourceIndex(0) +7 >Emitted(59, 26) Source(81, 26) + SourceIndex(0) +8 >Emitted(59, 27) Source(81, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for ((_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(61, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(83, 6) + SourceIndex(0) +5 >Emitted(61, 7) Source(83, 6) + SourceIndex(0) +6 >Emitted(61, 27) Source(83, 93) + SourceIndex(0) +7 >Emitted(61, 29) Source(83, 8) + SourceIndex(0) +8 >Emitted(61, 44) Source(83, 19) + SourceIndex(0) +9 >Emitted(61, 46) Source(83, 21) + SourceIndex(0) +10>Emitted(61, 60) Source(83, 73) + SourceIndex(0) +11>Emitted(61, 62) Source(83, 31) + SourceIndex(0) +12>Emitted(61, 83) Source(83, 48) + SourceIndex(0) +13>Emitted(61, 85) Source(83, 50) + SourceIndex(0) +14>Emitted(61, 110) Source(83, 71) + SourceIndex(0) +15>Emitted(61, 115) Source(83, 93) + SourceIndex(0) +16>Emitted(61, 117) Source(83, 95) + SourceIndex(0) +17>Emitted(61, 118) Source(83, 96) + SourceIndex(0) +18>Emitted(61, 121) Source(83, 99) + SourceIndex(0) +19>Emitted(61, 122) Source(83, 100) + SourceIndex(0) +20>Emitted(61, 124) Source(83, 102) + SourceIndex(0) +21>Emitted(61, 125) Source(83, 103) + SourceIndex(0) +22>Emitted(61, 128) Source(83, 106) + SourceIndex(0) +23>Emitted(61, 129) Source(83, 107) + SourceIndex(0) +24>Emitted(61, 131) Source(83, 109) + SourceIndex(0) +25>Emitted(61, 132) Source(83, 110) + SourceIndex(0) +26>Emitted(61, 134) Source(83, 112) + SourceIndex(0) +27>Emitted(61, 136) Source(83, 114) + SourceIndex(0) +28>Emitted(61, 137) Source(83, 115) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(84, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(84, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(84, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(84, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(84, 17) + SourceIndex(0) +6 >Emitted(62, 25) Source(84, 25) + SourceIndex(0) +7 >Emitted(62, 26) Source(84, 26) + SourceIndex(0) +8 >Emitted(62, 27) Source(84, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(85, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(85, 2) + SourceIndex(0) +--- +>>>for ((_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(64, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(86, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(86, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(64, 7) Source(86, 6) + SourceIndex(0) +6 >Emitted(64, 85) Source(87, 90) + SourceIndex(0) +7 >Emitted(64, 87) Source(86, 8) + SourceIndex(0) +8 >Emitted(64, 102) Source(86, 19) + SourceIndex(0) +9 >Emitted(64, 104) Source(86, 21) + SourceIndex(0) +10>Emitted(64, 118) Source(86, 73) + SourceIndex(0) +11>Emitted(64, 120) Source(86, 31) + SourceIndex(0) +12>Emitted(64, 141) Source(86, 48) + SourceIndex(0) +13>Emitted(64, 143) Source(86, 50) + SourceIndex(0) +14>Emitted(64, 168) Source(86, 71) + SourceIndex(0) +15>Emitted(64, 173) Source(87, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(65, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(65, 6) Source(88, 6) + SourceIndex(0) +3 >Emitted(65, 9) Source(88, 9) + SourceIndex(0) +4 >Emitted(65, 10) Source(88, 10) + SourceIndex(0) +5 >Emitted(65, 12) Source(88, 12) + SourceIndex(0) +6 >Emitted(65, 13) Source(88, 13) + SourceIndex(0) +7 >Emitted(65, 16) Source(88, 16) + SourceIndex(0) +8 >Emitted(65, 17) Source(88, 17) + SourceIndex(0) +9 >Emitted(65, 19) Source(88, 19) + SourceIndex(0) +10>Emitted(65, 20) Source(88, 20) + SourceIndex(0) +11>Emitted(65, 22) Source(88, 22) + SourceIndex(0) +12>Emitted(65, 24) Source(88, 24) + SourceIndex(0) +13>Emitted(65, 25) Source(88, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(66, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(66, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(66, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(66, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(66, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(66, 25) Source(89, 25) + SourceIndex(0) +7 >Emitted(66, 26) Source(89, 26) + SourceIndex(0) +8 >Emitted(66, 27) Source(89, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(67, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(67, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for ((name = robot.name, skill = robot.skill, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > , +8 > skill +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(68, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(68, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(68, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(68, 6) Source(91, 6) + SourceIndex(0) +5 >Emitted(68, 7) Source(91, 8) + SourceIndex(0) +6 >Emitted(68, 24) Source(91, 12) + SourceIndex(0) +7 >Emitted(68, 26) Source(91, 14) + SourceIndex(0) +8 >Emitted(68, 45) Source(91, 19) + SourceIndex(0) +9 >Emitted(68, 47) Source(91, 24) + SourceIndex(0) +10>Emitted(68, 52) Source(91, 29) + SourceIndex(0) +11>Emitted(68, 53) Source(91, 29) + SourceIndex(0) +12>Emitted(68, 55) Source(91, 31) + SourceIndex(0) +13>Emitted(68, 56) Source(91, 32) + SourceIndex(0) +14>Emitted(68, 59) Source(91, 35) + SourceIndex(0) +15>Emitted(68, 60) Source(91, 36) + SourceIndex(0) +16>Emitted(68, 62) Source(91, 38) + SourceIndex(0) +17>Emitted(68, 63) Source(91, 39) + SourceIndex(0) +18>Emitted(68, 66) Source(91, 42) + SourceIndex(0) +19>Emitted(68, 67) Source(91, 43) + SourceIndex(0) +20>Emitted(68, 69) Source(91, 45) + SourceIndex(0) +21>Emitted(68, 70) Source(91, 46) + SourceIndex(0) +22>Emitted(68, 72) Source(91, 48) + SourceIndex(0) +23>Emitted(68, 74) Source(91, 50) + SourceIndex(0) +24>Emitted(68, 75) Source(91, 51) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(69, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(69, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(69, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(69, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(69, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(69, 22) Source(92, 22) + SourceIndex(0) +7 >Emitted(69, 23) Source(92, 23) + SourceIndex(0) +8 >Emitted(69, 24) Source(92, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(70, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(70, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for ((_x = getRobot(), name = _x.name, skill = _x.skill, _x), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skill } = getRobot() +7 > +8 > name +9 > , +10> skill +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(71, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(71, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(71, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(71, 6) Source(94, 6) + SourceIndex(0) +5 >Emitted(71, 7) Source(94, 6) + SourceIndex(0) +6 >Emitted(71, 22) Source(94, 34) + SourceIndex(0) +7 >Emitted(71, 24) Source(94, 8) + SourceIndex(0) +8 >Emitted(71, 38) Source(94, 12) + SourceIndex(0) +9 >Emitted(71, 40) Source(94, 14) + SourceIndex(0) +10>Emitted(71, 56) Source(94, 19) + SourceIndex(0) +11>Emitted(71, 61) Source(94, 34) + SourceIndex(0) +12>Emitted(71, 63) Source(94, 36) + SourceIndex(0) +13>Emitted(71, 64) Source(94, 37) + SourceIndex(0) +14>Emitted(71, 67) Source(94, 40) + SourceIndex(0) +15>Emitted(71, 68) Source(94, 41) + SourceIndex(0) +16>Emitted(71, 70) Source(94, 43) + SourceIndex(0) +17>Emitted(71, 71) Source(94, 44) + SourceIndex(0) +18>Emitted(71, 74) Source(94, 47) + SourceIndex(0) +19>Emitted(71, 75) Source(94, 48) + SourceIndex(0) +20>Emitted(71, 77) Source(94, 50) + SourceIndex(0) +21>Emitted(71, 78) Source(94, 51) + SourceIndex(0) +22>Emitted(71, 80) Source(94, 53) + SourceIndex(0) +23>Emitted(71, 82) Source(94, 55) + SourceIndex(0) +24>Emitted(71, 83) Source(94, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(95, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(95, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(95, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(73, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(73, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for ((_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skill } = { name: "trimmer", skill: "trimming" } +7 > +8 > name +9 > , +10> skill +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(74, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(97, 6) + SourceIndex(0) +5 >Emitted(74, 7) Source(97, 6) + SourceIndex(0) +6 >Emitted(74, 50) Source(97, 69) + SourceIndex(0) +7 >Emitted(74, 52) Source(97, 8) + SourceIndex(0) +8 >Emitted(74, 66) Source(97, 12) + SourceIndex(0) +9 >Emitted(74, 68) Source(97, 14) + SourceIndex(0) +10>Emitted(74, 84) Source(97, 19) + SourceIndex(0) +11>Emitted(74, 89) Source(97, 69) + SourceIndex(0) +12>Emitted(74, 91) Source(97, 71) + SourceIndex(0) +13>Emitted(74, 92) Source(97, 72) + SourceIndex(0) +14>Emitted(74, 95) Source(97, 75) + SourceIndex(0) +15>Emitted(74, 96) Source(97, 76) + SourceIndex(0) +16>Emitted(74, 98) Source(97, 78) + SourceIndex(0) +17>Emitted(74, 99) Source(97, 79) + SourceIndex(0) +18>Emitted(74, 102) Source(97, 82) + SourceIndex(0) +19>Emitted(74, 103) Source(97, 83) + SourceIndex(0) +20>Emitted(74, 105) Source(97, 85) + SourceIndex(0) +21>Emitted(74, 106) Source(97, 86) + SourceIndex(0) +22>Emitted(74, 108) Source(97, 88) + SourceIndex(0) +23>Emitted(74, 110) Source(97, 90) + SourceIndex(0) +24>Emitted(74, 111) Source(97, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(75, 22) Source(98, 22) + SourceIndex(0) +7 >Emitted(75, 23) Source(98, 23) + SourceIndex(0) +8 >Emitted(75, 24) Source(98, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(76, 1) Source(99, 1) + SourceIndex(0) +2 >Emitted(76, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for ((name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > , +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = +14> multiRobot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(77, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(100, 6) + SourceIndex(0) +5 >Emitted(77, 7) Source(100, 8) + SourceIndex(0) +6 >Emitted(77, 29) Source(100, 12) + SourceIndex(0) +7 >Emitted(77, 31) Source(100, 14) + SourceIndex(0) +8 >Emitted(77, 53) Source(100, 44) + SourceIndex(0) +9 >Emitted(77, 55) Source(100, 24) + SourceIndex(0) +10>Emitted(77, 75) Source(100, 31) + SourceIndex(0) +11>Emitted(77, 77) Source(100, 33) + SourceIndex(0) +12>Emitted(77, 101) Source(100, 42) + SourceIndex(0) +13>Emitted(77, 103) Source(100, 49) + SourceIndex(0) +14>Emitted(77, 113) Source(100, 59) + SourceIndex(0) +15>Emitted(77, 114) Source(100, 59) + SourceIndex(0) +16>Emitted(77, 116) Source(100, 61) + SourceIndex(0) +17>Emitted(77, 117) Source(100, 62) + SourceIndex(0) +18>Emitted(77, 120) Source(100, 65) + SourceIndex(0) +19>Emitted(77, 121) Source(100, 66) + SourceIndex(0) +20>Emitted(77, 123) Source(100, 68) + SourceIndex(0) +21>Emitted(77, 124) Source(100, 69) + SourceIndex(0) +22>Emitted(77, 127) Source(100, 72) + SourceIndex(0) +23>Emitted(77, 128) Source(100, 73) + SourceIndex(0) +24>Emitted(77, 130) Source(100, 75) + SourceIndex(0) +25>Emitted(77, 131) Source(100, 76) + SourceIndex(0) +26>Emitted(77, 133) Source(100, 78) + SourceIndex(0) +27>Emitted(77, 135) Source(100, 80) + SourceIndex(0) +28>Emitted(77, 136) Source(100, 81) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(78, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(78, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(78, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(78, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(78, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(78, 25) Source(101, 25) + SourceIndex(0) +7 >Emitted(78, 26) Source(101, 26) + SourceIndex(0) +8 >Emitted(78, 27) Source(101, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(79, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(79, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for ((_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skills: { primary, secondary } } = getMultiRobot() +7 > +8 > name +9 > , +10> skills: { primary, secondary } +11> +12> primary +13> , +14> secondary +15> } } = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(80, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(80, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(80, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(80, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(80, 7) Source(103, 6) + SourceIndex(0) +6 >Emitted(80, 27) Source(103, 64) + SourceIndex(0) +7 >Emitted(80, 29) Source(103, 8) + SourceIndex(0) +8 >Emitted(80, 43) Source(103, 12) + SourceIndex(0) +9 >Emitted(80, 45) Source(103, 14) + SourceIndex(0) +10>Emitted(80, 59) Source(103, 44) + SourceIndex(0) +11>Emitted(80, 61) Source(103, 24) + SourceIndex(0) +12>Emitted(80, 81) Source(103, 31) + SourceIndex(0) +13>Emitted(80, 83) Source(103, 33) + SourceIndex(0) +14>Emitted(80, 107) Source(103, 42) + SourceIndex(0) +15>Emitted(80, 112) Source(103, 64) + SourceIndex(0) +16>Emitted(80, 114) Source(103, 66) + SourceIndex(0) +17>Emitted(80, 115) Source(103, 67) + SourceIndex(0) +18>Emitted(80, 118) Source(103, 70) + SourceIndex(0) +19>Emitted(80, 119) Source(103, 71) + SourceIndex(0) +20>Emitted(80, 121) Source(103, 73) + SourceIndex(0) +21>Emitted(80, 122) Source(103, 74) + SourceIndex(0) +22>Emitted(80, 125) Source(103, 77) + SourceIndex(0) +23>Emitted(80, 126) Source(103, 78) + SourceIndex(0) +24>Emitted(80, 128) Source(103, 80) + SourceIndex(0) +25>Emitted(80, 129) Source(103, 81) + SourceIndex(0) +26>Emitted(80, 131) Source(103, 83) + SourceIndex(0) +27>Emitted(80, 133) Source(103, 85) + SourceIndex(0) +28>Emitted(80, 134) Source(103, 86) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(81, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(81, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(81, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(81, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(81, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(81, 25) Source(104, 25) + SourceIndex(0) +7 >Emitted(81, 26) Source(104, 26) + SourceIndex(0) +8 >Emitted(81, 27) Source(104, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(82, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(82, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for ((_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skills: { primary, secondary } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name +9 > , +10> skills: { primary, secondary } +11> +12> primary +13> , +14> secondary +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(83, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(83, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(83, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(83, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(83, 7) Source(106, 6) + SourceIndex(0) +6 >Emitted(83, 85) Source(107, 90) + SourceIndex(0) +7 >Emitted(83, 87) Source(106, 8) + SourceIndex(0) +8 >Emitted(83, 101) Source(106, 12) + SourceIndex(0) +9 >Emitted(83, 103) Source(106, 14) + SourceIndex(0) +10>Emitted(83, 117) Source(106, 44) + SourceIndex(0) +11>Emitted(83, 119) Source(106, 24) + SourceIndex(0) +12>Emitted(83, 139) Source(106, 31) + SourceIndex(0) +13>Emitted(83, 141) Source(106, 33) + SourceIndex(0) +14>Emitted(83, 165) Source(106, 42) + SourceIndex(0) +15>Emitted(83, 170) Source(107, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(84, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(84, 6) Source(108, 6) + SourceIndex(0) +3 >Emitted(84, 9) Source(108, 9) + SourceIndex(0) +4 >Emitted(84, 10) Source(108, 10) + SourceIndex(0) +5 >Emitted(84, 12) Source(108, 12) + SourceIndex(0) +6 >Emitted(84, 13) Source(108, 13) + SourceIndex(0) +7 >Emitted(84, 16) Source(108, 16) + SourceIndex(0) +8 >Emitted(84, 17) Source(108, 17) + SourceIndex(0) +9 >Emitted(84, 19) Source(108, 19) + SourceIndex(0) +10>Emitted(84, 20) Source(108, 20) + SourceIndex(0) +11>Emitted(84, 22) Source(108, 22) + SourceIndex(0) +12>Emitted(84, 24) Source(108, 24) + SourceIndex(0) +13>Emitted(84, 25) Source(108, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(85, 5) Source(109, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(109, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(109, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(109, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(109, 17) + SourceIndex(0) +6 >Emitted(85, 25) Source(109, 25) + SourceIndex(0) +7 >Emitted(85, 26) Source(109, 26) + SourceIndex(0) +8 >Emitted(85, 27) Source(109, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(110, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(110, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols new file mode 100644 index 00000000000..49de55505a2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols @@ -0,0 +1,490 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 11, 24)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 53)) + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 28, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 31)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 48, 6)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 51, 6)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 6)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 25)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 25)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary, secondary } } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 25)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 70, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 70, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 73, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 73, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 46)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 63)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 90, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 90, 12)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 93, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 93, 12)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 12)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 31)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 31)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 31)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skills: { primary, secondary } } = +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 31)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types new file mode 100644 index 00000000000..81beb06d3d7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types @@ -0,0 +1,774 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { +>{ name: nameA } = robot, i = 0 : number +>{ name: nameA } = robot : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +>{ name: nameA } = getRobot(), i = 0 : number +>{ name: nameA } = getRobot() : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA } = { name: "trimmer", skill: "trimming" } : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name } = robot, i = 0; i < 1; i++) { +>{ name } = robot, i = 0 : number +>{ name } = robot : Robot +>{ name } : { name: string; } +>name : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { +>{ name } = getRobot(), i = 0 : number +>{ name } = getRobot() : Robot +>{ name } : { name: string; } +>name : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name } = { name: "trimmer", skill: "trimming" } : Robot +>{ name } : { name: string; } +>name : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>{ skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ skills: { primary, secondary } } = multiRobot : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ skills: { primary, secondary } } = getMultiRobot() : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } = +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = robot, i = 0 : number +>{ name: nameA, skill: skillA } = robot : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = getRobot(), i = 0 : number +>{ name: nameA, skill: skillA } = getRobot() : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { +>{ name, skill } = robot, i = 0 : number +>{ name, skill } = robot : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +>{ name, skill } = getRobot(), i = 0 : number +>{ name, skill } = getRobot() : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name, skill } = { name: "trimmer", skill: "trimming" } : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>{ name, skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ name, skills: { primary, secondary } } = multiRobot : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ name, skills: { primary, secondary } } = getMultiRobot() : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skills: { primary, secondary } } = +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..785148ba652 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js @@ -0,0 +1,145 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _t = getRobot(), _u = _t.name, nameA = _u === void 0 ? "noName" : _u, _v = _t.skill, skillA = _v === void 0 ? "skill" : _v, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _w = { name: "trimmer", skill: "trimming" }, _x = _w.name, nameA = _x === void 0 ? "noName" : _x, _y = _w.skill, skillA = _y === void 0 ? "skill" : _y, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _z = multiRobot.name, nameA = _z === void 0 ? "noName" : _z, _0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primaryA = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondaryA = _3 === void 0 ? "secondary" : _3, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _4 = getMultiRobot(), _5 = _4.name, nameA = _5 === void 0 ? "noName" : _5, _6 = _4.skills, _7 = _6 === void 0 ? { primary: "none", secondary: "none" } : _6, _8 = _7.primary, primaryA = _8 === void 0 ? "primary" : _8, _9 = _7.secondary, secondaryA = _9 === void 0 ? "secondary" : _9, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _10 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _11 = _10.name, nameA = _11 === void 0 ? "noName" : _11, _12 = _10.skills, _13 = _12 === void 0 ? { primary: "none", secondary: "none" } : _12, _14 = _13.primary, primaryA = _14 === void 0 ? "primary" : _14, _15 = _13.secondary, secondaryA = _15 === void 0 ? "secondary" : _15, i = 0; i < 1; i++) { + console.log(primaryA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..b208c41c9a6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,mBAAqB,EAArB,qCAAqB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,wBAAsB,EAAtB,qCAAsB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,oDAAsB,EAAtB,qCAAsB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,0BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,+BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,yFAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,mBAAsB,EAAtB,qCAAsB,EAAE,gBAAuB,EAAvB,qCAAuB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAmE,EAA9D,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,2CAAsG,EAAjG,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,wBAAsB,EAAtB,qCAAsB,EACtB,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAMc,EALf,YAAsB,EAAtB,qCAAsB,EACtB,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..c8c63e66adf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,1740 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA= "noName" +6 > +7 > name: nameA= "noName" +8 > } = robot, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +5 >Emitted(9, 25) Source(26, 32) + SourceIndex(0) +6 >Emitted(9, 27) Source(26, 11) + SourceIndex(0) +7 >Emitted(9, 64) Source(26, 32) + SourceIndex(0) +8 >Emitted(9, 66) Source(26, 44) + SourceIndex(0) +9 >Emitted(9, 67) Source(26, 45) + SourceIndex(0) +10>Emitted(9, 70) Source(26, 48) + SourceIndex(0) +11>Emitted(9, 71) Source(26, 49) + SourceIndex(0) +12>Emitted(9, 73) Source(26, 51) + SourceIndex(0) +13>Emitted(9, 74) Source(26, 52) + SourceIndex(0) +14>Emitted(9, 77) Source(26, 55) + SourceIndex(0) +15>Emitted(9, 78) Source(26, 56) + SourceIndex(0) +16>Emitted(9, 80) Source(26, 58) + SourceIndex(0) +17>Emitted(9, 81) Source(26, 59) + SourceIndex(0) +18>Emitted(9, 83) Source(26, 61) + SourceIndex(0) +19>Emitted(9, 85) Source(26, 63) + SourceIndex(0) +20>Emitted(9, 86) Source(26, 64) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +5 >Emitted(12, 30) Source(29, 33) + SourceIndex(0) +6 >Emitted(12, 32) Source(29, 11) + SourceIndex(0) +7 >Emitted(12, 69) Source(29, 33) + SourceIndex(0) +8 >Emitted(12, 71) Source(29, 50) + SourceIndex(0) +9 >Emitted(12, 72) Source(29, 51) + SourceIndex(0) +10>Emitted(12, 75) Source(29, 54) + SourceIndex(0) +11>Emitted(12, 76) Source(29, 55) + SourceIndex(0) +12>Emitted(12, 78) Source(29, 57) + SourceIndex(0) +13>Emitted(12, 79) Source(29, 58) + SourceIndex(0) +14>Emitted(12, 82) Source(29, 61) + SourceIndex(0) +15>Emitted(12, 83) Source(29, 62) + SourceIndex(0) +16>Emitted(12, 85) Source(29, 64) + SourceIndex(0) +17>Emitted(12, 86) Source(29, 65) + SourceIndex(0) +18>Emitted(12, 88) Source(29, 67) + SourceIndex(0) +19>Emitted(12, 90) Source(29, 69) + SourceIndex(0) +20>Emitted(12, 91) Source(29, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(13, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(13, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(13, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +5 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) +6 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) +7 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) +8 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) +9 >Emitted(15, 100) Source(32, 86) + SourceIndex(0) +10>Emitted(15, 103) Source(32, 89) + SourceIndex(0) +11>Emitted(15, 104) Source(32, 90) + SourceIndex(0) +12>Emitted(15, 106) Source(32, 92) + SourceIndex(0) +13>Emitted(15, 107) Source(32, 93) + SourceIndex(0) +14>Emitted(15, 110) Source(32, 96) + SourceIndex(0) +15>Emitted(15, 111) Source(32, 97) + SourceIndex(0) +16>Emitted(15, 113) Source(32, 99) + SourceIndex(0) +17>Emitted(15, 114) Source(32, 100) + SourceIndex(0) +18>Emitted(15, 116) Source(32, 102) + SourceIndex(0) +19>Emitted(15, 118) Source(32, 104) + SourceIndex(0) +20>Emitted(15, 119) Source(32, 105) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = multiRobot, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(36, 5) + SourceIndex(0) +5 >Emitted(18, 32) Source(39, 47) + SourceIndex(0) +6 >Emitted(18, 34) Source(36, 5) + SourceIndex(0) +7 >Emitted(18, 98) Source(39, 47) + SourceIndex(0) +8 >Emitted(18, 100) Source(37, 9) + SourceIndex(0) +9 >Emitted(18, 115) Source(37, 38) + SourceIndex(0) +10>Emitted(18, 117) Source(37, 9) + SourceIndex(0) +11>Emitted(18, 158) Source(37, 38) + SourceIndex(0) +12>Emitted(18, 160) Source(38, 9) + SourceIndex(0) +13>Emitted(18, 177) Source(38, 44) + SourceIndex(0) +14>Emitted(18, 179) Source(38, 9) + SourceIndex(0) +15>Emitted(18, 224) Source(38, 44) + SourceIndex(0) +16>Emitted(18, 226) Source(40, 17) + SourceIndex(0) +17>Emitted(18, 227) Source(40, 18) + SourceIndex(0) +18>Emitted(18, 230) Source(40, 21) + SourceIndex(0) +19>Emitted(18, 231) Source(40, 22) + SourceIndex(0) +20>Emitted(18, 233) Source(40, 24) + SourceIndex(0) +21>Emitted(18, 234) Source(40, 25) + SourceIndex(0) +22>Emitted(18, 237) Source(40, 28) + SourceIndex(0) +23>Emitted(18, 238) Source(40, 29) + SourceIndex(0) +24>Emitted(18, 240) Source(40, 31) + SourceIndex(0) +25>Emitted(18, 241) Source(40, 32) + SourceIndex(0) +26>Emitted(18, 243) Source(40, 34) + SourceIndex(0) +27>Emitted(18, 245) Source(40, 36) + SourceIndex(0) +28>Emitted(18, 246) Source(40, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(19, 25) Source(41, 25) + SourceIndex(0) +7 >Emitted(19, 26) Source(41, 26) + SourceIndex(0) +8 >Emitted(19, 27) Source(41, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot(), +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(21, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(44, 5) + SourceIndex(0) +5 >Emitted(21, 37) Source(47, 47) + SourceIndex(0) +6 >Emitted(21, 39) Source(44, 5) + SourceIndex(0) +7 >Emitted(21, 103) Source(47, 47) + SourceIndex(0) +8 >Emitted(21, 105) Source(45, 9) + SourceIndex(0) +9 >Emitted(21, 120) Source(45, 38) + SourceIndex(0) +10>Emitted(21, 122) Source(45, 9) + SourceIndex(0) +11>Emitted(21, 163) Source(45, 38) + SourceIndex(0) +12>Emitted(21, 165) Source(46, 9) + SourceIndex(0) +13>Emitted(21, 182) Source(46, 44) + SourceIndex(0) +14>Emitted(21, 184) Source(46, 9) + SourceIndex(0) +15>Emitted(21, 229) Source(46, 44) + SourceIndex(0) +16>Emitted(21, 231) Source(48, 22) + SourceIndex(0) +17>Emitted(21, 232) Source(48, 23) + SourceIndex(0) +18>Emitted(21, 235) Source(48, 26) + SourceIndex(0) +19>Emitted(21, 236) Source(48, 27) + SourceIndex(0) +20>Emitted(21, 238) Source(48, 29) + SourceIndex(0) +21>Emitted(21, 239) Source(48, 30) + SourceIndex(0) +22>Emitted(21, 242) Source(48, 33) + SourceIndex(0) +23>Emitted(21, 243) Source(48, 34) + SourceIndex(0) +24>Emitted(21, 245) Source(48, 36) + SourceIndex(0) +25>Emitted(21, 246) Source(48, 37) + SourceIndex(0) +26>Emitted(21, 248) Source(48, 39) + SourceIndex(0) +27>Emitted(21, 250) Source(48, 41) + SourceIndex(0) +28>Emitted(21, 251) Source(48, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(22, 25) Source(49, 25) + SourceIndex(0) +7 >Emitted(22, 26) Source(49, 26) + SourceIndex(0) +8 >Emitted(22, 27) Source(49, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(24, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) +5 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) +6 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) +7 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) +8 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) +9 >Emitted(24, 178) Source(53, 38) + SourceIndex(0) +10>Emitted(24, 180) Source(53, 9) + SourceIndex(0) +11>Emitted(24, 221) Source(53, 38) + SourceIndex(0) +12>Emitted(24, 223) Source(54, 9) + SourceIndex(0) +13>Emitted(24, 240) Source(54, 44) + SourceIndex(0) +14>Emitted(24, 242) Source(54, 9) + SourceIndex(0) +15>Emitted(24, 287) Source(54, 44) + SourceIndex(0) +16>Emitted(24, 289) Source(57, 5) + SourceIndex(0) +17>Emitted(24, 290) Source(57, 6) + SourceIndex(0) +18>Emitted(24, 293) Source(57, 9) + SourceIndex(0) +19>Emitted(24, 294) Source(57, 10) + SourceIndex(0) +20>Emitted(24, 296) Source(57, 12) + SourceIndex(0) +21>Emitted(24, 297) Source(57, 13) + SourceIndex(0) +22>Emitted(24, 300) Source(57, 16) + SourceIndex(0) +23>Emitted(24, 301) Source(57, 17) + SourceIndex(0) +24>Emitted(24, 303) Source(57, 19) + SourceIndex(0) +25>Emitted(24, 304) Source(57, 20) + SourceIndex(0) +26>Emitted(24, 306) Source(57, 22) + SourceIndex(0) +27>Emitted(24, 308) Source(57, 24) + SourceIndex(0) +28>Emitted(24, 309) Source(57, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(25, 25) Source(58, 25) + SourceIndex(0) +7 >Emitted(25, 26) Source(58, 26) + SourceIndex(0) +8 >Emitted(25, 27) Source(58, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , +9 > skill: skillA = "skill" +10> +11> skill: skillA = "skill" +12> } = robot, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(27, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(61, 11) + SourceIndex(0) +5 >Emitted(27, 25) Source(61, 33) + SourceIndex(0) +6 >Emitted(27, 27) Source(61, 11) + SourceIndex(0) +7 >Emitted(27, 64) Source(61, 33) + SourceIndex(0) +8 >Emitted(27, 66) Source(61, 35) + SourceIndex(0) +9 >Emitted(27, 82) Source(61, 58) + SourceIndex(0) +10>Emitted(27, 84) Source(61, 35) + SourceIndex(0) +11>Emitted(27, 121) Source(61, 58) + SourceIndex(0) +12>Emitted(27, 123) Source(61, 70) + SourceIndex(0) +13>Emitted(27, 124) Source(61, 71) + SourceIndex(0) +14>Emitted(27, 127) Source(61, 74) + SourceIndex(0) +15>Emitted(27, 128) Source(61, 75) + SourceIndex(0) +16>Emitted(27, 130) Source(61, 77) + SourceIndex(0) +17>Emitted(27, 131) Source(61, 78) + SourceIndex(0) +18>Emitted(27, 134) Source(61, 81) + SourceIndex(0) +19>Emitted(27, 135) Source(61, 82) + SourceIndex(0) +20>Emitted(27, 137) Source(61, 84) + SourceIndex(0) +21>Emitted(27, 138) Source(61, 85) + SourceIndex(0) +22>Emitted(27, 140) Source(61, 87) + SourceIndex(0) +23>Emitted(27, 142) Source(61, 89) + SourceIndex(0) +24>Emitted(27, 143) Source(61, 90) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(28, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(28, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(28, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _t = getRobot(), _u = _t.name, nameA = _u === void 0 ? "noName" : _u, _v = _t.skill, skillA = _v === void 0 ? "skill" : _v, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = getRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(30, 10) Source(64, 6) + SourceIndex(0) +6 >Emitted(30, 25) Source(64, 73) + SourceIndex(0) +7 >Emitted(30, 27) Source(64, 11) + SourceIndex(0) +8 >Emitted(30, 39) Source(64, 33) + SourceIndex(0) +9 >Emitted(30, 41) Source(64, 11) + SourceIndex(0) +10>Emitted(30, 78) Source(64, 33) + SourceIndex(0) +11>Emitted(30, 80) Source(64, 35) + SourceIndex(0) +12>Emitted(30, 93) Source(64, 58) + SourceIndex(0) +13>Emitted(30, 95) Source(64, 35) + SourceIndex(0) +14>Emitted(30, 132) Source(64, 58) + SourceIndex(0) +15>Emitted(30, 134) Source(64, 75) + SourceIndex(0) +16>Emitted(30, 135) Source(64, 76) + SourceIndex(0) +17>Emitted(30, 138) Source(64, 79) + SourceIndex(0) +18>Emitted(30, 139) Source(64, 80) + SourceIndex(0) +19>Emitted(30, 141) Source(64, 82) + SourceIndex(0) +20>Emitted(30, 142) Source(64, 83) + SourceIndex(0) +21>Emitted(30, 145) Source(64, 86) + SourceIndex(0) +22>Emitted(30, 146) Source(64, 87) + SourceIndex(0) +23>Emitted(30, 148) Source(64, 89) + SourceIndex(0) +24>Emitted(30, 149) Source(64, 90) + SourceIndex(0) +25>Emitted(30, 151) Source(64, 92) + SourceIndex(0) +26>Emitted(30, 153) Source(64, 94) + SourceIndex(0) +27>Emitted(30, 154) Source(64, 95) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _w = { name: "trimmer", skill: "trimming" }, _x = _w.name, nameA = _x === void 0 ? "noName" : _x, _y = _w.skill, skillA = _y === void 0 ? "skill" : _y, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = { name: "trimmer", skill: "trimming" }, +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(33, 10) Source(67, 6) + SourceIndex(0) +6 >Emitted(33, 53) Source(67, 108) + SourceIndex(0) +7 >Emitted(33, 55) Source(67, 11) + SourceIndex(0) +8 >Emitted(33, 67) Source(67, 33) + SourceIndex(0) +9 >Emitted(33, 69) Source(67, 11) + SourceIndex(0) +10>Emitted(33, 106) Source(67, 33) + SourceIndex(0) +11>Emitted(33, 108) Source(67, 35) + SourceIndex(0) +12>Emitted(33, 121) Source(67, 58) + SourceIndex(0) +13>Emitted(33, 123) Source(67, 35) + SourceIndex(0) +14>Emitted(33, 160) Source(67, 58) + SourceIndex(0) +15>Emitted(33, 162) Source(67, 110) + SourceIndex(0) +16>Emitted(33, 163) Source(67, 111) + SourceIndex(0) +17>Emitted(33, 166) Source(67, 114) + SourceIndex(0) +18>Emitted(33, 167) Source(67, 115) + SourceIndex(0) +19>Emitted(33, 169) Source(67, 117) + SourceIndex(0) +20>Emitted(33, 170) Source(67, 118) + SourceIndex(0) +21>Emitted(33, 173) Source(67, 121) + SourceIndex(0) +22>Emitted(33, 174) Source(67, 122) + SourceIndex(0) +23>Emitted(33, 176) Source(67, 124) + SourceIndex(0) +24>Emitted(33, 177) Source(67, 125) + SourceIndex(0) +25>Emitted(33, 179) Source(67, 127) + SourceIndex(0) +26>Emitted(33, 181) Source(67, 129) + SourceIndex(0) +27>Emitted(33, 182) Source(67, 130) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _z = multiRobot.name, nameA = _z === void 0 ? "noName" : _z, _0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primaryA = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondaryA = _3 === void 0 ? "secondary" : _3, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , + > +9 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +10> +11> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +12> +13> primary: primaryA = "primary" +14> +15> primary: primaryA = "primary" +16> , + > +17> secondary: secondaryA = "secondary" +18> +19> secondary: secondaryA = "secondary" +20> + > } = { primary: "none", secondary: "none" } + > } = multiRobot, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(71, 5) + SourceIndex(0) +5 >Emitted(36, 30) Source(71, 27) + SourceIndex(0) +6 >Emitted(36, 32) Source(71, 5) + SourceIndex(0) +7 >Emitted(36, 69) Source(71, 27) + SourceIndex(0) +8 >Emitted(36, 71) Source(72, 5) + SourceIndex(0) +9 >Emitted(36, 93) Source(75, 47) + SourceIndex(0) +10>Emitted(36, 95) Source(72, 5) + SourceIndex(0) +11>Emitted(36, 159) Source(75, 47) + SourceIndex(0) +12>Emitted(36, 161) Source(73, 9) + SourceIndex(0) +13>Emitted(36, 176) Source(73, 38) + SourceIndex(0) +14>Emitted(36, 178) Source(73, 9) + SourceIndex(0) +15>Emitted(36, 219) Source(73, 38) + SourceIndex(0) +16>Emitted(36, 221) Source(74, 9) + SourceIndex(0) +17>Emitted(36, 238) Source(74, 44) + SourceIndex(0) +18>Emitted(36, 240) Source(74, 9) + SourceIndex(0) +19>Emitted(36, 285) Source(74, 44) + SourceIndex(0) +20>Emitted(36, 287) Source(76, 17) + SourceIndex(0) +21>Emitted(36, 288) Source(76, 18) + SourceIndex(0) +22>Emitted(36, 291) Source(76, 21) + SourceIndex(0) +23>Emitted(36, 292) Source(76, 22) + SourceIndex(0) +24>Emitted(36, 294) Source(76, 24) + SourceIndex(0) +25>Emitted(36, 295) Source(76, 25) + SourceIndex(0) +26>Emitted(36, 298) Source(76, 28) + SourceIndex(0) +27>Emitted(36, 299) Source(76, 29) + SourceIndex(0) +28>Emitted(36, 301) Source(76, 31) + SourceIndex(0) +29>Emitted(36, 302) Source(76, 32) + SourceIndex(0) +30>Emitted(36, 304) Source(76, 34) + SourceIndex(0) +31>Emitted(36, 306) Source(76, 36) + SourceIndex(0) +32>Emitted(36, 307) Source(76, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(37, 25) Source(77, 25) + SourceIndex(0) +7 >Emitted(37, 26) Source(77, 26) + SourceIndex(0) +8 >Emitted(37, 27) Source(77, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _4 = getMultiRobot(), _5 = _4.name, nameA = _5 === void 0 ? "noName" : _5, _6 = _4.skills, _7 = _6 === void 0 ? { primary: "none", secondary: "none" } : _6, _8 = _7.primary, primaryA = _8 === void 0 ? "primary" : _8, _9 = _7.secondary, secondaryA = _9 === void 0 ? "secondary" : _9, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot(), +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(39, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(79, 6) + SourceIndex(0) +5 >Emitted(39, 10) Source(79, 6) + SourceIndex(0) +6 >Emitted(39, 30) Source(85, 20) + SourceIndex(0) +7 >Emitted(39, 32) Source(80, 5) + SourceIndex(0) +8 >Emitted(39, 44) Source(80, 27) + SourceIndex(0) +9 >Emitted(39, 46) Source(80, 5) + SourceIndex(0) +10>Emitted(39, 83) Source(80, 27) + SourceIndex(0) +11>Emitted(39, 85) Source(81, 5) + SourceIndex(0) +12>Emitted(39, 99) Source(84, 47) + SourceIndex(0) +13>Emitted(39, 101) Source(81, 5) + SourceIndex(0) +14>Emitted(39, 165) Source(84, 47) + SourceIndex(0) +15>Emitted(39, 167) Source(82, 9) + SourceIndex(0) +16>Emitted(39, 182) Source(82, 38) + SourceIndex(0) +17>Emitted(39, 184) Source(82, 9) + SourceIndex(0) +18>Emitted(39, 225) Source(82, 38) + SourceIndex(0) +19>Emitted(39, 227) Source(83, 9) + SourceIndex(0) +20>Emitted(39, 244) Source(83, 44) + SourceIndex(0) +21>Emitted(39, 246) Source(83, 9) + SourceIndex(0) +22>Emitted(39, 291) Source(83, 44) + SourceIndex(0) +23>Emitted(39, 293) Source(85, 22) + SourceIndex(0) +24>Emitted(39, 294) Source(85, 23) + SourceIndex(0) +25>Emitted(39, 297) Source(85, 26) + SourceIndex(0) +26>Emitted(39, 298) Source(85, 27) + SourceIndex(0) +27>Emitted(39, 300) Source(85, 29) + SourceIndex(0) +28>Emitted(39, 301) Source(85, 30) + SourceIndex(0) +29>Emitted(39, 304) Source(85, 33) + SourceIndex(0) +30>Emitted(39, 305) Source(85, 34) + SourceIndex(0) +31>Emitted(39, 307) Source(85, 36) + SourceIndex(0) +32>Emitted(39, 308) Source(85, 37) + SourceIndex(0) +33>Emitted(39, 310) Source(85, 39) + SourceIndex(0) +34>Emitted(39, 312) Source(85, 41) + SourceIndex(0) +35>Emitted(39, 313) Source(85, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(86, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(86, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(86, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(86, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(86, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(86, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(86, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(86, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(87, 2) + SourceIndex(0) +--- +>>>for (var _10 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _11 = _10.name, nameA = _11 === void 0 ? "noName" : _11, _12 = _10.skills, _13 = _12 === void 0 ? { primary: "none", secondary: "none" } : _12, _14 = _13.primary, primaryA = _14 === void 0 ? "primary" : _14, _15 = _13.secondary, secondaryA = _15 === void 0 ? "secondary" : _15, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(42, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(88, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(88, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(88, 6) + SourceIndex(0) +5 >Emitted(42, 10) Source(88, 6) + SourceIndex(0) +6 >Emitted(42, 89) Source(94, 90) + SourceIndex(0) +7 >Emitted(42, 91) Source(89, 5) + SourceIndex(0) +8 >Emitted(42, 105) Source(89, 27) + SourceIndex(0) +9 >Emitted(42, 107) Source(89, 5) + SourceIndex(0) +10>Emitted(42, 146) Source(89, 27) + SourceIndex(0) +11>Emitted(42, 148) Source(90, 5) + SourceIndex(0) +12>Emitted(42, 164) Source(93, 47) + SourceIndex(0) +13>Emitted(42, 166) Source(90, 5) + SourceIndex(0) +14>Emitted(42, 233) Source(93, 47) + SourceIndex(0) +15>Emitted(42, 235) Source(91, 9) + SourceIndex(0) +16>Emitted(42, 252) Source(91, 38) + SourceIndex(0) +17>Emitted(42, 254) Source(91, 9) + SourceIndex(0) +18>Emitted(42, 297) Source(91, 38) + SourceIndex(0) +19>Emitted(42, 299) Source(92, 9) + SourceIndex(0) +20>Emitted(42, 318) Source(92, 44) + SourceIndex(0) +21>Emitted(42, 320) Source(92, 9) + SourceIndex(0) +22>Emitted(42, 367) Source(92, 44) + SourceIndex(0) +23>Emitted(42, 369) Source(95, 5) + SourceIndex(0) +24>Emitted(42, 370) Source(95, 6) + SourceIndex(0) +25>Emitted(42, 373) Source(95, 9) + SourceIndex(0) +26>Emitted(42, 374) Source(95, 10) + SourceIndex(0) +27>Emitted(42, 376) Source(95, 12) + SourceIndex(0) +28>Emitted(42, 377) Source(95, 13) + SourceIndex(0) +29>Emitted(42, 380) Source(95, 16) + SourceIndex(0) +30>Emitted(42, 381) Source(95, 17) + SourceIndex(0) +31>Emitted(42, 383) Source(95, 19) + SourceIndex(0) +32>Emitted(42, 384) Source(95, 20) + SourceIndex(0) +33>Emitted(42, 386) Source(95, 22) + SourceIndex(0) +34>Emitted(42, 388) Source(95, 24) + SourceIndex(0) +35>Emitted(42, 389) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(96, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(96, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(96, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(97, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..5d47a45699e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,350 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 10)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 10)) +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 10)) +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 10)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 45)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 62)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 10)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 35, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 36, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 38, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 38, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 35, 13)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 43, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 44, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 46, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 46, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 43, 13)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 51, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 52, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 54, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 54, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 51, 13)) +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 33)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 33)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 33)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 70)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 69, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 71, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 72, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 74, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 74, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 71, 13)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 78, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 80, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 81, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 83, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 83, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 80, 13)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 87, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 89, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 90, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 92, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 92, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 89, 13)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..c9e76f88581 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types @@ -0,0 +1,484 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..a360326c1ca --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js @@ -0,0 +1,265 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for ((_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_v = robot.name, name = _v === void 0 ? "noName" : _v, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58), + i = 0; i < 1; i++) { + console.log(primaryA); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..448921b9cdc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAC,CAAC,eAAsB,EAAtB,qCAAsB,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsC,EAArC,YAAsB,EAAtB,qCAAsB,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAyE,EAAxE,YAAsB,EAAtB,qCAAsB,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEvC,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,KAExB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EAKoF,EAJrF,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,KAE8C;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAC,CAAE,eAAe,EAAf,oCAAe,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAgC,EAA9B,YAAe,EAAf,oCAAe,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAmE,EAAjE,YAAe,EAAf,oCAAe,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,sBAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,EAE3B,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,KAEZ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EAKoF,EAJrF,eAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,KAE0D;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAC,CAAC,gBAAsB,EAAtB,uCAAsB,EAAE,iBAAuB,EAAvB,uCAAuB,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAA+D,EAA9D,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,MAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,4CAAkG,EAAjG,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,MAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,qBAAsB,EAAtB,uCAAsB,EACtB,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAEvC,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAMc,EALf,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,MAExB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,MAE8C;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAC,CAAE,gBAAe,EAAf,sCAAe,EAAE,iBAAe,EAAf,sCAAe,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAAiD,EAA/C,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,MAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,4CAAoF,EAAlF,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,MAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,qBAAe,EAAf,sCAAe,EACf,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,EAE3B,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAMc,EALf,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,MAEZ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+EAMoF,EALrF,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,MAE0D;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..3e4d7a87855 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3589 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 18) + SourceIndex(0) +4 >Emitted(9, 12) Source(26, 20) + SourceIndex(0) +5 >Emitted(9, 20) Source(26, 36) + SourceIndex(0) +6 >Emitted(9, 22) Source(26, 38) + SourceIndex(0) +7 >Emitted(9, 32) Source(26, 56) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 58) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 67) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 69) + SourceIndex(0) +11>Emitted(9, 43) Source(26, 83) + SourceIndex(0) +12>Emitted(9, 44) Source(26, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(10, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(10, 9) Source(27, 17) + SourceIndex(0) +4 >Emitted(10, 11) Source(27, 19) + SourceIndex(0) +5 >Emitted(10, 18) Source(27, 34) + SourceIndex(0) +6 >Emitted(10, 20) Source(27, 36) + SourceIndex(0) +7 >Emitted(10, 29) Source(27, 53) + SourceIndex(0) +8 >Emitted(10, 31) Source(27, 55) + SourceIndex(0) +9 >Emitted(10, 36) Source(27, 68) + SourceIndex(0) +10>Emitted(10, 37) Source(27, 69) + SourceIndex(0) +--- +>>>for ((_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(11, 6) Source(29, 6) + SourceIndex(0) +5 >Emitted(11, 7) Source(29, 7) + SourceIndex(0) +6 >Emitted(11, 22) Source(29, 29) + SourceIndex(0) +7 >Emitted(11, 24) Source(29, 7) + SourceIndex(0) +8 >Emitted(11, 61) Source(29, 29) + SourceIndex(0) +9 >Emitted(11, 63) Source(29, 34) + SourceIndex(0) +10>Emitted(11, 68) Source(29, 39) + SourceIndex(0) +11>Emitted(11, 69) Source(29, 39) + SourceIndex(0) +12>Emitted(11, 71) Source(29, 41) + SourceIndex(0) +13>Emitted(11, 72) Source(29, 42) + SourceIndex(0) +14>Emitted(11, 75) Source(29, 45) + SourceIndex(0) +15>Emitted(11, 76) Source(29, 46) + SourceIndex(0) +16>Emitted(11, 78) Source(29, 48) + SourceIndex(0) +17>Emitted(11, 79) Source(29, 49) + SourceIndex(0) +18>Emitted(11, 82) Source(29, 52) + SourceIndex(0) +19>Emitted(11, 83) Source(29, 53) + SourceIndex(0) +20>Emitted(11, 85) Source(29, 55) + SourceIndex(0) +21>Emitted(11, 86) Source(29, 56) + SourceIndex(0) +22>Emitted(11, 88) Source(29, 58) + SourceIndex(0) +23>Emitted(11, 90) Source(29, 60) + SourceIndex(0) +24>Emitted(11, 91) Source(29, 61) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for ((_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +5 >Emitted(14, 7) Source(32, 6) + SourceIndex(0) +6 >Emitted(14, 22) Source(32, 44) + SourceIndex(0) +7 >Emitted(14, 24) Source(32, 7) + SourceIndex(0) +8 >Emitted(14, 36) Source(32, 29) + SourceIndex(0) +9 >Emitted(14, 38) Source(32, 7) + SourceIndex(0) +10>Emitted(14, 75) Source(32, 29) + SourceIndex(0) +11>Emitted(14, 80) Source(32, 44) + SourceIndex(0) +12>Emitted(14, 82) Source(32, 46) + SourceIndex(0) +13>Emitted(14, 83) Source(32, 47) + SourceIndex(0) +14>Emitted(14, 86) Source(32, 50) + SourceIndex(0) +15>Emitted(14, 87) Source(32, 51) + SourceIndex(0) +16>Emitted(14, 89) Source(32, 53) + SourceIndex(0) +17>Emitted(14, 90) Source(32, 54) + SourceIndex(0) +18>Emitted(14, 93) Source(32, 57) + SourceIndex(0) +19>Emitted(14, 94) Source(32, 58) + SourceIndex(0) +20>Emitted(14, 96) Source(32, 60) + SourceIndex(0) +21>Emitted(14, 97) Source(32, 61) + SourceIndex(0) +22>Emitted(14, 99) Source(32, 63) + SourceIndex(0) +23>Emitted(14, 101) Source(32, 65) + SourceIndex(0) +24>Emitted(14, 102) Source(32, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for ((_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +5 >Emitted(17, 7) Source(35, 6) + SourceIndex(0) +6 >Emitted(17, 50) Source(35, 79) + SourceIndex(0) +7 >Emitted(17, 52) Source(35, 7) + SourceIndex(0) +8 >Emitted(17, 64) Source(35, 29) + SourceIndex(0) +9 >Emitted(17, 66) Source(35, 7) + SourceIndex(0) +10>Emitted(17, 103) Source(35, 29) + SourceIndex(0) +11>Emitted(17, 108) Source(35, 79) + SourceIndex(0) +12>Emitted(17, 110) Source(35, 81) + SourceIndex(0) +13>Emitted(17, 111) Source(35, 82) + SourceIndex(0) +14>Emitted(17, 114) Source(35, 85) + SourceIndex(0) +15>Emitted(17, 115) Source(35, 86) + SourceIndex(0) +16>Emitted(17, 117) Source(35, 88) + SourceIndex(0) +17>Emitted(17, 118) Source(35, 89) + SourceIndex(0) +18>Emitted(17, 121) Source(35, 92) + SourceIndex(0) +19>Emitted(17, 122) Source(35, 93) + SourceIndex(0) +20>Emitted(17, 124) Source(35, 95) + SourceIndex(0) +21>Emitted(17, 125) Source(35, 96) + SourceIndex(0) +22>Emitted(17, 127) Source(35, 98) + SourceIndex(0) +23>Emitted(17, 129) Source(35, 100) + SourceIndex(0) +24>Emitted(17, 130) Source(35, 101) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for ((_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary: primaryA = "primary" +11> +12> primary: primaryA = "primary" +13> , + > +14> secondary: secondaryA = "secondary" +15> +16> secondary: secondaryA = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = +18> multiRobot +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 6) + SourceIndex(0) +5 >Emitted(20, 7) Source(39, 5) + SourceIndex(0) +6 >Emitted(20, 29) Source(42, 47) + SourceIndex(0) +7 >Emitted(20, 31) Source(39, 5) + SourceIndex(0) +8 >Emitted(20, 95) Source(42, 47) + SourceIndex(0) +9 >Emitted(20, 97) Source(40, 9) + SourceIndex(0) +10>Emitted(20, 112) Source(40, 38) + SourceIndex(0) +11>Emitted(20, 114) Source(40, 9) + SourceIndex(0) +12>Emitted(20, 155) Source(40, 38) + SourceIndex(0) +13>Emitted(20, 157) Source(41, 9) + SourceIndex(0) +14>Emitted(20, 174) Source(41, 44) + SourceIndex(0) +15>Emitted(20, 176) Source(41, 9) + SourceIndex(0) +16>Emitted(20, 221) Source(41, 44) + SourceIndex(0) +17>Emitted(20, 223) Source(43, 5) + SourceIndex(0) +18>Emitted(20, 233) Source(43, 15) + SourceIndex(0) +19>Emitted(20, 234) Source(43, 15) + SourceIndex(0) +20>Emitted(20, 236) Source(43, 17) + SourceIndex(0) +21>Emitted(20, 237) Source(43, 18) + SourceIndex(0) +22>Emitted(20, 240) Source(43, 21) + SourceIndex(0) +23>Emitted(20, 241) Source(43, 22) + SourceIndex(0) +24>Emitted(20, 243) Source(43, 24) + SourceIndex(0) +25>Emitted(20, 244) Source(43, 25) + SourceIndex(0) +26>Emitted(20, 247) Source(43, 28) + SourceIndex(0) +27>Emitted(20, 248) Source(43, 29) + SourceIndex(0) +28>Emitted(20, 250) Source(43, 31) + SourceIndex(0) +29>Emitted(20, 251) Source(43, 32) + SourceIndex(0) +30>Emitted(20, 253) Source(43, 34) + SourceIndex(0) +31>Emitted(20, 255) Source(43, 36) + SourceIndex(0) +32>Emitted(20, 256) Source(43, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(21, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(21, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(21, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(21, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(21, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(21, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(21, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(21, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(22, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(22, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(23, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(23, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(23, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(23, 6) Source(46, 6) + SourceIndex(0) +5 >Emitted(23, 7) Source(46, 6) + SourceIndex(0) +6 >Emitted(23, 27) Source(51, 20) + SourceIndex(0) +7 >Emitted(23, 29) Source(47, 5) + SourceIndex(0) +8 >Emitted(23, 43) Source(50, 47) + SourceIndex(0) +9 >Emitted(23, 45) Source(47, 5) + SourceIndex(0) +10>Emitted(23, 109) Source(50, 47) + SourceIndex(0) +11>Emitted(23, 111) Source(48, 9) + SourceIndex(0) +12>Emitted(23, 126) Source(48, 38) + SourceIndex(0) +13>Emitted(23, 128) Source(48, 9) + SourceIndex(0) +14>Emitted(23, 169) Source(48, 38) + SourceIndex(0) +15>Emitted(23, 171) Source(49, 9) + SourceIndex(0) +16>Emitted(23, 188) Source(49, 44) + SourceIndex(0) +17>Emitted(23, 190) Source(49, 9) + SourceIndex(0) +18>Emitted(23, 235) Source(49, 44) + SourceIndex(0) +19>Emitted(23, 240) Source(51, 20) + SourceIndex(0) +20>Emitted(23, 242) Source(51, 22) + SourceIndex(0) +21>Emitted(23, 243) Source(51, 23) + SourceIndex(0) +22>Emitted(23, 246) Source(51, 26) + SourceIndex(0) +23>Emitted(23, 247) Source(51, 27) + SourceIndex(0) +24>Emitted(23, 249) Source(51, 29) + SourceIndex(0) +25>Emitted(23, 250) Source(51, 30) + SourceIndex(0) +26>Emitted(23, 253) Source(51, 33) + SourceIndex(0) +27>Emitted(23, 254) Source(51, 34) + SourceIndex(0) +28>Emitted(23, 256) Source(51, 36) + SourceIndex(0) +29>Emitted(23, 257) Source(51, 37) + SourceIndex(0) +30>Emitted(23, 259) Source(51, 39) + SourceIndex(0) +31>Emitted(23, 261) Source(51, 41) + SourceIndex(0) +32>Emitted(23, 262) Source(51, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(52, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(52, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(52, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(25, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(25, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for ((_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(26, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(54, 6) + SourceIndex(0) +5 >Emitted(26, 7) Source(54, 6) + SourceIndex(0) +6 >Emitted(26, 85) Source(59, 90) + SourceIndex(0) +7 >Emitted(26, 87) Source(55, 5) + SourceIndex(0) +8 >Emitted(26, 101) Source(58, 47) + SourceIndex(0) +9 >Emitted(26, 103) Source(55, 5) + SourceIndex(0) +10>Emitted(26, 167) Source(58, 47) + SourceIndex(0) +11>Emitted(26, 169) Source(56, 9) + SourceIndex(0) +12>Emitted(26, 184) Source(56, 38) + SourceIndex(0) +13>Emitted(26, 186) Source(56, 9) + SourceIndex(0) +14>Emitted(26, 227) Source(56, 38) + SourceIndex(0) +15>Emitted(26, 229) Source(57, 9) + SourceIndex(0) +16>Emitted(26, 246) Source(57, 44) + SourceIndex(0) +17>Emitted(26, 248) Source(57, 9) + SourceIndex(0) +18>Emitted(26, 293) Source(57, 44) + SourceIndex(0) +19>Emitted(26, 298) Source(59, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(27, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(27, 6) Source(60, 6) + SourceIndex(0) +3 >Emitted(27, 9) Source(60, 9) + SourceIndex(0) +4 >Emitted(27, 10) Source(60, 10) + SourceIndex(0) +5 >Emitted(27, 12) Source(60, 12) + SourceIndex(0) +6 >Emitted(27, 13) Source(60, 13) + SourceIndex(0) +7 >Emitted(27, 16) Source(60, 16) + SourceIndex(0) +8 >Emitted(27, 17) Source(60, 17) + SourceIndex(0) +9 >Emitted(27, 19) Source(60, 19) + SourceIndex(0) +10>Emitted(27, 20) Source(60, 20) + SourceIndex(0) +11>Emitted(27, 22) Source(60, 22) + SourceIndex(0) +12>Emitted(27, 24) Source(60, 24) + SourceIndex(0) +13>Emitted(27, 25) Source(60, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(28, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(61, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(61, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(61, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for ((_v = robot.name, name = _v === void 0 ? "noName" : _v, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name = "noName" +7 > +8 > name = "noName" +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(64, 8) + SourceIndex(0) +6 >Emitted(30, 22) Source(64, 23) + SourceIndex(0) +7 >Emitted(30, 24) Source(64, 8) + SourceIndex(0) +8 >Emitted(30, 60) Source(64, 23) + SourceIndex(0) +9 >Emitted(30, 62) Source(64, 28) + SourceIndex(0) +10>Emitted(30, 67) Source(64, 33) + SourceIndex(0) +11>Emitted(30, 68) Source(64, 33) + SourceIndex(0) +12>Emitted(30, 70) Source(64, 35) + SourceIndex(0) +13>Emitted(30, 71) Source(64, 36) + SourceIndex(0) +14>Emitted(30, 74) Source(64, 39) + SourceIndex(0) +15>Emitted(30, 75) Source(64, 40) + SourceIndex(0) +16>Emitted(30, 77) Source(64, 42) + SourceIndex(0) +17>Emitted(30, 78) Source(64, 43) + SourceIndex(0) +18>Emitted(30, 81) Source(64, 46) + SourceIndex(0) +19>Emitted(30, 82) Source(64, 47) + SourceIndex(0) +20>Emitted(30, 84) Source(64, 49) + SourceIndex(0) +21>Emitted(30, 85) Source(64, 50) + SourceIndex(0) +22>Emitted(30, 87) Source(64, 52) + SourceIndex(0) +23>Emitted(30, 89) Source(64, 54) + SourceIndex(0) +24>Emitted(30, 90) Source(64, 55) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for ((_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName" } = getRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(67, 6) + SourceIndex(0) +6 >Emitted(33, 22) Source(67, 38) + SourceIndex(0) +7 >Emitted(33, 24) Source(67, 8) + SourceIndex(0) +8 >Emitted(33, 36) Source(67, 23) + SourceIndex(0) +9 >Emitted(33, 38) Source(67, 8) + SourceIndex(0) +10>Emitted(33, 74) Source(67, 23) + SourceIndex(0) +11>Emitted(33, 79) Source(67, 38) + SourceIndex(0) +12>Emitted(33, 81) Source(67, 40) + SourceIndex(0) +13>Emitted(33, 82) Source(67, 41) + SourceIndex(0) +14>Emitted(33, 85) Source(67, 44) + SourceIndex(0) +15>Emitted(33, 86) Source(67, 45) + SourceIndex(0) +16>Emitted(33, 88) Source(67, 47) + SourceIndex(0) +17>Emitted(33, 89) Source(67, 48) + SourceIndex(0) +18>Emitted(33, 92) Source(67, 51) + SourceIndex(0) +19>Emitted(33, 93) Source(67, 52) + SourceIndex(0) +20>Emitted(33, 95) Source(67, 54) + SourceIndex(0) +21>Emitted(33, 96) Source(67, 55) + SourceIndex(0) +22>Emitted(33, 98) Source(67, 57) + SourceIndex(0) +23>Emitted(33, 100) Source(67, 59) + SourceIndex(0) +24>Emitted(33, 101) Source(67, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for ((_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(70, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(70, 6) + SourceIndex(0) +6 >Emitted(36, 50) Source(70, 73) + SourceIndex(0) +7 >Emitted(36, 52) Source(70, 8) + SourceIndex(0) +8 >Emitted(36, 64) Source(70, 23) + SourceIndex(0) +9 >Emitted(36, 66) Source(70, 8) + SourceIndex(0) +10>Emitted(36, 102) Source(70, 23) + SourceIndex(0) +11>Emitted(36, 107) Source(70, 73) + SourceIndex(0) +12>Emitted(36, 109) Source(70, 75) + SourceIndex(0) +13>Emitted(36, 110) Source(70, 76) + SourceIndex(0) +14>Emitted(36, 113) Source(70, 79) + SourceIndex(0) +15>Emitted(36, 114) Source(70, 80) + SourceIndex(0) +16>Emitted(36, 116) Source(70, 82) + SourceIndex(0) +17>Emitted(36, 117) Source(70, 83) + SourceIndex(0) +18>Emitted(36, 120) Source(70, 86) + SourceIndex(0) +19>Emitted(36, 121) Source(70, 87) + SourceIndex(0) +20>Emitted(36, 123) Source(70, 89) + SourceIndex(0) +21>Emitted(36, 124) Source(70, 90) + SourceIndex(0) +22>Emitted(36, 126) Source(70, 92) + SourceIndex(0) +23>Emitted(36, 128) Source(70, 94) + SourceIndex(0) +24>Emitted(36, 129) Source(70, 95) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(71, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(71, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(71, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(72, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for ((_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary = "primary" +11> +12> primary = "primary" +13> , + > +14> secondary = "secondary" +15> +16> secondary = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = +18> multiRobot +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(39, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(73, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(74, 5) + SourceIndex(0) +6 >Emitted(39, 29) Source(77, 47) + SourceIndex(0) +7 >Emitted(39, 31) Source(74, 5) + SourceIndex(0) +8 >Emitted(39, 95) Source(77, 47) + SourceIndex(0) +9 >Emitted(39, 97) Source(75, 9) + SourceIndex(0) +10>Emitted(39, 112) Source(75, 28) + SourceIndex(0) +11>Emitted(39, 114) Source(75, 9) + SourceIndex(0) +12>Emitted(39, 154) Source(75, 28) + SourceIndex(0) +13>Emitted(39, 156) Source(76, 9) + SourceIndex(0) +14>Emitted(39, 173) Source(76, 32) + SourceIndex(0) +15>Emitted(39, 175) Source(76, 9) + SourceIndex(0) +16>Emitted(39, 219) Source(76, 32) + SourceIndex(0) +17>Emitted(39, 221) Source(78, 5) + SourceIndex(0) +18>Emitted(39, 231) Source(78, 15) + SourceIndex(0) +19>Emitted(39, 232) Source(78, 15) + SourceIndex(0) +20>Emitted(39, 234) Source(78, 17) + SourceIndex(0) +21>Emitted(39, 235) Source(78, 18) + SourceIndex(0) +22>Emitted(39, 238) Source(78, 21) + SourceIndex(0) +23>Emitted(39, 239) Source(78, 22) + SourceIndex(0) +24>Emitted(39, 241) Source(78, 24) + SourceIndex(0) +25>Emitted(39, 242) Source(78, 25) + SourceIndex(0) +26>Emitted(39, 245) Source(78, 28) + SourceIndex(0) +27>Emitted(39, 246) Source(78, 29) + SourceIndex(0) +28>Emitted(39, 248) Source(78, 31) + SourceIndex(0) +29>Emitted(39, 249) Source(78, 32) + SourceIndex(0) +30>Emitted(39, 251) Source(78, 34) + SourceIndex(0) +31>Emitted(39, 253) Source(78, 36) + SourceIndex(0) +32>Emitted(39, 254) Source(78, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for ((_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(42, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(81, 6) + SourceIndex(0) +6 >Emitted(42, 27) Source(86, 20) + SourceIndex(0) +7 >Emitted(42, 29) Source(82, 5) + SourceIndex(0) +8 >Emitted(42, 43) Source(85, 47) + SourceIndex(0) +9 >Emitted(42, 45) Source(82, 5) + SourceIndex(0) +10>Emitted(42, 109) Source(85, 47) + SourceIndex(0) +11>Emitted(42, 111) Source(83, 9) + SourceIndex(0) +12>Emitted(42, 126) Source(83, 28) + SourceIndex(0) +13>Emitted(42, 128) Source(83, 9) + SourceIndex(0) +14>Emitted(42, 168) Source(83, 28) + SourceIndex(0) +15>Emitted(42, 170) Source(84, 9) + SourceIndex(0) +16>Emitted(42, 187) Source(84, 32) + SourceIndex(0) +17>Emitted(42, 189) Source(84, 9) + SourceIndex(0) +18>Emitted(42, 233) Source(84, 32) + SourceIndex(0) +19>Emitted(42, 238) Source(86, 20) + SourceIndex(0) +20>Emitted(42, 240) Source(86, 22) + SourceIndex(0) +21>Emitted(42, 241) Source(86, 23) + SourceIndex(0) +22>Emitted(42, 244) Source(86, 26) + SourceIndex(0) +23>Emitted(42, 245) Source(86, 27) + SourceIndex(0) +24>Emitted(42, 247) Source(86, 29) + SourceIndex(0) +25>Emitted(42, 248) Source(86, 30) + SourceIndex(0) +26>Emitted(42, 251) Source(86, 33) + SourceIndex(0) +27>Emitted(42, 252) Source(86, 34) + SourceIndex(0) +28>Emitted(42, 254) Source(86, 36) + SourceIndex(0) +29>Emitted(42, 255) Source(86, 37) + SourceIndex(0) +30>Emitted(42, 257) Source(86, 39) + SourceIndex(0) +31>Emitted(42, 259) Source(86, 41) + SourceIndex(0) +32>Emitted(42, 260) Source(86, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(87, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(87, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(87, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for ((_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(45, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(89, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(89, 6) + SourceIndex(0) +6 >Emitted(45, 85) Source(94, 90) + SourceIndex(0) +7 >Emitted(45, 87) Source(90, 5) + SourceIndex(0) +8 >Emitted(45, 102) Source(93, 47) + SourceIndex(0) +9 >Emitted(45, 104) Source(90, 5) + SourceIndex(0) +10>Emitted(45, 171) Source(93, 47) + SourceIndex(0) +11>Emitted(45, 173) Source(91, 9) + SourceIndex(0) +12>Emitted(45, 190) Source(91, 28) + SourceIndex(0) +13>Emitted(45, 192) Source(91, 9) + SourceIndex(0) +14>Emitted(45, 234) Source(91, 28) + SourceIndex(0) +15>Emitted(45, 236) Source(92, 9) + SourceIndex(0) +16>Emitted(45, 255) Source(92, 32) + SourceIndex(0) +17>Emitted(45, 257) Source(92, 9) + SourceIndex(0) +18>Emitted(45, 303) Source(92, 32) + SourceIndex(0) +19>Emitted(45, 308) Source(94, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(46, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(95, 6) + SourceIndex(0) +3 >Emitted(46, 9) Source(95, 9) + SourceIndex(0) +4 >Emitted(46, 10) Source(95, 10) + SourceIndex(0) +5 >Emitted(46, 12) Source(95, 12) + SourceIndex(0) +6 >Emitted(46, 13) Source(95, 13) + SourceIndex(0) +7 >Emitted(46, 16) Source(95, 16) + SourceIndex(0) +8 >Emitted(46, 17) Source(95, 17) + SourceIndex(0) +9 >Emitted(46, 19) Source(95, 19) + SourceIndex(0) +10>Emitted(46, 20) Source(95, 20) + SourceIndex(0) +11>Emitted(46, 22) Source(95, 22) + SourceIndex(0) +12>Emitted(46, 24) Source(95, 24) + SourceIndex(0) +13>Emitted(46, 25) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(47, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(47, 25) Source(96, 25) + SourceIndex(0) +7 >Emitted(47, 26) Source(96, 26) + SourceIndex(0) +8 >Emitted(47, 27) Source(96, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for ((_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , +10> skill: skillA = "skill" +11> +12> skill: skillA = "skill" +13> } = +14> robot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(49, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(100, 6) + SourceIndex(0) +5 >Emitted(49, 7) Source(100, 7) + SourceIndex(0) +6 >Emitted(49, 23) Source(100, 29) + SourceIndex(0) +7 >Emitted(49, 25) Source(100, 7) + SourceIndex(0) +8 >Emitted(49, 64) Source(100, 29) + SourceIndex(0) +9 >Emitted(49, 66) Source(100, 31) + SourceIndex(0) +10>Emitted(49, 83) Source(100, 54) + SourceIndex(0) +11>Emitted(49, 85) Source(100, 31) + SourceIndex(0) +12>Emitted(49, 124) Source(100, 54) + SourceIndex(0) +13>Emitted(49, 126) Source(100, 59) + SourceIndex(0) +14>Emitted(49, 131) Source(100, 64) + SourceIndex(0) +15>Emitted(49, 132) Source(100, 64) + SourceIndex(0) +16>Emitted(49, 134) Source(100, 66) + SourceIndex(0) +17>Emitted(49, 135) Source(100, 67) + SourceIndex(0) +18>Emitted(49, 138) Source(100, 70) + SourceIndex(0) +19>Emitted(49, 139) Source(100, 71) + SourceIndex(0) +20>Emitted(49, 141) Source(100, 73) + SourceIndex(0) +21>Emitted(49, 142) Source(100, 74) + SourceIndex(0) +22>Emitted(49, 145) Source(100, 77) + SourceIndex(0) +23>Emitted(49, 146) Source(100, 78) + SourceIndex(0) +24>Emitted(49, 148) Source(100, 80) + SourceIndex(0) +25>Emitted(49, 149) Source(100, 81) + SourceIndex(0) +26>Emitted(49, 151) Source(100, 83) + SourceIndex(0) +27>Emitted(49, 153) Source(100, 85) + SourceIndex(0) +28>Emitted(49, 154) Source(100, 86) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(50, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(50, 22) Source(101, 22) + SourceIndex(0) +7 >Emitted(50, 23) Source(101, 23) + SourceIndex(0) +8 >Emitted(50, 24) Source(101, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for ((_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = getRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(52, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(52, 7) Source(103, 6) + SourceIndex(0) +6 >Emitted(52, 23) Source(103, 69) + SourceIndex(0) +7 >Emitted(52, 25) Source(103, 7) + SourceIndex(0) +8 >Emitted(52, 39) Source(103, 29) + SourceIndex(0) +9 >Emitted(52, 41) Source(103, 7) + SourceIndex(0) +10>Emitted(52, 80) Source(103, 29) + SourceIndex(0) +11>Emitted(52, 82) Source(103, 31) + SourceIndex(0) +12>Emitted(52, 97) Source(103, 54) + SourceIndex(0) +13>Emitted(52, 99) Source(103, 31) + SourceIndex(0) +14>Emitted(52, 138) Source(103, 54) + SourceIndex(0) +15>Emitted(52, 144) Source(103, 69) + SourceIndex(0) +16>Emitted(52, 146) Source(103, 71) + SourceIndex(0) +17>Emitted(52, 147) Source(103, 72) + SourceIndex(0) +18>Emitted(52, 150) Source(103, 75) + SourceIndex(0) +19>Emitted(52, 151) Source(103, 76) + SourceIndex(0) +20>Emitted(52, 153) Source(103, 78) + SourceIndex(0) +21>Emitted(52, 154) Source(103, 79) + SourceIndex(0) +22>Emitted(52, 157) Source(103, 82) + SourceIndex(0) +23>Emitted(52, 158) Source(103, 83) + SourceIndex(0) +24>Emitted(52, 160) Source(103, 85) + SourceIndex(0) +25>Emitted(52, 161) Source(103, 86) + SourceIndex(0) +26>Emitted(52, 163) Source(103, 88) + SourceIndex(0) +27>Emitted(52, 165) Source(103, 90) + SourceIndex(0) +28>Emitted(52, 166) Source(103, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(104, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(104, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(104, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for ((_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = { name: "trimmer", skill: "trimming" } +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(55, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(55, 7) Source(106, 6) + SourceIndex(0) +6 >Emitted(55, 51) Source(106, 104) + SourceIndex(0) +7 >Emitted(55, 53) Source(106, 7) + SourceIndex(0) +8 >Emitted(55, 67) Source(106, 29) + SourceIndex(0) +9 >Emitted(55, 69) Source(106, 7) + SourceIndex(0) +10>Emitted(55, 108) Source(106, 29) + SourceIndex(0) +11>Emitted(55, 110) Source(106, 31) + SourceIndex(0) +12>Emitted(55, 125) Source(106, 54) + SourceIndex(0) +13>Emitted(55, 127) Source(106, 31) + SourceIndex(0) +14>Emitted(55, 166) Source(106, 54) + SourceIndex(0) +15>Emitted(55, 172) Source(106, 104) + SourceIndex(0) +16>Emitted(55, 174) Source(106, 106) + SourceIndex(0) +17>Emitted(55, 175) Source(106, 107) + SourceIndex(0) +18>Emitted(55, 178) Source(106, 110) + SourceIndex(0) +19>Emitted(55, 179) Source(106, 111) + SourceIndex(0) +20>Emitted(55, 181) Source(106, 113) + SourceIndex(0) +21>Emitted(55, 182) Source(106, 114) + SourceIndex(0) +22>Emitted(55, 185) Source(106, 117) + SourceIndex(0) +23>Emitted(55, 186) Source(106, 118) + SourceIndex(0) +24>Emitted(55, 188) Source(106, 120) + SourceIndex(0) +25>Emitted(55, 189) Source(106, 121) + SourceIndex(0) +26>Emitted(55, 191) Source(106, 123) + SourceIndex(0) +27>Emitted(55, 193) Source(106, 125) + SourceIndex(0) +28>Emitted(55, 194) Source(106, 126) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(56, 22) Source(107, 22) + SourceIndex(0) +7 >Emitted(56, 23) Source(107, 23) + SourceIndex(0) +8 >Emitted(56, 24) Source(107, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(108, 2) + SourceIndex(0) +--- +>>>for ((_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , + > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> primary: primaryA = "primary" +15> +16> primary: primaryA = "primary" +17> , + > +18> secondary: secondaryA = "secondary" +19> +20> secondary: secondaryA = "secondary" +21> + > } = { primary: "none", secondary: "none" } + > } = +22> multiRobot +23> +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(58, 1) Source(109, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(109, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(109, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(109, 6) + SourceIndex(0) +5 >Emitted(58, 7) Source(110, 5) + SourceIndex(0) +6 >Emitted(58, 28) Source(110, 27) + SourceIndex(0) +7 >Emitted(58, 30) Source(110, 5) + SourceIndex(0) +8 >Emitted(58, 69) Source(110, 27) + SourceIndex(0) +9 >Emitted(58, 71) Source(111, 5) + SourceIndex(0) +10>Emitted(58, 94) Source(114, 47) + SourceIndex(0) +11>Emitted(58, 96) Source(111, 5) + SourceIndex(0) +12>Emitted(58, 163) Source(114, 47) + SourceIndex(0) +13>Emitted(58, 165) Source(112, 9) + SourceIndex(0) +14>Emitted(58, 182) Source(112, 38) + SourceIndex(0) +15>Emitted(58, 184) Source(112, 9) + SourceIndex(0) +16>Emitted(58, 227) Source(112, 38) + SourceIndex(0) +17>Emitted(58, 229) Source(113, 9) + SourceIndex(0) +18>Emitted(58, 248) Source(113, 44) + SourceIndex(0) +19>Emitted(58, 250) Source(113, 9) + SourceIndex(0) +20>Emitted(58, 297) Source(113, 44) + SourceIndex(0) +21>Emitted(58, 299) Source(115, 5) + SourceIndex(0) +22>Emitted(58, 309) Source(115, 15) + SourceIndex(0) +23>Emitted(58, 310) Source(115, 15) + SourceIndex(0) +24>Emitted(58, 312) Source(115, 17) + SourceIndex(0) +25>Emitted(58, 313) Source(115, 18) + SourceIndex(0) +26>Emitted(58, 316) Source(115, 21) + SourceIndex(0) +27>Emitted(58, 317) Source(115, 22) + SourceIndex(0) +28>Emitted(58, 319) Source(115, 24) + SourceIndex(0) +29>Emitted(58, 320) Source(115, 25) + SourceIndex(0) +30>Emitted(58, 323) Source(115, 28) + SourceIndex(0) +31>Emitted(58, 324) Source(115, 29) + SourceIndex(0) +32>Emitted(58, 326) Source(115, 31) + SourceIndex(0) +33>Emitted(58, 327) Source(115, 32) + SourceIndex(0) +34>Emitted(58, 329) Source(115, 34) + SourceIndex(0) +35>Emitted(58, 331) Source(115, 36) + SourceIndex(0) +36>Emitted(58, 332) Source(115, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(116, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(116, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(116, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(116, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(116, 17) + SourceIndex(0) +6 >Emitted(59, 25) Source(116, 25) + SourceIndex(0) +7 >Emitted(59, 26) Source(116, 26) + SourceIndex(0) +8 >Emitted(59, 27) Source(116, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(117, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(117, 2) + SourceIndex(0) +--- +>>>for ((_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(61, 1) Source(118, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(118, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(118, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(118, 6) + SourceIndex(0) +5 >Emitted(61, 7) Source(118, 6) + SourceIndex(0) +6 >Emitted(61, 28) Source(124, 20) + SourceIndex(0) +7 >Emitted(61, 30) Source(119, 5) + SourceIndex(0) +8 >Emitted(61, 44) Source(119, 27) + SourceIndex(0) +9 >Emitted(61, 46) Source(119, 5) + SourceIndex(0) +10>Emitted(61, 85) Source(119, 27) + SourceIndex(0) +11>Emitted(61, 87) Source(120, 5) + SourceIndex(0) +12>Emitted(61, 103) Source(123, 47) + SourceIndex(0) +13>Emitted(61, 105) Source(120, 5) + SourceIndex(0) +14>Emitted(61, 172) Source(123, 47) + SourceIndex(0) +15>Emitted(61, 174) Source(121, 9) + SourceIndex(0) +16>Emitted(61, 191) Source(121, 38) + SourceIndex(0) +17>Emitted(61, 193) Source(121, 9) + SourceIndex(0) +18>Emitted(61, 236) Source(121, 38) + SourceIndex(0) +19>Emitted(61, 238) Source(122, 9) + SourceIndex(0) +20>Emitted(61, 257) Source(122, 44) + SourceIndex(0) +21>Emitted(61, 259) Source(122, 9) + SourceIndex(0) +22>Emitted(61, 306) Source(122, 44) + SourceIndex(0) +23>Emitted(61, 312) Source(124, 20) + SourceIndex(0) +24>Emitted(61, 314) Source(124, 22) + SourceIndex(0) +25>Emitted(61, 315) Source(124, 23) + SourceIndex(0) +26>Emitted(61, 318) Source(124, 26) + SourceIndex(0) +27>Emitted(61, 319) Source(124, 27) + SourceIndex(0) +28>Emitted(61, 321) Source(124, 29) + SourceIndex(0) +29>Emitted(61, 322) Source(124, 30) + SourceIndex(0) +30>Emitted(61, 325) Source(124, 33) + SourceIndex(0) +31>Emitted(61, 326) Source(124, 34) + SourceIndex(0) +32>Emitted(61, 328) Source(124, 36) + SourceIndex(0) +33>Emitted(61, 329) Source(124, 37) + SourceIndex(0) +34>Emitted(61, 331) Source(124, 39) + SourceIndex(0) +35>Emitted(61, 333) Source(124, 41) + SourceIndex(0) +36>Emitted(61, 334) Source(124, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(125, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(125, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(125, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(125, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(125, 17) + SourceIndex(0) +6 >Emitted(62, 25) Source(125, 25) + SourceIndex(0) +7 >Emitted(62, 26) Source(125, 26) + SourceIndex(0) +8 >Emitted(62, 27) Source(125, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(126, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(126, 2) + SourceIndex(0) +--- +>>>for ((_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(64, 1) Source(127, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(127, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(127, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(127, 6) + SourceIndex(0) +5 >Emitted(64, 7) Source(127, 6) + SourceIndex(0) +6 >Emitted(64, 86) Source(133, 90) + SourceIndex(0) +7 >Emitted(64, 88) Source(128, 5) + SourceIndex(0) +8 >Emitted(64, 102) Source(128, 27) + SourceIndex(0) +9 >Emitted(64, 104) Source(128, 5) + SourceIndex(0) +10>Emitted(64, 143) Source(128, 27) + SourceIndex(0) +11>Emitted(64, 145) Source(129, 5) + SourceIndex(0) +12>Emitted(64, 161) Source(132, 47) + SourceIndex(0) +13>Emitted(64, 163) Source(129, 5) + SourceIndex(0) +14>Emitted(64, 230) Source(132, 47) + SourceIndex(0) +15>Emitted(64, 232) Source(130, 9) + SourceIndex(0) +16>Emitted(64, 249) Source(130, 38) + SourceIndex(0) +17>Emitted(64, 251) Source(130, 9) + SourceIndex(0) +18>Emitted(64, 294) Source(130, 38) + SourceIndex(0) +19>Emitted(64, 296) Source(131, 9) + SourceIndex(0) +20>Emitted(64, 315) Source(131, 44) + SourceIndex(0) +21>Emitted(64, 317) Source(131, 9) + SourceIndex(0) +22>Emitted(64, 364) Source(131, 44) + SourceIndex(0) +23>Emitted(64, 370) Source(133, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(65, 5) Source(134, 5) + SourceIndex(0) +2 >Emitted(65, 6) Source(134, 6) + SourceIndex(0) +3 >Emitted(65, 9) Source(134, 9) + SourceIndex(0) +4 >Emitted(65, 10) Source(134, 10) + SourceIndex(0) +5 >Emitted(65, 12) Source(134, 12) + SourceIndex(0) +6 >Emitted(65, 13) Source(134, 13) + SourceIndex(0) +7 >Emitted(65, 16) Source(134, 16) + SourceIndex(0) +8 >Emitted(65, 17) Source(134, 17) + SourceIndex(0) +9 >Emitted(65, 19) Source(134, 19) + SourceIndex(0) +10>Emitted(65, 20) Source(134, 20) + SourceIndex(0) +11>Emitted(65, 22) Source(134, 22) + SourceIndex(0) +12>Emitted(65, 24) Source(134, 24) + SourceIndex(0) +13>Emitted(65, 25) Source(134, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(66, 5) Source(135, 5) + SourceIndex(0) +2 >Emitted(66, 12) Source(135, 12) + SourceIndex(0) +3 >Emitted(66, 13) Source(135, 13) + SourceIndex(0) +4 >Emitted(66, 16) Source(135, 16) + SourceIndex(0) +5 >Emitted(66, 17) Source(135, 17) + SourceIndex(0) +6 >Emitted(66, 25) Source(135, 25) + SourceIndex(0) +7 >Emitted(66, 26) Source(135, 26) + SourceIndex(0) +8 >Emitted(66, 27) Source(135, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(67, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(67, 2) Source(136, 2) + SourceIndex(0) +--- +>>>for ((_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name = "noName" +7 > +8 > name = "noName" +9 > , +10> skill = "skill" +11> +12> skill = "skill" +13> } = +14> robot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(68, 1) Source(138, 1) + SourceIndex(0) +2 >Emitted(68, 4) Source(138, 4) + SourceIndex(0) +3 >Emitted(68, 5) Source(138, 5) + SourceIndex(0) +4 >Emitted(68, 6) Source(138, 6) + SourceIndex(0) +5 >Emitted(68, 7) Source(138, 8) + SourceIndex(0) +6 >Emitted(68, 23) Source(138, 23) + SourceIndex(0) +7 >Emitted(68, 25) Source(138, 8) + SourceIndex(0) +8 >Emitted(68, 63) Source(138, 23) + SourceIndex(0) +9 >Emitted(68, 65) Source(138, 25) + SourceIndex(0) +10>Emitted(68, 82) Source(138, 40) + SourceIndex(0) +11>Emitted(68, 84) Source(138, 25) + SourceIndex(0) +12>Emitted(68, 122) Source(138, 40) + SourceIndex(0) +13>Emitted(68, 124) Source(138, 45) + SourceIndex(0) +14>Emitted(68, 129) Source(138, 50) + SourceIndex(0) +15>Emitted(68, 130) Source(138, 50) + SourceIndex(0) +16>Emitted(68, 132) Source(138, 52) + SourceIndex(0) +17>Emitted(68, 133) Source(138, 53) + SourceIndex(0) +18>Emitted(68, 136) Source(138, 56) + SourceIndex(0) +19>Emitted(68, 137) Source(138, 57) + SourceIndex(0) +20>Emitted(68, 139) Source(138, 59) + SourceIndex(0) +21>Emitted(68, 140) Source(138, 60) + SourceIndex(0) +22>Emitted(68, 143) Source(138, 63) + SourceIndex(0) +23>Emitted(68, 144) Source(138, 64) + SourceIndex(0) +24>Emitted(68, 146) Source(138, 66) + SourceIndex(0) +25>Emitted(68, 147) Source(138, 67) + SourceIndex(0) +26>Emitted(68, 149) Source(138, 69) + SourceIndex(0) +27>Emitted(68, 151) Source(138, 71) + SourceIndex(0) +28>Emitted(68, 152) Source(138, 72) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(69, 5) Source(139, 5) + SourceIndex(0) +2 >Emitted(69, 12) Source(139, 12) + SourceIndex(0) +3 >Emitted(69, 13) Source(139, 13) + SourceIndex(0) +4 >Emitted(69, 16) Source(139, 16) + SourceIndex(0) +5 >Emitted(69, 17) Source(139, 17) + SourceIndex(0) +6 >Emitted(69, 22) Source(139, 22) + SourceIndex(0) +7 >Emitted(69, 23) Source(139, 23) + SourceIndex(0) +8 >Emitted(69, 24) Source(139, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(70, 1) Source(140, 1) + SourceIndex(0) +2 >Emitted(70, 2) Source(140, 2) + SourceIndex(0) +--- +>>>for ((_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName", skill = "skill" } = getRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , +12> skill = "skill" +13> +14> skill = "skill" +15> } = getRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(71, 1) Source(141, 1) + SourceIndex(0) +2 >Emitted(71, 4) Source(141, 4) + SourceIndex(0) +3 >Emitted(71, 5) Source(141, 5) + SourceIndex(0) +4 >Emitted(71, 6) Source(141, 6) + SourceIndex(0) +5 >Emitted(71, 7) Source(141, 6) + SourceIndex(0) +6 >Emitted(71, 23) Source(141, 55) + SourceIndex(0) +7 >Emitted(71, 25) Source(141, 8) + SourceIndex(0) +8 >Emitted(71, 39) Source(141, 23) + SourceIndex(0) +9 >Emitted(71, 41) Source(141, 8) + SourceIndex(0) +10>Emitted(71, 79) Source(141, 23) + SourceIndex(0) +11>Emitted(71, 81) Source(141, 25) + SourceIndex(0) +12>Emitted(71, 96) Source(141, 40) + SourceIndex(0) +13>Emitted(71, 98) Source(141, 25) + SourceIndex(0) +14>Emitted(71, 136) Source(141, 40) + SourceIndex(0) +15>Emitted(71, 142) Source(141, 55) + SourceIndex(0) +16>Emitted(71, 144) Source(141, 57) + SourceIndex(0) +17>Emitted(71, 145) Source(141, 58) + SourceIndex(0) +18>Emitted(71, 148) Source(141, 61) + SourceIndex(0) +19>Emitted(71, 149) Source(141, 62) + SourceIndex(0) +20>Emitted(71, 151) Source(141, 64) + SourceIndex(0) +21>Emitted(71, 152) Source(141, 65) + SourceIndex(0) +22>Emitted(71, 155) Source(141, 68) + SourceIndex(0) +23>Emitted(71, 156) Source(141, 69) + SourceIndex(0) +24>Emitted(71, 158) Source(141, 71) + SourceIndex(0) +25>Emitted(71, 159) Source(141, 72) + SourceIndex(0) +26>Emitted(71, 161) Source(141, 74) + SourceIndex(0) +27>Emitted(71, 163) Source(141, 76) + SourceIndex(0) +28>Emitted(71, 164) Source(141, 77) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(142, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(142, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(142, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(142, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(142, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(142, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(142, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(142, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(73, 1) Source(143, 1) + SourceIndex(0) +2 >Emitted(73, 2) Source(143, 2) + SourceIndex(0) +--- +>>>for ((_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , +12> skill = "skill" +13> +14> skill = "skill" +15> } = { name: "trimmer", skill: "trimming" } +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(74, 1) Source(144, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(144, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(144, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(144, 6) + SourceIndex(0) +5 >Emitted(74, 7) Source(144, 6) + SourceIndex(0) +6 >Emitted(74, 51) Source(144, 90) + SourceIndex(0) +7 >Emitted(74, 53) Source(144, 8) + SourceIndex(0) +8 >Emitted(74, 67) Source(144, 23) + SourceIndex(0) +9 >Emitted(74, 69) Source(144, 8) + SourceIndex(0) +10>Emitted(74, 107) Source(144, 23) + SourceIndex(0) +11>Emitted(74, 109) Source(144, 25) + SourceIndex(0) +12>Emitted(74, 124) Source(144, 40) + SourceIndex(0) +13>Emitted(74, 126) Source(144, 25) + SourceIndex(0) +14>Emitted(74, 164) Source(144, 40) + SourceIndex(0) +15>Emitted(74, 170) Source(144, 90) + SourceIndex(0) +16>Emitted(74, 172) Source(144, 92) + SourceIndex(0) +17>Emitted(74, 173) Source(144, 93) + SourceIndex(0) +18>Emitted(74, 176) Source(144, 96) + SourceIndex(0) +19>Emitted(74, 177) Source(144, 97) + SourceIndex(0) +20>Emitted(74, 179) Source(144, 99) + SourceIndex(0) +21>Emitted(74, 180) Source(144, 100) + SourceIndex(0) +22>Emitted(74, 183) Source(144, 103) + SourceIndex(0) +23>Emitted(74, 184) Source(144, 104) + SourceIndex(0) +24>Emitted(74, 186) Source(144, 106) + SourceIndex(0) +25>Emitted(74, 187) Source(144, 107) + SourceIndex(0) +26>Emitted(74, 189) Source(144, 109) + SourceIndex(0) +27>Emitted(74, 191) Source(144, 111) + SourceIndex(0) +28>Emitted(74, 192) Source(144, 112) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(145, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(145, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(145, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(145, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(145, 17) + SourceIndex(0) +6 >Emitted(75, 22) Source(145, 22) + SourceIndex(0) +7 >Emitted(75, 23) Source(145, 23) + SourceIndex(0) +8 >Emitted(75, 24) Source(145, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(76, 1) Source(146, 1) + SourceIndex(0) +2 >Emitted(76, 2) Source(146, 2) + SourceIndex(0) +--- +>>>for ((_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > name = "noName" +7 > +8 > name = "noName" +9 > , + > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> primary = "primary" +15> +16> primary = "primary" +17> , + > +18> secondary = "secondary" +19> +20> secondary = "secondary" +21> + > } = { primary: "none", secondary: "none" } + > } = +22> multiRobot +23> +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(77, 1) Source(147, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(147, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(147, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(147, 6) + SourceIndex(0) +5 >Emitted(77, 7) Source(148, 5) + SourceIndex(0) +6 >Emitted(77, 28) Source(148, 20) + SourceIndex(0) +7 >Emitted(77, 30) Source(148, 5) + SourceIndex(0) +8 >Emitted(77, 68) Source(148, 20) + SourceIndex(0) +9 >Emitted(77, 70) Source(149, 5) + SourceIndex(0) +10>Emitted(77, 93) Source(152, 47) + SourceIndex(0) +11>Emitted(77, 95) Source(149, 5) + SourceIndex(0) +12>Emitted(77, 162) Source(152, 47) + SourceIndex(0) +13>Emitted(77, 164) Source(150, 9) + SourceIndex(0) +14>Emitted(77, 181) Source(150, 28) + SourceIndex(0) +15>Emitted(77, 183) Source(150, 9) + SourceIndex(0) +16>Emitted(77, 225) Source(150, 28) + SourceIndex(0) +17>Emitted(77, 227) Source(151, 9) + SourceIndex(0) +18>Emitted(77, 246) Source(151, 32) + SourceIndex(0) +19>Emitted(77, 248) Source(151, 9) + SourceIndex(0) +20>Emitted(77, 294) Source(151, 32) + SourceIndex(0) +21>Emitted(77, 296) Source(153, 5) + SourceIndex(0) +22>Emitted(77, 306) Source(153, 15) + SourceIndex(0) +23>Emitted(77, 307) Source(153, 15) + SourceIndex(0) +24>Emitted(77, 309) Source(153, 17) + SourceIndex(0) +25>Emitted(77, 310) Source(153, 18) + SourceIndex(0) +26>Emitted(77, 313) Source(153, 21) + SourceIndex(0) +27>Emitted(77, 314) Source(153, 22) + SourceIndex(0) +28>Emitted(77, 316) Source(153, 24) + SourceIndex(0) +29>Emitted(77, 317) Source(153, 25) + SourceIndex(0) +30>Emitted(77, 320) Source(153, 28) + SourceIndex(0) +31>Emitted(77, 321) Source(153, 29) + SourceIndex(0) +32>Emitted(77, 323) Source(153, 31) + SourceIndex(0) +33>Emitted(77, 324) Source(153, 32) + SourceIndex(0) +34>Emitted(77, 326) Source(153, 34) + SourceIndex(0) +35>Emitted(77, 328) Source(153, 36) + SourceIndex(0) +36>Emitted(77, 329) Source(153, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(78, 5) Source(154, 5) + SourceIndex(0) +2 >Emitted(78, 12) Source(154, 12) + SourceIndex(0) +3 >Emitted(78, 13) Source(154, 13) + SourceIndex(0) +4 >Emitted(78, 16) Source(154, 16) + SourceIndex(0) +5 >Emitted(78, 17) Source(154, 17) + SourceIndex(0) +6 >Emitted(78, 25) Source(154, 25) + SourceIndex(0) +7 >Emitted(78, 26) Source(154, 26) + SourceIndex(0) +8 >Emitted(78, 27) Source(154, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(79, 1) Source(155, 1) + SourceIndex(0) +2 >Emitted(79, 2) Source(155, 2) + SourceIndex(0) +--- +>>>for ((_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , + > +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary = "primary" +17> +18> primary = "primary" +19> , + > +20> secondary = "secondary" +21> +22> secondary = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(80, 1) Source(156, 1) + SourceIndex(0) +2 >Emitted(80, 4) Source(156, 4) + SourceIndex(0) +3 >Emitted(80, 5) Source(156, 5) + SourceIndex(0) +4 >Emitted(80, 6) Source(156, 6) + SourceIndex(0) +5 >Emitted(80, 7) Source(156, 6) + SourceIndex(0) +6 >Emitted(80, 28) Source(162, 20) + SourceIndex(0) +7 >Emitted(80, 30) Source(157, 5) + SourceIndex(0) +8 >Emitted(80, 44) Source(157, 20) + SourceIndex(0) +9 >Emitted(80, 46) Source(157, 5) + SourceIndex(0) +10>Emitted(80, 84) Source(157, 20) + SourceIndex(0) +11>Emitted(80, 86) Source(158, 5) + SourceIndex(0) +12>Emitted(80, 102) Source(161, 47) + SourceIndex(0) +13>Emitted(80, 104) Source(158, 5) + SourceIndex(0) +14>Emitted(80, 171) Source(161, 47) + SourceIndex(0) +15>Emitted(80, 173) Source(159, 9) + SourceIndex(0) +16>Emitted(80, 190) Source(159, 28) + SourceIndex(0) +17>Emitted(80, 192) Source(159, 9) + SourceIndex(0) +18>Emitted(80, 234) Source(159, 28) + SourceIndex(0) +19>Emitted(80, 236) Source(160, 9) + SourceIndex(0) +20>Emitted(80, 255) Source(160, 32) + SourceIndex(0) +21>Emitted(80, 257) Source(160, 9) + SourceIndex(0) +22>Emitted(80, 303) Source(160, 32) + SourceIndex(0) +23>Emitted(80, 309) Source(162, 20) + SourceIndex(0) +24>Emitted(80, 311) Source(162, 22) + SourceIndex(0) +25>Emitted(80, 312) Source(162, 23) + SourceIndex(0) +26>Emitted(80, 315) Source(162, 26) + SourceIndex(0) +27>Emitted(80, 316) Source(162, 27) + SourceIndex(0) +28>Emitted(80, 318) Source(162, 29) + SourceIndex(0) +29>Emitted(80, 319) Source(162, 30) + SourceIndex(0) +30>Emitted(80, 322) Source(162, 33) + SourceIndex(0) +31>Emitted(80, 323) Source(162, 34) + SourceIndex(0) +32>Emitted(80, 325) Source(162, 36) + SourceIndex(0) +33>Emitted(80, 326) Source(162, 37) + SourceIndex(0) +34>Emitted(80, 328) Source(162, 39) + SourceIndex(0) +35>Emitted(80, 330) Source(162, 41) + SourceIndex(0) +36>Emitted(80, 331) Source(162, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(81, 5) Source(163, 5) + SourceIndex(0) +2 >Emitted(81, 12) Source(163, 12) + SourceIndex(0) +3 >Emitted(81, 13) Source(163, 13) + SourceIndex(0) +4 >Emitted(81, 16) Source(163, 16) + SourceIndex(0) +5 >Emitted(81, 17) Source(163, 17) + SourceIndex(0) +6 >Emitted(81, 25) Source(163, 25) + SourceIndex(0) +7 >Emitted(81, 26) Source(163, 26) + SourceIndex(0) +8 >Emitted(81, 27) Source(163, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(82, 1) Source(164, 1) + SourceIndex(0) +2 >Emitted(82, 2) Source(164, 2) + SourceIndex(0) +--- +>>>for ((_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , + > +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary = "primary" +17> +18> primary = "primary" +19> , + > +20> secondary = "secondary" +21> +22> secondary = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(83, 1) Source(165, 1) + SourceIndex(0) +2 >Emitted(83, 4) Source(165, 4) + SourceIndex(0) +3 >Emitted(83, 5) Source(165, 5) + SourceIndex(0) +4 >Emitted(83, 6) Source(165, 6) + SourceIndex(0) +5 >Emitted(83, 7) Source(165, 6) + SourceIndex(0) +6 >Emitted(83, 86) Source(171, 90) + SourceIndex(0) +7 >Emitted(83, 88) Source(166, 5) + SourceIndex(0) +8 >Emitted(83, 102) Source(166, 20) + SourceIndex(0) +9 >Emitted(83, 104) Source(166, 5) + SourceIndex(0) +10>Emitted(83, 142) Source(166, 20) + SourceIndex(0) +11>Emitted(83, 144) Source(167, 5) + SourceIndex(0) +12>Emitted(83, 160) Source(170, 47) + SourceIndex(0) +13>Emitted(83, 162) Source(167, 5) + SourceIndex(0) +14>Emitted(83, 229) Source(170, 47) + SourceIndex(0) +15>Emitted(83, 231) Source(168, 9) + SourceIndex(0) +16>Emitted(83, 248) Source(168, 28) + SourceIndex(0) +17>Emitted(83, 250) Source(168, 9) + SourceIndex(0) +18>Emitted(83, 292) Source(168, 28) + SourceIndex(0) +19>Emitted(83, 294) Source(169, 9) + SourceIndex(0) +20>Emitted(83, 313) Source(169, 32) + SourceIndex(0) +21>Emitted(83, 315) Source(169, 9) + SourceIndex(0) +22>Emitted(83, 361) Source(169, 32) + SourceIndex(0) +23>Emitted(83, 367) Source(171, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(84, 5) Source(172, 5) + SourceIndex(0) +2 >Emitted(84, 6) Source(172, 6) + SourceIndex(0) +3 >Emitted(84, 9) Source(172, 9) + SourceIndex(0) +4 >Emitted(84, 10) Source(172, 10) + SourceIndex(0) +5 >Emitted(84, 12) Source(172, 12) + SourceIndex(0) +6 >Emitted(84, 13) Source(172, 13) + SourceIndex(0) +7 >Emitted(84, 16) Source(172, 16) + SourceIndex(0) +8 >Emitted(84, 17) Source(172, 17) + SourceIndex(0) +9 >Emitted(84, 19) Source(172, 19) + SourceIndex(0) +10>Emitted(84, 20) Source(172, 20) + SourceIndex(0) +11>Emitted(84, 22) Source(172, 22) + SourceIndex(0) +12>Emitted(84, 24) Source(172, 24) + SourceIndex(0) +13>Emitted(84, 25) Source(172, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(85, 5) Source(173, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(173, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(173, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(173, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(173, 17) + SourceIndex(0) +6 >Emitted(85, 25) Source(173, 25) + SourceIndex(0) +7 >Emitted(85, 26) Source(173, 26) + SourceIndex(0) +8 >Emitted(85, 27) Source(173, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(174, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(174, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..20ccd1136c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols @@ -0,0 +1,628 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 11, 25)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 53)) + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 28, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 41)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 58)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 37, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 38, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 39, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 41, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 41, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 45, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 46, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 47, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 49, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 49, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 53, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 54, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 55, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 57, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 57, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 63, 6)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 66, 6)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 6)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 35)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 72, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 73, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 74, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 76, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 76, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 80, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 81, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 82, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 84, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 88, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 89, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 90, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 92, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 92, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 99, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 99, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 102, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 102, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 66)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 108, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 109, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 110, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 111, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 113, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 113, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 117, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 118, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 119, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 120, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 122, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 122, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 126, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 127, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 128, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 129, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 131, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 131, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 137, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 137, 23)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 140, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 140, 23)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 23)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 52)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 146, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 147, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 148, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 149, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 151, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 151, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 155, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 156, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 157, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 158, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 160, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 160, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 164, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 165, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 166, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 167, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 169, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 169, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..aa8c95bae01 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types @@ -0,0 +1,1020 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +>{name: nameA = "noName" } = robot, i = 0 : number +>{name: nameA = "noName" } = robot : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>{name: nameA = "noName" } = getRobot(), i = 0 : number +>{name: nameA = "noName" } = getRobot() : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +>{ name = "noName" } = robot, i = 0 : number +>{ name = "noName" } = robot : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +>{ name = "noName" } = getRobot(), i = 0 : number +>{ name = "noName" } = getRobot() : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName" } = { name: "trimmer", skill: "trimming" } : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = robot : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot() : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = robot, i = 0 : number +>{ name = "noName", skill = "skill" } = robot : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = getRobot(), i = 0 : number +>{ name = "noName", skill = "skill" } = getRobot() : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js new file mode 100644 index 00000000000..daf39ece7be --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js @@ -0,0 +1,207 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA] of robots) { + console.log(nameA); +} +for (let [, nameA] of getRobots()) { + console.log(nameA); +} +for (let [, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB] of robots) { + console.log(numberB); +} +for (let [numberB] of getRobots()) { + console.log(numberB); +} +for (let [numberB] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB] of multiRobots) { + console.log(nameB); +} +for (let [nameB] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i], nameA = _a[1]; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + var _d = _c[_b], nameA = _d[1]; + console.log(nameA); +} +for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { + var _g = _f[_e], nameA = _g[1]; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + var _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; + console.log(primarySkillA); +} +for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { + var _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; + console.log(primarySkillA); +} +for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { + var _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; + console.log(primarySkillA); +} +for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { + var numberB = robots_2[_u][0]; + console.log(numberB); +} +for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { + var numberB = _w[_v][0]; + console.log(numberB); +} +for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { + var numberB = _y[_x][0]; + console.log(numberB); +} +for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { + var nameB = multiRobots_2[_z][0]; + console.log(nameB); +} +for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { + var nameB = _1[_0][0]; + console.log(nameB); +} +for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { + var nameB = _3[_2][0]; + console.log(nameB); +} +for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { + var _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; + console.log(nameA2); +} +for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { + var _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; + console.log(nameA2); +} +for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { + var _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; + console.log(nameA2); +} +for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { + var _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; + console.log(nameMA); +} +for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { + var _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; + console.log(nameMA); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + var _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; + console.log(nameMA); +} +for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { + var _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); + console.log(numberA3); +} +for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { + var _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); + console.log(numberA3); +} +for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { + var _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); + console.log(numberA3); +} +for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { + var multiRobotAInfo = multiRobots_4[_31].slice(0); + console.log(multiRobotAInfo); +} +for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { + var multiRobotAInfo = _33[_32].slice(0); + console.log(multiRobotAInfo); +} +for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { + var multiRobotAInfo = _35[_34].slice(0); + console.log(multiRobotAInfo); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map new file mode 100644 index 00000000000..076b6994fa3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,qBAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,eAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAlC,eAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6C,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAxD,0BAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7D,eAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAAvE,eAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnB,6BAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxB,uBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7B,uBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAgB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtB,gCAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3B,qBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAArC,qBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAoC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA1C,qBAA+B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA/C,eAA+B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB,CAAC;IAApD,iBAA+B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAA9D,4BAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAnE,kBAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAA7E,kBAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAkC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAxC,uBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA7C,kBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlD,kBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAnC,iDAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAxC,uCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAlD,uCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..17110072800 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt @@ -0,0 +1,2661 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let [, nameA] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 16) Source(21, 29) + SourceIndex(0) +6 >Emitted(13, 18) Source(21, 23) + SourceIndex(0) +7 >Emitted(13, 35) Source(21, 29) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 23) + SourceIndex(0) +9 >Emitted(13, 57) Source(21, 29) + SourceIndex(0) +10>Emitted(13, 59) Source(21, 23) + SourceIndex(0) +11>Emitted(13, 63) Source(21, 29) + SourceIndex(0) +12>Emitted(13, 64) Source(21, 30) + SourceIndex(0) +--- +>>> var _a = robots_1[_i], nameA = _a[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(14, 5) Source(21, 6) + SourceIndex(0) +2 >Emitted(14, 26) Source(21, 19) + SourceIndex(0) +3 >Emitted(14, 28) Source(21, 13) + SourceIndex(0) +4 >Emitted(14, 41) Source(21, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(16, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [, nameA] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(24, 23) + SourceIndex(0) +5 >Emitted(17, 16) Source(24, 34) + SourceIndex(0) +6 >Emitted(17, 18) Source(24, 23) + SourceIndex(0) +7 >Emitted(17, 23) Source(24, 23) + SourceIndex(0) +8 >Emitted(17, 32) Source(24, 32) + SourceIndex(0) +9 >Emitted(17, 34) Source(24, 34) + SourceIndex(0) +10>Emitted(17, 36) Source(24, 23) + SourceIndex(0) +11>Emitted(17, 50) Source(24, 34) + SourceIndex(0) +12>Emitted(17, 52) Source(24, 23) + SourceIndex(0) +13>Emitted(17, 56) Source(24, 34) + SourceIndex(0) +14>Emitted(17, 57) Source(24, 35) + SourceIndex(0) +--- +>>> var _d = _c[_b], nameA = _d[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(18, 5) Source(24, 6) + SourceIndex(0) +2 >Emitted(18, 20) Source(24, 19) + SourceIndex(0) +3 >Emitted(18, 22) Source(24, 13) + SourceIndex(0) +4 >Emitted(18, 35) Source(24, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [, nameA] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(27, 23) + SourceIndex(0) +5 >Emitted(21, 16) Source(27, 39) + SourceIndex(0) +6 >Emitted(21, 18) Source(27, 23) + SourceIndex(0) +7 >Emitted(21, 24) Source(27, 24) + SourceIndex(0) +8 >Emitted(21, 30) Source(27, 30) + SourceIndex(0) +9 >Emitted(21, 32) Source(27, 32) + SourceIndex(0) +10>Emitted(21, 38) Source(27, 38) + SourceIndex(0) +11>Emitted(21, 39) Source(27, 39) + SourceIndex(0) +12>Emitted(21, 41) Source(27, 23) + SourceIndex(0) +13>Emitted(21, 55) Source(27, 39) + SourceIndex(0) +14>Emitted(21, 57) Source(27, 23) + SourceIndex(0) +15>Emitted(21, 61) Source(27, 39) + SourceIndex(0) +16>Emitted(21, 62) Source(27, 40) + SourceIndex(0) +--- +>>> var _g = _f[_e], nameA = _g[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(22, 5) Source(27, 6) + SourceIndex(0) +2 >Emitted(22, 20) Source(27, 19) + SourceIndex(0) +3 >Emitted(22, 22) Source(27, 13) + SourceIndex(0) +4 >Emitted(22, 35) Source(27, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(30, 50) + SourceIndex(0) +5 >Emitted(25, 16) Source(30, 61) + SourceIndex(0) +6 >Emitted(25, 18) Source(30, 50) + SourceIndex(0) +7 >Emitted(25, 45) Source(30, 61) + SourceIndex(0) +8 >Emitted(25, 47) Source(30, 50) + SourceIndex(0) +9 >Emitted(25, 72) Source(30, 61) + SourceIndex(0) +10>Emitted(25, 74) Source(30, 50) + SourceIndex(0) +11>Emitted(25, 78) Source(30, 61) + SourceIndex(0) +12>Emitted(25, 79) Source(30, 62) + SourceIndex(0) +--- +>>> var _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(26, 5) Source(30, 6) + SourceIndex(0) +2 >Emitted(26, 31) Source(30, 46) + SourceIndex(0) +3 >Emitted(26, 33) Source(30, 13) + SourceIndex(0) +4 >Emitted(26, 43) Source(30, 45) + SourceIndex(0) +5 >Emitted(26, 45) Source(30, 14) + SourceIndex(0) +6 >Emitted(26, 66) Source(30, 27) + SourceIndex(0) +7 >Emitted(26, 68) Source(30, 29) + SourceIndex(0) +8 >Emitted(26, 91) Source(30, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(27, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(27, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(27, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(29, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(33, 50) + SourceIndex(0) +5 >Emitted(29, 16) Source(33, 66) + SourceIndex(0) +6 >Emitted(29, 18) Source(33, 50) + SourceIndex(0) +7 >Emitted(29, 23) Source(33, 50) + SourceIndex(0) +8 >Emitted(29, 37) Source(33, 64) + SourceIndex(0) +9 >Emitted(29, 39) Source(33, 66) + SourceIndex(0) +10>Emitted(29, 41) Source(33, 50) + SourceIndex(0) +11>Emitted(29, 55) Source(33, 66) + SourceIndex(0) +12>Emitted(29, 57) Source(33, 50) + SourceIndex(0) +13>Emitted(29, 61) Source(33, 66) + SourceIndex(0) +14>Emitted(29, 62) Source(33, 67) + SourceIndex(0) +--- +>>> var _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(30, 5) Source(33, 6) + SourceIndex(0) +2 >Emitted(30, 20) Source(33, 46) + SourceIndex(0) +3 >Emitted(30, 22) Source(33, 13) + SourceIndex(0) +4 >Emitted(30, 32) Source(33, 45) + SourceIndex(0) +5 >Emitted(30, 34) Source(33, 14) + SourceIndex(0) +6 >Emitted(30, 55) Source(33, 27) + SourceIndex(0) +7 >Emitted(30, 57) Source(33, 29) + SourceIndex(0) +8 >Emitted(30, 80) Source(33, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(33, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(36, 50) + SourceIndex(0) +5 >Emitted(33, 16) Source(36, 76) + SourceIndex(0) +6 >Emitted(33, 18) Source(36, 50) + SourceIndex(0) +7 >Emitted(33, 24) Source(36, 51) + SourceIndex(0) +8 >Emitted(33, 35) Source(36, 62) + SourceIndex(0) +9 >Emitted(33, 37) Source(36, 64) + SourceIndex(0) +10>Emitted(33, 48) Source(36, 75) + SourceIndex(0) +11>Emitted(33, 49) Source(36, 76) + SourceIndex(0) +12>Emitted(33, 51) Source(36, 50) + SourceIndex(0) +13>Emitted(33, 65) Source(36, 76) + SourceIndex(0) +14>Emitted(33, 67) Source(36, 50) + SourceIndex(0) +15>Emitted(33, 71) Source(36, 76) + SourceIndex(0) +16>Emitted(33, 72) Source(36, 77) + SourceIndex(0) +--- +>>> var _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(34, 5) Source(36, 6) + SourceIndex(0) +2 >Emitted(34, 20) Source(36, 46) + SourceIndex(0) +3 >Emitted(34, 22) Source(36, 13) + SourceIndex(0) +4 >Emitted(34, 32) Source(36, 45) + SourceIndex(0) +5 >Emitted(34, 34) Source(36, 14) + SourceIndex(0) +6 >Emitted(34, 55) Source(36, 27) + SourceIndex(0) +7 >Emitted(34, 57) Source(36, 29) + SourceIndex(0) +8 >Emitted(34, 80) Source(36, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let [numberB] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(40, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(40, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(40, 23) + SourceIndex(0) +5 >Emitted(37, 16) Source(40, 29) + SourceIndex(0) +6 >Emitted(37, 18) Source(40, 23) + SourceIndex(0) +7 >Emitted(37, 35) Source(40, 29) + SourceIndex(0) +8 >Emitted(37, 37) Source(40, 23) + SourceIndex(0) +9 >Emitted(37, 57) Source(40, 29) + SourceIndex(0) +10>Emitted(37, 59) Source(40, 23) + SourceIndex(0) +11>Emitted(37, 63) Source(40, 29) + SourceIndex(0) +12>Emitted(37, 64) Source(40, 30) + SourceIndex(0) +--- +>>> var numberB = robots_2[_u][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(38, 5) Source(40, 11) + SourceIndex(0) +2 >Emitted(38, 34) Source(40, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(39, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(39, 24) Source(41, 24) + SourceIndex(0) +7 >Emitted(39, 25) Source(41, 25) + SourceIndex(0) +8 >Emitted(39, 26) Source(41, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [numberB] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(43, 23) + SourceIndex(0) +5 >Emitted(41, 16) Source(43, 34) + SourceIndex(0) +6 >Emitted(41, 18) Source(43, 23) + SourceIndex(0) +7 >Emitted(41, 23) Source(43, 23) + SourceIndex(0) +8 >Emitted(41, 32) Source(43, 32) + SourceIndex(0) +9 >Emitted(41, 34) Source(43, 34) + SourceIndex(0) +10>Emitted(41, 36) Source(43, 23) + SourceIndex(0) +11>Emitted(41, 50) Source(43, 34) + SourceIndex(0) +12>Emitted(41, 52) Source(43, 23) + SourceIndex(0) +13>Emitted(41, 56) Source(43, 34) + SourceIndex(0) +14>Emitted(41, 57) Source(43, 35) + SourceIndex(0) +--- +>>> var numberB = _w[_v][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(42, 5) Source(43, 11) + SourceIndex(0) +2 >Emitted(42, 28) Source(43, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [numberB] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(45, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(46, 23) + SourceIndex(0) +5 >Emitted(45, 16) Source(46, 39) + SourceIndex(0) +6 >Emitted(45, 18) Source(46, 23) + SourceIndex(0) +7 >Emitted(45, 24) Source(46, 24) + SourceIndex(0) +8 >Emitted(45, 30) Source(46, 30) + SourceIndex(0) +9 >Emitted(45, 32) Source(46, 32) + SourceIndex(0) +10>Emitted(45, 38) Source(46, 38) + SourceIndex(0) +11>Emitted(45, 39) Source(46, 39) + SourceIndex(0) +12>Emitted(45, 41) Source(46, 23) + SourceIndex(0) +13>Emitted(45, 55) Source(46, 39) + SourceIndex(0) +14>Emitted(45, 57) Source(46, 23) + SourceIndex(0) +15>Emitted(45, 61) Source(46, 39) + SourceIndex(0) +16>Emitted(45, 62) Source(46, 40) + SourceIndex(0) +--- +>>> var numberB = _y[_x][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(46, 5) Source(46, 11) + SourceIndex(0) +2 >Emitted(46, 28) Source(46, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(49, 21) + SourceIndex(0) +5 >Emitted(49, 16) Source(49, 32) + SourceIndex(0) +6 >Emitted(49, 18) Source(49, 21) + SourceIndex(0) +7 >Emitted(49, 45) Source(49, 32) + SourceIndex(0) +8 >Emitted(49, 47) Source(49, 21) + SourceIndex(0) +9 >Emitted(49, 72) Source(49, 32) + SourceIndex(0) +10>Emitted(49, 74) Source(49, 21) + SourceIndex(0) +11>Emitted(49, 78) Source(49, 32) + SourceIndex(0) +12>Emitted(49, 79) Source(49, 33) + SourceIndex(0) +--- +>>> var nameB = multiRobots_2[_z][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(50, 5) Source(49, 11) + SourceIndex(0) +2 >Emitted(50, 37) Source(49, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(51, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(51, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(51, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(52, 21) + SourceIndex(0) +5 >Emitted(53, 16) Source(52, 37) + SourceIndex(0) +6 >Emitted(53, 18) Source(52, 21) + SourceIndex(0) +7 >Emitted(53, 23) Source(52, 21) + SourceIndex(0) +8 >Emitted(53, 37) Source(52, 35) + SourceIndex(0) +9 >Emitted(53, 39) Source(52, 37) + SourceIndex(0) +10>Emitted(53, 41) Source(52, 21) + SourceIndex(0) +11>Emitted(53, 55) Source(52, 37) + SourceIndex(0) +12>Emitted(53, 57) Source(52, 21) + SourceIndex(0) +13>Emitted(53, 61) Source(52, 37) + SourceIndex(0) +14>Emitted(53, 62) Source(52, 38) + SourceIndex(0) +--- +>>> var nameB = _1[_0][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(54, 5) Source(52, 11) + SourceIndex(0) +2 >Emitted(54, 26) Source(52, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(57, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(55, 21) + SourceIndex(0) +5 >Emitted(57, 16) Source(55, 47) + SourceIndex(0) +6 >Emitted(57, 18) Source(55, 21) + SourceIndex(0) +7 >Emitted(57, 24) Source(55, 22) + SourceIndex(0) +8 >Emitted(57, 35) Source(55, 33) + SourceIndex(0) +9 >Emitted(57, 37) Source(55, 35) + SourceIndex(0) +10>Emitted(57, 48) Source(55, 46) + SourceIndex(0) +11>Emitted(57, 49) Source(55, 47) + SourceIndex(0) +12>Emitted(57, 51) Source(55, 21) + SourceIndex(0) +13>Emitted(57, 65) Source(55, 47) + SourceIndex(0) +14>Emitted(57, 67) Source(55, 21) + SourceIndex(0) +15>Emitted(57, 71) Source(55, 47) + SourceIndex(0) +16>Emitted(57, 72) Source(55, 48) + SourceIndex(0) +--- +>>> var nameB = _3[_2][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(58, 5) Source(55, 11) + SourceIndex(0) +2 >Emitted(58, 26) Source(55, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(61, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(59, 41) + SourceIndex(0) +5 >Emitted(61, 16) Source(59, 47) + SourceIndex(0) +6 >Emitted(61, 18) Source(59, 41) + SourceIndex(0) +7 >Emitted(61, 35) Source(59, 47) + SourceIndex(0) +8 >Emitted(61, 37) Source(59, 41) + SourceIndex(0) +9 >Emitted(61, 57) Source(59, 47) + SourceIndex(0) +10>Emitted(61, 59) Source(59, 41) + SourceIndex(0) +11>Emitted(61, 63) Source(59, 47) + SourceIndex(0) +12>Emitted(61, 64) Source(59, 48) + SourceIndex(0) +--- +>>> var _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(62, 5) Source(59, 6) + SourceIndex(0) +2 >Emitted(62, 26) Source(59, 37) + SourceIndex(0) +3 >Emitted(62, 28) Source(59, 11) + SourceIndex(0) +4 >Emitted(62, 44) Source(59, 19) + SourceIndex(0) +5 >Emitted(62, 46) Source(59, 21) + SourceIndex(0) +6 >Emitted(62, 60) Source(59, 27) + SourceIndex(0) +7 >Emitted(62, 62) Source(59, 29) + SourceIndex(0) +8 >Emitted(62, 77) Source(59, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(63, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(63, 23) Source(60, 23) + SourceIndex(0) +7 >Emitted(63, 24) Source(60, 24) + SourceIndex(0) +8 >Emitted(63, 25) Source(60, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(65, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(62, 41) + SourceIndex(0) +5 >Emitted(65, 16) Source(62, 52) + SourceIndex(0) +6 >Emitted(65, 18) Source(62, 41) + SourceIndex(0) +7 >Emitted(65, 23) Source(62, 41) + SourceIndex(0) +8 >Emitted(65, 32) Source(62, 50) + SourceIndex(0) +9 >Emitted(65, 34) Source(62, 52) + SourceIndex(0) +10>Emitted(65, 36) Source(62, 41) + SourceIndex(0) +11>Emitted(65, 50) Source(62, 52) + SourceIndex(0) +12>Emitted(65, 52) Source(62, 41) + SourceIndex(0) +13>Emitted(65, 56) Source(62, 52) + SourceIndex(0) +14>Emitted(65, 57) Source(62, 53) + SourceIndex(0) +--- +>>> var _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(66, 5) Source(62, 6) + SourceIndex(0) +2 >Emitted(66, 20) Source(62, 37) + SourceIndex(0) +3 >Emitted(66, 22) Source(62, 11) + SourceIndex(0) +4 >Emitted(66, 38) Source(62, 19) + SourceIndex(0) +5 >Emitted(66, 40) Source(62, 21) + SourceIndex(0) +6 >Emitted(66, 54) Source(62, 27) + SourceIndex(0) +7 >Emitted(66, 56) Source(62, 29) + SourceIndex(0) +8 >Emitted(66, 71) Source(62, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(69, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(65, 41) + SourceIndex(0) +5 >Emitted(69, 16) Source(65, 57) + SourceIndex(0) +6 >Emitted(69, 18) Source(65, 41) + SourceIndex(0) +7 >Emitted(69, 25) Source(65, 42) + SourceIndex(0) +8 >Emitted(69, 31) Source(65, 48) + SourceIndex(0) +9 >Emitted(69, 33) Source(65, 50) + SourceIndex(0) +10>Emitted(69, 39) Source(65, 56) + SourceIndex(0) +11>Emitted(69, 40) Source(65, 57) + SourceIndex(0) +12>Emitted(69, 42) Source(65, 41) + SourceIndex(0) +13>Emitted(69, 57) Source(65, 57) + SourceIndex(0) +14>Emitted(69, 59) Source(65, 41) + SourceIndex(0) +15>Emitted(69, 63) Source(65, 57) + SourceIndex(0) +16>Emitted(69, 64) Source(65, 58) + SourceIndex(0) +--- +>>> var _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(70, 5) Source(65, 6) + SourceIndex(0) +2 >Emitted(70, 22) Source(65, 37) + SourceIndex(0) +3 >Emitted(70, 24) Source(65, 11) + SourceIndex(0) +4 >Emitted(70, 41) Source(65, 19) + SourceIndex(0) +5 >Emitted(70, 43) Source(65, 21) + SourceIndex(0) +6 >Emitted(70, 58) Source(65, 27) + SourceIndex(0) +7 >Emitted(70, 60) Source(65, 29) + SourceIndex(0) +8 >Emitted(70, 76) Source(65, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(73, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(68, 56) + SourceIndex(0) +5 >Emitted(73, 17) Source(68, 67) + SourceIndex(0) +6 >Emitted(73, 19) Source(68, 56) + SourceIndex(0) +7 >Emitted(73, 46) Source(68, 67) + SourceIndex(0) +8 >Emitted(73, 48) Source(68, 56) + SourceIndex(0) +9 >Emitted(73, 74) Source(68, 67) + SourceIndex(0) +10>Emitted(73, 76) Source(68, 56) + SourceIndex(0) +11>Emitted(73, 81) Source(68, 67) + SourceIndex(0) +12>Emitted(73, 82) Source(68, 68) + SourceIndex(0) +--- +>>> var _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(74, 5) Source(68, 6) + SourceIndex(0) +2 >Emitted(74, 33) Source(68, 52) + SourceIndex(0) +3 >Emitted(74, 35) Source(68, 11) + SourceIndex(0) +4 >Emitted(74, 50) Source(68, 17) + SourceIndex(0) +5 >Emitted(74, 52) Source(68, 19) + SourceIndex(0) +6 >Emitted(74, 64) Source(68, 51) + SourceIndex(0) +7 >Emitted(74, 66) Source(68, 20) + SourceIndex(0) +8 >Emitted(74, 88) Source(68, 33) + SourceIndex(0) +9 >Emitted(74, 90) Source(68, 35) + SourceIndex(0) +10>Emitted(74, 114) Source(68, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(77, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(71, 56) + SourceIndex(0) +5 >Emitted(77, 17) Source(71, 72) + SourceIndex(0) +6 >Emitted(77, 19) Source(71, 56) + SourceIndex(0) +7 >Emitted(77, 25) Source(71, 56) + SourceIndex(0) +8 >Emitted(77, 39) Source(71, 70) + SourceIndex(0) +9 >Emitted(77, 41) Source(71, 72) + SourceIndex(0) +10>Emitted(77, 43) Source(71, 56) + SourceIndex(0) +11>Emitted(77, 59) Source(71, 72) + SourceIndex(0) +12>Emitted(77, 61) Source(71, 56) + SourceIndex(0) +13>Emitted(77, 66) Source(71, 72) + SourceIndex(0) +14>Emitted(77, 67) Source(71, 73) + SourceIndex(0) +--- +>>> var _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(78, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(78, 23) Source(71, 52) + SourceIndex(0) +3 >Emitted(78, 25) Source(71, 11) + SourceIndex(0) +4 >Emitted(78, 40) Source(71, 17) + SourceIndex(0) +5 >Emitted(78, 42) Source(71, 19) + SourceIndex(0) +6 >Emitted(78, 54) Source(71, 51) + SourceIndex(0) +7 >Emitted(78, 56) Source(71, 20) + SourceIndex(0) +8 >Emitted(78, 78) Source(71, 33) + SourceIndex(0) +9 >Emitted(78, 80) Source(71, 35) + SourceIndex(0) +10>Emitted(78, 104) Source(71, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(81, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(74, 56) + SourceIndex(0) +5 >Emitted(81, 17) Source(74, 82) + SourceIndex(0) +6 >Emitted(81, 19) Source(74, 56) + SourceIndex(0) +7 >Emitted(81, 26) Source(74, 57) + SourceIndex(0) +8 >Emitted(81, 37) Source(74, 68) + SourceIndex(0) +9 >Emitted(81, 39) Source(74, 70) + SourceIndex(0) +10>Emitted(81, 50) Source(74, 81) + SourceIndex(0) +11>Emitted(81, 51) Source(74, 82) + SourceIndex(0) +12>Emitted(81, 53) Source(74, 56) + SourceIndex(0) +13>Emitted(81, 69) Source(74, 82) + SourceIndex(0) +14>Emitted(81, 71) Source(74, 56) + SourceIndex(0) +15>Emitted(81, 76) Source(74, 82) + SourceIndex(0) +16>Emitted(81, 77) Source(74, 83) + SourceIndex(0) +--- +>>> var _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(82, 5) Source(74, 6) + SourceIndex(0) +2 >Emitted(82, 23) Source(74, 52) + SourceIndex(0) +3 >Emitted(82, 25) Source(74, 11) + SourceIndex(0) +4 >Emitted(82, 40) Source(74, 17) + SourceIndex(0) +5 >Emitted(82, 42) Source(74, 19) + SourceIndex(0) +6 >Emitted(82, 54) Source(74, 51) + SourceIndex(0) +7 >Emitted(82, 56) Source(74, 20) + SourceIndex(0) +8 >Emitted(82, 78) Source(74, 33) + SourceIndex(0) +9 >Emitted(82, 80) Source(74, 35) + SourceIndex(0) +10>Emitted(82, 104) Source(74, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(85, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(78, 39) + SourceIndex(0) +5 >Emitted(85, 17) Source(78, 45) + SourceIndex(0) +6 >Emitted(85, 19) Source(78, 39) + SourceIndex(0) +7 >Emitted(85, 36) Source(78, 45) + SourceIndex(0) +8 >Emitted(85, 38) Source(78, 39) + SourceIndex(0) +9 >Emitted(85, 59) Source(78, 45) + SourceIndex(0) +10>Emitted(85, 61) Source(78, 39) + SourceIndex(0) +11>Emitted(85, 66) Source(78, 45) + SourceIndex(0) +12>Emitted(85, 67) Source(78, 46) + SourceIndex(0) +--- +>>> var _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(86, 5) Source(78, 6) + SourceIndex(0) +2 >Emitted(86, 28) Source(78, 35) + SourceIndex(0) +3 >Emitted(86, 30) Source(78, 11) + SourceIndex(0) +4 >Emitted(86, 47) Source(78, 19) + SourceIndex(0) +5 >Emitted(86, 49) Source(78, 21) + SourceIndex(0) +6 >Emitted(86, 74) Source(78, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(87, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(87, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(87, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(87, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(89, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(81, 39) + SourceIndex(0) +5 >Emitted(89, 17) Source(81, 50) + SourceIndex(0) +6 >Emitted(89, 19) Source(81, 39) + SourceIndex(0) +7 >Emitted(89, 25) Source(81, 39) + SourceIndex(0) +8 >Emitted(89, 34) Source(81, 48) + SourceIndex(0) +9 >Emitted(89, 36) Source(81, 50) + SourceIndex(0) +10>Emitted(89, 38) Source(81, 39) + SourceIndex(0) +11>Emitted(89, 54) Source(81, 50) + SourceIndex(0) +12>Emitted(89, 56) Source(81, 39) + SourceIndex(0) +13>Emitted(89, 61) Source(81, 50) + SourceIndex(0) +14>Emitted(89, 62) Source(81, 51) + SourceIndex(0) +--- +>>> var _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(90, 5) Source(81, 6) + SourceIndex(0) +2 >Emitted(90, 23) Source(81, 35) + SourceIndex(0) +3 >Emitted(90, 25) Source(81, 11) + SourceIndex(0) +4 >Emitted(90, 42) Source(81, 19) + SourceIndex(0) +5 >Emitted(90, 44) Source(81, 21) + SourceIndex(0) +6 >Emitted(90, 69) Source(81, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(93, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(84, 39) + SourceIndex(0) +5 >Emitted(93, 17) Source(84, 55) + SourceIndex(0) +6 >Emitted(93, 19) Source(84, 39) + SourceIndex(0) +7 >Emitted(93, 26) Source(84, 40) + SourceIndex(0) +8 >Emitted(93, 32) Source(84, 46) + SourceIndex(0) +9 >Emitted(93, 34) Source(84, 48) + SourceIndex(0) +10>Emitted(93, 40) Source(84, 54) + SourceIndex(0) +11>Emitted(93, 41) Source(84, 55) + SourceIndex(0) +12>Emitted(93, 43) Source(84, 39) + SourceIndex(0) +13>Emitted(93, 59) Source(84, 55) + SourceIndex(0) +14>Emitted(93, 61) Source(84, 39) + SourceIndex(0) +15>Emitted(93, 66) Source(84, 55) + SourceIndex(0) +16>Emitted(93, 67) Source(84, 56) + SourceIndex(0) +--- +>>> var _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(94, 5) Source(84, 6) + SourceIndex(0) +2 >Emitted(94, 23) Source(84, 35) + SourceIndex(0) +3 >Emitted(94, 25) Source(84, 11) + SourceIndex(0) +4 >Emitted(94, 42) Source(84, 19) + SourceIndex(0) +5 >Emitted(94, 44) Source(84, 21) + SourceIndex(0) +6 >Emitted(94, 69) Source(84, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(85, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(85, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(85, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(97, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(87, 34) + SourceIndex(0) +5 >Emitted(97, 17) Source(87, 45) + SourceIndex(0) +6 >Emitted(97, 19) Source(87, 34) + SourceIndex(0) +7 >Emitted(97, 46) Source(87, 45) + SourceIndex(0) +8 >Emitted(97, 48) Source(87, 34) + SourceIndex(0) +9 >Emitted(97, 74) Source(87, 45) + SourceIndex(0) +10>Emitted(97, 76) Source(87, 34) + SourceIndex(0) +11>Emitted(97, 81) Source(87, 45) + SourceIndex(0) +12>Emitted(97, 82) Source(87, 46) + SourceIndex(0) +--- +>>> var multiRobotAInfo = multiRobots_4[_31].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(98, 5) Source(87, 11) + SourceIndex(0) +2 >Emitted(98, 54) Source(87, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(99, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(99, 32) Source(88, 32) + SourceIndex(0) +7 >Emitted(99, 33) Source(88, 33) + SourceIndex(0) +8 >Emitted(99, 34) Source(88, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(101, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(101, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(101, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(101, 6) Source(90, 34) + SourceIndex(0) +5 >Emitted(101, 17) Source(90, 50) + SourceIndex(0) +6 >Emitted(101, 19) Source(90, 34) + SourceIndex(0) +7 >Emitted(101, 25) Source(90, 34) + SourceIndex(0) +8 >Emitted(101, 39) Source(90, 48) + SourceIndex(0) +9 >Emitted(101, 41) Source(90, 50) + SourceIndex(0) +10>Emitted(101, 43) Source(90, 34) + SourceIndex(0) +11>Emitted(101, 59) Source(90, 50) + SourceIndex(0) +12>Emitted(101, 61) Source(90, 34) + SourceIndex(0) +13>Emitted(101, 66) Source(90, 50) + SourceIndex(0) +14>Emitted(101, 67) Source(90, 51) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _33[_32].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(102, 5) Source(90, 11) + SourceIndex(0) +2 >Emitted(102, 44) Source(90, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(103, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(103, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(103, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(103, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(103, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(103, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(103, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(103, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(104, 2) Source(92, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(105, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(105, 4) Source(93, 4) + SourceIndex(0) +3 >Emitted(105, 5) Source(93, 5) + SourceIndex(0) +4 >Emitted(105, 6) Source(93, 34) + SourceIndex(0) +5 >Emitted(105, 17) Source(93, 60) + SourceIndex(0) +6 >Emitted(105, 19) Source(93, 34) + SourceIndex(0) +7 >Emitted(105, 26) Source(93, 35) + SourceIndex(0) +8 >Emitted(105, 37) Source(93, 46) + SourceIndex(0) +9 >Emitted(105, 39) Source(93, 48) + SourceIndex(0) +10>Emitted(105, 50) Source(93, 59) + SourceIndex(0) +11>Emitted(105, 51) Source(93, 60) + SourceIndex(0) +12>Emitted(105, 53) Source(93, 34) + SourceIndex(0) +13>Emitted(105, 69) Source(93, 60) + SourceIndex(0) +14>Emitted(105, 71) Source(93, 34) + SourceIndex(0) +15>Emitted(105, 76) Source(93, 60) + SourceIndex(0) +16>Emitted(105, 77) Source(93, 61) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _35[_34].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(106, 5) Source(93, 11) + SourceIndex(0) +2 >Emitted(106, 44) Source(93, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(107, 5) Source(94, 5) + SourceIndex(0) +2 >Emitted(107, 12) Source(94, 12) + SourceIndex(0) +3 >Emitted(107, 13) Source(94, 13) + SourceIndex(0) +4 >Emitted(107, 16) Source(94, 16) + SourceIndex(0) +5 >Emitted(107, 17) Source(94, 17) + SourceIndex(0) +6 >Emitted(107, 32) Source(94, 32) + SourceIndex(0) +7 >Emitted(107, 33) Source(94, 33) + SourceIndex(0) +8 >Emitted(107, 34) Source(94, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(108, 2) Source(95, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols new file mode 100644 index 00000000000..7d4412805e0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols @@ -0,0 +1,323 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) +} + +for (let [, nameA] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 20, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 20, 11)) +} +for (let [, nameA] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 23, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 23, 11)) +} +for (let [, nameA] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 26, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 26, 11)) +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 27)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 27)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 27)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 13)) +} + +for (let [numberB] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 39, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 39, 10)) +} +for (let [numberB] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 42, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 42, 10)) +} +for (let [numberB] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 45, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 45, 10)) +} +for (let [nameB] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 48, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 48, 10)) +} +for (let [nameB] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 51, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 51, 10)) +} +for (let [nameB] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 54, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 54, 10)) +} + +for (let [numberA2, nameA2, skillA2] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 27)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 19)) +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 27)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 19)) +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 27)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 19)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 33)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 33)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 33)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 10)) +} + +for (let [numberA3, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 19)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 10)) +} +for (let [numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 19)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 10)) +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 10)) +} +for (let [...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 86, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 86, 10)) +} +for (let [...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 89, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 89, 10)) +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 92, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 92, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types new file mode 100644 index 00000000000..95c947f8fcc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types @@ -0,0 +1,389 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +for (let [, nameA] of robots) { +> : undefined +>nameA : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] of getRobots()) { +> : undefined +>nameA : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] of [robotA, robotB]) { +> : undefined +>nameA : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB] of robots) { +>numberB : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] of getRobots()) { +>numberB : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] of [robotA, robotB]) { +>numberB : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB] of multiRobots) { +>nameB : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] of getMultiRobots()) { +>nameB : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] of [multiRobotA, multiRobotB]) { +>nameB : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2, nameA2, skillA2] of robots) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3, ...robotAInfo] of robots) { +>numberA3 : number +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : number +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : number +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : (string | [string, string])[] +>multiRobots : [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : (string | [string, string])[] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js new file mode 100644 index 00000000000..8b21faf3ad9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js @@ -0,0 +1,217 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA] of robots) { + console.log(nameA); +} +for ([, nameA] of getRobots()) { + console.log(nameA); +} +for ([, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB] of robots) { + console.log(numberB); +} +for ([numberB] of getRobots()) { + console.log(numberB); +} +for ([numberB] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB] of multiRobots) { + console.log(nameB); +} +for ([nameB] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for ([...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i], nameA = _a[1]; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + _d = _c[_b], nameA = _d[1]; + console.log(nameA); +} +for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { + _g = _f[_e], nameA = _g[1]; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; + console.log(primarySkillA); +} +for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { + _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; + console.log(primarySkillA); +} +for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { + _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; + console.log(primarySkillA); +} +for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { + numberB = robots_2[_u][0]; + console.log(numberB); +} +for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { + numberB = _w[_v][0]; + console.log(numberB); +} +for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { + numberB = _y[_x][0]; + console.log(numberB); +} +for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { + nameB = multiRobots_2[_z][0]; + console.log(nameB); +} +for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { + nameB = _1[_0][0]; + console.log(nameB); +} +for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { + nameB = _3[_2][0]; + console.log(nameB); +} +for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { + _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; + console.log(nameA2); +} +for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { + _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; + console.log(nameA2); +} +for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { + _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; + console.log(nameA2); +} +for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { + _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; + console.log(nameMA); +} +for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { + _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; + console.log(nameMA); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; + console.log(nameMA); +} +for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { + _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); + console.log(numberA3); +} +for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { + _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); + console.log(numberA3); +} +for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { + _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); + console.log(numberA3); +} +for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { + multiRobotAInfo = multiRobots_4[_31].slice(0); + console.log(multiRobotAInfo); +} +for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { + multiRobotAInfo = _33[_32].slice(0); + console.log(multiRobotAInfo); +} +for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { + multiRobotAInfo = _35[_34].slice(0); + console.log(multiRobotAInfo); +} +var _a, _d, _g, _j, _k, _o, _p, _s, _t, _5, _8, _11, _13, _14, _17, _18, _21, _22, _24, _27, _30; +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map new file mode 100644 index 00000000000..cae221df0f2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAApB,iBAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAzB,WAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA9B,WAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAApD,sBAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAzD,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAAnE,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnB,yBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxB,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7B,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtB,4BAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3B,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAArC,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAgC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAtC,iBAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA3C,WAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB,CAAC;IAAhD,aAA2B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAA1D,wBAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA/D,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAzE,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAA8B,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAApC,mBAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAzC,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA9C,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAnC,6CAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAxC,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAlD,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..72970488233 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,2777 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 18) + SourceIndex(0) +4 >Emitted(13, 12) Source(21, 20) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 43) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 66) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 12) Source(22, 20) + SourceIndex(0) +4 >Emitted(14, 14) Source(22, 22) + SourceIndex(0) +5 >Emitted(14, 19) Source(22, 35) + SourceIndex(0) +6 >Emitted(14, 20) Source(22, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 13) Source(23, 21) + SourceIndex(0) +4 >Emitted(15, 15) Source(23, 23) + SourceIndex(0) +5 >Emitted(15, 21) Source(23, 37) + SourceIndex(0) +6 >Emitted(15, 23) Source(23, 39) + SourceIndex(0) +7 >Emitted(15, 30) Source(23, 54) + SourceIndex(0) +8 >Emitted(15, 32) Source(23, 56) + SourceIndex(0) +9 >Emitted(15, 38) Source(23, 70) + SourceIndex(0) +10>Emitted(15, 39) Source(23, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(16, 13) Source(24, 21) + SourceIndex(0) +4 >Emitted(16, 15) Source(24, 23) + SourceIndex(0) +5 >Emitted(16, 25) Source(24, 54) + SourceIndex(0) +6 >Emitted(16, 27) Source(24, 56) + SourceIndex(0) +7 >Emitted(16, 42) Source(24, 102) + SourceIndex(0) +8 >Emitted(16, 43) Source(24, 103) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([, nameA] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(26, 19) + SourceIndex(0) +5 >Emitted(17, 16) Source(26, 25) + SourceIndex(0) +6 >Emitted(17, 18) Source(26, 19) + SourceIndex(0) +7 >Emitted(17, 35) Source(26, 25) + SourceIndex(0) +8 >Emitted(17, 37) Source(26, 19) + SourceIndex(0) +9 >Emitted(17, 57) Source(26, 25) + SourceIndex(0) +10>Emitted(17, 59) Source(26, 19) + SourceIndex(0) +11>Emitted(17, 63) Source(26, 25) + SourceIndex(0) +12>Emitted(17, 64) Source(26, 26) + SourceIndex(0) +--- +>>> _a = robots_1[_i], nameA = _a[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(18, 5) Source(26, 6) + SourceIndex(0) +2 >Emitted(18, 22) Source(26, 15) + SourceIndex(0) +3 >Emitted(18, 24) Source(26, 9) + SourceIndex(0) +4 >Emitted(18, 37) Source(26, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([, nameA] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(29, 19) + SourceIndex(0) +5 >Emitted(21, 16) Source(29, 30) + SourceIndex(0) +6 >Emitted(21, 18) Source(29, 19) + SourceIndex(0) +7 >Emitted(21, 23) Source(29, 19) + SourceIndex(0) +8 >Emitted(21, 32) Source(29, 28) + SourceIndex(0) +9 >Emitted(21, 34) Source(29, 30) + SourceIndex(0) +10>Emitted(21, 36) Source(29, 19) + SourceIndex(0) +11>Emitted(21, 50) Source(29, 30) + SourceIndex(0) +12>Emitted(21, 52) Source(29, 19) + SourceIndex(0) +13>Emitted(21, 56) Source(29, 30) + SourceIndex(0) +14>Emitted(21, 57) Source(29, 31) + SourceIndex(0) +--- +>>> _d = _c[_b], nameA = _d[1]; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(22, 5) Source(29, 6) + SourceIndex(0) +2 >Emitted(22, 16) Source(29, 15) + SourceIndex(0) +3 >Emitted(22, 18) Source(29, 9) + SourceIndex(0) +4 >Emitted(22, 31) Source(29, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([, nameA] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(32, 19) + SourceIndex(0) +5 >Emitted(25, 16) Source(32, 35) + SourceIndex(0) +6 >Emitted(25, 18) Source(32, 19) + SourceIndex(0) +7 >Emitted(25, 24) Source(32, 20) + SourceIndex(0) +8 >Emitted(25, 30) Source(32, 26) + SourceIndex(0) +9 >Emitted(25, 32) Source(32, 28) + SourceIndex(0) +10>Emitted(25, 38) Source(32, 34) + SourceIndex(0) +11>Emitted(25, 39) Source(32, 35) + SourceIndex(0) +12>Emitted(25, 41) Source(32, 19) + SourceIndex(0) +13>Emitted(25, 55) Source(32, 35) + SourceIndex(0) +14>Emitted(25, 57) Source(32, 19) + SourceIndex(0) +15>Emitted(25, 61) Source(32, 35) + SourceIndex(0) +16>Emitted(25, 62) Source(32, 36) + SourceIndex(0) +--- +>>> _g = _f[_e], nameA = _g[1]; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(26, 5) Source(32, 6) + SourceIndex(0) +2 >Emitted(26, 16) Source(32, 15) + SourceIndex(0) +3 >Emitted(26, 18) Source(32, 9) + SourceIndex(0) +4 >Emitted(26, 31) Source(32, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(27, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(27, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(27, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(35, 46) + SourceIndex(0) +5 >Emitted(29, 16) Source(35, 57) + SourceIndex(0) +6 >Emitted(29, 18) Source(35, 46) + SourceIndex(0) +7 >Emitted(29, 45) Source(35, 57) + SourceIndex(0) +8 >Emitted(29, 47) Source(35, 46) + SourceIndex(0) +9 >Emitted(29, 72) Source(35, 57) + SourceIndex(0) +10>Emitted(29, 74) Source(35, 46) + SourceIndex(0) +11>Emitted(29, 78) Source(35, 57) + SourceIndex(0) +12>Emitted(29, 79) Source(35, 58) + SourceIndex(0) +--- +>>> _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(30, 5) Source(35, 6) + SourceIndex(0) +2 >Emitted(30, 27) Source(35, 42) + SourceIndex(0) +3 >Emitted(30, 29) Source(35, 9) + SourceIndex(0) +4 >Emitted(30, 39) Source(35, 41) + SourceIndex(0) +5 >Emitted(30, 41) Source(35, 10) + SourceIndex(0) +6 >Emitted(30, 62) Source(35, 23) + SourceIndex(0) +7 >Emitted(30, 64) Source(35, 25) + SourceIndex(0) +8 >Emitted(30, 87) Source(35, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(36, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(36, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(36, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(33, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(38, 46) + SourceIndex(0) +5 >Emitted(33, 16) Source(38, 62) + SourceIndex(0) +6 >Emitted(33, 18) Source(38, 46) + SourceIndex(0) +7 >Emitted(33, 23) Source(38, 46) + SourceIndex(0) +8 >Emitted(33, 37) Source(38, 60) + SourceIndex(0) +9 >Emitted(33, 39) Source(38, 62) + SourceIndex(0) +10>Emitted(33, 41) Source(38, 46) + SourceIndex(0) +11>Emitted(33, 55) Source(38, 62) + SourceIndex(0) +12>Emitted(33, 57) Source(38, 46) + SourceIndex(0) +13>Emitted(33, 61) Source(38, 62) + SourceIndex(0) +14>Emitted(33, 62) Source(38, 63) + SourceIndex(0) +--- +>>> _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(34, 5) Source(38, 6) + SourceIndex(0) +2 >Emitted(34, 16) Source(38, 42) + SourceIndex(0) +3 >Emitted(34, 18) Source(38, 9) + SourceIndex(0) +4 >Emitted(34, 28) Source(38, 41) + SourceIndex(0) +5 >Emitted(34, 30) Source(38, 10) + SourceIndex(0) +6 >Emitted(34, 51) Source(38, 23) + SourceIndex(0) +7 >Emitted(34, 53) Source(38, 25) + SourceIndex(0) +8 >Emitted(34, 76) Source(38, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(39, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(39, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(39, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(37, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(41, 46) + SourceIndex(0) +5 >Emitted(37, 16) Source(41, 72) + SourceIndex(0) +6 >Emitted(37, 18) Source(41, 46) + SourceIndex(0) +7 >Emitted(37, 24) Source(41, 47) + SourceIndex(0) +8 >Emitted(37, 35) Source(41, 58) + SourceIndex(0) +9 >Emitted(37, 37) Source(41, 60) + SourceIndex(0) +10>Emitted(37, 48) Source(41, 71) + SourceIndex(0) +11>Emitted(37, 49) Source(41, 72) + SourceIndex(0) +12>Emitted(37, 51) Source(41, 46) + SourceIndex(0) +13>Emitted(37, 65) Source(41, 72) + SourceIndex(0) +14>Emitted(37, 67) Source(41, 46) + SourceIndex(0) +15>Emitted(37, 71) Source(41, 72) + SourceIndex(0) +16>Emitted(37, 72) Source(41, 73) + SourceIndex(0) +--- +>>> _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(38, 5) Source(41, 6) + SourceIndex(0) +2 >Emitted(38, 16) Source(41, 42) + SourceIndex(0) +3 >Emitted(38, 18) Source(41, 9) + SourceIndex(0) +4 >Emitted(38, 28) Source(41, 41) + SourceIndex(0) +5 >Emitted(38, 30) Source(41, 10) + SourceIndex(0) +6 >Emitted(38, 51) Source(41, 23) + SourceIndex(0) +7 >Emitted(38, 53) Source(41, 25) + SourceIndex(0) +8 >Emitted(38, 76) Source(41, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(39, 30) Source(42, 30) + SourceIndex(0) +7 >Emitted(39, 31) Source(42, 31) + SourceIndex(0) +8 >Emitted(39, 32) Source(42, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([numberB] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(41, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(45, 19) + SourceIndex(0) +5 >Emitted(41, 16) Source(45, 25) + SourceIndex(0) +6 >Emitted(41, 18) Source(45, 19) + SourceIndex(0) +7 >Emitted(41, 35) Source(45, 25) + SourceIndex(0) +8 >Emitted(41, 37) Source(45, 19) + SourceIndex(0) +9 >Emitted(41, 57) Source(45, 25) + SourceIndex(0) +10>Emitted(41, 59) Source(45, 19) + SourceIndex(0) +11>Emitted(41, 63) Source(45, 25) + SourceIndex(0) +12>Emitted(41, 64) Source(45, 26) + SourceIndex(0) +--- +>>> numberB = robots_2[_u][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(42, 5) Source(45, 7) + SourceIndex(0) +2 >Emitted(42, 30) Source(45, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(46, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(46, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(46, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([numberB] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(45, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(48, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(48, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(48, 19) + SourceIndex(0) +5 >Emitted(45, 16) Source(48, 30) + SourceIndex(0) +6 >Emitted(45, 18) Source(48, 19) + SourceIndex(0) +7 >Emitted(45, 23) Source(48, 19) + SourceIndex(0) +8 >Emitted(45, 32) Source(48, 28) + SourceIndex(0) +9 >Emitted(45, 34) Source(48, 30) + SourceIndex(0) +10>Emitted(45, 36) Source(48, 19) + SourceIndex(0) +11>Emitted(45, 50) Source(48, 30) + SourceIndex(0) +12>Emitted(45, 52) Source(48, 19) + SourceIndex(0) +13>Emitted(45, 56) Source(48, 30) + SourceIndex(0) +14>Emitted(45, 57) Source(48, 31) + SourceIndex(0) +--- +>>> numberB = _w[_v][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > numberB +1 >Emitted(46, 5) Source(48, 7) + SourceIndex(0) +2 >Emitted(46, 24) Source(48, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(47, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(49, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(49, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(49, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberB] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(49, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(51, 19) + SourceIndex(0) +5 >Emitted(49, 16) Source(51, 35) + SourceIndex(0) +6 >Emitted(49, 18) Source(51, 19) + SourceIndex(0) +7 >Emitted(49, 24) Source(51, 20) + SourceIndex(0) +8 >Emitted(49, 30) Source(51, 26) + SourceIndex(0) +9 >Emitted(49, 32) Source(51, 28) + SourceIndex(0) +10>Emitted(49, 38) Source(51, 34) + SourceIndex(0) +11>Emitted(49, 39) Source(51, 35) + SourceIndex(0) +12>Emitted(49, 41) Source(51, 19) + SourceIndex(0) +13>Emitted(49, 55) Source(51, 35) + SourceIndex(0) +14>Emitted(49, 57) Source(51, 19) + SourceIndex(0) +15>Emitted(49, 61) Source(51, 35) + SourceIndex(0) +16>Emitted(49, 62) Source(51, 36) + SourceIndex(0) +--- +>>> numberB = _y[_x][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > numberB +1 >Emitted(50, 5) Source(51, 7) + SourceIndex(0) +2 >Emitted(50, 24) Source(51, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(51, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(51, 24) Source(52, 24) + SourceIndex(0) +7 >Emitted(51, 25) Source(52, 25) + SourceIndex(0) +8 >Emitted(51, 26) Source(52, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(53, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(54, 17) + SourceIndex(0) +5 >Emitted(53, 16) Source(54, 28) + SourceIndex(0) +6 >Emitted(53, 18) Source(54, 17) + SourceIndex(0) +7 >Emitted(53, 45) Source(54, 28) + SourceIndex(0) +8 >Emitted(53, 47) Source(54, 17) + SourceIndex(0) +9 >Emitted(53, 72) Source(54, 28) + SourceIndex(0) +10>Emitted(53, 74) Source(54, 17) + SourceIndex(0) +11>Emitted(53, 78) Source(54, 28) + SourceIndex(0) +12>Emitted(53, 79) Source(54, 29) + SourceIndex(0) +--- +>>> nameB = multiRobots_2[_z][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(54, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(54, 33) Source(54, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(55, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(55, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(57, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(57, 17) + SourceIndex(0) +5 >Emitted(57, 16) Source(57, 33) + SourceIndex(0) +6 >Emitted(57, 18) Source(57, 17) + SourceIndex(0) +7 >Emitted(57, 23) Source(57, 17) + SourceIndex(0) +8 >Emitted(57, 37) Source(57, 31) + SourceIndex(0) +9 >Emitted(57, 39) Source(57, 33) + SourceIndex(0) +10>Emitted(57, 41) Source(57, 17) + SourceIndex(0) +11>Emitted(57, 55) Source(57, 33) + SourceIndex(0) +12>Emitted(57, 57) Source(57, 17) + SourceIndex(0) +13>Emitted(57, 61) Source(57, 33) + SourceIndex(0) +14>Emitted(57, 62) Source(57, 34) + SourceIndex(0) +--- +>>> nameB = _1[_0][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > nameB +1 >Emitted(58, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(58, 22) Source(57, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1->Emitted(59, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(58, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(58, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(58, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(61, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(60, 17) + SourceIndex(0) +5 >Emitted(61, 16) Source(60, 43) + SourceIndex(0) +6 >Emitted(61, 18) Source(60, 17) + SourceIndex(0) +7 >Emitted(61, 24) Source(60, 18) + SourceIndex(0) +8 >Emitted(61, 35) Source(60, 29) + SourceIndex(0) +9 >Emitted(61, 37) Source(60, 31) + SourceIndex(0) +10>Emitted(61, 48) Source(60, 42) + SourceIndex(0) +11>Emitted(61, 49) Source(60, 43) + SourceIndex(0) +12>Emitted(61, 51) Source(60, 17) + SourceIndex(0) +13>Emitted(61, 65) Source(60, 43) + SourceIndex(0) +14>Emitted(61, 67) Source(60, 17) + SourceIndex(0) +15>Emitted(61, 71) Source(60, 43) + SourceIndex(0) +16>Emitted(61, 72) Source(60, 44) + SourceIndex(0) +--- +>>> nameB = _3[_2][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > nameB +1 >Emitted(62, 5) Source(60, 7) + SourceIndex(0) +2 >Emitted(62, 22) Source(60, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1->Emitted(63, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(63, 22) Source(61, 22) + SourceIndex(0) +7 >Emitted(63, 23) Source(61, 23) + SourceIndex(0) +8 >Emitted(63, 24) Source(61, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(65, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(64, 37) + SourceIndex(0) +5 >Emitted(65, 16) Source(64, 43) + SourceIndex(0) +6 >Emitted(65, 18) Source(64, 37) + SourceIndex(0) +7 >Emitted(65, 35) Source(64, 43) + SourceIndex(0) +8 >Emitted(65, 37) Source(64, 37) + SourceIndex(0) +9 >Emitted(65, 57) Source(64, 43) + SourceIndex(0) +10>Emitted(65, 59) Source(64, 37) + SourceIndex(0) +11>Emitted(65, 63) Source(64, 43) + SourceIndex(0) +12>Emitted(65, 64) Source(64, 44) + SourceIndex(0) +--- +>>> _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(66, 5) Source(64, 6) + SourceIndex(0) +2 >Emitted(66, 22) Source(64, 33) + SourceIndex(0) +3 >Emitted(66, 24) Source(64, 7) + SourceIndex(0) +4 >Emitted(66, 40) Source(64, 15) + SourceIndex(0) +5 >Emitted(66, 42) Source(64, 17) + SourceIndex(0) +6 >Emitted(66, 56) Source(64, 23) + SourceIndex(0) +7 >Emitted(66, 58) Source(64, 25) + SourceIndex(0) +8 >Emitted(66, 73) Source(64, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(65, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(65, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(65, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(69, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(67, 37) + SourceIndex(0) +5 >Emitted(69, 16) Source(67, 48) + SourceIndex(0) +6 >Emitted(69, 18) Source(67, 37) + SourceIndex(0) +7 >Emitted(69, 23) Source(67, 37) + SourceIndex(0) +8 >Emitted(69, 32) Source(67, 46) + SourceIndex(0) +9 >Emitted(69, 34) Source(67, 48) + SourceIndex(0) +10>Emitted(69, 36) Source(67, 37) + SourceIndex(0) +11>Emitted(69, 50) Source(67, 48) + SourceIndex(0) +12>Emitted(69, 52) Source(67, 37) + SourceIndex(0) +13>Emitted(69, 56) Source(67, 48) + SourceIndex(0) +14>Emitted(69, 57) Source(67, 49) + SourceIndex(0) +--- +>>> _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(70, 5) Source(67, 6) + SourceIndex(0) +2 >Emitted(70, 16) Source(67, 33) + SourceIndex(0) +3 >Emitted(70, 18) Source(67, 7) + SourceIndex(0) +4 >Emitted(70, 34) Source(67, 15) + SourceIndex(0) +5 >Emitted(70, 36) Source(67, 17) + SourceIndex(0) +6 >Emitted(70, 50) Source(67, 23) + SourceIndex(0) +7 >Emitted(70, 52) Source(67, 25) + SourceIndex(0) +8 >Emitted(70, 67) Source(67, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(68, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(68, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(68, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(73, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(70, 37) + SourceIndex(0) +5 >Emitted(73, 16) Source(70, 53) + SourceIndex(0) +6 >Emitted(73, 18) Source(70, 37) + SourceIndex(0) +7 >Emitted(73, 25) Source(70, 38) + SourceIndex(0) +8 >Emitted(73, 31) Source(70, 44) + SourceIndex(0) +9 >Emitted(73, 33) Source(70, 46) + SourceIndex(0) +10>Emitted(73, 39) Source(70, 52) + SourceIndex(0) +11>Emitted(73, 40) Source(70, 53) + SourceIndex(0) +12>Emitted(73, 42) Source(70, 37) + SourceIndex(0) +13>Emitted(73, 57) Source(70, 53) + SourceIndex(0) +14>Emitted(73, 59) Source(70, 37) + SourceIndex(0) +15>Emitted(73, 63) Source(70, 53) + SourceIndex(0) +16>Emitted(73, 64) Source(70, 54) + SourceIndex(0) +--- +>>> _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(74, 5) Source(70, 6) + SourceIndex(0) +2 >Emitted(74, 18) Source(70, 33) + SourceIndex(0) +3 >Emitted(74, 20) Source(70, 7) + SourceIndex(0) +4 >Emitted(74, 37) Source(70, 15) + SourceIndex(0) +5 >Emitted(74, 39) Source(70, 17) + SourceIndex(0) +6 >Emitted(74, 54) Source(70, 23) + SourceIndex(0) +7 >Emitted(74, 56) Source(70, 25) + SourceIndex(0) +8 >Emitted(74, 72) Source(70, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(75, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(71, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(71, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(71, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(77, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(73, 52) + SourceIndex(0) +5 >Emitted(77, 17) Source(73, 63) + SourceIndex(0) +6 >Emitted(77, 19) Source(73, 52) + SourceIndex(0) +7 >Emitted(77, 46) Source(73, 63) + SourceIndex(0) +8 >Emitted(77, 48) Source(73, 52) + SourceIndex(0) +9 >Emitted(77, 74) Source(73, 63) + SourceIndex(0) +10>Emitted(77, 76) Source(73, 52) + SourceIndex(0) +11>Emitted(77, 81) Source(73, 63) + SourceIndex(0) +12>Emitted(77, 82) Source(73, 64) + SourceIndex(0) +--- +>>> _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(78, 5) Source(73, 6) + SourceIndex(0) +2 >Emitted(78, 29) Source(73, 48) + SourceIndex(0) +3 >Emitted(78, 31) Source(73, 7) + SourceIndex(0) +4 >Emitted(78, 46) Source(73, 13) + SourceIndex(0) +5 >Emitted(78, 48) Source(73, 15) + SourceIndex(0) +6 >Emitted(78, 60) Source(73, 47) + SourceIndex(0) +7 >Emitted(78, 62) Source(73, 16) + SourceIndex(0) +8 >Emitted(78, 84) Source(73, 29) + SourceIndex(0) +9 >Emitted(78, 86) Source(73, 31) + SourceIndex(0) +10>Emitted(78, 110) Source(73, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(74, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(74, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(74, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(74, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(74, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(75, 2) + SourceIndex(0) +--- +>>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(81, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(76, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(76, 52) + SourceIndex(0) +5 >Emitted(81, 17) Source(76, 68) + SourceIndex(0) +6 >Emitted(81, 19) Source(76, 52) + SourceIndex(0) +7 >Emitted(81, 25) Source(76, 52) + SourceIndex(0) +8 >Emitted(81, 39) Source(76, 66) + SourceIndex(0) +9 >Emitted(81, 41) Source(76, 68) + SourceIndex(0) +10>Emitted(81, 43) Source(76, 52) + SourceIndex(0) +11>Emitted(81, 59) Source(76, 68) + SourceIndex(0) +12>Emitted(81, 61) Source(76, 52) + SourceIndex(0) +13>Emitted(81, 66) Source(76, 68) + SourceIndex(0) +14>Emitted(81, 67) Source(76, 69) + SourceIndex(0) +--- +>>> _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(82, 5) Source(76, 6) + SourceIndex(0) +2 >Emitted(82, 19) Source(76, 48) + SourceIndex(0) +3 >Emitted(82, 21) Source(76, 7) + SourceIndex(0) +4 >Emitted(82, 36) Source(76, 13) + SourceIndex(0) +5 >Emitted(82, 38) Source(76, 15) + SourceIndex(0) +6 >Emitted(82, 50) Source(76, 47) + SourceIndex(0) +7 >Emitted(82, 52) Source(76, 16) + SourceIndex(0) +8 >Emitted(82, 74) Source(76, 29) + SourceIndex(0) +9 >Emitted(82, 76) Source(76, 31) + SourceIndex(0) +10>Emitted(82, 100) Source(76, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(77, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(77, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(77, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(85, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(79, 52) + SourceIndex(0) +5 >Emitted(85, 17) Source(79, 78) + SourceIndex(0) +6 >Emitted(85, 19) Source(79, 52) + SourceIndex(0) +7 >Emitted(85, 26) Source(79, 53) + SourceIndex(0) +8 >Emitted(85, 37) Source(79, 64) + SourceIndex(0) +9 >Emitted(85, 39) Source(79, 66) + SourceIndex(0) +10>Emitted(85, 50) Source(79, 77) + SourceIndex(0) +11>Emitted(85, 51) Source(79, 78) + SourceIndex(0) +12>Emitted(85, 53) Source(79, 52) + SourceIndex(0) +13>Emitted(85, 69) Source(79, 78) + SourceIndex(0) +14>Emitted(85, 71) Source(79, 52) + SourceIndex(0) +15>Emitted(85, 76) Source(79, 78) + SourceIndex(0) +16>Emitted(85, 77) Source(79, 79) + SourceIndex(0) +--- +>>> _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(86, 5) Source(79, 6) + SourceIndex(0) +2 >Emitted(86, 19) Source(79, 48) + SourceIndex(0) +3 >Emitted(86, 21) Source(79, 7) + SourceIndex(0) +4 >Emitted(86, 36) Source(79, 13) + SourceIndex(0) +5 >Emitted(86, 38) Source(79, 15) + SourceIndex(0) +6 >Emitted(86, 50) Source(79, 47) + SourceIndex(0) +7 >Emitted(86, 52) Source(79, 16) + SourceIndex(0) +8 >Emitted(86, 74) Source(79, 29) + SourceIndex(0) +9 >Emitted(86, 76) Source(79, 31) + SourceIndex(0) +10>Emitted(86, 100) Source(79, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(87, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(80, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(80, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(80, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(80, 17) + SourceIndex(0) +6 >Emitted(87, 23) Source(80, 23) + SourceIndex(0) +7 >Emitted(87, 24) Source(80, 24) + SourceIndex(0) +8 >Emitted(87, 25) Source(80, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(81, 2) + SourceIndex(0) +--- +>>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(89, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(83, 35) + SourceIndex(0) +5 >Emitted(89, 17) Source(83, 41) + SourceIndex(0) +6 >Emitted(89, 19) Source(83, 35) + SourceIndex(0) +7 >Emitted(89, 36) Source(83, 41) + SourceIndex(0) +8 >Emitted(89, 38) Source(83, 35) + SourceIndex(0) +9 >Emitted(89, 59) Source(83, 41) + SourceIndex(0) +10>Emitted(89, 61) Source(83, 35) + SourceIndex(0) +11>Emitted(89, 66) Source(83, 41) + SourceIndex(0) +12>Emitted(89, 67) Source(83, 42) + SourceIndex(0) +--- +>>> _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(90, 5) Source(83, 6) + SourceIndex(0) +2 >Emitted(90, 24) Source(83, 31) + SourceIndex(0) +3 >Emitted(90, 26) Source(83, 7) + SourceIndex(0) +4 >Emitted(90, 43) Source(83, 15) + SourceIndex(0) +5 >Emitted(90, 45) Source(83, 17) + SourceIndex(0) +6 >Emitted(90, 70) Source(83, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(84, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(84, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(84, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(84, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(84, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(84, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(84, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(84, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(85, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(93, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(86, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(86, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(86, 35) + SourceIndex(0) +5 >Emitted(93, 17) Source(86, 46) + SourceIndex(0) +6 >Emitted(93, 19) Source(86, 35) + SourceIndex(0) +7 >Emitted(93, 25) Source(86, 35) + SourceIndex(0) +8 >Emitted(93, 34) Source(86, 44) + SourceIndex(0) +9 >Emitted(93, 36) Source(86, 46) + SourceIndex(0) +10>Emitted(93, 38) Source(86, 35) + SourceIndex(0) +11>Emitted(93, 54) Source(86, 46) + SourceIndex(0) +12>Emitted(93, 56) Source(86, 35) + SourceIndex(0) +13>Emitted(93, 61) Source(86, 46) + SourceIndex(0) +14>Emitted(93, 62) Source(86, 47) + SourceIndex(0) +--- +>>> _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(94, 5) Source(86, 6) + SourceIndex(0) +2 >Emitted(94, 19) Source(86, 31) + SourceIndex(0) +3 >Emitted(94, 21) Source(86, 7) + SourceIndex(0) +4 >Emitted(94, 38) Source(86, 15) + SourceIndex(0) +5 >Emitted(94, 40) Source(86, 17) + SourceIndex(0) +6 >Emitted(94, 65) Source(86, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(87, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(87, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(87, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(97, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(89, 35) + SourceIndex(0) +5 >Emitted(97, 17) Source(89, 51) + SourceIndex(0) +6 >Emitted(97, 19) Source(89, 35) + SourceIndex(0) +7 >Emitted(97, 26) Source(89, 36) + SourceIndex(0) +8 >Emitted(97, 32) Source(89, 42) + SourceIndex(0) +9 >Emitted(97, 34) Source(89, 44) + SourceIndex(0) +10>Emitted(97, 40) Source(89, 50) + SourceIndex(0) +11>Emitted(97, 41) Source(89, 51) + SourceIndex(0) +12>Emitted(97, 43) Source(89, 35) + SourceIndex(0) +13>Emitted(97, 59) Source(89, 51) + SourceIndex(0) +14>Emitted(97, 61) Source(89, 35) + SourceIndex(0) +15>Emitted(97, 66) Source(89, 51) + SourceIndex(0) +16>Emitted(97, 67) Source(89, 52) + SourceIndex(0) +--- +>>> _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1 >Emitted(98, 5) Source(89, 6) + SourceIndex(0) +2 >Emitted(98, 19) Source(89, 31) + SourceIndex(0) +3 >Emitted(98, 21) Source(89, 7) + SourceIndex(0) +4 >Emitted(98, 38) Source(89, 15) + SourceIndex(0) +5 >Emitted(98, 40) Source(89, 17) + SourceIndex(0) +6 >Emitted(98, 65) Source(89, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(99, 5) Source(90, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(90, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(90, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(90, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(90, 17) + SourceIndex(0) +6 >Emitted(99, 25) Source(90, 25) + SourceIndex(0) +7 >Emitted(99, 26) Source(90, 26) + SourceIndex(0) +8 >Emitted(99, 27) Source(90, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(91, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(101, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(101, 4) Source(92, 4) + SourceIndex(0) +3 >Emitted(101, 5) Source(92, 5) + SourceIndex(0) +4 >Emitted(101, 6) Source(92, 30) + SourceIndex(0) +5 >Emitted(101, 17) Source(92, 41) + SourceIndex(0) +6 >Emitted(101, 19) Source(92, 30) + SourceIndex(0) +7 >Emitted(101, 46) Source(92, 41) + SourceIndex(0) +8 >Emitted(101, 48) Source(92, 30) + SourceIndex(0) +9 >Emitted(101, 74) Source(92, 41) + SourceIndex(0) +10>Emitted(101, 76) Source(92, 30) + SourceIndex(0) +11>Emitted(101, 81) Source(92, 41) + SourceIndex(0) +12>Emitted(101, 82) Source(92, 42) + SourceIndex(0) +--- +>>> multiRobotAInfo = multiRobots_4[_31].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(102, 5) Source(92, 7) + SourceIndex(0) +2 >Emitted(102, 50) Source(92, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(103, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(103, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(103, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(103, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(103, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(103, 32) Source(93, 32) + SourceIndex(0) +7 >Emitted(103, 33) Source(93, 33) + SourceIndex(0) +8 >Emitted(103, 34) Source(93, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(104, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(105, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(105, 4) Source(95, 4) + SourceIndex(0) +3 >Emitted(105, 5) Source(95, 5) + SourceIndex(0) +4 >Emitted(105, 6) Source(95, 30) + SourceIndex(0) +5 >Emitted(105, 17) Source(95, 46) + SourceIndex(0) +6 >Emitted(105, 19) Source(95, 30) + SourceIndex(0) +7 >Emitted(105, 25) Source(95, 30) + SourceIndex(0) +8 >Emitted(105, 39) Source(95, 44) + SourceIndex(0) +9 >Emitted(105, 41) Source(95, 46) + SourceIndex(0) +10>Emitted(105, 43) Source(95, 30) + SourceIndex(0) +11>Emitted(105, 59) Source(95, 46) + SourceIndex(0) +12>Emitted(105, 61) Source(95, 30) + SourceIndex(0) +13>Emitted(105, 66) Source(95, 46) + SourceIndex(0) +14>Emitted(105, 67) Source(95, 47) + SourceIndex(0) +--- +>>> multiRobotAInfo = _33[_32].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(106, 5) Source(95, 7) + SourceIndex(0) +2 >Emitted(106, 40) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(107, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(107, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(107, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(107, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(107, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(107, 32) Source(96, 32) + SourceIndex(0) +7 >Emitted(107, 33) Source(96, 33) + SourceIndex(0) +8 >Emitted(107, 34) Source(96, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(108, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(109, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(109, 4) Source(98, 4) + SourceIndex(0) +3 >Emitted(109, 5) Source(98, 5) + SourceIndex(0) +4 >Emitted(109, 6) Source(98, 30) + SourceIndex(0) +5 >Emitted(109, 17) Source(98, 56) + SourceIndex(0) +6 >Emitted(109, 19) Source(98, 30) + SourceIndex(0) +7 >Emitted(109, 26) Source(98, 31) + SourceIndex(0) +8 >Emitted(109, 37) Source(98, 42) + SourceIndex(0) +9 >Emitted(109, 39) Source(98, 44) + SourceIndex(0) +10>Emitted(109, 50) Source(98, 55) + SourceIndex(0) +11>Emitted(109, 51) Source(98, 56) + SourceIndex(0) +12>Emitted(109, 53) Source(98, 30) + SourceIndex(0) +13>Emitted(109, 69) Source(98, 56) + SourceIndex(0) +14>Emitted(109, 71) Source(98, 30) + SourceIndex(0) +15>Emitted(109, 76) Source(98, 56) + SourceIndex(0) +16>Emitted(109, 77) Source(98, 57) + SourceIndex(0) +--- +>>> multiRobotAInfo = _35[_34].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(110, 5) Source(98, 7) + SourceIndex(0) +2 >Emitted(110, 40) Source(98, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(111, 5) Source(99, 5) + SourceIndex(0) +2 >Emitted(111, 12) Source(99, 12) + SourceIndex(0) +3 >Emitted(111, 13) Source(99, 13) + SourceIndex(0) +4 >Emitted(111, 16) Source(99, 16) + SourceIndex(0) +5 >Emitted(111, 17) Source(99, 17) + SourceIndex(0) +6 >Emitted(111, 32) Source(99, 32) + SourceIndex(0) +7 >Emitted(111, 33) Source(99, 33) + SourceIndex(0) +8 >Emitted(111, 34) Source(99, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(112, 2) Source(100, 2) + SourceIndex(0) +--- +>>>var _a, _d, _g, _j, _k, _o, _p, _s, _t, _5, _8, _11, _13, _14, _17, _18, _21, _22, _24, _27, _30; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols new file mode 100644 index 00000000000..9f7648afccb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols @@ -0,0 +1,343 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) + +for ([, nameA] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, nameA] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, nameA] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} + +for ([numberB] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([numberB] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([numberB] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([nameB] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} +for ([nameB] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} +for ([nameB] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} + +for ([numberA2, nameA2, skillA2] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} + +for ([numberA3, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} +for ([...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types new file mode 100644 index 00000000000..33b503d0d8f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types @@ -0,0 +1,445 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +for ([, nameA] of robots) { +>[, nameA] : string[] +> : undefined +>nameA : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] of getRobots()) { +>[, nameA] : string[] +> : undefined +>nameA : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] of [robotA, robotB]) { +>[, nameA] : string[] +> : undefined +>nameA : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB] of robots) { +>[numberB] : number[] +>numberB : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] of getRobots()) { +>[numberB] : number[] +>numberB : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] of [robotA, robotB]) { +>[numberB] : number[] +>numberB : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB] of multiRobots) { +>[nameB] : string[] +>nameB : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] of getMultiRobots()) { +>[nameB] : string[] +>nameB : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] of [multiRobotA, multiRobotB]) { +>[nameB] : string[] +>nameB : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2, nameA2, skillA2] of robots) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] of getRobots()) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3, ...robotAInfo] of robots) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] of getRobots()) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([...multiRobotAInfo] of multiRobots) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobots : [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] of getMultiRobots()) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..ff692af87f2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js @@ -0,0 +1,204 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA = "noName"] of robots) { + console.log(nameA); +} +for (let [, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for (let [, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB = -1] of robots) { + console.log(numberB); +} +for (let [numberB = -1] of getRobots()) { + console.log(numberB); +} +for (let [numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for (let [nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; + console.log(nameA); +} +for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { + var _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; + console.log(nameA); +} +for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { + var _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; + console.log(nameA); +} +for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { + var _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; + console.log(primarySkillA); +} +for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { + var _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; + console.log(primarySkillA); +} +for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { + var _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; + console.log(primarySkillA); +} +for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { + var _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; + console.log(numberB); +} +for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { + var _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; + console.log(numberB); +} +for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { + var _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; + console.log(numberB); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + var _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; + console.log(nameB); +} +for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { + var _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; + console.log(nameB); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + var _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; + console.log(nameB); +} +for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { + var _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; + console.log(nameA2); +} +for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { + var _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; + console.log(nameA2); +} +for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { + var _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; + console.log(nameA2); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + var _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; + console.log(nameMA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + var _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; + console.log(nameMA); +} +for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { + var _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; + console.log(nameMA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + var _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); + console.log(numberA3); +} +for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { + var _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); + console.log(numberA3); +} +for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { + var _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); + console.log(numberA3); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..4d12f811df1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAA6B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,qBAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,eAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7C,eAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAHpC,0BAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAHzC,eAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAHnD,eAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,wBAAY,EAAZ,iCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,mBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlC,qBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAA2B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAjC,+BAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAtC,qBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAhD,qBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA8D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAApE,uBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAzE,kBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA9E,kBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAHpC,4BAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAHzC,kBAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAHnD,kBAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAuC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAA7C,uBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAlD,kBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAvD,kBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..de9a60de903 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2742 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 34) + SourceIndex(0) +5 >Emitted(13, 16) Source(21, 40) + SourceIndex(0) +6 >Emitted(13, 18) Source(21, 34) + SourceIndex(0) +7 >Emitted(13, 35) Source(21, 40) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 34) + SourceIndex(0) +9 >Emitted(13, 57) Source(21, 40) + SourceIndex(0) +10>Emitted(13, 59) Source(21, 34) + SourceIndex(0) +11>Emitted(13, 63) Source(21, 40) + SourceIndex(0) +12>Emitted(13, 64) Source(21, 41) + SourceIndex(0) +--- +>>> var _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(14, 5) Source(21, 6) + SourceIndex(0) +2 >Emitted(14, 26) Source(21, 30) + SourceIndex(0) +3 >Emitted(14, 28) Source(21, 13) + SourceIndex(0) +4 >Emitted(14, 38) Source(21, 29) + SourceIndex(0) +5 >Emitted(14, 40) Source(21, 13) + SourceIndex(0) +6 >Emitted(14, 77) Source(21, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(16, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(24, 34) + SourceIndex(0) +5 >Emitted(17, 16) Source(24, 45) + SourceIndex(0) +6 >Emitted(17, 18) Source(24, 34) + SourceIndex(0) +7 >Emitted(17, 23) Source(24, 34) + SourceIndex(0) +8 >Emitted(17, 32) Source(24, 43) + SourceIndex(0) +9 >Emitted(17, 34) Source(24, 45) + SourceIndex(0) +10>Emitted(17, 36) Source(24, 34) + SourceIndex(0) +11>Emitted(17, 50) Source(24, 45) + SourceIndex(0) +12>Emitted(17, 52) Source(24, 34) + SourceIndex(0) +13>Emitted(17, 56) Source(24, 45) + SourceIndex(0) +14>Emitted(17, 57) Source(24, 46) + SourceIndex(0) +--- +>>> var _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(18, 5) Source(24, 6) + SourceIndex(0) +2 >Emitted(18, 20) Source(24, 30) + SourceIndex(0) +3 >Emitted(18, 22) Source(24, 13) + SourceIndex(0) +4 >Emitted(18, 32) Source(24, 29) + SourceIndex(0) +5 >Emitted(18, 34) Source(24, 13) + SourceIndex(0) +6 >Emitted(18, 71) Source(24, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(27, 34) + SourceIndex(0) +5 >Emitted(21, 16) Source(27, 50) + SourceIndex(0) +6 >Emitted(21, 18) Source(27, 34) + SourceIndex(0) +7 >Emitted(21, 24) Source(27, 35) + SourceIndex(0) +8 >Emitted(21, 30) Source(27, 41) + SourceIndex(0) +9 >Emitted(21, 32) Source(27, 43) + SourceIndex(0) +10>Emitted(21, 38) Source(27, 49) + SourceIndex(0) +11>Emitted(21, 39) Source(27, 50) + SourceIndex(0) +12>Emitted(21, 41) Source(27, 34) + SourceIndex(0) +13>Emitted(21, 55) Source(27, 50) + SourceIndex(0) +14>Emitted(21, 57) Source(27, 34) + SourceIndex(0) +15>Emitted(21, 61) Source(27, 50) + SourceIndex(0) +16>Emitted(21, 62) Source(27, 51) + SourceIndex(0) +--- +>>> var _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(22, 5) Source(27, 6) + SourceIndex(0) +2 >Emitted(22, 20) Source(27, 30) + SourceIndex(0) +3 >Emitted(22, 22) Source(27, 13) + SourceIndex(0) +4 >Emitted(22, 32) Source(27, 29) + SourceIndex(0) +5 >Emitted(22, 34) Source(27, 13) + SourceIndex(0) +6 >Emitted(22, 71) Source(27, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(33, 30) + SourceIndex(0) +5 >Emitted(25, 16) Source(33, 41) + SourceIndex(0) +6 >Emitted(25, 18) Source(33, 30) + SourceIndex(0) +7 >Emitted(25, 45) Source(33, 41) + SourceIndex(0) +8 >Emitted(25, 47) Source(33, 30) + SourceIndex(0) +9 >Emitted(25, 72) Source(33, 41) + SourceIndex(0) +10>Emitted(25, 74) Source(33, 30) + SourceIndex(0) +11>Emitted(25, 78) Source(33, 41) + SourceIndex(0) +12>Emitted(25, 79) Source(33, 42) + SourceIndex(0) +--- +>>> var _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(26, 5) Source(30, 6) + SourceIndex(0) +2 >Emitted(26, 31) Source(33, 26) + SourceIndex(0) +3 >Emitted(26, 33) Source(30, 13) + SourceIndex(0) +4 >Emitted(26, 43) Source(33, 25) + SourceIndex(0) +5 >Emitted(26, 45) Source(30, 13) + SourceIndex(0) +6 >Emitted(26, 91) Source(33, 25) + SourceIndex(0) +7 >Emitted(26, 93) Source(31, 5) + SourceIndex(0) +8 >Emitted(26, 103) Source(31, 30) + SourceIndex(0) +9 >Emitted(26, 105) Source(31, 5) + SourceIndex(0) +10>Emitted(26, 151) Source(31, 30) + SourceIndex(0) +11>Emitted(26, 153) Source(32, 5) + SourceIndex(0) +12>Emitted(26, 163) Source(32, 34) + SourceIndex(0) +13>Emitted(26, 165) Source(32, 5) + SourceIndex(0) +14>Emitted(26, 215) Source(32, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(27, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(27, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(27, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(29, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(39, 30) + SourceIndex(0) +5 >Emitted(29, 16) Source(39, 46) + SourceIndex(0) +6 >Emitted(29, 18) Source(39, 30) + SourceIndex(0) +7 >Emitted(29, 23) Source(39, 30) + SourceIndex(0) +8 >Emitted(29, 37) Source(39, 44) + SourceIndex(0) +9 >Emitted(29, 39) Source(39, 46) + SourceIndex(0) +10>Emitted(29, 41) Source(39, 30) + SourceIndex(0) +11>Emitted(29, 55) Source(39, 46) + SourceIndex(0) +12>Emitted(29, 57) Source(39, 30) + SourceIndex(0) +13>Emitted(29, 61) Source(39, 46) + SourceIndex(0) +14>Emitted(29, 62) Source(39, 47) + SourceIndex(0) +--- +>>> var _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(30, 5) Source(36, 6) + SourceIndex(0) +2 >Emitted(30, 20) Source(39, 26) + SourceIndex(0) +3 >Emitted(30, 22) Source(36, 13) + SourceIndex(0) +4 >Emitted(30, 32) Source(39, 25) + SourceIndex(0) +5 >Emitted(30, 34) Source(36, 13) + SourceIndex(0) +6 >Emitted(30, 80) Source(39, 25) + SourceIndex(0) +7 >Emitted(30, 82) Source(37, 5) + SourceIndex(0) +8 >Emitted(30, 92) Source(37, 30) + SourceIndex(0) +9 >Emitted(30, 94) Source(37, 5) + SourceIndex(0) +10>Emitted(30, 140) Source(37, 30) + SourceIndex(0) +11>Emitted(30, 142) Source(38, 5) + SourceIndex(0) +12>Emitted(30, 152) Source(38, 34) + SourceIndex(0) +13>Emitted(30, 154) Source(38, 5) + SourceIndex(0) +14>Emitted(30, 204) Source(38, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(40, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(40, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(40, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(33, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(42, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(42, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(45, 30) + SourceIndex(0) +5 >Emitted(33, 16) Source(45, 56) + SourceIndex(0) +6 >Emitted(33, 18) Source(45, 30) + SourceIndex(0) +7 >Emitted(33, 24) Source(45, 31) + SourceIndex(0) +8 >Emitted(33, 35) Source(45, 42) + SourceIndex(0) +9 >Emitted(33, 37) Source(45, 44) + SourceIndex(0) +10>Emitted(33, 48) Source(45, 55) + SourceIndex(0) +11>Emitted(33, 49) Source(45, 56) + SourceIndex(0) +12>Emitted(33, 51) Source(45, 30) + SourceIndex(0) +13>Emitted(33, 65) Source(45, 56) + SourceIndex(0) +14>Emitted(33, 67) Source(45, 30) + SourceIndex(0) +15>Emitted(33, 71) Source(45, 56) + SourceIndex(0) +16>Emitted(33, 72) Source(45, 57) + SourceIndex(0) +--- +>>> var _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(34, 5) Source(42, 6) + SourceIndex(0) +2 >Emitted(34, 20) Source(45, 26) + SourceIndex(0) +3 >Emitted(34, 22) Source(42, 13) + SourceIndex(0) +4 >Emitted(34, 32) Source(45, 25) + SourceIndex(0) +5 >Emitted(34, 34) Source(42, 13) + SourceIndex(0) +6 >Emitted(34, 80) Source(45, 25) + SourceIndex(0) +7 >Emitted(34, 82) Source(43, 5) + SourceIndex(0) +8 >Emitted(34, 92) Source(43, 30) + SourceIndex(0) +9 >Emitted(34, 94) Source(43, 5) + SourceIndex(0) +10>Emitted(34, 140) Source(43, 30) + SourceIndex(0) +11>Emitted(34, 142) Source(44, 5) + SourceIndex(0) +12>Emitted(34, 152) Source(44, 34) + SourceIndex(0) +13>Emitted(34, 154) Source(44, 5) + SourceIndex(0) +14>Emitted(34, 204) Source(44, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(46, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(46, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(46, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(49, 28) + SourceIndex(0) +5 >Emitted(37, 16) Source(49, 34) + SourceIndex(0) +6 >Emitted(37, 18) Source(49, 28) + SourceIndex(0) +7 >Emitted(37, 35) Source(49, 34) + SourceIndex(0) +8 >Emitted(37, 37) Source(49, 28) + SourceIndex(0) +9 >Emitted(37, 57) Source(49, 34) + SourceIndex(0) +10>Emitted(37, 59) Source(49, 28) + SourceIndex(0) +11>Emitted(37, 63) Source(49, 34) + SourceIndex(0) +12>Emitted(37, 64) Source(49, 35) + SourceIndex(0) +--- +>>> var _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(38, 5) Source(49, 11) + SourceIndex(0) +2 >Emitted(38, 29) Source(49, 23) + SourceIndex(0) +3 >Emitted(38, 31) Source(49, 11) + SourceIndex(0) +4 >Emitted(38, 64) Source(49, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(39, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(39, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(39, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(39, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(52, 28) + SourceIndex(0) +5 >Emitted(41, 16) Source(52, 39) + SourceIndex(0) +6 >Emitted(41, 18) Source(52, 28) + SourceIndex(0) +7 >Emitted(41, 23) Source(52, 28) + SourceIndex(0) +8 >Emitted(41, 32) Source(52, 37) + SourceIndex(0) +9 >Emitted(41, 34) Source(52, 39) + SourceIndex(0) +10>Emitted(41, 36) Source(52, 28) + SourceIndex(0) +11>Emitted(41, 50) Source(52, 39) + SourceIndex(0) +12>Emitted(41, 52) Source(52, 28) + SourceIndex(0) +13>Emitted(41, 56) Source(52, 39) + SourceIndex(0) +14>Emitted(41, 57) Source(52, 40) + SourceIndex(0) +--- +>>> var _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(42, 5) Source(52, 11) + SourceIndex(0) +2 >Emitted(42, 24) Source(52, 23) + SourceIndex(0) +3 >Emitted(42, 26) Source(52, 11) + SourceIndex(0) +4 >Emitted(42, 61) Source(52, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(55, 28) + SourceIndex(0) +5 >Emitted(45, 17) Source(55, 44) + SourceIndex(0) +6 >Emitted(45, 19) Source(55, 28) + SourceIndex(0) +7 >Emitted(45, 26) Source(55, 29) + SourceIndex(0) +8 >Emitted(45, 32) Source(55, 35) + SourceIndex(0) +9 >Emitted(45, 34) Source(55, 37) + SourceIndex(0) +10>Emitted(45, 40) Source(55, 43) + SourceIndex(0) +11>Emitted(45, 41) Source(55, 44) + SourceIndex(0) +12>Emitted(45, 43) Source(55, 28) + SourceIndex(0) +13>Emitted(45, 59) Source(55, 44) + SourceIndex(0) +14>Emitted(45, 61) Source(55, 28) + SourceIndex(0) +15>Emitted(45, 66) Source(55, 44) + SourceIndex(0) +16>Emitted(45, 67) Source(55, 45) + SourceIndex(0) +--- +>>> var _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(46, 5) Source(55, 11) + SourceIndex(0) +2 >Emitted(46, 26) Source(55, 23) + SourceIndex(0) +3 >Emitted(46, 28) Source(55, 11) + SourceIndex(0) +4 >Emitted(46, 63) Source(55, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(56, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(56, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(56, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(58, 32) + SourceIndex(0) +5 >Emitted(49, 17) Source(58, 43) + SourceIndex(0) +6 >Emitted(49, 19) Source(58, 32) + SourceIndex(0) +7 >Emitted(49, 46) Source(58, 43) + SourceIndex(0) +8 >Emitted(49, 48) Source(58, 32) + SourceIndex(0) +9 >Emitted(49, 74) Source(58, 43) + SourceIndex(0) +10>Emitted(49, 76) Source(58, 32) + SourceIndex(0) +11>Emitted(49, 81) Source(58, 43) + SourceIndex(0) +12>Emitted(49, 82) Source(58, 44) + SourceIndex(0) +--- +>>> var _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(50, 5) Source(58, 11) + SourceIndex(0) +2 >Emitted(50, 36) Source(58, 27) + SourceIndex(0) +3 >Emitted(50, 38) Source(58, 11) + SourceIndex(0) +4 >Emitted(50, 77) Source(58, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(51, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(51, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(51, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^-> +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(61, 32) + SourceIndex(0) +5 >Emitted(53, 17) Source(61, 48) + SourceIndex(0) +6 >Emitted(53, 19) Source(61, 32) + SourceIndex(0) +7 >Emitted(53, 25) Source(61, 32) + SourceIndex(0) +8 >Emitted(53, 39) Source(61, 46) + SourceIndex(0) +9 >Emitted(53, 41) Source(61, 48) + SourceIndex(0) +10>Emitted(53, 43) Source(61, 32) + SourceIndex(0) +11>Emitted(53, 59) Source(61, 48) + SourceIndex(0) +12>Emitted(53, 61) Source(61, 32) + SourceIndex(0) +13>Emitted(53, 66) Source(61, 48) + SourceIndex(0) +14>Emitted(53, 67) Source(61, 49) + SourceIndex(0) +--- +>>> var _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1->Emitted(54, 5) Source(61, 11) + SourceIndex(0) +2 >Emitted(54, 26) Source(61, 27) + SourceIndex(0) +3 >Emitted(54, 28) Source(61, 11) + SourceIndex(0) +4 >Emitted(54, 67) Source(61, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(57, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(64, 32) + SourceIndex(0) +5 >Emitted(57, 17) Source(64, 58) + SourceIndex(0) +6 >Emitted(57, 19) Source(64, 32) + SourceIndex(0) +7 >Emitted(57, 26) Source(64, 33) + SourceIndex(0) +8 >Emitted(57, 37) Source(64, 44) + SourceIndex(0) +9 >Emitted(57, 39) Source(64, 46) + SourceIndex(0) +10>Emitted(57, 50) Source(64, 57) + SourceIndex(0) +11>Emitted(57, 51) Source(64, 58) + SourceIndex(0) +12>Emitted(57, 53) Source(64, 32) + SourceIndex(0) +13>Emitted(57, 69) Source(64, 58) + SourceIndex(0) +14>Emitted(57, 71) Source(64, 32) + SourceIndex(0) +15>Emitted(57, 76) Source(64, 58) + SourceIndex(0) +16>Emitted(57, 77) Source(64, 59) + SourceIndex(0) +--- +>>> var _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(58, 5) Source(64, 11) + SourceIndex(0) +2 >Emitted(58, 26) Source(64, 27) + SourceIndex(0) +3 >Emitted(58, 28) Source(64, 11) + SourceIndex(0) +4 >Emitted(58, 67) Source(64, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(61, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(68, 67) + SourceIndex(0) +5 >Emitted(61, 17) Source(68, 73) + SourceIndex(0) +6 >Emitted(61, 19) Source(68, 67) + SourceIndex(0) +7 >Emitted(61, 36) Source(68, 73) + SourceIndex(0) +8 >Emitted(61, 38) Source(68, 67) + SourceIndex(0) +9 >Emitted(61, 59) Source(68, 73) + SourceIndex(0) +10>Emitted(61, 61) Source(68, 67) + SourceIndex(0) +11>Emitted(61, 66) Source(68, 73) + SourceIndex(0) +12>Emitted(61, 67) Source(68, 74) + SourceIndex(0) +--- +>>> var _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(62, 5) Source(68, 6) + SourceIndex(0) +2 >Emitted(62, 28) Source(68, 63) + SourceIndex(0) +3 >Emitted(62, 30) Source(68, 11) + SourceIndex(0) +4 >Emitted(62, 42) Source(68, 24) + SourceIndex(0) +5 >Emitted(62, 44) Source(68, 11) + SourceIndex(0) +6 >Emitted(62, 80) Source(68, 24) + SourceIndex(0) +7 >Emitted(62, 82) Source(68, 26) + SourceIndex(0) +8 >Emitted(62, 94) Source(68, 43) + SourceIndex(0) +9 >Emitted(62, 96) Source(68, 26) + SourceIndex(0) +10>Emitted(62, 136) Source(68, 43) + SourceIndex(0) +11>Emitted(62, 138) Source(68, 45) + SourceIndex(0) +12>Emitted(62, 150) Source(68, 62) + SourceIndex(0) +13>Emitted(62, 152) Source(68, 45) + SourceIndex(0) +14>Emitted(62, 192) Source(68, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(63, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(63, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(63, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(63, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(65, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(71, 67) + SourceIndex(0) +5 >Emitted(65, 17) Source(71, 78) + SourceIndex(0) +6 >Emitted(65, 19) Source(71, 67) + SourceIndex(0) +7 >Emitted(65, 25) Source(71, 67) + SourceIndex(0) +8 >Emitted(65, 34) Source(71, 76) + SourceIndex(0) +9 >Emitted(65, 36) Source(71, 78) + SourceIndex(0) +10>Emitted(65, 38) Source(71, 67) + SourceIndex(0) +11>Emitted(65, 54) Source(71, 78) + SourceIndex(0) +12>Emitted(65, 56) Source(71, 67) + SourceIndex(0) +13>Emitted(65, 61) Source(71, 78) + SourceIndex(0) +14>Emitted(65, 62) Source(71, 79) + SourceIndex(0) +--- +>>> var _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(66, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(66, 23) Source(71, 63) + SourceIndex(0) +3 >Emitted(66, 25) Source(71, 11) + SourceIndex(0) +4 >Emitted(66, 37) Source(71, 24) + SourceIndex(0) +5 >Emitted(66, 39) Source(71, 11) + SourceIndex(0) +6 >Emitted(66, 75) Source(71, 24) + SourceIndex(0) +7 >Emitted(66, 77) Source(71, 26) + SourceIndex(0) +8 >Emitted(66, 89) Source(71, 43) + SourceIndex(0) +9 >Emitted(66, 91) Source(71, 26) + SourceIndex(0) +10>Emitted(66, 131) Source(71, 43) + SourceIndex(0) +11>Emitted(66, 133) Source(71, 45) + SourceIndex(0) +12>Emitted(66, 145) Source(71, 62) + SourceIndex(0) +13>Emitted(66, 147) Source(71, 45) + SourceIndex(0) +14>Emitted(66, 187) Source(71, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(69, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(74, 67) + SourceIndex(0) +5 >Emitted(69, 17) Source(74, 83) + SourceIndex(0) +6 >Emitted(69, 19) Source(74, 67) + SourceIndex(0) +7 >Emitted(69, 26) Source(74, 68) + SourceIndex(0) +8 >Emitted(69, 32) Source(74, 74) + SourceIndex(0) +9 >Emitted(69, 34) Source(74, 76) + SourceIndex(0) +10>Emitted(69, 40) Source(74, 82) + SourceIndex(0) +11>Emitted(69, 41) Source(74, 83) + SourceIndex(0) +12>Emitted(69, 43) Source(74, 67) + SourceIndex(0) +13>Emitted(69, 59) Source(74, 83) + SourceIndex(0) +14>Emitted(69, 61) Source(74, 67) + SourceIndex(0) +15>Emitted(69, 66) Source(74, 83) + SourceIndex(0) +16>Emitted(69, 67) Source(74, 84) + SourceIndex(0) +--- +>>> var _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(70, 5) Source(74, 6) + SourceIndex(0) +2 >Emitted(70, 23) Source(74, 63) + SourceIndex(0) +3 >Emitted(70, 25) Source(74, 11) + SourceIndex(0) +4 >Emitted(70, 37) Source(74, 24) + SourceIndex(0) +5 >Emitted(70, 39) Source(74, 11) + SourceIndex(0) +6 >Emitted(70, 75) Source(74, 24) + SourceIndex(0) +7 >Emitted(70, 77) Source(74, 26) + SourceIndex(0) +8 >Emitted(70, 89) Source(74, 43) + SourceIndex(0) +9 >Emitted(70, 91) Source(74, 26) + SourceIndex(0) +10>Emitted(70, 131) Source(74, 43) + SourceIndex(0) +11>Emitted(70, 133) Source(74, 45) + SourceIndex(0) +12>Emitted(70, 145) Source(74, 62) + SourceIndex(0) +13>Emitted(70, 147) Source(74, 45) + SourceIndex(0) +14>Emitted(70, 187) Source(74, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(73, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(80, 30) + SourceIndex(0) +5 >Emitted(73, 17) Source(80, 41) + SourceIndex(0) +6 >Emitted(73, 19) Source(80, 30) + SourceIndex(0) +7 >Emitted(73, 46) Source(80, 41) + SourceIndex(0) +8 >Emitted(73, 48) Source(80, 30) + SourceIndex(0) +9 >Emitted(73, 74) Source(80, 41) + SourceIndex(0) +10>Emitted(73, 76) Source(80, 30) + SourceIndex(0) +11>Emitted(73, 81) Source(80, 41) + SourceIndex(0) +12>Emitted(73, 82) Source(80, 42) + SourceIndex(0) +--- +>>> var _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(74, 5) Source(77, 6) + SourceIndex(0) +2 >Emitted(74, 33) Source(80, 26) + SourceIndex(0) +3 >Emitted(74, 35) Source(77, 11) + SourceIndex(0) +4 >Emitted(74, 47) Source(77, 28) + SourceIndex(0) +5 >Emitted(74, 49) Source(77, 11) + SourceIndex(0) +6 >Emitted(74, 89) Source(77, 28) + SourceIndex(0) +7 >Emitted(74, 91) Source(77, 30) + SourceIndex(0) +8 >Emitted(74, 103) Source(80, 25) + SourceIndex(0) +9 >Emitted(74, 105) Source(77, 30) + SourceIndex(0) +10>Emitted(74, 154) Source(80, 25) + SourceIndex(0) +11>Emitted(74, 156) Source(78, 5) + SourceIndex(0) +12>Emitted(74, 168) Source(78, 30) + SourceIndex(0) +13>Emitted(74, 170) Source(78, 5) + SourceIndex(0) +14>Emitted(74, 218) Source(78, 30) + SourceIndex(0) +15>Emitted(74, 220) Source(79, 5) + SourceIndex(0) +16>Emitted(74, 232) Source(79, 34) + SourceIndex(0) +17>Emitted(74, 234) Source(79, 5) + SourceIndex(0) +18>Emitted(74, 286) Source(79, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(81, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(81, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(81, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(77, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(86, 30) + SourceIndex(0) +5 >Emitted(77, 17) Source(86, 46) + SourceIndex(0) +6 >Emitted(77, 19) Source(86, 30) + SourceIndex(0) +7 >Emitted(77, 25) Source(86, 30) + SourceIndex(0) +8 >Emitted(77, 39) Source(86, 44) + SourceIndex(0) +9 >Emitted(77, 41) Source(86, 46) + SourceIndex(0) +10>Emitted(77, 43) Source(86, 30) + SourceIndex(0) +11>Emitted(77, 59) Source(86, 46) + SourceIndex(0) +12>Emitted(77, 61) Source(86, 30) + SourceIndex(0) +13>Emitted(77, 66) Source(86, 46) + SourceIndex(0) +14>Emitted(77, 67) Source(86, 47) + SourceIndex(0) +--- +>>> var _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(78, 5) Source(83, 6) + SourceIndex(0) +2 >Emitted(78, 23) Source(86, 26) + SourceIndex(0) +3 >Emitted(78, 25) Source(83, 11) + SourceIndex(0) +4 >Emitted(78, 37) Source(83, 28) + SourceIndex(0) +5 >Emitted(78, 39) Source(83, 11) + SourceIndex(0) +6 >Emitted(78, 79) Source(83, 28) + SourceIndex(0) +7 >Emitted(78, 81) Source(83, 30) + SourceIndex(0) +8 >Emitted(78, 93) Source(86, 25) + SourceIndex(0) +9 >Emitted(78, 95) Source(83, 30) + SourceIndex(0) +10>Emitted(78, 144) Source(86, 25) + SourceIndex(0) +11>Emitted(78, 146) Source(84, 5) + SourceIndex(0) +12>Emitted(78, 158) Source(84, 30) + SourceIndex(0) +13>Emitted(78, 160) Source(84, 5) + SourceIndex(0) +14>Emitted(78, 208) Source(84, 30) + SourceIndex(0) +15>Emitted(78, 210) Source(85, 5) + SourceIndex(0) +16>Emitted(78, 222) Source(85, 34) + SourceIndex(0) +17>Emitted(78, 224) Source(85, 5) + SourceIndex(0) +18>Emitted(78, 276) Source(85, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(87, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(87, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(87, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(81, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(92, 30) + SourceIndex(0) +5 >Emitted(81, 17) Source(92, 56) + SourceIndex(0) +6 >Emitted(81, 19) Source(92, 30) + SourceIndex(0) +7 >Emitted(81, 26) Source(92, 31) + SourceIndex(0) +8 >Emitted(81, 37) Source(92, 42) + SourceIndex(0) +9 >Emitted(81, 39) Source(92, 44) + SourceIndex(0) +10>Emitted(81, 50) Source(92, 55) + SourceIndex(0) +11>Emitted(81, 51) Source(92, 56) + SourceIndex(0) +12>Emitted(81, 53) Source(92, 30) + SourceIndex(0) +13>Emitted(81, 69) Source(92, 56) + SourceIndex(0) +14>Emitted(81, 71) Source(92, 30) + SourceIndex(0) +15>Emitted(81, 76) Source(92, 56) + SourceIndex(0) +16>Emitted(81, 77) Source(92, 57) + SourceIndex(0) +--- +>>> var _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(82, 5) Source(89, 6) + SourceIndex(0) +2 >Emitted(82, 23) Source(92, 26) + SourceIndex(0) +3 >Emitted(82, 25) Source(89, 11) + SourceIndex(0) +4 >Emitted(82, 37) Source(89, 28) + SourceIndex(0) +5 >Emitted(82, 39) Source(89, 11) + SourceIndex(0) +6 >Emitted(82, 79) Source(89, 28) + SourceIndex(0) +7 >Emitted(82, 81) Source(89, 30) + SourceIndex(0) +8 >Emitted(82, 93) Source(92, 25) + SourceIndex(0) +9 >Emitted(82, 95) Source(89, 30) + SourceIndex(0) +10>Emitted(82, 144) Source(92, 25) + SourceIndex(0) +11>Emitted(82, 146) Source(90, 5) + SourceIndex(0) +12>Emitted(82, 158) Source(90, 30) + SourceIndex(0) +13>Emitted(82, 160) Source(90, 5) + SourceIndex(0) +14>Emitted(82, 208) Source(90, 30) + SourceIndex(0) +15>Emitted(82, 210) Source(91, 5) + SourceIndex(0) +16>Emitted(82, 222) Source(91, 34) + SourceIndex(0) +17>Emitted(82, 224) Source(91, 5) + SourceIndex(0) +18>Emitted(82, 276) Source(91, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(93, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(93, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(93, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(85, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(96, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(96, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(96, 44) + SourceIndex(0) +5 >Emitted(85, 17) Source(96, 50) + SourceIndex(0) +6 >Emitted(85, 19) Source(96, 44) + SourceIndex(0) +7 >Emitted(85, 36) Source(96, 50) + SourceIndex(0) +8 >Emitted(85, 38) Source(96, 44) + SourceIndex(0) +9 >Emitted(85, 59) Source(96, 50) + SourceIndex(0) +10>Emitted(85, 61) Source(96, 44) + SourceIndex(0) +11>Emitted(85, 66) Source(96, 50) + SourceIndex(0) +12>Emitted(85, 67) Source(96, 51) + SourceIndex(0) +--- +>>> var _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(86, 5) Source(96, 6) + SourceIndex(0) +2 >Emitted(86, 28) Source(96, 40) + SourceIndex(0) +3 >Emitted(86, 30) Source(96, 11) + SourceIndex(0) +4 >Emitted(86, 42) Source(96, 24) + SourceIndex(0) +5 >Emitted(86, 44) Source(96, 11) + SourceIndex(0) +6 >Emitted(86, 80) Source(96, 24) + SourceIndex(0) +7 >Emitted(86, 82) Source(96, 26) + SourceIndex(0) +8 >Emitted(86, 107) Source(96, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(87, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(87, 25) Source(97, 25) + SourceIndex(0) +7 >Emitted(87, 26) Source(97, 26) + SourceIndex(0) +8 >Emitted(87, 27) Source(97, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(98, 2) + SourceIndex(0) +--- +>>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(89, 1) Source(99, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(99, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(99, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(99, 44) + SourceIndex(0) +5 >Emitted(89, 17) Source(99, 55) + SourceIndex(0) +6 >Emitted(89, 19) Source(99, 44) + SourceIndex(0) +7 >Emitted(89, 25) Source(99, 44) + SourceIndex(0) +8 >Emitted(89, 34) Source(99, 53) + SourceIndex(0) +9 >Emitted(89, 36) Source(99, 55) + SourceIndex(0) +10>Emitted(89, 38) Source(99, 44) + SourceIndex(0) +11>Emitted(89, 54) Source(99, 55) + SourceIndex(0) +12>Emitted(89, 56) Source(99, 44) + SourceIndex(0) +13>Emitted(89, 61) Source(99, 55) + SourceIndex(0) +14>Emitted(89, 62) Source(99, 56) + SourceIndex(0) +--- +>>> var _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(90, 5) Source(99, 6) + SourceIndex(0) +2 >Emitted(90, 23) Source(99, 40) + SourceIndex(0) +3 >Emitted(90, 25) Source(99, 11) + SourceIndex(0) +4 >Emitted(90, 37) Source(99, 24) + SourceIndex(0) +5 >Emitted(90, 39) Source(99, 11) + SourceIndex(0) +6 >Emitted(90, 75) Source(99, 24) + SourceIndex(0) +7 >Emitted(90, 77) Source(99, 26) + SourceIndex(0) +8 >Emitted(90, 102) Source(99, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(100, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(100, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(100, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(100, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(100, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(100, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(100, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(100, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(101, 2) + SourceIndex(0) +--- +>>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(93, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(102, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(102, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(102, 44) + SourceIndex(0) +5 >Emitted(93, 17) Source(102, 60) + SourceIndex(0) +6 >Emitted(93, 19) Source(102, 44) + SourceIndex(0) +7 >Emitted(93, 26) Source(102, 45) + SourceIndex(0) +8 >Emitted(93, 32) Source(102, 51) + SourceIndex(0) +9 >Emitted(93, 34) Source(102, 53) + SourceIndex(0) +10>Emitted(93, 40) Source(102, 59) + SourceIndex(0) +11>Emitted(93, 41) Source(102, 60) + SourceIndex(0) +12>Emitted(93, 43) Source(102, 44) + SourceIndex(0) +13>Emitted(93, 59) Source(102, 60) + SourceIndex(0) +14>Emitted(93, 61) Source(102, 44) + SourceIndex(0) +15>Emitted(93, 66) Source(102, 60) + SourceIndex(0) +16>Emitted(93, 67) Source(102, 61) + SourceIndex(0) +--- +>>> var _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(94, 5) Source(102, 6) + SourceIndex(0) +2 >Emitted(94, 23) Source(102, 40) + SourceIndex(0) +3 >Emitted(94, 25) Source(102, 11) + SourceIndex(0) +4 >Emitted(94, 37) Source(102, 24) + SourceIndex(0) +5 >Emitted(94, 39) Source(102, 11) + SourceIndex(0) +6 >Emitted(94, 75) Source(102, 24) + SourceIndex(0) +7 >Emitted(94, 77) Source(102, 26) + SourceIndex(0) +8 >Emitted(94, 102) Source(102, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(103, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(103, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(103, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(103, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(103, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(103, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(103, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(103, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(104, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..b398a8e6af5 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,325 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) +} + +for (let [, nameA = "noName"] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 20, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 20, 11)) +} +for (let [, nameA = "noName"] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 23, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 23, 11)) +} +for (let [, nameA = "noName"] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 26, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 26, 11)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 29, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 30, 30)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 29, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 35, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 36, 30)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 35, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 41, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 42, 30)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 41, 13)) +} + +for (let [numberB = -1] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 48, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 48, 10)) +} +for (let [numberB = -1] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 51, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 51, 10)) +} +for (let [numberB = -1] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 54, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 54, 10)) +} +for (let [nameB = "noName"] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 57, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 57, 10)) +} +for (let [nameB = "noName"] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 60, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 60, 10)) +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 63, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 63, 10)) +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 43)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 24)) +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 43)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 24)) +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 24)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 77, 30)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 10)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 83, 30)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 10)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 89, 30)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 10)) +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 24)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 24)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 24)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..488b5c46145 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types @@ -0,0 +1,452 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +for (let [, nameA = "noName"] of robots) { +> : undefined +>nameA : string +>"noName" : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "noName"] of getRobots()) { +> : undefined +>nameA : string +>"noName" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "noName"] of [robotA, robotB]) { +> : undefined +>nameA : string +>"noName" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB = -1] of robots) { +>numberB : number +>-1 : number +>1 : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] of getRobots()) { +>numberB : number +>-1 : number +>1 : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] of [robotA, robotB]) { +>numberB : number +>-1 : number +>1 : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB = "noName"] of multiRobots) { +>nameB : string +>"noName" : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "noName"] of getMultiRobots()) { +>nameB : string +>"noName" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : string +>"noName" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..9cff7412ea9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js @@ -0,0 +1,214 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA = "noName"] of robots) { + console.log(nameA); +} +for ([, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for ([, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB = -1] of robots) { + console.log(numberB); +} +for ([numberB = -1] of getRobots()) { + console.log(numberB); +} +for ([numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for ([nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; + console.log(nameA); +} +for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { + _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; + console.log(nameA); +} +for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { + _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; + console.log(nameA); +} +for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { + _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; + console.log(primarySkillA); +} +for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { + _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; + console.log(primarySkillA); +} +for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { + _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; + console.log(primarySkillA); +} +for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { + _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; + console.log(numberB); +} +for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { + _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; + console.log(numberB); +} +for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { + _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; + console.log(numberB); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; + console.log(nameB); +} +for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { + _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; + console.log(nameB); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; + console.log(nameB); +} +for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { + _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; + console.log(nameA2); +} +for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { + _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; + console.log(nameA2); +} +for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { + _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; + console.log(nameA2); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; + console.log(nameMA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; + console.log(nameMA); +} +for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { + _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; + console.log(nameMA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); + console.log(numberA3); +} +for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { + _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); + console.log(numberA3); +} +for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { + _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); + console.log(numberA3); +} +var _a, _b, _e, _f, _j, _k, _m, _o, _p, _q, _r, _u, _v, _w, _x, _y, _1, _2, _3, _4, _5, _7, _10, _13, _15, _18, _21, _23, _24, _25, _26, _29, _30, _31, _32, _35, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _67, _68, _71, _72; +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..ccee72c33bf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAyB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA/B,iBAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAApC,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAzC,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAHpC,sBAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAHzC,WAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAHnD,WAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,oBAAY,EAAZ,iCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,eAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlC,iBAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAjC,2BAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAtC,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAhD,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA0D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAhE,mBAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAArE,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA1E,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAHpC,wBAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAHzC,cAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAHnD,cAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAmC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAzC,mBAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA9C,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAnD,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..dc11eb52da9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,2853 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 18) + SourceIndex(0) +4 >Emitted(13, 12) Source(21, 20) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 43) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 66) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 12) Source(22, 20) + SourceIndex(0) +4 >Emitted(14, 14) Source(22, 22) + SourceIndex(0) +5 >Emitted(14, 19) Source(22, 35) + SourceIndex(0) +6 >Emitted(14, 20) Source(22, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 13) Source(23, 21) + SourceIndex(0) +4 >Emitted(15, 15) Source(23, 23) + SourceIndex(0) +5 >Emitted(15, 21) Source(23, 37) + SourceIndex(0) +6 >Emitted(15, 23) Source(23, 39) + SourceIndex(0) +7 >Emitted(15, 30) Source(23, 54) + SourceIndex(0) +8 >Emitted(15, 32) Source(23, 56) + SourceIndex(0) +9 >Emitted(15, 38) Source(23, 70) + SourceIndex(0) +10>Emitted(15, 39) Source(23, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(16, 13) Source(24, 21) + SourceIndex(0) +4 >Emitted(16, 15) Source(24, 23) + SourceIndex(0) +5 >Emitted(16, 25) Source(24, 54) + SourceIndex(0) +6 >Emitted(16, 27) Source(24, 56) + SourceIndex(0) +7 >Emitted(16, 42) Source(24, 102) + SourceIndex(0) +8 >Emitted(16, 43) Source(24, 103) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(26, 30) + SourceIndex(0) +5 >Emitted(17, 16) Source(26, 36) + SourceIndex(0) +6 >Emitted(17, 18) Source(26, 30) + SourceIndex(0) +7 >Emitted(17, 35) Source(26, 36) + SourceIndex(0) +8 >Emitted(17, 37) Source(26, 30) + SourceIndex(0) +9 >Emitted(17, 57) Source(26, 36) + SourceIndex(0) +10>Emitted(17, 59) Source(26, 30) + SourceIndex(0) +11>Emitted(17, 63) Source(26, 36) + SourceIndex(0) +12>Emitted(17, 64) Source(26, 37) + SourceIndex(0) +--- +>>> _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(18, 5) Source(26, 6) + SourceIndex(0) +2 >Emitted(18, 22) Source(26, 26) + SourceIndex(0) +3 >Emitted(18, 24) Source(26, 9) + SourceIndex(0) +4 >Emitted(18, 34) Source(26, 25) + SourceIndex(0) +5 >Emitted(18, 36) Source(26, 9) + SourceIndex(0) +6 >Emitted(18, 73) Source(26, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(29, 30) + SourceIndex(0) +5 >Emitted(21, 16) Source(29, 41) + SourceIndex(0) +6 >Emitted(21, 18) Source(29, 30) + SourceIndex(0) +7 >Emitted(21, 23) Source(29, 30) + SourceIndex(0) +8 >Emitted(21, 32) Source(29, 39) + SourceIndex(0) +9 >Emitted(21, 34) Source(29, 41) + SourceIndex(0) +10>Emitted(21, 36) Source(29, 30) + SourceIndex(0) +11>Emitted(21, 50) Source(29, 41) + SourceIndex(0) +12>Emitted(21, 52) Source(29, 30) + SourceIndex(0) +13>Emitted(21, 56) Source(29, 41) + SourceIndex(0) +14>Emitted(21, 57) Source(29, 42) + SourceIndex(0) +--- +>>> _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(22, 5) Source(29, 6) + SourceIndex(0) +2 >Emitted(22, 16) Source(29, 26) + SourceIndex(0) +3 >Emitted(22, 18) Source(29, 9) + SourceIndex(0) +4 >Emitted(22, 28) Source(29, 25) + SourceIndex(0) +5 >Emitted(22, 30) Source(29, 9) + SourceIndex(0) +6 >Emitted(22, 67) Source(29, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(32, 30) + SourceIndex(0) +5 >Emitted(25, 16) Source(32, 46) + SourceIndex(0) +6 >Emitted(25, 18) Source(32, 30) + SourceIndex(0) +7 >Emitted(25, 24) Source(32, 31) + SourceIndex(0) +8 >Emitted(25, 30) Source(32, 37) + SourceIndex(0) +9 >Emitted(25, 32) Source(32, 39) + SourceIndex(0) +10>Emitted(25, 38) Source(32, 45) + SourceIndex(0) +11>Emitted(25, 39) Source(32, 46) + SourceIndex(0) +12>Emitted(25, 41) Source(32, 30) + SourceIndex(0) +13>Emitted(25, 55) Source(32, 46) + SourceIndex(0) +14>Emitted(25, 57) Source(32, 30) + SourceIndex(0) +15>Emitted(25, 61) Source(32, 46) + SourceIndex(0) +16>Emitted(25, 62) Source(32, 47) + SourceIndex(0) +--- +>>> _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(26, 5) Source(32, 6) + SourceIndex(0) +2 >Emitted(26, 16) Source(32, 26) + SourceIndex(0) +3 >Emitted(26, 18) Source(32, 9) + SourceIndex(0) +4 >Emitted(26, 28) Source(32, 25) + SourceIndex(0) +5 >Emitted(26, 30) Source(32, 9) + SourceIndex(0) +6 >Emitted(26, 67) Source(32, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(27, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(27, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(27, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(38, 30) + SourceIndex(0) +5 >Emitted(29, 16) Source(38, 41) + SourceIndex(0) +6 >Emitted(29, 18) Source(38, 30) + SourceIndex(0) +7 >Emitted(29, 45) Source(38, 41) + SourceIndex(0) +8 >Emitted(29, 47) Source(38, 30) + SourceIndex(0) +9 >Emitted(29, 72) Source(38, 41) + SourceIndex(0) +10>Emitted(29, 74) Source(38, 30) + SourceIndex(0) +11>Emitted(29, 78) Source(38, 41) + SourceIndex(0) +12>Emitted(29, 79) Source(38, 42) + SourceIndex(0) +--- +>>> _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(30, 5) Source(35, 6) + SourceIndex(0) +2 >Emitted(30, 27) Source(38, 26) + SourceIndex(0) +3 >Emitted(30, 29) Source(35, 9) + SourceIndex(0) +4 >Emitted(30, 39) Source(38, 25) + SourceIndex(0) +5 >Emitted(30, 41) Source(35, 9) + SourceIndex(0) +6 >Emitted(30, 87) Source(38, 25) + SourceIndex(0) +7 >Emitted(30, 89) Source(36, 5) + SourceIndex(0) +8 >Emitted(30, 99) Source(36, 30) + SourceIndex(0) +9 >Emitted(30, 101) Source(36, 5) + SourceIndex(0) +10>Emitted(30, 147) Source(36, 30) + SourceIndex(0) +11>Emitted(30, 149) Source(37, 5) + SourceIndex(0) +12>Emitted(30, 159) Source(37, 34) + SourceIndex(0) +13>Emitted(30, 161) Source(37, 5) + SourceIndex(0) +14>Emitted(30, 211) Source(37, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(39, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(39, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(39, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(33, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(44, 30) + SourceIndex(0) +5 >Emitted(33, 16) Source(44, 46) + SourceIndex(0) +6 >Emitted(33, 18) Source(44, 30) + SourceIndex(0) +7 >Emitted(33, 23) Source(44, 30) + SourceIndex(0) +8 >Emitted(33, 37) Source(44, 44) + SourceIndex(0) +9 >Emitted(33, 39) Source(44, 46) + SourceIndex(0) +10>Emitted(33, 41) Source(44, 30) + SourceIndex(0) +11>Emitted(33, 55) Source(44, 46) + SourceIndex(0) +12>Emitted(33, 57) Source(44, 30) + SourceIndex(0) +13>Emitted(33, 61) Source(44, 46) + SourceIndex(0) +14>Emitted(33, 62) Source(44, 47) + SourceIndex(0) +--- +>>> _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(34, 5) Source(41, 6) + SourceIndex(0) +2 >Emitted(34, 16) Source(44, 26) + SourceIndex(0) +3 >Emitted(34, 18) Source(41, 9) + SourceIndex(0) +4 >Emitted(34, 28) Source(44, 25) + SourceIndex(0) +5 >Emitted(34, 30) Source(41, 9) + SourceIndex(0) +6 >Emitted(34, 76) Source(44, 25) + SourceIndex(0) +7 >Emitted(34, 78) Source(42, 5) + SourceIndex(0) +8 >Emitted(34, 88) Source(42, 30) + SourceIndex(0) +9 >Emitted(34, 90) Source(42, 5) + SourceIndex(0) +10>Emitted(34, 136) Source(42, 30) + SourceIndex(0) +11>Emitted(34, 138) Source(43, 5) + SourceIndex(0) +12>Emitted(34, 148) Source(43, 34) + SourceIndex(0) +13>Emitted(34, 150) Source(43, 5) + SourceIndex(0) +14>Emitted(34, 200) Source(43, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(45, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(45, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(45, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(46, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(37, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(50, 30) + SourceIndex(0) +5 >Emitted(37, 16) Source(50, 56) + SourceIndex(0) +6 >Emitted(37, 18) Source(50, 30) + SourceIndex(0) +7 >Emitted(37, 24) Source(50, 31) + SourceIndex(0) +8 >Emitted(37, 35) Source(50, 42) + SourceIndex(0) +9 >Emitted(37, 37) Source(50, 44) + SourceIndex(0) +10>Emitted(37, 48) Source(50, 55) + SourceIndex(0) +11>Emitted(37, 49) Source(50, 56) + SourceIndex(0) +12>Emitted(37, 51) Source(50, 30) + SourceIndex(0) +13>Emitted(37, 65) Source(50, 56) + SourceIndex(0) +14>Emitted(37, 67) Source(50, 30) + SourceIndex(0) +15>Emitted(37, 71) Source(50, 56) + SourceIndex(0) +16>Emitted(37, 72) Source(50, 57) + SourceIndex(0) +--- +>>> _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(38, 5) Source(47, 6) + SourceIndex(0) +2 >Emitted(38, 16) Source(50, 26) + SourceIndex(0) +3 >Emitted(38, 18) Source(47, 9) + SourceIndex(0) +4 >Emitted(38, 28) Source(50, 25) + SourceIndex(0) +5 >Emitted(38, 30) Source(47, 9) + SourceIndex(0) +6 >Emitted(38, 76) Source(50, 25) + SourceIndex(0) +7 >Emitted(38, 78) Source(48, 5) + SourceIndex(0) +8 >Emitted(38, 88) Source(48, 30) + SourceIndex(0) +9 >Emitted(38, 90) Source(48, 5) + SourceIndex(0) +10>Emitted(38, 136) Source(48, 30) + SourceIndex(0) +11>Emitted(38, 138) Source(49, 5) + SourceIndex(0) +12>Emitted(38, 148) Source(49, 34) + SourceIndex(0) +13>Emitted(38, 150) Source(49, 5) + SourceIndex(0) +14>Emitted(38, 200) Source(49, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(51, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(51, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(51, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(51, 17) + SourceIndex(0) +6 >Emitted(39, 30) Source(51, 30) + SourceIndex(0) +7 >Emitted(39, 31) Source(51, 31) + SourceIndex(0) +8 >Emitted(39, 32) Source(51, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(52, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([numberB = -1] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(54, 24) + SourceIndex(0) +5 >Emitted(41, 16) Source(54, 30) + SourceIndex(0) +6 >Emitted(41, 18) Source(54, 24) + SourceIndex(0) +7 >Emitted(41, 35) Source(54, 30) + SourceIndex(0) +8 >Emitted(41, 37) Source(54, 24) + SourceIndex(0) +9 >Emitted(41, 57) Source(54, 30) + SourceIndex(0) +10>Emitted(41, 59) Source(54, 24) + SourceIndex(0) +11>Emitted(41, 63) Source(54, 30) + SourceIndex(0) +12>Emitted(41, 64) Source(54, 31) + SourceIndex(0) +--- +>>> _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(42, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(42, 25) Source(54, 19) + SourceIndex(0) +3 >Emitted(42, 27) Source(54, 7) + SourceIndex(0) +4 >Emitted(42, 60) Source(54, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(55, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(55, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(55, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^-> +1-> + > +2 >for +3 > +4 > ([numberB = -1] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(57, 24) + SourceIndex(0) +5 >Emitted(45, 16) Source(57, 35) + SourceIndex(0) +6 >Emitted(45, 18) Source(57, 24) + SourceIndex(0) +7 >Emitted(45, 23) Source(57, 24) + SourceIndex(0) +8 >Emitted(45, 32) Source(57, 33) + SourceIndex(0) +9 >Emitted(45, 34) Source(57, 35) + SourceIndex(0) +10>Emitted(45, 36) Source(57, 24) + SourceIndex(0) +11>Emitted(45, 50) Source(57, 35) + SourceIndex(0) +12>Emitted(45, 52) Source(57, 24) + SourceIndex(0) +13>Emitted(45, 56) Source(57, 35) + SourceIndex(0) +14>Emitted(45, 57) Source(57, 36) + SourceIndex(0) +--- +>>> _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(46, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(46, 20) Source(57, 19) + SourceIndex(0) +3 >Emitted(46, 22) Source(57, 7) + SourceIndex(0) +4 >Emitted(46, 57) Source(57, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(58, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(58, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(58, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberB = -1] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(60, 24) + SourceIndex(0) +5 >Emitted(49, 17) Source(60, 40) + SourceIndex(0) +6 >Emitted(49, 19) Source(60, 24) + SourceIndex(0) +7 >Emitted(49, 26) Source(60, 25) + SourceIndex(0) +8 >Emitted(49, 32) Source(60, 31) + SourceIndex(0) +9 >Emitted(49, 34) Source(60, 33) + SourceIndex(0) +10>Emitted(49, 40) Source(60, 39) + SourceIndex(0) +11>Emitted(49, 41) Source(60, 40) + SourceIndex(0) +12>Emitted(49, 43) Source(60, 24) + SourceIndex(0) +13>Emitted(49, 59) Source(60, 40) + SourceIndex(0) +14>Emitted(49, 61) Source(60, 24) + SourceIndex(0) +15>Emitted(49, 66) Source(60, 40) + SourceIndex(0) +16>Emitted(49, 67) Source(60, 41) + SourceIndex(0) +--- +>>> _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(50, 5) Source(60, 7) + SourceIndex(0) +2 >Emitted(50, 22) Source(60, 19) + SourceIndex(0) +3 >Emitted(50, 24) Source(60, 7) + SourceIndex(0) +4 >Emitted(50, 59) Source(60, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(51, 24) Source(61, 24) + SourceIndex(0) +7 >Emitted(51, 25) Source(61, 25) + SourceIndex(0) +8 >Emitted(51, 26) Source(61, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(63, 28) + SourceIndex(0) +5 >Emitted(53, 17) Source(63, 39) + SourceIndex(0) +6 >Emitted(53, 19) Source(63, 28) + SourceIndex(0) +7 >Emitted(53, 46) Source(63, 39) + SourceIndex(0) +8 >Emitted(53, 48) Source(63, 28) + SourceIndex(0) +9 >Emitted(53, 74) Source(63, 39) + SourceIndex(0) +10>Emitted(53, 76) Source(63, 28) + SourceIndex(0) +11>Emitted(53, 81) Source(63, 39) + SourceIndex(0) +12>Emitted(53, 82) Source(63, 40) + SourceIndex(0) +--- +>>> _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(54, 5) Source(63, 7) + SourceIndex(0) +2 >Emitted(54, 32) Source(63, 23) + SourceIndex(0) +3 >Emitted(54, 34) Source(63, 7) + SourceIndex(0) +4 >Emitted(54, 73) Source(63, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(64, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(64, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(64, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(64, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(64, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(64, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(64, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(65, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(66, 28) + SourceIndex(0) +5 >Emitted(57, 17) Source(66, 44) + SourceIndex(0) +6 >Emitted(57, 19) Source(66, 28) + SourceIndex(0) +7 >Emitted(57, 25) Source(66, 28) + SourceIndex(0) +8 >Emitted(57, 39) Source(66, 42) + SourceIndex(0) +9 >Emitted(57, 41) Source(66, 44) + SourceIndex(0) +10>Emitted(57, 43) Source(66, 28) + SourceIndex(0) +11>Emitted(57, 59) Source(66, 44) + SourceIndex(0) +12>Emitted(57, 61) Source(66, 28) + SourceIndex(0) +13>Emitted(57, 66) Source(66, 44) + SourceIndex(0) +14>Emitted(57, 67) Source(66, 45) + SourceIndex(0) +--- +>>> _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(58, 5) Source(66, 7) + SourceIndex(0) +2 >Emitted(58, 22) Source(66, 23) + SourceIndex(0) +3 >Emitted(58, 24) Source(66, 7) + SourceIndex(0) +4 >Emitted(58, 63) Source(66, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(67, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(67, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(67, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(67, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(67, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(67, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(67, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(68, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(61, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(69, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(69, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(69, 28) + SourceIndex(0) +5 >Emitted(61, 17) Source(69, 54) + SourceIndex(0) +6 >Emitted(61, 19) Source(69, 28) + SourceIndex(0) +7 >Emitted(61, 26) Source(69, 29) + SourceIndex(0) +8 >Emitted(61, 37) Source(69, 40) + SourceIndex(0) +9 >Emitted(61, 39) Source(69, 42) + SourceIndex(0) +10>Emitted(61, 50) Source(69, 53) + SourceIndex(0) +11>Emitted(61, 51) Source(69, 54) + SourceIndex(0) +12>Emitted(61, 53) Source(69, 28) + SourceIndex(0) +13>Emitted(61, 69) Source(69, 54) + SourceIndex(0) +14>Emitted(61, 71) Source(69, 28) + SourceIndex(0) +15>Emitted(61, 76) Source(69, 54) + SourceIndex(0) +16>Emitted(61, 77) Source(69, 55) + SourceIndex(0) +--- +>>> _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(62, 5) Source(69, 7) + SourceIndex(0) +2 >Emitted(62, 22) Source(69, 23) + SourceIndex(0) +3 >Emitted(62, 24) Source(69, 7) + SourceIndex(0) +4 >Emitted(62, 63) Source(69, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(63, 5) Source(70, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(70, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(70, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(70, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(70, 17) + SourceIndex(0) +6 >Emitted(63, 22) Source(70, 22) + SourceIndex(0) +7 >Emitted(63, 23) Source(70, 23) + SourceIndex(0) +8 >Emitted(63, 24) Source(70, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(71, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(65, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(73, 63) + SourceIndex(0) +5 >Emitted(65, 17) Source(73, 69) + SourceIndex(0) +6 >Emitted(65, 19) Source(73, 63) + SourceIndex(0) +7 >Emitted(65, 36) Source(73, 69) + SourceIndex(0) +8 >Emitted(65, 38) Source(73, 63) + SourceIndex(0) +9 >Emitted(65, 59) Source(73, 69) + SourceIndex(0) +10>Emitted(65, 61) Source(73, 63) + SourceIndex(0) +11>Emitted(65, 66) Source(73, 69) + SourceIndex(0) +12>Emitted(65, 67) Source(73, 70) + SourceIndex(0) +--- +>>> _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(66, 5) Source(73, 6) + SourceIndex(0) +2 >Emitted(66, 24) Source(73, 59) + SourceIndex(0) +3 >Emitted(66, 26) Source(73, 7) + SourceIndex(0) +4 >Emitted(66, 38) Source(73, 20) + SourceIndex(0) +5 >Emitted(66, 40) Source(73, 7) + SourceIndex(0) +6 >Emitted(66, 76) Source(73, 20) + SourceIndex(0) +7 >Emitted(66, 78) Source(73, 22) + SourceIndex(0) +8 >Emitted(66, 90) Source(73, 39) + SourceIndex(0) +9 >Emitted(66, 92) Source(73, 22) + SourceIndex(0) +10>Emitted(66, 132) Source(73, 39) + SourceIndex(0) +11>Emitted(66, 134) Source(73, 41) + SourceIndex(0) +12>Emitted(66, 146) Source(73, 58) + SourceIndex(0) +13>Emitted(66, 148) Source(73, 41) + SourceIndex(0) +14>Emitted(66, 188) Source(73, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(74, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(74, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(74, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(74, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(74, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(74, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(74, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(75, 2) + SourceIndex(0) +--- +>>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(69, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(76, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(76, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(76, 63) + SourceIndex(0) +5 >Emitted(69, 17) Source(76, 74) + SourceIndex(0) +6 >Emitted(69, 19) Source(76, 63) + SourceIndex(0) +7 >Emitted(69, 25) Source(76, 63) + SourceIndex(0) +8 >Emitted(69, 34) Source(76, 72) + SourceIndex(0) +9 >Emitted(69, 36) Source(76, 74) + SourceIndex(0) +10>Emitted(69, 38) Source(76, 63) + SourceIndex(0) +11>Emitted(69, 54) Source(76, 74) + SourceIndex(0) +12>Emitted(69, 56) Source(76, 63) + SourceIndex(0) +13>Emitted(69, 61) Source(76, 74) + SourceIndex(0) +14>Emitted(69, 62) Source(76, 75) + SourceIndex(0) +--- +>>> _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(70, 5) Source(76, 6) + SourceIndex(0) +2 >Emitted(70, 19) Source(76, 59) + SourceIndex(0) +3 >Emitted(70, 21) Source(76, 7) + SourceIndex(0) +4 >Emitted(70, 33) Source(76, 20) + SourceIndex(0) +5 >Emitted(70, 35) Source(76, 7) + SourceIndex(0) +6 >Emitted(70, 71) Source(76, 20) + SourceIndex(0) +7 >Emitted(70, 73) Source(76, 22) + SourceIndex(0) +8 >Emitted(70, 85) Source(76, 39) + SourceIndex(0) +9 >Emitted(70, 87) Source(76, 22) + SourceIndex(0) +10>Emitted(70, 127) Source(76, 39) + SourceIndex(0) +11>Emitted(70, 129) Source(76, 41) + SourceIndex(0) +12>Emitted(70, 141) Source(76, 58) + SourceIndex(0) +13>Emitted(70, 143) Source(76, 41) + SourceIndex(0) +14>Emitted(70, 183) Source(76, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(77, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(77, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(77, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(73, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(79, 63) + SourceIndex(0) +5 >Emitted(73, 17) Source(79, 79) + SourceIndex(0) +6 >Emitted(73, 19) Source(79, 63) + SourceIndex(0) +7 >Emitted(73, 26) Source(79, 64) + SourceIndex(0) +8 >Emitted(73, 32) Source(79, 70) + SourceIndex(0) +9 >Emitted(73, 34) Source(79, 72) + SourceIndex(0) +10>Emitted(73, 40) Source(79, 78) + SourceIndex(0) +11>Emitted(73, 41) Source(79, 79) + SourceIndex(0) +12>Emitted(73, 43) Source(79, 63) + SourceIndex(0) +13>Emitted(73, 59) Source(79, 79) + SourceIndex(0) +14>Emitted(73, 61) Source(79, 63) + SourceIndex(0) +15>Emitted(73, 66) Source(79, 79) + SourceIndex(0) +16>Emitted(73, 67) Source(79, 80) + SourceIndex(0) +--- +>>> _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(74, 5) Source(79, 6) + SourceIndex(0) +2 >Emitted(74, 19) Source(79, 59) + SourceIndex(0) +3 >Emitted(74, 21) Source(79, 7) + SourceIndex(0) +4 >Emitted(74, 33) Source(79, 20) + SourceIndex(0) +5 >Emitted(74, 35) Source(79, 7) + SourceIndex(0) +6 >Emitted(74, 71) Source(79, 20) + SourceIndex(0) +7 >Emitted(74, 73) Source(79, 22) + SourceIndex(0) +8 >Emitted(74, 85) Source(79, 39) + SourceIndex(0) +9 >Emitted(74, 87) Source(79, 22) + SourceIndex(0) +10>Emitted(74, 127) Source(79, 39) + SourceIndex(0) +11>Emitted(74, 129) Source(79, 41) + SourceIndex(0) +12>Emitted(74, 141) Source(79, 58) + SourceIndex(0) +13>Emitted(74, 143) Source(79, 41) + SourceIndex(0) +14>Emitted(74, 183) Source(79, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(75, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(80, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(80, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(80, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(80, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(80, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(80, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(80, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(81, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(77, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(82, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(82, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(85, 30) + SourceIndex(0) +5 >Emitted(77, 17) Source(85, 41) + SourceIndex(0) +6 >Emitted(77, 19) Source(85, 30) + SourceIndex(0) +7 >Emitted(77, 46) Source(85, 41) + SourceIndex(0) +8 >Emitted(77, 48) Source(85, 30) + SourceIndex(0) +9 >Emitted(77, 74) Source(85, 41) + SourceIndex(0) +10>Emitted(77, 76) Source(85, 30) + SourceIndex(0) +11>Emitted(77, 81) Source(85, 41) + SourceIndex(0) +12>Emitted(77, 82) Source(85, 42) + SourceIndex(0) +--- +>>> _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(78, 5) Source(82, 6) + SourceIndex(0) +2 >Emitted(78, 29) Source(85, 26) + SourceIndex(0) +3 >Emitted(78, 31) Source(82, 7) + SourceIndex(0) +4 >Emitted(78, 43) Source(82, 24) + SourceIndex(0) +5 >Emitted(78, 45) Source(82, 7) + SourceIndex(0) +6 >Emitted(78, 85) Source(82, 24) + SourceIndex(0) +7 >Emitted(78, 87) Source(82, 26) + SourceIndex(0) +8 >Emitted(78, 99) Source(85, 25) + SourceIndex(0) +9 >Emitted(78, 101) Source(82, 26) + SourceIndex(0) +10>Emitted(78, 150) Source(85, 25) + SourceIndex(0) +11>Emitted(78, 152) Source(83, 5) + SourceIndex(0) +12>Emitted(78, 164) Source(83, 30) + SourceIndex(0) +13>Emitted(78, 166) Source(83, 5) + SourceIndex(0) +14>Emitted(78, 214) Source(83, 30) + SourceIndex(0) +15>Emitted(78, 216) Source(84, 5) + SourceIndex(0) +16>Emitted(78, 228) Source(84, 34) + SourceIndex(0) +17>Emitted(78, 230) Source(84, 5) + SourceIndex(0) +18>Emitted(78, 282) Source(84, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(86, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(86, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(86, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(86, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(86, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(86, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(86, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(86, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(87, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(81, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(88, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(88, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(91, 30) + SourceIndex(0) +5 >Emitted(81, 17) Source(91, 46) + SourceIndex(0) +6 >Emitted(81, 19) Source(91, 30) + SourceIndex(0) +7 >Emitted(81, 25) Source(91, 30) + SourceIndex(0) +8 >Emitted(81, 39) Source(91, 44) + SourceIndex(0) +9 >Emitted(81, 41) Source(91, 46) + SourceIndex(0) +10>Emitted(81, 43) Source(91, 30) + SourceIndex(0) +11>Emitted(81, 59) Source(91, 46) + SourceIndex(0) +12>Emitted(81, 61) Source(91, 30) + SourceIndex(0) +13>Emitted(81, 66) Source(91, 46) + SourceIndex(0) +14>Emitted(81, 67) Source(91, 47) + SourceIndex(0) +--- +>>> _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(82, 5) Source(88, 6) + SourceIndex(0) +2 >Emitted(82, 19) Source(91, 26) + SourceIndex(0) +3 >Emitted(82, 21) Source(88, 7) + SourceIndex(0) +4 >Emitted(82, 33) Source(88, 24) + SourceIndex(0) +5 >Emitted(82, 35) Source(88, 7) + SourceIndex(0) +6 >Emitted(82, 75) Source(88, 24) + SourceIndex(0) +7 >Emitted(82, 77) Source(88, 26) + SourceIndex(0) +8 >Emitted(82, 89) Source(91, 25) + SourceIndex(0) +9 >Emitted(82, 91) Source(88, 26) + SourceIndex(0) +10>Emitted(82, 140) Source(91, 25) + SourceIndex(0) +11>Emitted(82, 142) Source(89, 5) + SourceIndex(0) +12>Emitted(82, 154) Source(89, 30) + SourceIndex(0) +13>Emitted(82, 156) Source(89, 5) + SourceIndex(0) +14>Emitted(82, 204) Source(89, 30) + SourceIndex(0) +15>Emitted(82, 206) Source(90, 5) + SourceIndex(0) +16>Emitted(82, 218) Source(90, 34) + SourceIndex(0) +17>Emitted(82, 220) Source(90, 5) + SourceIndex(0) +18>Emitted(82, 272) Source(90, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(92, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(92, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(92, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(85, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(97, 30) + SourceIndex(0) +5 >Emitted(85, 17) Source(97, 56) + SourceIndex(0) +6 >Emitted(85, 19) Source(97, 30) + SourceIndex(0) +7 >Emitted(85, 26) Source(97, 31) + SourceIndex(0) +8 >Emitted(85, 37) Source(97, 42) + SourceIndex(0) +9 >Emitted(85, 39) Source(97, 44) + SourceIndex(0) +10>Emitted(85, 50) Source(97, 55) + SourceIndex(0) +11>Emitted(85, 51) Source(97, 56) + SourceIndex(0) +12>Emitted(85, 53) Source(97, 30) + SourceIndex(0) +13>Emitted(85, 69) Source(97, 56) + SourceIndex(0) +14>Emitted(85, 71) Source(97, 30) + SourceIndex(0) +15>Emitted(85, 76) Source(97, 56) + SourceIndex(0) +16>Emitted(85, 77) Source(97, 57) + SourceIndex(0) +--- +>>> _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(86, 5) Source(94, 6) + SourceIndex(0) +2 >Emitted(86, 19) Source(97, 26) + SourceIndex(0) +3 >Emitted(86, 21) Source(94, 7) + SourceIndex(0) +4 >Emitted(86, 33) Source(94, 24) + SourceIndex(0) +5 >Emitted(86, 35) Source(94, 7) + SourceIndex(0) +6 >Emitted(86, 75) Source(94, 24) + SourceIndex(0) +7 >Emitted(86, 77) Source(94, 26) + SourceIndex(0) +8 >Emitted(86, 89) Source(97, 25) + SourceIndex(0) +9 >Emitted(86, 91) Source(94, 26) + SourceIndex(0) +10>Emitted(86, 140) Source(97, 25) + SourceIndex(0) +11>Emitted(86, 142) Source(95, 5) + SourceIndex(0) +12>Emitted(86, 154) Source(95, 30) + SourceIndex(0) +13>Emitted(86, 156) Source(95, 5) + SourceIndex(0) +14>Emitted(86, 204) Source(95, 30) + SourceIndex(0) +15>Emitted(86, 206) Source(96, 5) + SourceIndex(0) +16>Emitted(86, 218) Source(96, 34) + SourceIndex(0) +17>Emitted(86, 220) Source(96, 5) + SourceIndex(0) +18>Emitted(86, 272) Source(96, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(87, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(87, 23) Source(98, 23) + SourceIndex(0) +7 >Emitted(87, 24) Source(98, 24) + SourceIndex(0) +8 >Emitted(87, 25) Source(98, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(89, 1) Source(101, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(101, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(101, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(101, 40) + SourceIndex(0) +5 >Emitted(89, 17) Source(101, 46) + SourceIndex(0) +6 >Emitted(89, 19) Source(101, 40) + SourceIndex(0) +7 >Emitted(89, 36) Source(101, 46) + SourceIndex(0) +8 >Emitted(89, 38) Source(101, 40) + SourceIndex(0) +9 >Emitted(89, 59) Source(101, 46) + SourceIndex(0) +10>Emitted(89, 61) Source(101, 40) + SourceIndex(0) +11>Emitted(89, 66) Source(101, 46) + SourceIndex(0) +12>Emitted(89, 67) Source(101, 47) + SourceIndex(0) +--- +>>> _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(90, 5) Source(101, 6) + SourceIndex(0) +2 >Emitted(90, 24) Source(101, 36) + SourceIndex(0) +3 >Emitted(90, 26) Source(101, 7) + SourceIndex(0) +4 >Emitted(90, 38) Source(101, 20) + SourceIndex(0) +5 >Emitted(90, 40) Source(101, 7) + SourceIndex(0) +6 >Emitted(90, 76) Source(101, 20) + SourceIndex(0) +7 >Emitted(90, 78) Source(101, 22) + SourceIndex(0) +8 >Emitted(90, 103) Source(101, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(102, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(102, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(102, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(102, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(102, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(102, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(102, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(102, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(103, 2) + SourceIndex(0) +--- +>>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(93, 1) Source(104, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(104, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(104, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(104, 40) + SourceIndex(0) +5 >Emitted(93, 17) Source(104, 51) + SourceIndex(0) +6 >Emitted(93, 19) Source(104, 40) + SourceIndex(0) +7 >Emitted(93, 25) Source(104, 40) + SourceIndex(0) +8 >Emitted(93, 34) Source(104, 49) + SourceIndex(0) +9 >Emitted(93, 36) Source(104, 51) + SourceIndex(0) +10>Emitted(93, 38) Source(104, 40) + SourceIndex(0) +11>Emitted(93, 54) Source(104, 51) + SourceIndex(0) +12>Emitted(93, 56) Source(104, 40) + SourceIndex(0) +13>Emitted(93, 61) Source(104, 51) + SourceIndex(0) +14>Emitted(93, 62) Source(104, 52) + SourceIndex(0) +--- +>>> _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(94, 5) Source(104, 6) + SourceIndex(0) +2 >Emitted(94, 19) Source(104, 36) + SourceIndex(0) +3 >Emitted(94, 21) Source(104, 7) + SourceIndex(0) +4 >Emitted(94, 33) Source(104, 20) + SourceIndex(0) +5 >Emitted(94, 35) Source(104, 7) + SourceIndex(0) +6 >Emitted(94, 71) Source(104, 20) + SourceIndex(0) +7 >Emitted(94, 73) Source(104, 22) + SourceIndex(0) +8 >Emitted(94, 98) Source(104, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(105, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(105, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(105, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(105, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(105, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(105, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(105, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(105, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(106, 2) + SourceIndex(0) +--- +>>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(97, 1) Source(107, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(107, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(107, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(107, 40) + SourceIndex(0) +5 >Emitted(97, 17) Source(107, 56) + SourceIndex(0) +6 >Emitted(97, 19) Source(107, 40) + SourceIndex(0) +7 >Emitted(97, 26) Source(107, 41) + SourceIndex(0) +8 >Emitted(97, 32) Source(107, 47) + SourceIndex(0) +9 >Emitted(97, 34) Source(107, 49) + SourceIndex(0) +10>Emitted(97, 40) Source(107, 55) + SourceIndex(0) +11>Emitted(97, 41) Source(107, 56) + SourceIndex(0) +12>Emitted(97, 43) Source(107, 40) + SourceIndex(0) +13>Emitted(97, 59) Source(107, 56) + SourceIndex(0) +14>Emitted(97, 61) Source(107, 40) + SourceIndex(0) +15>Emitted(97, 66) Source(107, 56) + SourceIndex(0) +16>Emitted(97, 67) Source(107, 57) + SourceIndex(0) +--- +>>> _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(98, 5) Source(107, 6) + SourceIndex(0) +2 >Emitted(98, 19) Source(107, 36) + SourceIndex(0) +3 >Emitted(98, 21) Source(107, 7) + SourceIndex(0) +4 >Emitted(98, 33) Source(107, 20) + SourceIndex(0) +5 >Emitted(98, 35) Source(107, 7) + SourceIndex(0) +6 >Emitted(98, 71) Source(107, 20) + SourceIndex(0) +7 >Emitted(98, 73) Source(107, 22) + SourceIndex(0) +8 >Emitted(98, 98) Source(107, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(99, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(99, 25) Source(108, 25) + SourceIndex(0) +7 >Emitted(99, 26) Source(108, 26) + SourceIndex(0) +8 >Emitted(99, 27) Source(108, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(109, 2) + SourceIndex(0) +--- +>>>var _a, _b, _e, _f, _j, _k, _m, _o, _p, _q, _r, _u, _v, _w, _x, _y, _1, _2, _3, _4, _5, _7, _10, _13, _15, _18, _21, _23, _24, _25, _26, _29, _30, _31, _32, _35, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _67, _68, _71, _72; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..6b16ace03ea --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,345 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 54)) + +for ([, nameA = "noName"] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, nameA = "noName"] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, nameA = "noName"] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} + +for ([numberB = -1] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([numberB = -1] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([numberB = -1] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([nameB = "noName"] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} +for ([nameB = "noName"] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..14189ad9d81 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types @@ -0,0 +1,544 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +for ([, nameA = "noName"] of robots) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "noName"] of getRobots()) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "noName"] of [robotA, robotB]) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB = -1] of robots) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] of getRobots()) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] of [robotA, robotB]) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB = "noName"] of multiRobots) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "noName"] of getMultiRobots()) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js new file mode 100644 index 00000000000..247e23ff1f1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js @@ -0,0 +1,130 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA } of robots) { + console.log(nameA); +} +for (let {name: nameA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var nameA = robots_1[_i].name; + console.log(nameA); +} +for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { + var nameA = _b[_a].name; + console.log(nameA); +} +for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { + var nameA = _d[_c].name; + console.log(nameA); +} +for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { + var _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; + console.log(primaryA); +} +for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { + var _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; + console.log(primaryA); +} +for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { + var _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; + console.log(primaryA); +} +for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { + var _p = robots_2[_o], nameA = _p.name, skillA = _p.skill; + console.log(nameA); +} +for (var _q = 0, _r = getRobots(); _q < _r.length; _q++) { + var _s = _r[_q], nameA = _s.name, skillA = _s.skill; + console.log(nameA); +} +for (var _t = 0, _u = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _t < _u.length; _t++) { + var _v = _u[_t], nameA = _v.name, skillA = _v.skill; + console.log(nameA); +} +for (var _w = 0, multiRobots_2 = multiRobots; _w < multiRobots_2.length; _w++) { + var _x = multiRobots_2[_w], nameA = _x.name, _y = _x.skills, primaryA = _y.primary, secondaryA = _y.secondary; + console.log(nameA); +} +for (var _z = 0, _0 = getMultiRobots(); _z < _0.length; _z++) { + var _1 = _0[_z], nameA = _1.name, _2 = _1.skills, primaryA = _2.primary, secondaryA = _2.secondary; + console.log(nameA); +} +for (var _3 = 0, _4 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _3 < _4.length; _3++) { + var _5 = _4[_3], nameA = _5.name, _6 = _5.skills, primaryA = _6.primary, secondaryA = _6.secondary; + console.log(nameA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map new file mode 100644 index 00000000000..3f10e267eb9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,6BAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,uBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9F,uBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAiE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtE,iCAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3E,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UACS,EADT,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADT,cACS,EADT,IACS,CAAC;IADpE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAEzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAsC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA5C,qBAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAjD,eAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAlH,eAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAxF,0BAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7F,eAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UACH,EADG,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjJ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADG,cACH,EADG,IACH,CAAC;IAD1E,eAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..5403a0863a3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt @@ -0,0 +1,1811 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let {name: nameA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(29, 28) + SourceIndex(0) +5 >Emitted(10, 16) Source(29, 34) + SourceIndex(0) +6 >Emitted(10, 18) Source(29, 28) + SourceIndex(0) +7 >Emitted(10, 35) Source(29, 34) + SourceIndex(0) +8 >Emitted(10, 37) Source(29, 28) + SourceIndex(0) +9 >Emitted(10, 57) Source(29, 34) + SourceIndex(0) +10>Emitted(10, 59) Source(29, 28) + SourceIndex(0) +11>Emitted(10, 63) Source(29, 34) + SourceIndex(0) +12>Emitted(10, 64) Source(29, 35) + SourceIndex(0) +--- +>>> var nameA = robots_1[_i].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(11, 5) Source(29, 11) + SourceIndex(0) +2 >Emitted(11, 34) Source(29, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 28) + SourceIndex(0) +5 >Emitted(14, 16) Source(32, 39) + SourceIndex(0) +6 >Emitted(14, 18) Source(32, 28) + SourceIndex(0) +7 >Emitted(14, 23) Source(32, 28) + SourceIndex(0) +8 >Emitted(14, 32) Source(32, 37) + SourceIndex(0) +9 >Emitted(14, 34) Source(32, 39) + SourceIndex(0) +10>Emitted(14, 36) Source(32, 28) + SourceIndex(0) +11>Emitted(14, 50) Source(32, 39) + SourceIndex(0) +12>Emitted(14, 52) Source(32, 28) + SourceIndex(0) +13>Emitted(14, 56) Source(32, 39) + SourceIndex(0) +14>Emitted(14, 57) Source(32, 40) + SourceIndex(0) +--- +>>> var nameA = _b[_a].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(15, 5) Source(32, 11) + SourceIndex(0) +2 >Emitted(15, 28) Source(32, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 28) + SourceIndex(0) +5 >Emitted(18, 16) Source(35, 104) + SourceIndex(0) +6 >Emitted(18, 18) Source(35, 28) + SourceIndex(0) +7 >Emitted(18, 24) Source(35, 29) + SourceIndex(0) +8 >Emitted(18, 26) Source(35, 31) + SourceIndex(0) +9 >Emitted(18, 30) Source(35, 35) + SourceIndex(0) +10>Emitted(18, 32) Source(35, 37) + SourceIndex(0) +11>Emitted(18, 39) Source(35, 44) + SourceIndex(0) +12>Emitted(18, 41) Source(35, 46) + SourceIndex(0) +13>Emitted(18, 46) Source(35, 51) + SourceIndex(0) +14>Emitted(18, 48) Source(35, 53) + SourceIndex(0) +15>Emitted(18, 56) Source(35, 61) + SourceIndex(0) +16>Emitted(18, 58) Source(35, 63) + SourceIndex(0) +17>Emitted(18, 60) Source(35, 65) + SourceIndex(0) +18>Emitted(18, 62) Source(35, 67) + SourceIndex(0) +19>Emitted(18, 66) Source(35, 71) + SourceIndex(0) +20>Emitted(18, 68) Source(35, 73) + SourceIndex(0) +21>Emitted(18, 77) Source(35, 82) + SourceIndex(0) +22>Emitted(18, 79) Source(35, 84) + SourceIndex(0) +23>Emitted(18, 84) Source(35, 89) + SourceIndex(0) +24>Emitted(18, 86) Source(35, 91) + SourceIndex(0) +25>Emitted(18, 96) Source(35, 101) + SourceIndex(0) +26>Emitted(18, 98) Source(35, 103) + SourceIndex(0) +27>Emitted(18, 99) Source(35, 104) + SourceIndex(0) +28>Emitted(18, 101) Source(35, 28) + SourceIndex(0) +29>Emitted(18, 115) Source(35, 104) + SourceIndex(0) +30>Emitted(18, 117) Source(35, 28) + SourceIndex(0) +31>Emitted(18, 121) Source(35, 104) + SourceIndex(0) +32>Emitted(18, 122) Source(35, 105) + SourceIndex(0) +--- +>>> var nameA = _d[_c].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(19, 5) Source(35, 11) + SourceIndex(0) +2 >Emitted(19, 28) Source(35, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(20, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(20, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(20, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(21, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(38, 70) + SourceIndex(0) +5 >Emitted(22, 16) Source(38, 81) + SourceIndex(0) +6 >Emitted(22, 18) Source(38, 70) + SourceIndex(0) +7 >Emitted(22, 45) Source(38, 81) + SourceIndex(0) +8 >Emitted(22, 47) Source(38, 70) + SourceIndex(0) +9 >Emitted(22, 72) Source(38, 81) + SourceIndex(0) +10>Emitted(22, 74) Source(38, 70) + SourceIndex(0) +11>Emitted(22, 78) Source(38, 81) + SourceIndex(0) +12>Emitted(22, 79) Source(38, 82) + SourceIndex(0) +--- +>>> var _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(23, 5) Source(38, 12) + SourceIndex(0) +2 >Emitted(23, 38) Source(38, 64) + SourceIndex(0) +3 >Emitted(23, 40) Source(38, 22) + SourceIndex(0) +4 >Emitted(23, 61) Source(38, 39) + SourceIndex(0) +5 >Emitted(23, 63) Source(38, 41) + SourceIndex(0) +6 >Emitted(23, 88) Source(38, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(25, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(26, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(41, 70) + SourceIndex(0) +5 >Emitted(26, 16) Source(41, 86) + SourceIndex(0) +6 >Emitted(26, 18) Source(41, 70) + SourceIndex(0) +7 >Emitted(26, 23) Source(41, 70) + SourceIndex(0) +8 >Emitted(26, 37) Source(41, 84) + SourceIndex(0) +9 >Emitted(26, 39) Source(41, 86) + SourceIndex(0) +10>Emitted(26, 41) Source(41, 70) + SourceIndex(0) +11>Emitted(26, 55) Source(41, 86) + SourceIndex(0) +12>Emitted(26, 57) Source(41, 70) + SourceIndex(0) +13>Emitted(26, 61) Source(41, 86) + SourceIndex(0) +14>Emitted(26, 62) Source(41, 87) + SourceIndex(0) +--- +>>> var _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(27, 5) Source(41, 12) + SourceIndex(0) +2 >Emitted(27, 27) Source(41, 64) + SourceIndex(0) +3 >Emitted(27, 29) Source(41, 22) + SourceIndex(0) +4 >Emitted(27, 50) Source(41, 39) + SourceIndex(0) +5 >Emitted(27, 52) Source(41, 41) + SourceIndex(0) +6 >Emitted(27, 77) Source(41, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(29, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(44, 70) + SourceIndex(0) +5 >Emitted(30, 16) Source(45, 79) + SourceIndex(0) +6 >Emitted(30, 18) Source(44, 70) + SourceIndex(0) +7 >Emitted(30, 24) Source(44, 71) + SourceIndex(0) +8 >Emitted(30, 26) Source(44, 73) + SourceIndex(0) +9 >Emitted(30, 30) Source(44, 77) + SourceIndex(0) +10>Emitted(30, 32) Source(44, 79) + SourceIndex(0) +11>Emitted(30, 39) Source(44, 86) + SourceIndex(0) +12>Emitted(30, 41) Source(44, 88) + SourceIndex(0) +13>Emitted(30, 47) Source(44, 94) + SourceIndex(0) +14>Emitted(30, 49) Source(44, 96) + SourceIndex(0) +15>Emitted(30, 51) Source(44, 98) + SourceIndex(0) +16>Emitted(30, 58) Source(44, 105) + SourceIndex(0) +17>Emitted(30, 60) Source(44, 107) + SourceIndex(0) +18>Emitted(30, 68) Source(44, 115) + SourceIndex(0) +19>Emitted(30, 70) Source(44, 117) + SourceIndex(0) +20>Emitted(30, 79) Source(44, 126) + SourceIndex(0) +21>Emitted(30, 81) Source(44, 128) + SourceIndex(0) +22>Emitted(30, 87) Source(44, 134) + SourceIndex(0) +23>Emitted(30, 89) Source(44, 136) + SourceIndex(0) +24>Emitted(30, 91) Source(44, 138) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(31, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(31, 7) Source(45, 7) + SourceIndex(0) +3 >Emitted(31, 11) Source(45, 11) + SourceIndex(0) +4 >Emitted(31, 13) Source(45, 13) + SourceIndex(0) +5 >Emitted(31, 22) Source(45, 22) + SourceIndex(0) +6 >Emitted(31, 24) Source(45, 24) + SourceIndex(0) +7 >Emitted(31, 30) Source(45, 30) + SourceIndex(0) +8 >Emitted(31, 32) Source(45, 32) + SourceIndex(0) +9 >Emitted(31, 34) Source(45, 34) + SourceIndex(0) +10>Emitted(31, 41) Source(45, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(45, 43) + SourceIndex(0) +12>Emitted(31, 53) Source(45, 53) + SourceIndex(0) +13>Emitted(31, 55) Source(45, 55) + SourceIndex(0) +14>Emitted(31, 64) Source(45, 64) + SourceIndex(0) +15>Emitted(31, 66) Source(45, 66) + SourceIndex(0) +16>Emitted(31, 74) Source(45, 74) + SourceIndex(0) +17>Emitted(31, 76) Source(45, 76) + SourceIndex(0) +18>Emitted(31, 78) Source(45, 78) + SourceIndex(0) +19>Emitted(31, 79) Source(45, 79) + SourceIndex(0) +20>Emitted(31, 81) Source(44, 70) + SourceIndex(0) +21>Emitted(31, 95) Source(45, 79) + SourceIndex(0) +22>Emitted(31, 97) Source(44, 70) + SourceIndex(0) +23>Emitted(31, 101) Source(45, 79) + SourceIndex(0) +24>Emitted(31, 102) Source(45, 80) + SourceIndex(0) +--- +>>> var _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1 >Emitted(32, 5) Source(44, 12) + SourceIndex(0) +2 >Emitted(32, 27) Source(44, 64) + SourceIndex(0) +3 >Emitted(32, 29) Source(44, 22) + SourceIndex(0) +4 >Emitted(32, 50) Source(44, 39) + SourceIndex(0) +5 >Emitted(32, 52) Source(44, 41) + SourceIndex(0) +6 >Emitted(32, 77) Source(44, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(33, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(33, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(33, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(33, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(33, 25) Source(46, 25) + SourceIndex(0) +7 >Emitted(33, 26) Source(46, 26) + SourceIndex(0) +8 >Emitted(33, 27) Source(46, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(34, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(35, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(35, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(35, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(35, 6) Source(49, 43) + SourceIndex(0) +5 >Emitted(35, 16) Source(49, 49) + SourceIndex(0) +6 >Emitted(35, 18) Source(49, 43) + SourceIndex(0) +7 >Emitted(35, 35) Source(49, 49) + SourceIndex(0) +8 >Emitted(35, 37) Source(49, 43) + SourceIndex(0) +9 >Emitted(35, 57) Source(49, 49) + SourceIndex(0) +10>Emitted(35, 59) Source(49, 43) + SourceIndex(0) +11>Emitted(35, 63) Source(49, 49) + SourceIndex(0) +12>Emitted(35, 64) Source(49, 50) + SourceIndex(0) +--- +>>> var _p = robots_2[_o], nameA = _p.name, skillA = _p.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(36, 5) Source(49, 6) + SourceIndex(0) +2 >Emitted(36, 26) Source(49, 39) + SourceIndex(0) +3 >Emitted(36, 28) Source(49, 11) + SourceIndex(0) +4 >Emitted(36, 43) Source(49, 22) + SourceIndex(0) +5 >Emitted(36, 45) Source(49, 24) + SourceIndex(0) +6 >Emitted(36, 62) Source(49, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(38, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = getRobots(); _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(39, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(52, 43) + SourceIndex(0) +5 >Emitted(39, 16) Source(52, 54) + SourceIndex(0) +6 >Emitted(39, 18) Source(52, 43) + SourceIndex(0) +7 >Emitted(39, 23) Source(52, 43) + SourceIndex(0) +8 >Emitted(39, 32) Source(52, 52) + SourceIndex(0) +9 >Emitted(39, 34) Source(52, 54) + SourceIndex(0) +10>Emitted(39, 36) Source(52, 43) + SourceIndex(0) +11>Emitted(39, 50) Source(52, 54) + SourceIndex(0) +12>Emitted(39, 52) Source(52, 43) + SourceIndex(0) +13>Emitted(39, 56) Source(52, 54) + SourceIndex(0) +14>Emitted(39, 57) Source(52, 55) + SourceIndex(0) +--- +>>> var _s = _r[_q], nameA = _s.name, skillA = _s.skill; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1->Emitted(40, 5) Source(52, 6) + SourceIndex(0) +2 >Emitted(40, 20) Source(52, 39) + SourceIndex(0) +3 >Emitted(40, 22) Source(52, 11) + SourceIndex(0) +4 >Emitted(40, 37) Source(52, 22) + SourceIndex(0) +5 >Emitted(40, 39) Source(52, 24) + SourceIndex(0) +6 >Emitted(40, 56) Source(52, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(41, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(42, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _t = 0, _u = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _t < _u.length; _t++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(43, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(55, 43) + SourceIndex(0) +5 >Emitted(43, 16) Source(55, 119) + SourceIndex(0) +6 >Emitted(43, 18) Source(55, 43) + SourceIndex(0) +7 >Emitted(43, 24) Source(55, 44) + SourceIndex(0) +8 >Emitted(43, 26) Source(55, 46) + SourceIndex(0) +9 >Emitted(43, 30) Source(55, 50) + SourceIndex(0) +10>Emitted(43, 32) Source(55, 52) + SourceIndex(0) +11>Emitted(43, 39) Source(55, 59) + SourceIndex(0) +12>Emitted(43, 41) Source(55, 61) + SourceIndex(0) +13>Emitted(43, 46) Source(55, 66) + SourceIndex(0) +14>Emitted(43, 48) Source(55, 68) + SourceIndex(0) +15>Emitted(43, 56) Source(55, 76) + SourceIndex(0) +16>Emitted(43, 58) Source(55, 78) + SourceIndex(0) +17>Emitted(43, 60) Source(55, 80) + SourceIndex(0) +18>Emitted(43, 62) Source(55, 82) + SourceIndex(0) +19>Emitted(43, 66) Source(55, 86) + SourceIndex(0) +20>Emitted(43, 68) Source(55, 88) + SourceIndex(0) +21>Emitted(43, 77) Source(55, 97) + SourceIndex(0) +22>Emitted(43, 79) Source(55, 99) + SourceIndex(0) +23>Emitted(43, 84) Source(55, 104) + SourceIndex(0) +24>Emitted(43, 86) Source(55, 106) + SourceIndex(0) +25>Emitted(43, 96) Source(55, 116) + SourceIndex(0) +26>Emitted(43, 98) Source(55, 118) + SourceIndex(0) +27>Emitted(43, 99) Source(55, 119) + SourceIndex(0) +28>Emitted(43, 101) Source(55, 43) + SourceIndex(0) +29>Emitted(43, 115) Source(55, 119) + SourceIndex(0) +30>Emitted(43, 117) Source(55, 43) + SourceIndex(0) +31>Emitted(43, 121) Source(55, 119) + SourceIndex(0) +32>Emitted(43, 122) Source(55, 120) + SourceIndex(0) +--- +>>> var _v = _u[_t], nameA = _v.name, skillA = _v.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(44, 5) Source(55, 6) + SourceIndex(0) +2 >Emitted(44, 20) Source(55, 39) + SourceIndex(0) +3 >Emitted(44, 22) Source(55, 11) + SourceIndex(0) +4 >Emitted(44, 37) Source(55, 22) + SourceIndex(0) +5 >Emitted(44, 39) Source(55, 24) + SourceIndex(0) +6 >Emitted(44, 56) Source(55, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(45, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(45, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(45, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(45, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(45, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(45, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(45, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(45, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(46, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _w = 0, multiRobots_2 = multiRobots; _w < multiRobots_2.length; _w++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(47, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(47, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(47, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(47, 6) Source(58, 82) + SourceIndex(0) +5 >Emitted(47, 16) Source(58, 93) + SourceIndex(0) +6 >Emitted(47, 18) Source(58, 82) + SourceIndex(0) +7 >Emitted(47, 45) Source(58, 93) + SourceIndex(0) +8 >Emitted(47, 47) Source(58, 82) + SourceIndex(0) +9 >Emitted(47, 72) Source(58, 93) + SourceIndex(0) +10>Emitted(47, 74) Source(58, 82) + SourceIndex(0) +11>Emitted(47, 78) Source(58, 93) + SourceIndex(0) +12>Emitted(47, 79) Source(58, 94) + SourceIndex(0) +--- +>>> var _x = multiRobots_2[_w], nameA = _x.name, _y = _x.skills, primaryA = _y.primary, secondaryA = _y.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(48, 5) Source(58, 6) + SourceIndex(0) +2 >Emitted(48, 31) Source(58, 78) + SourceIndex(0) +3 >Emitted(48, 33) Source(58, 11) + SourceIndex(0) +4 >Emitted(48, 48) Source(58, 22) + SourceIndex(0) +5 >Emitted(48, 50) Source(58, 24) + SourceIndex(0) +6 >Emitted(48, 64) Source(58, 76) + SourceIndex(0) +7 >Emitted(48, 66) Source(58, 34) + SourceIndex(0) +8 >Emitted(48, 87) Source(58, 51) + SourceIndex(0) +9 >Emitted(48, 89) Source(58, 53) + SourceIndex(0) +10>Emitted(48, 114) Source(58, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = getMultiRobots(); _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(51, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(61, 82) + SourceIndex(0) +5 >Emitted(51, 16) Source(61, 98) + SourceIndex(0) +6 >Emitted(51, 18) Source(61, 82) + SourceIndex(0) +7 >Emitted(51, 23) Source(61, 82) + SourceIndex(0) +8 >Emitted(51, 37) Source(61, 96) + SourceIndex(0) +9 >Emitted(51, 39) Source(61, 98) + SourceIndex(0) +10>Emitted(51, 41) Source(61, 82) + SourceIndex(0) +11>Emitted(51, 55) Source(61, 98) + SourceIndex(0) +12>Emitted(51, 57) Source(61, 82) + SourceIndex(0) +13>Emitted(51, 61) Source(61, 98) + SourceIndex(0) +14>Emitted(51, 62) Source(61, 99) + SourceIndex(0) +--- +>>> var _1 = _0[_z], nameA = _1.name, _2 = _1.skills, primaryA = _2.primary, secondaryA = _2.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(52, 5) Source(61, 6) + SourceIndex(0) +2 >Emitted(52, 20) Source(61, 78) + SourceIndex(0) +3 >Emitted(52, 22) Source(61, 11) + SourceIndex(0) +4 >Emitted(52, 37) Source(61, 22) + SourceIndex(0) +5 >Emitted(52, 39) Source(61, 24) + SourceIndex(0) +6 >Emitted(52, 53) Source(61, 76) + SourceIndex(0) +7 >Emitted(52, 55) Source(61, 34) + SourceIndex(0) +8 >Emitted(52, 76) Source(61, 51) + SourceIndex(0) +9 >Emitted(52, 78) Source(61, 53) + SourceIndex(0) +10>Emitted(52, 103) Source(61, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(54, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _3 = 0, _4 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(55, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(64, 82) + SourceIndex(0) +5 >Emitted(55, 16) Source(65, 79) + SourceIndex(0) +6 >Emitted(55, 18) Source(64, 82) + SourceIndex(0) +7 >Emitted(55, 24) Source(64, 83) + SourceIndex(0) +8 >Emitted(55, 26) Source(64, 85) + SourceIndex(0) +9 >Emitted(55, 30) Source(64, 89) + SourceIndex(0) +10>Emitted(55, 32) Source(64, 91) + SourceIndex(0) +11>Emitted(55, 39) Source(64, 98) + SourceIndex(0) +12>Emitted(55, 41) Source(64, 100) + SourceIndex(0) +13>Emitted(55, 47) Source(64, 106) + SourceIndex(0) +14>Emitted(55, 49) Source(64, 108) + SourceIndex(0) +15>Emitted(55, 51) Source(64, 110) + SourceIndex(0) +16>Emitted(55, 58) Source(64, 117) + SourceIndex(0) +17>Emitted(55, 60) Source(64, 119) + SourceIndex(0) +18>Emitted(55, 68) Source(64, 127) + SourceIndex(0) +19>Emitted(55, 70) Source(64, 129) + SourceIndex(0) +20>Emitted(55, 79) Source(64, 138) + SourceIndex(0) +21>Emitted(55, 81) Source(64, 140) + SourceIndex(0) +22>Emitted(55, 87) Source(64, 146) + SourceIndex(0) +23>Emitted(55, 89) Source(64, 148) + SourceIndex(0) +24>Emitted(55, 91) Source(64, 150) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _3 < _4.length; _3++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(56, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(56, 7) Source(65, 7) + SourceIndex(0) +3 >Emitted(56, 11) Source(65, 11) + SourceIndex(0) +4 >Emitted(56, 13) Source(65, 13) + SourceIndex(0) +5 >Emitted(56, 22) Source(65, 22) + SourceIndex(0) +6 >Emitted(56, 24) Source(65, 24) + SourceIndex(0) +7 >Emitted(56, 30) Source(65, 30) + SourceIndex(0) +8 >Emitted(56, 32) Source(65, 32) + SourceIndex(0) +9 >Emitted(56, 34) Source(65, 34) + SourceIndex(0) +10>Emitted(56, 41) Source(65, 41) + SourceIndex(0) +11>Emitted(56, 43) Source(65, 43) + SourceIndex(0) +12>Emitted(56, 53) Source(65, 53) + SourceIndex(0) +13>Emitted(56, 55) Source(65, 55) + SourceIndex(0) +14>Emitted(56, 64) Source(65, 64) + SourceIndex(0) +15>Emitted(56, 66) Source(65, 66) + SourceIndex(0) +16>Emitted(56, 74) Source(65, 74) + SourceIndex(0) +17>Emitted(56, 76) Source(65, 76) + SourceIndex(0) +18>Emitted(56, 78) Source(65, 78) + SourceIndex(0) +19>Emitted(56, 79) Source(65, 79) + SourceIndex(0) +20>Emitted(56, 81) Source(64, 82) + SourceIndex(0) +21>Emitted(56, 95) Source(65, 79) + SourceIndex(0) +22>Emitted(56, 97) Source(64, 82) + SourceIndex(0) +23>Emitted(56, 101) Source(65, 79) + SourceIndex(0) +24>Emitted(56, 102) Source(65, 80) + SourceIndex(0) +--- +>>> var _5 = _4[_3], nameA = _5.name, _6 = _5.skills, primaryA = _6.primary, secondaryA = _6.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(57, 5) Source(64, 6) + SourceIndex(0) +2 >Emitted(57, 20) Source(64, 78) + SourceIndex(0) +3 >Emitted(57, 22) Source(64, 11) + SourceIndex(0) +4 >Emitted(57, 37) Source(64, 22) + SourceIndex(0) +5 >Emitted(57, 39) Source(64, 24) + SourceIndex(0) +6 >Emitted(57, 53) Source(64, 76) + SourceIndex(0) +7 >Emitted(57, 55) Source(64, 34) + SourceIndex(0) +8 >Emitted(57, 76) Source(64, 51) + SourceIndex(0) +9 >Emitted(57, 78) Source(64, 53) + SourceIndex(0) +10>Emitted(57, 103) Source(64, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(58, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(58, 22) Source(66, 22) + SourceIndex(0) +7 >Emitted(58, 23) Source(66, 23) + SourceIndex(0) +8 >Emitted(58, 24) Source(66, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(59, 2) Source(67, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols new file mode 100644 index 00000000000..8fef1fabd6d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols @@ -0,0 +1,259 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) +} + +for (let {name: nameA } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 28, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 28, 10)) +} +for (let {name: nameA } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 31, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 31, 10)) +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 29)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 10)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 29)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 44)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 65)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 82)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 10)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 39)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 39)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 86)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 96)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 115)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 71)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 86)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 96)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 115)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 20)) +} + +for (let {name: nameA, skill: skillA } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 22)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 10)) +} +for (let {name: nameA, skill: skillA } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 22)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 10)) +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 44)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 10)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 59)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 44)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 59)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 80)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 97)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 51)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 51)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 83)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 10)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 98)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 108)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 127)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 51)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 83)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 98)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 108)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 127)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types new file mode 100644 index 00000000000..17c060225dc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types @@ -0,0 +1,329 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +for (let {name: nameA } of robots) { +>name : any +>nameA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } of getRobots()) { +>name : any +>nameA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA, skill: skillA } of robots) { +>name : any +>nameA : string +>skill : any +>skillA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } of getRobots()) { +>name : any +>nameA : string +>skill : any +>skillA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>skill : any +>skillA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js new file mode 100644 index 00000000000..aebfd11b9db --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js @@ -0,0 +1,225 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA } of robots) { + console.log(nameA); +} +for ({name: nameA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} +for ({name } of robots) { + console.log(nameA); +} +for ({name } of getRobots()) { + console.log(nameA); +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} +for ({name, skill } of robots) { + console.log(nameA); +} +for ({name, skill } of getRobots()) { + console.log(nameA); +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of multiRobots) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + nameA = robots_1[_i].name; + console.log(nameA); +} +for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { + nameA = _b[_a].name; + console.log(nameA); +} +for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { + nameA = _d[_c].name; + console.log(nameA); +} +for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { + _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; + console.log(primaryA); +} +for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { + _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; + console.log(primaryA); +} +for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { + _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; + console.log(primaryA); +} +for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { + name = robots_2[_o].name; + console.log(nameA); +} +for (var _p = 0, _q = getRobots(); _p < _q.length; _p++) { + name = _q[_p].name; + console.log(nameA); +} +for (var _r = 0, _s = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _r < _s.length; _r++) { + name = _s[_r].name; + console.log(nameA); +} +for (var _t = 0, multiRobots_2 = multiRobots; _t < multiRobots_2.length; _t++) { + _u = multiRobots_2[_t].skills, primary = _u.primary, secondary = _u.secondary; + console.log(primaryA); +} +for (var _v = 0, _w = getMultiRobots(); _v < _w.length; _v++) { + _x = _w[_v].skills, primary = _x.primary, secondary = _x.secondary; + console.log(primaryA); +} +for (var _y = 0, _z = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _y < _z.length; _y++) { + _0 = _z[_y].skills, primary = _0.primary, secondary = _0.secondary; + console.log(primaryA); +} +for (var _1 = 0, robots_3 = robots; _1 < robots_3.length; _1++) { + _2 = robots_3[_1], nameA = _2.name, skillA = _2.skill; + console.log(nameA); +} +for (var _3 = 0, _4 = getRobots(); _3 < _4.length; _3++) { + _5 = _4[_3], nameA = _5.name, skillA = _5.skill; + console.log(nameA); +} +for (var _6 = 0, _7 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _6 < _7.length; _6++) { + _8 = _7[_6], nameA = _8.name, skillA = _8.skill; + console.log(nameA); +} +for (var _9 = 0, multiRobots_3 = multiRobots; _9 < multiRobots_3.length; _9++) { + _10 = multiRobots_3[_9], nameA = _10.name, _11 = _10.skills, primaryA = _11.primary, secondaryA = _11.secondary; + console.log(nameA); +} +for (var _12 = 0, _13 = getMultiRobots(); _12 < _13.length; _12++) { + _14 = _13[_12], nameA = _14.name, _15 = _14.skills, primaryA = _15.primary, secondaryA = _15.secondary; + console.log(nameA); +} +for (var _16 = 0, _17 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _16 < _17.length; _16++) { + _18 = _17[_16], nameA = _18.name, _19 = _18.skills, primaryA = _19.primary, secondaryA = _19.secondary; + console.log(nameA); +} +for (var _20 = 0, robots_4 = robots; _20 < robots_4.length; _20++) { + _21 = robots_4[_20], name = _21.name, skill = _21.skill; + console.log(nameA); +} +for (var _22 = 0, _23 = getRobots(); _22 < _23.length; _22++) { + _24 = _23[_22], name = _24.name, skill = _24.skill; + console.log(nameA); +} +for (var _25 = 0, _26 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _25 < _26.length; _25++) { + _27 = _26[_25], name = _27.name, skill = _27.skill; + console.log(nameA); +} +for (var _28 = 0, multiRobots_4 = multiRobots; _28 < multiRobots_4.length; _28++) { + _29 = multiRobots_4[_28], name = _29.name, _30 = _29.skills, primary = _30.primary, secondary = _30.secondary; + console.log(nameA); +} +for (var _31 = 0, _32 = getMultiRobots(); _31 < _32.length; _31++) { + _33 = _32[_31], name = _33.name, _34 = _33.skills, primary = _34.primary, secondary = _34.secondary; + console.log(nameA); +} +for (var _35 = 0, _36 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _35 < _36.length; _35++) { + _37 = _36[_35], name = _37.name, _38 = _37.skills, primary = _38.primary, secondary = _38.secondary; + console.log(nameA); +} +var _f, _j, _m, _u, _x, _0, _2, _5, _8, _10, _11, _14, _15, _18, _19, _21, _24, _27, _29, _30, _33, _34, _37, _38; +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map new file mode 100644 index 00000000000..c8610cbeef8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,yBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9F,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6D,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtE,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3E,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UACa,EADb,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADb,cACa,EADb,IACa,CAAC;IADxE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAY,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAjB,wBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAtB,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAvF,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAhD,6BAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAArD,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UACmC,EADnC,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC3G,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADnC,cACmC,EADnC,IACmC,CAAC;IADxE,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxC,iBAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7C,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9G,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAApF,uBAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAzF,cAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WACC,EADD,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC7I,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADD,gBACC,EADD,KACC,CAAC;IAD1E,cAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IAEjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAzB,mBAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA9B,cAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAA/F,cAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAvD,wBAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA5D,cAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAC8B,EAD9B,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChH,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9B,gBAC8B,EAD9B,KAC8B,CAAC;IAD1E,cAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IAEpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..8a603317954 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt @@ -0,0 +1,3387 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(29, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(29, 20) + SourceIndex(0) +5 >Emitted(10, 20) Source(29, 36) + SourceIndex(0) +6 >Emitted(10, 22) Source(29, 38) + SourceIndex(0) +7 >Emitted(10, 32) Source(29, 56) + SourceIndex(0) +8 >Emitted(10, 34) Source(29, 58) + SourceIndex(0) +9 >Emitted(10, 35) Source(29, 67) + SourceIndex(0) +10>Emitted(10, 37) Source(29, 69) + SourceIndex(0) +11>Emitted(10, 43) Source(29, 83) + SourceIndex(0) +12>Emitted(10, 44) Source(29, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(11, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(11, 9) Source(30, 17) + SourceIndex(0) +4 >Emitted(11, 11) Source(30, 19) + SourceIndex(0) +5 >Emitted(11, 18) Source(30, 34) + SourceIndex(0) +6 >Emitted(11, 20) Source(30, 36) + SourceIndex(0) +7 >Emitted(11, 29) Source(30, 53) + SourceIndex(0) +8 >Emitted(11, 31) Source(30, 55) + SourceIndex(0) +9 >Emitted(11, 36) Source(30, 68) + SourceIndex(0) +10>Emitted(11, 37) Source(30, 69) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ({name: nameA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(32, 24) + SourceIndex(0) +5 >Emitted(12, 16) Source(32, 30) + SourceIndex(0) +6 >Emitted(12, 18) Source(32, 24) + SourceIndex(0) +7 >Emitted(12, 35) Source(32, 30) + SourceIndex(0) +8 >Emitted(12, 37) Source(32, 24) + SourceIndex(0) +9 >Emitted(12, 57) Source(32, 30) + SourceIndex(0) +10>Emitted(12, 59) Source(32, 24) + SourceIndex(0) +11>Emitted(12, 63) Source(32, 30) + SourceIndex(0) +12>Emitted(12, 64) Source(32, 31) + SourceIndex(0) +--- +>>> nameA = robots_1[_i].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(13, 5) Source(32, 7) + SourceIndex(0) +2 >Emitted(13, 30) Source(32, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(15, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(35, 24) + SourceIndex(0) +5 >Emitted(16, 16) Source(35, 35) + SourceIndex(0) +6 >Emitted(16, 18) Source(35, 24) + SourceIndex(0) +7 >Emitted(16, 23) Source(35, 24) + SourceIndex(0) +8 >Emitted(16, 32) Source(35, 33) + SourceIndex(0) +9 >Emitted(16, 34) Source(35, 35) + SourceIndex(0) +10>Emitted(16, 36) Source(35, 24) + SourceIndex(0) +11>Emitted(16, 50) Source(35, 35) + SourceIndex(0) +12>Emitted(16, 52) Source(35, 24) + SourceIndex(0) +13>Emitted(16, 56) Source(35, 35) + SourceIndex(0) +14>Emitted(16, 57) Source(35, 36) + SourceIndex(0) +--- +>>> nameA = _b[_a].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^-> +1 > +2 > name: nameA +1 >Emitted(17, 5) Source(35, 7) + SourceIndex(0) +2 >Emitted(17, 24) Source(35, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 24) + SourceIndex(0) +5 >Emitted(20, 16) Source(38, 100) + SourceIndex(0) +6 >Emitted(20, 18) Source(38, 24) + SourceIndex(0) +7 >Emitted(20, 24) Source(38, 25) + SourceIndex(0) +8 >Emitted(20, 26) Source(38, 27) + SourceIndex(0) +9 >Emitted(20, 30) Source(38, 31) + SourceIndex(0) +10>Emitted(20, 32) Source(38, 33) + SourceIndex(0) +11>Emitted(20, 39) Source(38, 40) + SourceIndex(0) +12>Emitted(20, 41) Source(38, 42) + SourceIndex(0) +13>Emitted(20, 46) Source(38, 47) + SourceIndex(0) +14>Emitted(20, 48) Source(38, 49) + SourceIndex(0) +15>Emitted(20, 56) Source(38, 57) + SourceIndex(0) +16>Emitted(20, 58) Source(38, 59) + SourceIndex(0) +17>Emitted(20, 60) Source(38, 61) + SourceIndex(0) +18>Emitted(20, 62) Source(38, 63) + SourceIndex(0) +19>Emitted(20, 66) Source(38, 67) + SourceIndex(0) +20>Emitted(20, 68) Source(38, 69) + SourceIndex(0) +21>Emitted(20, 77) Source(38, 78) + SourceIndex(0) +22>Emitted(20, 79) Source(38, 80) + SourceIndex(0) +23>Emitted(20, 84) Source(38, 85) + SourceIndex(0) +24>Emitted(20, 86) Source(38, 87) + SourceIndex(0) +25>Emitted(20, 96) Source(38, 97) + SourceIndex(0) +26>Emitted(20, 98) Source(38, 99) + SourceIndex(0) +27>Emitted(20, 99) Source(38, 100) + SourceIndex(0) +28>Emitted(20, 101) Source(38, 24) + SourceIndex(0) +29>Emitted(20, 115) Source(38, 100) + SourceIndex(0) +30>Emitted(20, 117) Source(38, 24) + SourceIndex(0) +31>Emitted(20, 121) Source(38, 100) + SourceIndex(0) +32>Emitted(20, 122) Source(38, 101) + SourceIndex(0) +--- +>>> nameA = _d[_c].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^-> +1 > +2 > name: nameA +1 >Emitted(21, 5) Source(38, 7) + SourceIndex(0) +2 >Emitted(21, 24) Source(38, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(41, 66) + SourceIndex(0) +5 >Emitted(24, 16) Source(41, 77) + SourceIndex(0) +6 >Emitted(24, 18) Source(41, 66) + SourceIndex(0) +7 >Emitted(24, 45) Source(41, 77) + SourceIndex(0) +8 >Emitted(24, 47) Source(41, 66) + SourceIndex(0) +9 >Emitted(24, 72) Source(41, 77) + SourceIndex(0) +10>Emitted(24, 74) Source(41, 66) + SourceIndex(0) +11>Emitted(24, 78) Source(41, 77) + SourceIndex(0) +12>Emitted(24, 79) Source(41, 78) + SourceIndex(0) +--- +>>> _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(25, 5) Source(41, 8) + SourceIndex(0) +2 >Emitted(25, 34) Source(41, 60) + SourceIndex(0) +3 >Emitted(25, 36) Source(41, 18) + SourceIndex(0) +4 >Emitted(25, 57) Source(41, 35) + SourceIndex(0) +5 >Emitted(25, 59) Source(41, 37) + SourceIndex(0) +6 >Emitted(25, 84) Source(41, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(26, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(26, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(26, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(27, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(28, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(44, 66) + SourceIndex(0) +5 >Emitted(28, 16) Source(44, 82) + SourceIndex(0) +6 >Emitted(28, 18) Source(44, 66) + SourceIndex(0) +7 >Emitted(28, 23) Source(44, 66) + SourceIndex(0) +8 >Emitted(28, 37) Source(44, 80) + SourceIndex(0) +9 >Emitted(28, 39) Source(44, 82) + SourceIndex(0) +10>Emitted(28, 41) Source(44, 66) + SourceIndex(0) +11>Emitted(28, 55) Source(44, 82) + SourceIndex(0) +12>Emitted(28, 57) Source(44, 66) + SourceIndex(0) +13>Emitted(28, 61) Source(44, 82) + SourceIndex(0) +14>Emitted(28, 62) Source(44, 83) + SourceIndex(0) +--- +>>> _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(29, 5) Source(44, 8) + SourceIndex(0) +2 >Emitted(29, 23) Source(44, 60) + SourceIndex(0) +3 >Emitted(29, 25) Source(44, 18) + SourceIndex(0) +4 >Emitted(29, 46) Source(44, 35) + SourceIndex(0) +5 >Emitted(29, 48) Source(44, 37) + SourceIndex(0) +6 >Emitted(29, 73) Source(44, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(30, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(30, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(30, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(30, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(30, 25) Source(45, 25) + SourceIndex(0) +7 >Emitted(30, 26) Source(45, 26) + SourceIndex(0) +8 >Emitted(30, 27) Source(45, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(31, 2) Source(46, 2) + SourceIndex(0) +--- +>>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(32, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(32, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(32, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(32, 6) Source(47, 66) + SourceIndex(0) +5 >Emitted(32, 16) Source(48, 79) + SourceIndex(0) +6 >Emitted(32, 18) Source(47, 66) + SourceIndex(0) +7 >Emitted(32, 24) Source(47, 67) + SourceIndex(0) +8 >Emitted(32, 26) Source(47, 69) + SourceIndex(0) +9 >Emitted(32, 30) Source(47, 73) + SourceIndex(0) +10>Emitted(32, 32) Source(47, 75) + SourceIndex(0) +11>Emitted(32, 39) Source(47, 82) + SourceIndex(0) +12>Emitted(32, 41) Source(47, 84) + SourceIndex(0) +13>Emitted(32, 47) Source(47, 90) + SourceIndex(0) +14>Emitted(32, 49) Source(47, 92) + SourceIndex(0) +15>Emitted(32, 51) Source(47, 94) + SourceIndex(0) +16>Emitted(32, 58) Source(47, 101) + SourceIndex(0) +17>Emitted(32, 60) Source(47, 103) + SourceIndex(0) +18>Emitted(32, 68) Source(47, 111) + SourceIndex(0) +19>Emitted(32, 70) Source(47, 113) + SourceIndex(0) +20>Emitted(32, 79) Source(47, 122) + SourceIndex(0) +21>Emitted(32, 81) Source(47, 124) + SourceIndex(0) +22>Emitted(32, 87) Source(47, 130) + SourceIndex(0) +23>Emitted(32, 89) Source(47, 132) + SourceIndex(0) +24>Emitted(32, 91) Source(47, 134) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(33, 5) Source(48, 5) + SourceIndex(0) +2 >Emitted(33, 7) Source(48, 7) + SourceIndex(0) +3 >Emitted(33, 11) Source(48, 11) + SourceIndex(0) +4 >Emitted(33, 13) Source(48, 13) + SourceIndex(0) +5 >Emitted(33, 22) Source(48, 22) + SourceIndex(0) +6 >Emitted(33, 24) Source(48, 24) + SourceIndex(0) +7 >Emitted(33, 30) Source(48, 30) + SourceIndex(0) +8 >Emitted(33, 32) Source(48, 32) + SourceIndex(0) +9 >Emitted(33, 34) Source(48, 34) + SourceIndex(0) +10>Emitted(33, 41) Source(48, 41) + SourceIndex(0) +11>Emitted(33, 43) Source(48, 43) + SourceIndex(0) +12>Emitted(33, 53) Source(48, 53) + SourceIndex(0) +13>Emitted(33, 55) Source(48, 55) + SourceIndex(0) +14>Emitted(33, 64) Source(48, 64) + SourceIndex(0) +15>Emitted(33, 66) Source(48, 66) + SourceIndex(0) +16>Emitted(33, 74) Source(48, 74) + SourceIndex(0) +17>Emitted(33, 76) Source(48, 76) + SourceIndex(0) +18>Emitted(33, 78) Source(48, 78) + SourceIndex(0) +19>Emitted(33, 79) Source(48, 79) + SourceIndex(0) +20>Emitted(33, 81) Source(47, 66) + SourceIndex(0) +21>Emitted(33, 95) Source(48, 79) + SourceIndex(0) +22>Emitted(33, 97) Source(47, 66) + SourceIndex(0) +23>Emitted(33, 101) Source(48, 79) + SourceIndex(0) +24>Emitted(33, 102) Source(48, 80) + SourceIndex(0) +--- +>>> _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1 >Emitted(34, 5) Source(47, 8) + SourceIndex(0) +2 >Emitted(34, 23) Source(47, 60) + SourceIndex(0) +3 >Emitted(34, 25) Source(47, 18) + SourceIndex(0) +4 >Emitted(34, 46) Source(47, 35) + SourceIndex(0) +5 >Emitted(34, 48) Source(47, 37) + SourceIndex(0) +6 >Emitted(34, 73) Source(47, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(35, 25) Source(49, 25) + SourceIndex(0) +7 >Emitted(35, 26) Source(49, 26) + SourceIndex(0) +8 >Emitted(35, 27) Source(49, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(51, 17) + SourceIndex(0) +5 >Emitted(37, 16) Source(51, 23) + SourceIndex(0) +6 >Emitted(37, 18) Source(51, 17) + SourceIndex(0) +7 >Emitted(37, 35) Source(51, 23) + SourceIndex(0) +8 >Emitted(37, 37) Source(51, 17) + SourceIndex(0) +9 >Emitted(37, 57) Source(51, 23) + SourceIndex(0) +10>Emitted(37, 59) Source(51, 17) + SourceIndex(0) +11>Emitted(37, 63) Source(51, 23) + SourceIndex(0) +12>Emitted(37, 64) Source(51, 24) + SourceIndex(0) +--- +>>> name = robots_2[_o].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name +1 >Emitted(38, 5) Source(51, 7) + SourceIndex(0) +2 >Emitted(38, 29) Source(51, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(39, 22) Source(52, 22) + SourceIndex(0) +7 >Emitted(39, 23) Source(52, 23) + SourceIndex(0) +8 >Emitted(39, 24) Source(52, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for (var _p = 0, _q = getRobots(); _p < _q.length; _p++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(54, 17) + SourceIndex(0) +5 >Emitted(41, 16) Source(54, 28) + SourceIndex(0) +6 >Emitted(41, 18) Source(54, 17) + SourceIndex(0) +7 >Emitted(41, 23) Source(54, 17) + SourceIndex(0) +8 >Emitted(41, 32) Source(54, 26) + SourceIndex(0) +9 >Emitted(41, 34) Source(54, 28) + SourceIndex(0) +10>Emitted(41, 36) Source(54, 17) + SourceIndex(0) +11>Emitted(41, 50) Source(54, 28) + SourceIndex(0) +12>Emitted(41, 52) Source(54, 17) + SourceIndex(0) +13>Emitted(41, 56) Source(54, 28) + SourceIndex(0) +14>Emitted(41, 57) Source(54, 29) + SourceIndex(0) +--- +>>> name = _q[_p].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1 > +2 > name +1 >Emitted(42, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(42, 23) Source(54, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(43, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(55, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(55, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _r = 0, _s = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _r < _s.length; _r++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(57, 17) + SourceIndex(0) +5 >Emitted(45, 16) Source(57, 93) + SourceIndex(0) +6 >Emitted(45, 18) Source(57, 17) + SourceIndex(0) +7 >Emitted(45, 24) Source(57, 18) + SourceIndex(0) +8 >Emitted(45, 26) Source(57, 20) + SourceIndex(0) +9 >Emitted(45, 30) Source(57, 24) + SourceIndex(0) +10>Emitted(45, 32) Source(57, 26) + SourceIndex(0) +11>Emitted(45, 39) Source(57, 33) + SourceIndex(0) +12>Emitted(45, 41) Source(57, 35) + SourceIndex(0) +13>Emitted(45, 46) Source(57, 40) + SourceIndex(0) +14>Emitted(45, 48) Source(57, 42) + SourceIndex(0) +15>Emitted(45, 56) Source(57, 50) + SourceIndex(0) +16>Emitted(45, 58) Source(57, 52) + SourceIndex(0) +17>Emitted(45, 60) Source(57, 54) + SourceIndex(0) +18>Emitted(45, 62) Source(57, 56) + SourceIndex(0) +19>Emitted(45, 66) Source(57, 60) + SourceIndex(0) +20>Emitted(45, 68) Source(57, 62) + SourceIndex(0) +21>Emitted(45, 77) Source(57, 71) + SourceIndex(0) +22>Emitted(45, 79) Source(57, 73) + SourceIndex(0) +23>Emitted(45, 84) Source(57, 78) + SourceIndex(0) +24>Emitted(45, 86) Source(57, 80) + SourceIndex(0) +25>Emitted(45, 96) Source(57, 90) + SourceIndex(0) +26>Emitted(45, 98) Source(57, 92) + SourceIndex(0) +27>Emitted(45, 99) Source(57, 93) + SourceIndex(0) +28>Emitted(45, 101) Source(57, 17) + SourceIndex(0) +29>Emitted(45, 115) Source(57, 93) + SourceIndex(0) +30>Emitted(45, 117) Source(57, 17) + SourceIndex(0) +31>Emitted(45, 121) Source(57, 93) + SourceIndex(0) +32>Emitted(45, 122) Source(57, 94) + SourceIndex(0) +--- +>>> name = _s[_r].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1 > +2 > name +1 >Emitted(46, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(46, 23) Source(57, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(47, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(47, 22) Source(58, 22) + SourceIndex(0) +7 >Emitted(47, 23) Source(58, 23) + SourceIndex(0) +8 >Emitted(47, 24) Source(58, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _t = 0, multiRobots_2 = multiRobots; _t < multiRobots_2.length; _t++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(60, 44) + SourceIndex(0) +5 >Emitted(49, 16) Source(60, 55) + SourceIndex(0) +6 >Emitted(49, 18) Source(60, 44) + SourceIndex(0) +7 >Emitted(49, 45) Source(60, 55) + SourceIndex(0) +8 >Emitted(49, 47) Source(60, 44) + SourceIndex(0) +9 >Emitted(49, 72) Source(60, 55) + SourceIndex(0) +10>Emitted(49, 74) Source(60, 44) + SourceIndex(0) +11>Emitted(49, 78) Source(60, 55) + SourceIndex(0) +12>Emitted(49, 79) Source(60, 56) + SourceIndex(0) +--- +>>> _u = multiRobots_2[_t].skills, primary = _u.primary, secondary = _u.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1->Emitted(50, 5) Source(60, 8) + SourceIndex(0) +2 >Emitted(50, 34) Source(60, 38) + SourceIndex(0) +3 >Emitted(50, 36) Source(60, 18) + SourceIndex(0) +4 >Emitted(50, 56) Source(60, 25) + SourceIndex(0) +5 >Emitted(50, 58) Source(60, 27) + SourceIndex(0) +6 >Emitted(50, 82) Source(60, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(51, 25) Source(61, 25) + SourceIndex(0) +7 >Emitted(51, 26) Source(61, 26) + SourceIndex(0) +8 >Emitted(51, 27) Source(61, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getMultiRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(63, 44) + SourceIndex(0) +5 >Emitted(53, 16) Source(63, 60) + SourceIndex(0) +6 >Emitted(53, 18) Source(63, 44) + SourceIndex(0) +7 >Emitted(53, 23) Source(63, 44) + SourceIndex(0) +8 >Emitted(53, 37) Source(63, 58) + SourceIndex(0) +9 >Emitted(53, 39) Source(63, 60) + SourceIndex(0) +10>Emitted(53, 41) Source(63, 44) + SourceIndex(0) +11>Emitted(53, 55) Source(63, 60) + SourceIndex(0) +12>Emitted(53, 57) Source(63, 44) + SourceIndex(0) +13>Emitted(53, 61) Source(63, 60) + SourceIndex(0) +14>Emitted(53, 62) Source(63, 61) + SourceIndex(0) +--- +>>> _x = _w[_v].skills, primary = _x.primary, secondary = _x.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1->Emitted(54, 5) Source(63, 8) + SourceIndex(0) +2 >Emitted(54, 23) Source(63, 38) + SourceIndex(0) +3 >Emitted(54, 25) Source(63, 18) + SourceIndex(0) +4 >Emitted(54, 45) Source(63, 25) + SourceIndex(0) +5 >Emitted(54, 47) Source(63, 27) + SourceIndex(0) +6 >Emitted(54, 71) Source(63, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(64, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(64, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(64, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(64, 17) + SourceIndex(0) +6 >Emitted(55, 25) Source(64, 25) + SourceIndex(0) +7 >Emitted(55, 26) Source(64, 26) + SourceIndex(0) +8 >Emitted(55, 27) Source(64, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(65, 2) + SourceIndex(0) +--- +>>>for (var _y = 0, _z = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(66, 44) + SourceIndex(0) +5 >Emitted(57, 16) Source(67, 79) + SourceIndex(0) +6 >Emitted(57, 18) Source(66, 44) + SourceIndex(0) +7 >Emitted(57, 24) Source(66, 45) + SourceIndex(0) +8 >Emitted(57, 26) Source(66, 47) + SourceIndex(0) +9 >Emitted(57, 30) Source(66, 51) + SourceIndex(0) +10>Emitted(57, 32) Source(66, 53) + SourceIndex(0) +11>Emitted(57, 39) Source(66, 60) + SourceIndex(0) +12>Emitted(57, 41) Source(66, 62) + SourceIndex(0) +13>Emitted(57, 47) Source(66, 68) + SourceIndex(0) +14>Emitted(57, 49) Source(66, 70) + SourceIndex(0) +15>Emitted(57, 51) Source(66, 72) + SourceIndex(0) +16>Emitted(57, 58) Source(66, 79) + SourceIndex(0) +17>Emitted(57, 60) Source(66, 81) + SourceIndex(0) +18>Emitted(57, 68) Source(66, 89) + SourceIndex(0) +19>Emitted(57, 70) Source(66, 91) + SourceIndex(0) +20>Emitted(57, 79) Source(66, 100) + SourceIndex(0) +21>Emitted(57, 81) Source(66, 102) + SourceIndex(0) +22>Emitted(57, 87) Source(66, 108) + SourceIndex(0) +23>Emitted(57, 89) Source(66, 110) + SourceIndex(0) +24>Emitted(57, 91) Source(66, 112) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _y < _z.length; _y++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(58, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(58, 7) Source(67, 7) + SourceIndex(0) +3 >Emitted(58, 11) Source(67, 11) + SourceIndex(0) +4 >Emitted(58, 13) Source(67, 13) + SourceIndex(0) +5 >Emitted(58, 22) Source(67, 22) + SourceIndex(0) +6 >Emitted(58, 24) Source(67, 24) + SourceIndex(0) +7 >Emitted(58, 30) Source(67, 30) + SourceIndex(0) +8 >Emitted(58, 32) Source(67, 32) + SourceIndex(0) +9 >Emitted(58, 34) Source(67, 34) + SourceIndex(0) +10>Emitted(58, 41) Source(67, 41) + SourceIndex(0) +11>Emitted(58, 43) Source(67, 43) + SourceIndex(0) +12>Emitted(58, 53) Source(67, 53) + SourceIndex(0) +13>Emitted(58, 55) Source(67, 55) + SourceIndex(0) +14>Emitted(58, 64) Source(67, 64) + SourceIndex(0) +15>Emitted(58, 66) Source(67, 66) + SourceIndex(0) +16>Emitted(58, 74) Source(67, 74) + SourceIndex(0) +17>Emitted(58, 76) Source(67, 76) + SourceIndex(0) +18>Emitted(58, 78) Source(67, 78) + SourceIndex(0) +19>Emitted(58, 79) Source(67, 79) + SourceIndex(0) +20>Emitted(58, 81) Source(66, 44) + SourceIndex(0) +21>Emitted(58, 95) Source(67, 79) + SourceIndex(0) +22>Emitted(58, 97) Source(66, 44) + SourceIndex(0) +23>Emitted(58, 101) Source(67, 79) + SourceIndex(0) +24>Emitted(58, 102) Source(67, 80) + SourceIndex(0) +--- +>>> _0 = _z[_y].skills, primary = _0.primary, secondary = _0.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1 >Emitted(59, 5) Source(66, 8) + SourceIndex(0) +2 >Emitted(59, 23) Source(66, 38) + SourceIndex(0) +3 >Emitted(59, 25) Source(66, 18) + SourceIndex(0) +4 >Emitted(59, 45) Source(66, 25) + SourceIndex(0) +5 >Emitted(59, 47) Source(66, 27) + SourceIndex(0) +6 >Emitted(59, 71) Source(66, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(60, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(60, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(60, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(60, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(60, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(60, 25) Source(68, 25) + SourceIndex(0) +7 >Emitted(60, 26) Source(68, 26) + SourceIndex(0) +8 >Emitted(60, 27) Source(68, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(61, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _1 = 0, robots_3 = robots; _1 < robots_3.length; _1++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(62, 1) Source(72, 1) + SourceIndex(0) +2 >Emitted(62, 4) Source(72, 4) + SourceIndex(0) +3 >Emitted(62, 5) Source(72, 5) + SourceIndex(0) +4 >Emitted(62, 6) Source(72, 39) + SourceIndex(0) +5 >Emitted(62, 16) Source(72, 45) + SourceIndex(0) +6 >Emitted(62, 18) Source(72, 39) + SourceIndex(0) +7 >Emitted(62, 35) Source(72, 45) + SourceIndex(0) +8 >Emitted(62, 37) Source(72, 39) + SourceIndex(0) +9 >Emitted(62, 57) Source(72, 45) + SourceIndex(0) +10>Emitted(62, 59) Source(72, 39) + SourceIndex(0) +11>Emitted(62, 63) Source(72, 45) + SourceIndex(0) +12>Emitted(62, 64) Source(72, 46) + SourceIndex(0) +--- +>>> _2 = robots_3[_1], nameA = _2.name, skillA = _2.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(63, 5) Source(72, 6) + SourceIndex(0) +2 >Emitted(63, 22) Source(72, 35) + SourceIndex(0) +3 >Emitted(63, 24) Source(72, 7) + SourceIndex(0) +4 >Emitted(63, 39) Source(72, 18) + SourceIndex(0) +5 >Emitted(63, 41) Source(72, 20) + SourceIndex(0) +6 >Emitted(63, 58) Source(72, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(73, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(73, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(73, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(73, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(73, 17) + SourceIndex(0) +6 >Emitted(64, 22) Source(73, 22) + SourceIndex(0) +7 >Emitted(64, 23) Source(73, 23) + SourceIndex(0) +8 >Emitted(64, 24) Source(73, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(65, 2) Source(74, 2) + SourceIndex(0) +--- +>>>for (var _3 = 0, _4 = getRobots(); _3 < _4.length; _3++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(66, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(75, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(75, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(75, 39) + SourceIndex(0) +5 >Emitted(66, 16) Source(75, 50) + SourceIndex(0) +6 >Emitted(66, 18) Source(75, 39) + SourceIndex(0) +7 >Emitted(66, 23) Source(75, 39) + SourceIndex(0) +8 >Emitted(66, 32) Source(75, 48) + SourceIndex(0) +9 >Emitted(66, 34) Source(75, 50) + SourceIndex(0) +10>Emitted(66, 36) Source(75, 39) + SourceIndex(0) +11>Emitted(66, 50) Source(75, 50) + SourceIndex(0) +12>Emitted(66, 52) Source(75, 39) + SourceIndex(0) +13>Emitted(66, 56) Source(75, 50) + SourceIndex(0) +14>Emitted(66, 57) Source(75, 51) + SourceIndex(0) +--- +>>> _5 = _4[_3], nameA = _5.name, skillA = _5.skill; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(67, 5) Source(75, 6) + SourceIndex(0) +2 >Emitted(67, 16) Source(75, 35) + SourceIndex(0) +3 >Emitted(67, 18) Source(75, 7) + SourceIndex(0) +4 >Emitted(67, 33) Source(75, 18) + SourceIndex(0) +5 >Emitted(67, 35) Source(75, 20) + SourceIndex(0) +6 >Emitted(67, 52) Source(75, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(68, 5) Source(76, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(76, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(76, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(76, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(76, 17) + SourceIndex(0) +6 >Emitted(68, 22) Source(76, 22) + SourceIndex(0) +7 >Emitted(68, 23) Source(76, 23) + SourceIndex(0) +8 >Emitted(68, 24) Source(76, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(69, 2) Source(77, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(70, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(78, 39) + SourceIndex(0) +5 >Emitted(70, 16) Source(78, 115) + SourceIndex(0) +6 >Emitted(70, 18) Source(78, 39) + SourceIndex(0) +7 >Emitted(70, 24) Source(78, 40) + SourceIndex(0) +8 >Emitted(70, 26) Source(78, 42) + SourceIndex(0) +9 >Emitted(70, 30) Source(78, 46) + SourceIndex(0) +10>Emitted(70, 32) Source(78, 48) + SourceIndex(0) +11>Emitted(70, 39) Source(78, 55) + SourceIndex(0) +12>Emitted(70, 41) Source(78, 57) + SourceIndex(0) +13>Emitted(70, 46) Source(78, 62) + SourceIndex(0) +14>Emitted(70, 48) Source(78, 64) + SourceIndex(0) +15>Emitted(70, 56) Source(78, 72) + SourceIndex(0) +16>Emitted(70, 58) Source(78, 74) + SourceIndex(0) +17>Emitted(70, 60) Source(78, 76) + SourceIndex(0) +18>Emitted(70, 62) Source(78, 78) + SourceIndex(0) +19>Emitted(70, 66) Source(78, 82) + SourceIndex(0) +20>Emitted(70, 68) Source(78, 84) + SourceIndex(0) +21>Emitted(70, 77) Source(78, 93) + SourceIndex(0) +22>Emitted(70, 79) Source(78, 95) + SourceIndex(0) +23>Emitted(70, 84) Source(78, 100) + SourceIndex(0) +24>Emitted(70, 86) Source(78, 102) + SourceIndex(0) +25>Emitted(70, 96) Source(78, 112) + SourceIndex(0) +26>Emitted(70, 98) Source(78, 114) + SourceIndex(0) +27>Emitted(70, 99) Source(78, 115) + SourceIndex(0) +28>Emitted(70, 101) Source(78, 39) + SourceIndex(0) +29>Emitted(70, 115) Source(78, 115) + SourceIndex(0) +30>Emitted(70, 117) Source(78, 39) + SourceIndex(0) +31>Emitted(70, 121) Source(78, 115) + SourceIndex(0) +32>Emitted(70, 122) Source(78, 116) + SourceIndex(0) +--- +>>> _8 = _7[_6], nameA = _8.name, skillA = _8.skill; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(71, 5) Source(78, 6) + SourceIndex(0) +2 >Emitted(71, 16) Source(78, 35) + SourceIndex(0) +3 >Emitted(71, 18) Source(78, 7) + SourceIndex(0) +4 >Emitted(71, 33) Source(78, 18) + SourceIndex(0) +5 >Emitted(71, 35) Source(78, 20) + SourceIndex(0) +6 >Emitted(71, 52) Source(78, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(79, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(79, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(79, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(73, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, multiRobots_3 = multiRobots; _9 < multiRobots_3.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(74, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(81, 78) + SourceIndex(0) +5 >Emitted(74, 16) Source(81, 89) + SourceIndex(0) +6 >Emitted(74, 18) Source(81, 78) + SourceIndex(0) +7 >Emitted(74, 45) Source(81, 89) + SourceIndex(0) +8 >Emitted(74, 47) Source(81, 78) + SourceIndex(0) +9 >Emitted(74, 72) Source(81, 89) + SourceIndex(0) +10>Emitted(74, 74) Source(81, 78) + SourceIndex(0) +11>Emitted(74, 78) Source(81, 89) + SourceIndex(0) +12>Emitted(74, 79) Source(81, 90) + SourceIndex(0) +--- +>>> _10 = multiRobots_3[_9], nameA = _10.name, _11 = _10.skills, primaryA = _11.primary, secondaryA = _11.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(75, 5) Source(81, 6) + SourceIndex(0) +2 >Emitted(75, 28) Source(81, 74) + SourceIndex(0) +3 >Emitted(75, 30) Source(81, 7) + SourceIndex(0) +4 >Emitted(75, 46) Source(81, 18) + SourceIndex(0) +5 >Emitted(75, 48) Source(81, 20) + SourceIndex(0) +6 >Emitted(75, 64) Source(81, 72) + SourceIndex(0) +7 >Emitted(75, 66) Source(81, 30) + SourceIndex(0) +8 >Emitted(75, 88) Source(81, 47) + SourceIndex(0) +9 >Emitted(75, 90) Source(81, 49) + SourceIndex(0) +10>Emitted(75, 116) Source(81, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(76, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(76, 22) Source(82, 22) + SourceIndex(0) +7 >Emitted(76, 23) Source(82, 23) + SourceIndex(0) +8 >Emitted(76, 24) Source(82, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(77, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, _13 = getMultiRobots(); _12 < _13.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(78, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(84, 78) + SourceIndex(0) +5 >Emitted(78, 17) Source(84, 94) + SourceIndex(0) +6 >Emitted(78, 19) Source(84, 78) + SourceIndex(0) +7 >Emitted(78, 25) Source(84, 78) + SourceIndex(0) +8 >Emitted(78, 39) Source(84, 92) + SourceIndex(0) +9 >Emitted(78, 41) Source(84, 94) + SourceIndex(0) +10>Emitted(78, 43) Source(84, 78) + SourceIndex(0) +11>Emitted(78, 59) Source(84, 94) + SourceIndex(0) +12>Emitted(78, 61) Source(84, 78) + SourceIndex(0) +13>Emitted(78, 66) Source(84, 94) + SourceIndex(0) +14>Emitted(78, 67) Source(84, 95) + SourceIndex(0) +--- +>>> _14 = _13[_12], nameA = _14.name, _15 = _14.skills, primaryA = _15.primary, secondaryA = _15.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(79, 5) Source(84, 6) + SourceIndex(0) +2 >Emitted(79, 19) Source(84, 74) + SourceIndex(0) +3 >Emitted(79, 21) Source(84, 7) + SourceIndex(0) +4 >Emitted(79, 37) Source(84, 18) + SourceIndex(0) +5 >Emitted(79, 39) Source(84, 20) + SourceIndex(0) +6 >Emitted(79, 55) Source(84, 72) + SourceIndex(0) +7 >Emitted(79, 57) Source(84, 30) + SourceIndex(0) +8 >Emitted(79, 79) Source(84, 47) + SourceIndex(0) +9 >Emitted(79, 81) Source(84, 49) + SourceIndex(0) +10>Emitted(79, 107) Source(84, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(80, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(80, 22) Source(85, 22) + SourceIndex(0) +7 >Emitted(80, 23) Source(85, 23) + SourceIndex(0) +8 >Emitted(80, 24) Source(85, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(81, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(82, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(82, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(82, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(82, 6) Source(87, 78) + SourceIndex(0) +5 >Emitted(82, 17) Source(88, 79) + SourceIndex(0) +6 >Emitted(82, 19) Source(87, 78) + SourceIndex(0) +7 >Emitted(82, 26) Source(87, 79) + SourceIndex(0) +8 >Emitted(82, 28) Source(87, 81) + SourceIndex(0) +9 >Emitted(82, 32) Source(87, 85) + SourceIndex(0) +10>Emitted(82, 34) Source(87, 87) + SourceIndex(0) +11>Emitted(82, 41) Source(87, 94) + SourceIndex(0) +12>Emitted(82, 43) Source(87, 96) + SourceIndex(0) +13>Emitted(82, 49) Source(87, 102) + SourceIndex(0) +14>Emitted(82, 51) Source(87, 104) + SourceIndex(0) +15>Emitted(82, 53) Source(87, 106) + SourceIndex(0) +16>Emitted(82, 60) Source(87, 113) + SourceIndex(0) +17>Emitted(82, 62) Source(87, 115) + SourceIndex(0) +18>Emitted(82, 70) Source(87, 123) + SourceIndex(0) +19>Emitted(82, 72) Source(87, 125) + SourceIndex(0) +20>Emitted(82, 81) Source(87, 134) + SourceIndex(0) +21>Emitted(82, 83) Source(87, 136) + SourceIndex(0) +22>Emitted(82, 89) Source(87, 142) + SourceIndex(0) +23>Emitted(82, 91) Source(87, 144) + SourceIndex(0) +24>Emitted(82, 93) Source(87, 146) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _16 < _17.length; _16++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(83, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(83, 7) Source(88, 7) + SourceIndex(0) +3 >Emitted(83, 11) Source(88, 11) + SourceIndex(0) +4 >Emitted(83, 13) Source(88, 13) + SourceIndex(0) +5 >Emitted(83, 22) Source(88, 22) + SourceIndex(0) +6 >Emitted(83, 24) Source(88, 24) + SourceIndex(0) +7 >Emitted(83, 30) Source(88, 30) + SourceIndex(0) +8 >Emitted(83, 32) Source(88, 32) + SourceIndex(0) +9 >Emitted(83, 34) Source(88, 34) + SourceIndex(0) +10>Emitted(83, 41) Source(88, 41) + SourceIndex(0) +11>Emitted(83, 43) Source(88, 43) + SourceIndex(0) +12>Emitted(83, 53) Source(88, 53) + SourceIndex(0) +13>Emitted(83, 55) Source(88, 55) + SourceIndex(0) +14>Emitted(83, 64) Source(88, 64) + SourceIndex(0) +15>Emitted(83, 66) Source(88, 66) + SourceIndex(0) +16>Emitted(83, 74) Source(88, 74) + SourceIndex(0) +17>Emitted(83, 76) Source(88, 76) + SourceIndex(0) +18>Emitted(83, 78) Source(88, 78) + SourceIndex(0) +19>Emitted(83, 79) Source(88, 79) + SourceIndex(0) +20>Emitted(83, 81) Source(87, 78) + SourceIndex(0) +21>Emitted(83, 97) Source(88, 79) + SourceIndex(0) +22>Emitted(83, 99) Source(87, 78) + SourceIndex(0) +23>Emitted(83, 104) Source(88, 79) + SourceIndex(0) +24>Emitted(83, 105) Source(88, 80) + SourceIndex(0) +--- +>>> _18 = _17[_16], nameA = _18.name, _19 = _18.skills, primaryA = _19.primary, secondaryA = _19.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(84, 5) Source(87, 6) + SourceIndex(0) +2 >Emitted(84, 19) Source(87, 74) + SourceIndex(0) +3 >Emitted(84, 21) Source(87, 7) + SourceIndex(0) +4 >Emitted(84, 37) Source(87, 18) + SourceIndex(0) +5 >Emitted(84, 39) Source(87, 20) + SourceIndex(0) +6 >Emitted(84, 55) Source(87, 72) + SourceIndex(0) +7 >Emitted(84, 57) Source(87, 30) + SourceIndex(0) +8 >Emitted(84, 79) Source(87, 47) + SourceIndex(0) +9 >Emitted(84, 81) Source(87, 49) + SourceIndex(0) +10>Emitted(84, 107) Source(87, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(85, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(85, 22) Source(89, 22) + SourceIndex(0) +7 >Emitted(85, 23) Source(89, 23) + SourceIndex(0) +8 >Emitted(85, 24) Source(89, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(86, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for (var _20 = 0, robots_4 = robots; _20 < robots_4.length; _20++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(87, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(87, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(87, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(87, 6) Source(91, 24) + SourceIndex(0) +5 >Emitted(87, 17) Source(91, 30) + SourceIndex(0) +6 >Emitted(87, 19) Source(91, 24) + SourceIndex(0) +7 >Emitted(87, 36) Source(91, 30) + SourceIndex(0) +8 >Emitted(87, 38) Source(91, 24) + SourceIndex(0) +9 >Emitted(87, 59) Source(91, 30) + SourceIndex(0) +10>Emitted(87, 61) Source(91, 24) + SourceIndex(0) +11>Emitted(87, 66) Source(91, 30) + SourceIndex(0) +12>Emitted(87, 67) Source(91, 31) + SourceIndex(0) +--- +>>> _21 = robots_4[_20], name = _21.name, skill = _21.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(88, 5) Source(91, 6) + SourceIndex(0) +2 >Emitted(88, 24) Source(91, 20) + SourceIndex(0) +3 >Emitted(88, 26) Source(91, 7) + SourceIndex(0) +4 >Emitted(88, 41) Source(91, 11) + SourceIndex(0) +5 >Emitted(88, 43) Source(91, 13) + SourceIndex(0) +6 >Emitted(88, 60) Source(91, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(89, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(89, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(89, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(89, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(89, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(89, 22) Source(92, 22) + SourceIndex(0) +7 >Emitted(89, 23) Source(92, 23) + SourceIndex(0) +8 >Emitted(89, 24) Source(92, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(90, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, _23 = getRobots(); _22 < _23.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(91, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(91, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(91, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(91, 6) Source(94, 24) + SourceIndex(0) +5 >Emitted(91, 17) Source(94, 35) + SourceIndex(0) +6 >Emitted(91, 19) Source(94, 24) + SourceIndex(0) +7 >Emitted(91, 25) Source(94, 24) + SourceIndex(0) +8 >Emitted(91, 34) Source(94, 33) + SourceIndex(0) +9 >Emitted(91, 36) Source(94, 35) + SourceIndex(0) +10>Emitted(91, 38) Source(94, 24) + SourceIndex(0) +11>Emitted(91, 54) Source(94, 35) + SourceIndex(0) +12>Emitted(91, 56) Source(94, 24) + SourceIndex(0) +13>Emitted(91, 61) Source(94, 35) + SourceIndex(0) +14>Emitted(91, 62) Source(94, 36) + SourceIndex(0) +--- +>>> _24 = _23[_22], name = _24.name, skill = _24.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(92, 5) Source(94, 6) + SourceIndex(0) +2 >Emitted(92, 19) Source(94, 20) + SourceIndex(0) +3 >Emitted(92, 21) Source(94, 7) + SourceIndex(0) +4 >Emitted(92, 36) Source(94, 11) + SourceIndex(0) +5 >Emitted(92, 38) Source(94, 13) + SourceIndex(0) +6 >Emitted(92, 55) Source(94, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(93, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(93, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(93, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(93, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(93, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(93, 22) Source(95, 22) + SourceIndex(0) +7 >Emitted(93, 23) Source(95, 23) + SourceIndex(0) +8 >Emitted(93, 24) Source(95, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(94, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(95, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(95, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(95, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(95, 6) Source(97, 24) + SourceIndex(0) +5 >Emitted(95, 17) Source(97, 100) + SourceIndex(0) +6 >Emitted(95, 19) Source(97, 24) + SourceIndex(0) +7 >Emitted(95, 26) Source(97, 25) + SourceIndex(0) +8 >Emitted(95, 28) Source(97, 27) + SourceIndex(0) +9 >Emitted(95, 32) Source(97, 31) + SourceIndex(0) +10>Emitted(95, 34) Source(97, 33) + SourceIndex(0) +11>Emitted(95, 41) Source(97, 40) + SourceIndex(0) +12>Emitted(95, 43) Source(97, 42) + SourceIndex(0) +13>Emitted(95, 48) Source(97, 47) + SourceIndex(0) +14>Emitted(95, 50) Source(97, 49) + SourceIndex(0) +15>Emitted(95, 58) Source(97, 57) + SourceIndex(0) +16>Emitted(95, 60) Source(97, 59) + SourceIndex(0) +17>Emitted(95, 62) Source(97, 61) + SourceIndex(0) +18>Emitted(95, 64) Source(97, 63) + SourceIndex(0) +19>Emitted(95, 68) Source(97, 67) + SourceIndex(0) +20>Emitted(95, 70) Source(97, 69) + SourceIndex(0) +21>Emitted(95, 79) Source(97, 78) + SourceIndex(0) +22>Emitted(95, 81) Source(97, 80) + SourceIndex(0) +23>Emitted(95, 86) Source(97, 85) + SourceIndex(0) +24>Emitted(95, 88) Source(97, 87) + SourceIndex(0) +25>Emitted(95, 98) Source(97, 97) + SourceIndex(0) +26>Emitted(95, 100) Source(97, 99) + SourceIndex(0) +27>Emitted(95, 101) Source(97, 100) + SourceIndex(0) +28>Emitted(95, 103) Source(97, 24) + SourceIndex(0) +29>Emitted(95, 119) Source(97, 100) + SourceIndex(0) +30>Emitted(95, 121) Source(97, 24) + SourceIndex(0) +31>Emitted(95, 126) Source(97, 100) + SourceIndex(0) +32>Emitted(95, 127) Source(97, 101) + SourceIndex(0) +--- +>>> _27 = _26[_25], name = _27.name, skill = _27.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(96, 5) Source(97, 6) + SourceIndex(0) +2 >Emitted(96, 19) Source(97, 20) + SourceIndex(0) +3 >Emitted(96, 21) Source(97, 7) + SourceIndex(0) +4 >Emitted(96, 36) Source(97, 11) + SourceIndex(0) +5 >Emitted(96, 38) Source(97, 13) + SourceIndex(0) +6 >Emitted(96, 55) Source(97, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(97, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(97, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(97, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(97, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(97, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(97, 22) Source(98, 22) + SourceIndex(0) +7 >Emitted(97, 23) Source(98, 23) + SourceIndex(0) +8 >Emitted(97, 24) Source(98, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(98, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, multiRobots_4 = multiRobots; _28 < multiRobots_4.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(99, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(99, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(99, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(99, 6) Source(100, 49) + SourceIndex(0) +5 >Emitted(99, 17) Source(100, 60) + SourceIndex(0) +6 >Emitted(99, 19) Source(100, 49) + SourceIndex(0) +7 >Emitted(99, 46) Source(100, 60) + SourceIndex(0) +8 >Emitted(99, 48) Source(100, 49) + SourceIndex(0) +9 >Emitted(99, 74) Source(100, 60) + SourceIndex(0) +10>Emitted(99, 76) Source(100, 49) + SourceIndex(0) +11>Emitted(99, 81) Source(100, 60) + SourceIndex(0) +12>Emitted(99, 82) Source(100, 61) + SourceIndex(0) +--- +>>> _29 = multiRobots_4[_28], name = _29.name, _30 = _29.skills, primary = _30.primary, secondary = _30.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(100, 5) Source(100, 6) + SourceIndex(0) +2 >Emitted(100, 29) Source(100, 45) + SourceIndex(0) +3 >Emitted(100, 31) Source(100, 7) + SourceIndex(0) +4 >Emitted(100, 46) Source(100, 11) + SourceIndex(0) +5 >Emitted(100, 48) Source(100, 13) + SourceIndex(0) +6 >Emitted(100, 64) Source(100, 43) + SourceIndex(0) +7 >Emitted(100, 66) Source(100, 23) + SourceIndex(0) +8 >Emitted(100, 87) Source(100, 30) + SourceIndex(0) +9 >Emitted(100, 89) Source(100, 32) + SourceIndex(0) +10>Emitted(100, 114) Source(100, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(101, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(101, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(101, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(101, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(101, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(101, 22) Source(101, 22) + SourceIndex(0) +7 >Emitted(101, 23) Source(101, 23) + SourceIndex(0) +8 >Emitted(101, 24) Source(101, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(102, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, _32 = getMultiRobots(); _31 < _32.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(103, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(103, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(103, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(103, 6) Source(103, 49) + SourceIndex(0) +5 >Emitted(103, 17) Source(103, 65) + SourceIndex(0) +6 >Emitted(103, 19) Source(103, 49) + SourceIndex(0) +7 >Emitted(103, 25) Source(103, 49) + SourceIndex(0) +8 >Emitted(103, 39) Source(103, 63) + SourceIndex(0) +9 >Emitted(103, 41) Source(103, 65) + SourceIndex(0) +10>Emitted(103, 43) Source(103, 49) + SourceIndex(0) +11>Emitted(103, 59) Source(103, 65) + SourceIndex(0) +12>Emitted(103, 61) Source(103, 49) + SourceIndex(0) +13>Emitted(103, 66) Source(103, 65) + SourceIndex(0) +14>Emitted(103, 67) Source(103, 66) + SourceIndex(0) +--- +>>> _33 = _32[_31], name = _33.name, _34 = _33.skills, primary = _34.primary, secondary = _34.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(104, 5) Source(103, 6) + SourceIndex(0) +2 >Emitted(104, 19) Source(103, 45) + SourceIndex(0) +3 >Emitted(104, 21) Source(103, 7) + SourceIndex(0) +4 >Emitted(104, 36) Source(103, 11) + SourceIndex(0) +5 >Emitted(104, 38) Source(103, 13) + SourceIndex(0) +6 >Emitted(104, 54) Source(103, 43) + SourceIndex(0) +7 >Emitted(104, 56) Source(103, 23) + SourceIndex(0) +8 >Emitted(104, 77) Source(103, 30) + SourceIndex(0) +9 >Emitted(104, 79) Source(103, 32) + SourceIndex(0) +10>Emitted(104, 104) Source(103, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(105, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(105, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(105, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(105, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(105, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(105, 22) Source(104, 22) + SourceIndex(0) +7 >Emitted(105, 23) Source(104, 23) + SourceIndex(0) +8 >Emitted(105, 24) Source(104, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(106, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for (var _35 = 0, _36 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(107, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(107, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(107, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(107, 6) Source(106, 49) + SourceIndex(0) +5 >Emitted(107, 17) Source(107, 79) + SourceIndex(0) +6 >Emitted(107, 19) Source(106, 49) + SourceIndex(0) +7 >Emitted(107, 26) Source(106, 50) + SourceIndex(0) +8 >Emitted(107, 28) Source(106, 52) + SourceIndex(0) +9 >Emitted(107, 32) Source(106, 56) + SourceIndex(0) +10>Emitted(107, 34) Source(106, 58) + SourceIndex(0) +11>Emitted(107, 41) Source(106, 65) + SourceIndex(0) +12>Emitted(107, 43) Source(106, 67) + SourceIndex(0) +13>Emitted(107, 49) Source(106, 73) + SourceIndex(0) +14>Emitted(107, 51) Source(106, 75) + SourceIndex(0) +15>Emitted(107, 53) Source(106, 77) + SourceIndex(0) +16>Emitted(107, 60) Source(106, 84) + SourceIndex(0) +17>Emitted(107, 62) Source(106, 86) + SourceIndex(0) +18>Emitted(107, 70) Source(106, 94) + SourceIndex(0) +19>Emitted(107, 72) Source(106, 96) + SourceIndex(0) +20>Emitted(107, 81) Source(106, 105) + SourceIndex(0) +21>Emitted(107, 83) Source(106, 107) + SourceIndex(0) +22>Emitted(107, 89) Source(106, 113) + SourceIndex(0) +23>Emitted(107, 91) Source(106, 115) + SourceIndex(0) +24>Emitted(107, 93) Source(106, 117) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _35 < _36.length; _35++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(108, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(108, 7) Source(107, 7) + SourceIndex(0) +3 >Emitted(108, 11) Source(107, 11) + SourceIndex(0) +4 >Emitted(108, 13) Source(107, 13) + SourceIndex(0) +5 >Emitted(108, 22) Source(107, 22) + SourceIndex(0) +6 >Emitted(108, 24) Source(107, 24) + SourceIndex(0) +7 >Emitted(108, 30) Source(107, 30) + SourceIndex(0) +8 >Emitted(108, 32) Source(107, 32) + SourceIndex(0) +9 >Emitted(108, 34) Source(107, 34) + SourceIndex(0) +10>Emitted(108, 41) Source(107, 41) + SourceIndex(0) +11>Emitted(108, 43) Source(107, 43) + SourceIndex(0) +12>Emitted(108, 53) Source(107, 53) + SourceIndex(0) +13>Emitted(108, 55) Source(107, 55) + SourceIndex(0) +14>Emitted(108, 64) Source(107, 64) + SourceIndex(0) +15>Emitted(108, 66) Source(107, 66) + SourceIndex(0) +16>Emitted(108, 74) Source(107, 74) + SourceIndex(0) +17>Emitted(108, 76) Source(107, 76) + SourceIndex(0) +18>Emitted(108, 78) Source(107, 78) + SourceIndex(0) +19>Emitted(108, 79) Source(107, 79) + SourceIndex(0) +20>Emitted(108, 81) Source(106, 49) + SourceIndex(0) +21>Emitted(108, 97) Source(107, 79) + SourceIndex(0) +22>Emitted(108, 99) Source(106, 49) + SourceIndex(0) +23>Emitted(108, 104) Source(107, 79) + SourceIndex(0) +24>Emitted(108, 105) Source(107, 80) + SourceIndex(0) +--- +>>> _37 = _36[_35], name = _37.name, _38 = _37.skills, primary = _38.primary, secondary = _38.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(109, 5) Source(106, 6) + SourceIndex(0) +2 >Emitted(109, 19) Source(106, 45) + SourceIndex(0) +3 >Emitted(109, 21) Source(106, 7) + SourceIndex(0) +4 >Emitted(109, 36) Source(106, 11) + SourceIndex(0) +5 >Emitted(109, 38) Source(106, 13) + SourceIndex(0) +6 >Emitted(109, 54) Source(106, 43) + SourceIndex(0) +7 >Emitted(109, 56) Source(106, 23) + SourceIndex(0) +8 >Emitted(109, 77) Source(106, 30) + SourceIndex(0) +9 >Emitted(109, 79) Source(106, 32) + SourceIndex(0) +10>Emitted(109, 104) Source(106, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(110, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(110, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(110, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(110, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(110, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(110, 22) Source(108, 22) + SourceIndex(0) +7 >Emitted(110, 23) Source(108, 23) + SourceIndex(0) +8 >Emitted(110, 24) Source(108, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(111, 2) Source(109, 2) + SourceIndex(0) +--- +>>>var _f, _j, _m, _u, _x, _0, _2, _5, _8, _10, _11, _14, _15, _18, _19, _21, _24, _27, _29, _30, _33, _34, _37, _38; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols new file mode 100644 index 00000000000..ed2a6c3449d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols @@ -0,0 +1,435 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 53)) + +for ({name: nameA } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 25)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 40)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 61)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 78)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 67)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 82)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 92)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 111)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({name } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 50, 6)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 53, 6)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 6)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 18)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 33)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 54)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 71)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({ skills: { primary, secondary } } of multiRobots) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 25)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 45)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 60)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 70)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 89)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} + + +for ({name: nameA, skill: skillA } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 71, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 71, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skill: skillA } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 74, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 74, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 40)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 76)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 93)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 79)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 94)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 104)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 123)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 90, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 90, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 93, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 93, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 11)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 25)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 40)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 61)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 78)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of multiRobots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 30)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 30)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 30)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 50)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 65)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 75)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 94)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types new file mode 100644 index 00000000000..1f292542545 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types @@ -0,0 +1,593 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA } of robots) { +>{name: nameA } : { name: string; } +>name : Robot +>nameA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA } of getRobots()) { +>{name: nameA } : { name: string; } +>name : Robot +>nameA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA } : { name: string; } +>name : { name: string; skill: string; } +>nameA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({name } of robots) { +>{name } : { name: string; } +>name : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name } of getRobots()) { +>{name } : { name: string; } +>name : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name } : { name: string; } +>name : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary, secondary } } of multiRobots) { +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA, skill: skillA } of robots) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : Robot +>nameA : string +>skill : Robot +>skillA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skill: skillA } of getRobots()) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : Robot +>nameA : string +>skill : Robot +>skillA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>nameA : string +>skill : { name: string; skill: string; } +>skillA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>nameA : string +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>nameA : string +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : { name: string; skills: { primary: string; secondary: string; }; } +>nameA : string +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of robots) { +>{name, skill } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of getRobots()) { +>{name, skill } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name, skill } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>skill : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of multiRobots) { +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : { name: string; skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..08cf3cf5466 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js @@ -0,0 +1,152 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA = "noName" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + var _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; + console.log(nameA); +} +for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { + var _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + var _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; + console.log(primaryA); +} +for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { + var _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; + console.log(primaryA); +} +for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { + var _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; + console.log(primaryA); +} +for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { + var _1 = robots_2[_0], _2 = _1.name, nameA = _2 === void 0 ? "noName" : _2, _3 = _1.skill, skillA = _3 === void 0 ? "noSkill" : _3; + console.log(nameA); +} +for (var _4 = 0, _5 = getRobots(); _4 < _5.length; _4++) { + var _6 = _5[_4], _7 = _6.name, nameA = _7 === void 0 ? "noName" : _7, _8 = _6.skill, skillA = _8 === void 0 ? "noSkill" : _8; + console.log(nameA); +} +for (var _9 = 0, _10 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _9 < _10.length; _9++) { + var _11 = _10[_9], _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "noSkill" : _13; + console.log(nameA); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + var _15 = multiRobots_2[_14], _16 = _15.name, nameA = _16 === void 0 ? "noName" : _16, _17 = _15.skills, _18 = _17 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _17, _19 = _18.primary, primaryA = _19 === void 0 ? "primary" : _19, _20 = _18.secondary, secondaryA = _20 === void 0 ? "secondary" : _20; + console.log(nameA); +} +for (var _21 = 0, _22 = getMultiRobots(); _21 < _22.length; _21++) { + var _23 = _22[_21], _24 = _23.name, nameA = _24 === void 0 ? "noName" : _24, _25 = _23.skills, _26 = _25 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _25, _27 = _26.primary, primaryA = _27 === void 0 ? "primary" : _27, _28 = _26.secondary, secondaryA = _28 === void 0 ? "secondary" : _28; + console.log(nameA); +} +for (var _29 = 0, _30 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _29 < _30.length; _29++) { + var _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skills, _34 = _33 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _33, _35 = _34.primary, primaryA = _35 === void 0 ? "primary" : _35, _36 = _34.secondary, secondaryA = _36 === void 0 ? "secondary" : _36; + console.log(nameA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..89313ae9027 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,0BAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,oBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAzG,oBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IADvD,iCACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAD5D,sBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC0E,EAD1E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD1E,cAC0E,EAD1E,IAC0E,CAAC;IAHpE,sBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAInF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAA6D,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnE,qBAAwD,EAAnD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAzE,eAAyD,EAApD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,eAA4E,EAA5E,IAA4E,CAAC;IAA1I,iBAAyD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,4BAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,kBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,kBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..e63344455ae --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2082 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(29, 39) + SourceIndex(0) +5 >Emitted(10, 16) Source(29, 45) + SourceIndex(0) +6 >Emitted(10, 18) Source(29, 39) + SourceIndex(0) +7 >Emitted(10, 35) Source(29, 45) + SourceIndex(0) +8 >Emitted(10, 37) Source(29, 39) + SourceIndex(0) +9 >Emitted(10, 57) Source(29, 45) + SourceIndex(0) +10>Emitted(10, 59) Source(29, 39) + SourceIndex(0) +11>Emitted(10, 63) Source(29, 45) + SourceIndex(0) +12>Emitted(10, 64) Source(29, 46) + SourceIndex(0) +--- +>>> var _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(11, 5) Source(29, 11) + SourceIndex(0) +2 >Emitted(11, 31) Source(29, 33) + SourceIndex(0) +3 >Emitted(11, 33) Source(29, 11) + SourceIndex(0) +4 >Emitted(11, 70) Source(29, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 39) + SourceIndex(0) +5 >Emitted(14, 16) Source(32, 50) + SourceIndex(0) +6 >Emitted(14, 18) Source(32, 39) + SourceIndex(0) +7 >Emitted(14, 23) Source(32, 39) + SourceIndex(0) +8 >Emitted(14, 32) Source(32, 48) + SourceIndex(0) +9 >Emitted(14, 34) Source(32, 50) + SourceIndex(0) +10>Emitted(14, 36) Source(32, 39) + SourceIndex(0) +11>Emitted(14, 50) Source(32, 50) + SourceIndex(0) +12>Emitted(14, 52) Source(32, 39) + SourceIndex(0) +13>Emitted(14, 56) Source(32, 50) + SourceIndex(0) +14>Emitted(14, 57) Source(32, 51) + SourceIndex(0) +--- +>>> var _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(15, 5) Source(32, 11) + SourceIndex(0) +2 >Emitted(15, 25) Source(32, 33) + SourceIndex(0) +3 >Emitted(15, 27) Source(32, 11) + SourceIndex(0) +4 >Emitted(15, 64) Source(32, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 39) + SourceIndex(0) +5 >Emitted(18, 16) Source(35, 115) + SourceIndex(0) +6 >Emitted(18, 18) Source(35, 39) + SourceIndex(0) +7 >Emitted(18, 24) Source(35, 40) + SourceIndex(0) +8 >Emitted(18, 26) Source(35, 42) + SourceIndex(0) +9 >Emitted(18, 30) Source(35, 46) + SourceIndex(0) +10>Emitted(18, 32) Source(35, 48) + SourceIndex(0) +11>Emitted(18, 39) Source(35, 55) + SourceIndex(0) +12>Emitted(18, 41) Source(35, 57) + SourceIndex(0) +13>Emitted(18, 46) Source(35, 62) + SourceIndex(0) +14>Emitted(18, 48) Source(35, 64) + SourceIndex(0) +15>Emitted(18, 56) Source(35, 72) + SourceIndex(0) +16>Emitted(18, 58) Source(35, 74) + SourceIndex(0) +17>Emitted(18, 60) Source(35, 76) + SourceIndex(0) +18>Emitted(18, 62) Source(35, 78) + SourceIndex(0) +19>Emitted(18, 66) Source(35, 82) + SourceIndex(0) +20>Emitted(18, 68) Source(35, 84) + SourceIndex(0) +21>Emitted(18, 77) Source(35, 93) + SourceIndex(0) +22>Emitted(18, 79) Source(35, 95) + SourceIndex(0) +23>Emitted(18, 84) Source(35, 100) + SourceIndex(0) +24>Emitted(18, 86) Source(35, 102) + SourceIndex(0) +25>Emitted(18, 96) Source(35, 112) + SourceIndex(0) +26>Emitted(18, 98) Source(35, 114) + SourceIndex(0) +27>Emitted(18, 99) Source(35, 115) + SourceIndex(0) +28>Emitted(18, 101) Source(35, 39) + SourceIndex(0) +29>Emitted(18, 115) Source(35, 115) + SourceIndex(0) +30>Emitted(18, 117) Source(35, 39) + SourceIndex(0) +31>Emitted(18, 121) Source(35, 115) + SourceIndex(0) +32>Emitted(18, 122) Source(35, 116) + SourceIndex(0) +--- +>>> var _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1 >Emitted(19, 5) Source(35, 11) + SourceIndex(0) +2 >Emitted(19, 25) Source(35, 33) + SourceIndex(0) +3 >Emitted(19, 27) Source(35, 11) + SourceIndex(0) +4 >Emitted(19, 64) Source(35, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(20, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(20, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(20, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(21, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(39, 55) + SourceIndex(0) +5 >Emitted(22, 16) Source(39, 66) + SourceIndex(0) +6 >Emitted(22, 18) Source(39, 55) + SourceIndex(0) +7 >Emitted(22, 45) Source(39, 66) + SourceIndex(0) +8 >Emitted(22, 47) Source(39, 55) + SourceIndex(0) +9 >Emitted(22, 72) Source(39, 66) + SourceIndex(0) +10>Emitted(22, 74) Source(39, 55) + SourceIndex(0) +11>Emitted(22, 78) Source(39, 66) + SourceIndex(0) +12>Emitted(22, 79) Source(39, 67) + SourceIndex(0) +--- +>>> var _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(23, 5) Source(38, 12) + SourceIndex(0) +2 >Emitted(23, 38) Source(39, 49) + SourceIndex(0) +3 >Emitted(23, 40) Source(38, 12) + SourceIndex(0) +4 >Emitted(23, 110) Source(39, 49) + SourceIndex(0) +5 >Emitted(23, 112) Source(38, 22) + SourceIndex(0) +6 >Emitted(23, 127) Source(38, 51) + SourceIndex(0) +7 >Emitted(23, 129) Source(38, 22) + SourceIndex(0) +8 >Emitted(23, 170) Source(38, 51) + SourceIndex(0) +9 >Emitted(23, 172) Source(38, 53) + SourceIndex(0) +10>Emitted(23, 189) Source(38, 88) + SourceIndex(0) +11>Emitted(23, 191) Source(38, 53) + SourceIndex(0) +12>Emitted(23, 236) Source(38, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(40, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(40, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(40, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(25, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(26, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(42, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(42, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(43, 55) + SourceIndex(0) +5 >Emitted(26, 16) Source(43, 71) + SourceIndex(0) +6 >Emitted(26, 18) Source(43, 55) + SourceIndex(0) +7 >Emitted(26, 23) Source(43, 55) + SourceIndex(0) +8 >Emitted(26, 37) Source(43, 69) + SourceIndex(0) +9 >Emitted(26, 39) Source(43, 71) + SourceIndex(0) +10>Emitted(26, 41) Source(43, 55) + SourceIndex(0) +11>Emitted(26, 55) Source(43, 71) + SourceIndex(0) +12>Emitted(26, 57) Source(43, 55) + SourceIndex(0) +13>Emitted(26, 61) Source(43, 71) + SourceIndex(0) +14>Emitted(26, 62) Source(43, 72) + SourceIndex(0) +--- +>>> var _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(27, 5) Source(42, 12) + SourceIndex(0) +2 >Emitted(27, 27) Source(43, 49) + SourceIndex(0) +3 >Emitted(27, 29) Source(42, 12) + SourceIndex(0) +4 >Emitted(27, 99) Source(43, 49) + SourceIndex(0) +5 >Emitted(27, 101) Source(42, 22) + SourceIndex(0) +6 >Emitted(27, 116) Source(42, 51) + SourceIndex(0) +7 >Emitted(27, 118) Source(42, 22) + SourceIndex(0) +8 >Emitted(27, 159) Source(42, 51) + SourceIndex(0) +9 >Emitted(27, 161) Source(42, 53) + SourceIndex(0) +10>Emitted(27, 178) Source(42, 88) + SourceIndex(0) +11>Emitted(27, 180) Source(42, 53) + SourceIndex(0) +12>Emitted(27, 225) Source(42, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(29, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(30, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(48, 5) + SourceIndex(0) +5 >Emitted(30, 16) Source(49, 79) + SourceIndex(0) +6 >Emitted(30, 18) Source(48, 5) + SourceIndex(0) +7 >Emitted(30, 23) Source(48, 19) + SourceIndex(0) +8 >Emitted(30, 24) Source(48, 20) + SourceIndex(0) +9 >Emitted(30, 26) Source(48, 22) + SourceIndex(0) +10>Emitted(30, 30) Source(48, 26) + SourceIndex(0) +11>Emitted(30, 32) Source(48, 28) + SourceIndex(0) +12>Emitted(30, 39) Source(48, 35) + SourceIndex(0) +13>Emitted(30, 41) Source(48, 37) + SourceIndex(0) +14>Emitted(30, 47) Source(48, 43) + SourceIndex(0) +15>Emitted(30, 49) Source(48, 45) + SourceIndex(0) +16>Emitted(30, 51) Source(48, 47) + SourceIndex(0) +17>Emitted(30, 58) Source(48, 54) + SourceIndex(0) +18>Emitted(30, 60) Source(48, 56) + SourceIndex(0) +19>Emitted(30, 68) Source(48, 64) + SourceIndex(0) +20>Emitted(30, 70) Source(48, 66) + SourceIndex(0) +21>Emitted(30, 79) Source(48, 75) + SourceIndex(0) +22>Emitted(30, 81) Source(48, 77) + SourceIndex(0) +23>Emitted(30, 87) Source(48, 83) + SourceIndex(0) +24>Emitted(30, 89) Source(48, 85) + SourceIndex(0) +25>Emitted(30, 91) Source(48, 87) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(31, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(31, 7) Source(49, 7) + SourceIndex(0) +3 >Emitted(31, 11) Source(49, 11) + SourceIndex(0) +4 >Emitted(31, 13) Source(49, 13) + SourceIndex(0) +5 >Emitted(31, 22) Source(49, 22) + SourceIndex(0) +6 >Emitted(31, 24) Source(49, 24) + SourceIndex(0) +7 >Emitted(31, 30) Source(49, 30) + SourceIndex(0) +8 >Emitted(31, 32) Source(49, 32) + SourceIndex(0) +9 >Emitted(31, 34) Source(49, 34) + SourceIndex(0) +10>Emitted(31, 41) Source(49, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(49, 43) + SourceIndex(0) +12>Emitted(31, 53) Source(49, 53) + SourceIndex(0) +13>Emitted(31, 55) Source(49, 55) + SourceIndex(0) +14>Emitted(31, 64) Source(49, 64) + SourceIndex(0) +15>Emitted(31, 66) Source(49, 66) + SourceIndex(0) +16>Emitted(31, 74) Source(49, 74) + SourceIndex(0) +17>Emitted(31, 76) Source(49, 76) + SourceIndex(0) +18>Emitted(31, 78) Source(49, 78) + SourceIndex(0) +19>Emitted(31, 79) Source(49, 79) + SourceIndex(0) +20>Emitted(31, 81) Source(48, 5) + SourceIndex(0) +21>Emitted(31, 95) Source(49, 79) + SourceIndex(0) +22>Emitted(31, 97) Source(48, 5) + SourceIndex(0) +23>Emitted(31, 101) Source(49, 79) + SourceIndex(0) +24>Emitted(31, 102) Source(49, 80) + SourceIndex(0) +--- +>>> var _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(32, 5) Source(46, 12) + SourceIndex(0) +2 >Emitted(32, 27) Source(47, 49) + SourceIndex(0) +3 >Emitted(32, 29) Source(46, 12) + SourceIndex(0) +4 >Emitted(32, 99) Source(47, 49) + SourceIndex(0) +5 >Emitted(32, 101) Source(46, 22) + SourceIndex(0) +6 >Emitted(32, 116) Source(46, 51) + SourceIndex(0) +7 >Emitted(32, 118) Source(46, 22) + SourceIndex(0) +8 >Emitted(32, 159) Source(46, 51) + SourceIndex(0) +9 >Emitted(32, 161) Source(46, 53) + SourceIndex(0) +10>Emitted(32, 178) Source(46, 88) + SourceIndex(0) +11>Emitted(32, 180) Source(46, 53) + SourceIndex(0) +12>Emitted(32, 225) Source(46, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of + > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(33, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(33, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(33, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(33, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(33, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(33, 25) Source(50, 25) + SourceIndex(0) +7 >Emitted(33, 26) Source(50, 26) + SourceIndex(0) +8 >Emitted(33, 27) Source(50, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(34, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(35, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(35, 4) Source(53, 4) + SourceIndex(0) +3 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +4 >Emitted(35, 6) Source(53, 66) + SourceIndex(0) +5 >Emitted(35, 16) Source(53, 72) + SourceIndex(0) +6 >Emitted(35, 18) Source(53, 66) + SourceIndex(0) +7 >Emitted(35, 35) Source(53, 72) + SourceIndex(0) +8 >Emitted(35, 37) Source(53, 66) + SourceIndex(0) +9 >Emitted(35, 57) Source(53, 72) + SourceIndex(0) +10>Emitted(35, 59) Source(53, 66) + SourceIndex(0) +11>Emitted(35, 63) Source(53, 72) + SourceIndex(0) +12>Emitted(35, 64) Source(53, 73) + SourceIndex(0) +--- +>>> var _1 = robots_2[_0], _2 = _1.name, nameA = _2 === void 0 ? "noName" : _2, _3 = _1.skill, skillA = _3 === void 0 ? "noSkill" : _3; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(36, 5) Source(53, 6) + SourceIndex(0) +2 >Emitted(36, 26) Source(53, 62) + SourceIndex(0) +3 >Emitted(36, 28) Source(53, 11) + SourceIndex(0) +4 >Emitted(36, 40) Source(53, 33) + SourceIndex(0) +5 >Emitted(36, 42) Source(53, 11) + SourceIndex(0) +6 >Emitted(36, 79) Source(53, 33) + SourceIndex(0) +7 >Emitted(36, 81) Source(53, 35) + SourceIndex(0) +8 >Emitted(36, 94) Source(53, 60) + SourceIndex(0) +9 >Emitted(36, 96) Source(53, 35) + SourceIndex(0) +10>Emitted(36, 135) Source(53, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(54, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(54, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(54, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(54, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(54, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(54, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(54, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(54, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(38, 2) Source(55, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, _5 = getRobots(); _4 < _5.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(39, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(56, 67) + SourceIndex(0) +5 >Emitted(39, 16) Source(56, 78) + SourceIndex(0) +6 >Emitted(39, 18) Source(56, 67) + SourceIndex(0) +7 >Emitted(39, 23) Source(56, 67) + SourceIndex(0) +8 >Emitted(39, 32) Source(56, 76) + SourceIndex(0) +9 >Emitted(39, 34) Source(56, 78) + SourceIndex(0) +10>Emitted(39, 36) Source(56, 67) + SourceIndex(0) +11>Emitted(39, 50) Source(56, 78) + SourceIndex(0) +12>Emitted(39, 52) Source(56, 67) + SourceIndex(0) +13>Emitted(39, 56) Source(56, 78) + SourceIndex(0) +14>Emitted(39, 57) Source(56, 79) + SourceIndex(0) +--- +>>> var _6 = _5[_4], _7 = _6.name, nameA = _7 === void 0 ? "noName" : _7, _8 = _6.skill, skillA = _8 === void 0 ? "noSkill" : _8; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(40, 5) Source(56, 6) + SourceIndex(0) +2 >Emitted(40, 20) Source(56, 63) + SourceIndex(0) +3 >Emitted(40, 22) Source(56, 11) + SourceIndex(0) +4 >Emitted(40, 34) Source(56, 33) + SourceIndex(0) +5 >Emitted(40, 36) Source(56, 11) + SourceIndex(0) +6 >Emitted(40, 73) Source(56, 33) + SourceIndex(0) +7 >Emitted(40, 75) Source(56, 35) + SourceIndex(0) +8 >Emitted(40, 88) Source(56, 60) + SourceIndex(0) +9 >Emitted(40, 90) Source(56, 35) + SourceIndex(0) +10>Emitted(40, 129) Source(56, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(41, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(57, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(57, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(57, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(42, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +33> ^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(43, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(59, 67) + SourceIndex(0) +5 >Emitted(43, 16) Source(59, 143) + SourceIndex(0) +6 >Emitted(43, 18) Source(59, 67) + SourceIndex(0) +7 >Emitted(43, 25) Source(59, 68) + SourceIndex(0) +8 >Emitted(43, 27) Source(59, 70) + SourceIndex(0) +9 >Emitted(43, 31) Source(59, 74) + SourceIndex(0) +10>Emitted(43, 33) Source(59, 76) + SourceIndex(0) +11>Emitted(43, 40) Source(59, 83) + SourceIndex(0) +12>Emitted(43, 42) Source(59, 85) + SourceIndex(0) +13>Emitted(43, 47) Source(59, 90) + SourceIndex(0) +14>Emitted(43, 49) Source(59, 92) + SourceIndex(0) +15>Emitted(43, 57) Source(59, 100) + SourceIndex(0) +16>Emitted(43, 59) Source(59, 102) + SourceIndex(0) +17>Emitted(43, 61) Source(59, 104) + SourceIndex(0) +18>Emitted(43, 63) Source(59, 106) + SourceIndex(0) +19>Emitted(43, 67) Source(59, 110) + SourceIndex(0) +20>Emitted(43, 69) Source(59, 112) + SourceIndex(0) +21>Emitted(43, 78) Source(59, 121) + SourceIndex(0) +22>Emitted(43, 80) Source(59, 123) + SourceIndex(0) +23>Emitted(43, 85) Source(59, 128) + SourceIndex(0) +24>Emitted(43, 87) Source(59, 130) + SourceIndex(0) +25>Emitted(43, 97) Source(59, 140) + SourceIndex(0) +26>Emitted(43, 99) Source(59, 142) + SourceIndex(0) +27>Emitted(43, 100) Source(59, 143) + SourceIndex(0) +28>Emitted(43, 102) Source(59, 67) + SourceIndex(0) +29>Emitted(43, 117) Source(59, 143) + SourceIndex(0) +30>Emitted(43, 119) Source(59, 67) + SourceIndex(0) +31>Emitted(43, 123) Source(59, 143) + SourceIndex(0) +32>Emitted(43, 124) Source(59, 144) + SourceIndex(0) +--- +>>> var _11 = _10[_9], _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "noSkill" : _13; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(44, 5) Source(59, 6) + SourceIndex(0) +2 >Emitted(44, 22) Source(59, 63) + SourceIndex(0) +3 >Emitted(44, 24) Source(59, 11) + SourceIndex(0) +4 >Emitted(44, 38) Source(59, 33) + SourceIndex(0) +5 >Emitted(44, 40) Source(59, 11) + SourceIndex(0) +6 >Emitted(44, 79) Source(59, 33) + SourceIndex(0) +7 >Emitted(44, 81) Source(59, 35) + SourceIndex(0) +8 >Emitted(44, 96) Source(59, 60) + SourceIndex(0) +9 >Emitted(44, 98) Source(59, 35) + SourceIndex(0) +10>Emitted(44, 139) Source(59, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(45, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(45, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(45, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(45, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(45, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(45, 22) Source(60, 22) + SourceIndex(0) +7 >Emitted(45, 23) Source(60, 23) + SourceIndex(0) +8 >Emitted(45, 24) Source(60, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(46, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(47, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(47, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(47, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(47, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(47, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(47, 19) Source(68, 6) + SourceIndex(0) +7 >Emitted(47, 46) Source(68, 17) + SourceIndex(0) +8 >Emitted(47, 48) Source(68, 6) + SourceIndex(0) +9 >Emitted(47, 74) Source(68, 17) + SourceIndex(0) +10>Emitted(47, 76) Source(68, 6) + SourceIndex(0) +11>Emitted(47, 81) Source(68, 17) + SourceIndex(0) +12>Emitted(47, 82) Source(68, 18) + SourceIndex(0) +--- +>>> var _15 = multiRobots_2[_14], _16 = _15.name, nameA = _16 === void 0 ? "noName" : _16, _17 = _15.skills, _18 = _17 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _17, _19 = _18.primary, primaryA = _19 === void 0 ? "primary" : _19, _20 = _18.secondary, secondaryA = _20 === void 0 ? "secondary" : _20; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(48, 5) Source(62, 6) + SourceIndex(0) +2 >Emitted(48, 33) Source(68, 2) + SourceIndex(0) +3 >Emitted(48, 35) Source(63, 5) + SourceIndex(0) +4 >Emitted(48, 49) Source(63, 27) + SourceIndex(0) +5 >Emitted(48, 51) Source(63, 5) + SourceIndex(0) +6 >Emitted(48, 90) Source(63, 27) + SourceIndex(0) +7 >Emitted(48, 92) Source(64, 5) + SourceIndex(0) +8 >Emitted(48, 108) Source(67, 53) + SourceIndex(0) +9 >Emitted(48, 110) Source(64, 5) + SourceIndex(0) +10>Emitted(48, 183) Source(67, 53) + SourceIndex(0) +11>Emitted(48, 185) Source(65, 9) + SourceIndex(0) +12>Emitted(48, 202) Source(65, 38) + SourceIndex(0) +13>Emitted(48, 204) Source(65, 9) + SourceIndex(0) +14>Emitted(48, 247) Source(65, 38) + SourceIndex(0) +15>Emitted(48, 249) Source(66, 9) + SourceIndex(0) +16>Emitted(48, 268) Source(66, 44) + SourceIndex(0) +17>Emitted(48, 270) Source(66, 9) + SourceIndex(0) +18>Emitted(48, 317) Source(66, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(49, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(69, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(69, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(69, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(50, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _21 = 0, _22 = getMultiRobots(); _21 < _22.length; _21++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(51, 17) Source(77, 22) + SourceIndex(0) +6 >Emitted(51, 19) Source(77, 6) + SourceIndex(0) +7 >Emitted(51, 25) Source(77, 6) + SourceIndex(0) +8 >Emitted(51, 39) Source(77, 20) + SourceIndex(0) +9 >Emitted(51, 41) Source(77, 22) + SourceIndex(0) +10>Emitted(51, 43) Source(77, 6) + SourceIndex(0) +11>Emitted(51, 59) Source(77, 22) + SourceIndex(0) +12>Emitted(51, 61) Source(77, 6) + SourceIndex(0) +13>Emitted(51, 66) Source(77, 22) + SourceIndex(0) +14>Emitted(51, 67) Source(77, 23) + SourceIndex(0) +--- +>>> var _23 = _22[_21], _24 = _23.name, nameA = _24 === void 0 ? "noName" : _24, _25 = _23.skills, _26 = _25 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _25, _27 = _26.primary, primaryA = _27 === void 0 ? "primary" : _27, _28 = _26.secondary, secondaryA = _28 === void 0 ? "secondary" : _28; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(52, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(52, 23) Source(77, 2) + SourceIndex(0) +3 >Emitted(52, 25) Source(72, 5) + SourceIndex(0) +4 >Emitted(52, 39) Source(72, 27) + SourceIndex(0) +5 >Emitted(52, 41) Source(72, 5) + SourceIndex(0) +6 >Emitted(52, 80) Source(72, 27) + SourceIndex(0) +7 >Emitted(52, 82) Source(73, 5) + SourceIndex(0) +8 >Emitted(52, 98) Source(76, 53) + SourceIndex(0) +9 >Emitted(52, 100) Source(73, 5) + SourceIndex(0) +10>Emitted(52, 173) Source(76, 53) + SourceIndex(0) +11>Emitted(52, 175) Source(74, 9) + SourceIndex(0) +12>Emitted(52, 192) Source(74, 38) + SourceIndex(0) +13>Emitted(52, 194) Source(74, 9) + SourceIndex(0) +14>Emitted(52, 237) Source(74, 38) + SourceIndex(0) +15>Emitted(52, 239) Source(75, 9) + SourceIndex(0) +16>Emitted(52, 258) Source(75, 44) + SourceIndex(0) +17>Emitted(52, 260) Source(75, 9) + SourceIndex(0) +18>Emitted(52, 307) Source(75, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(78, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(78, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(78, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(54, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for (var _29 = 0, _30 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(55, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(55, 17) Source(87, 79) + SourceIndex(0) +6 >Emitted(55, 19) Source(86, 6) + SourceIndex(0) +7 >Emitted(55, 25) Source(86, 20) + SourceIndex(0) +8 >Emitted(55, 26) Source(86, 21) + SourceIndex(0) +9 >Emitted(55, 28) Source(86, 23) + SourceIndex(0) +10>Emitted(55, 32) Source(86, 27) + SourceIndex(0) +11>Emitted(55, 34) Source(86, 29) + SourceIndex(0) +12>Emitted(55, 41) Source(86, 36) + SourceIndex(0) +13>Emitted(55, 43) Source(86, 38) + SourceIndex(0) +14>Emitted(55, 49) Source(86, 44) + SourceIndex(0) +15>Emitted(55, 51) Source(86, 46) + SourceIndex(0) +16>Emitted(55, 53) Source(86, 48) + SourceIndex(0) +17>Emitted(55, 60) Source(86, 55) + SourceIndex(0) +18>Emitted(55, 62) Source(86, 57) + SourceIndex(0) +19>Emitted(55, 70) Source(86, 65) + SourceIndex(0) +20>Emitted(55, 72) Source(86, 67) + SourceIndex(0) +21>Emitted(55, 81) Source(86, 76) + SourceIndex(0) +22>Emitted(55, 83) Source(86, 78) + SourceIndex(0) +23>Emitted(55, 89) Source(86, 84) + SourceIndex(0) +24>Emitted(55, 91) Source(86, 86) + SourceIndex(0) +25>Emitted(55, 93) Source(86, 88) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _29 < _30.length; _29++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(56, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(56, 7) Source(87, 7) + SourceIndex(0) +3 >Emitted(56, 11) Source(87, 11) + SourceIndex(0) +4 >Emitted(56, 13) Source(87, 13) + SourceIndex(0) +5 >Emitted(56, 22) Source(87, 22) + SourceIndex(0) +6 >Emitted(56, 24) Source(87, 24) + SourceIndex(0) +7 >Emitted(56, 30) Source(87, 30) + SourceIndex(0) +8 >Emitted(56, 32) Source(87, 32) + SourceIndex(0) +9 >Emitted(56, 34) Source(87, 34) + SourceIndex(0) +10>Emitted(56, 41) Source(87, 41) + SourceIndex(0) +11>Emitted(56, 43) Source(87, 43) + SourceIndex(0) +12>Emitted(56, 53) Source(87, 53) + SourceIndex(0) +13>Emitted(56, 55) Source(87, 55) + SourceIndex(0) +14>Emitted(56, 64) Source(87, 64) + SourceIndex(0) +15>Emitted(56, 66) Source(87, 66) + SourceIndex(0) +16>Emitted(56, 74) Source(87, 74) + SourceIndex(0) +17>Emitted(56, 76) Source(87, 76) + SourceIndex(0) +18>Emitted(56, 78) Source(87, 78) + SourceIndex(0) +19>Emitted(56, 79) Source(87, 79) + SourceIndex(0) +20>Emitted(56, 81) Source(86, 6) + SourceIndex(0) +21>Emitted(56, 97) Source(87, 79) + SourceIndex(0) +22>Emitted(56, 99) Source(86, 6) + SourceIndex(0) +23>Emitted(56, 104) Source(87, 79) + SourceIndex(0) +24>Emitted(56, 105) Source(87, 80) + SourceIndex(0) +--- +>>> var _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skills, _34 = _33 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _33, _35 = _34.primary, primaryA = _35 === void 0 ? "primary" : _35, _36 = _34.secondary, secondaryA = _36 === void 0 ? "secondary" : _36; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(57, 5) Source(80, 6) + SourceIndex(0) +2 >Emitted(57, 23) Source(86, 2) + SourceIndex(0) +3 >Emitted(57, 25) Source(81, 5) + SourceIndex(0) +4 >Emitted(57, 39) Source(81, 27) + SourceIndex(0) +5 >Emitted(57, 41) Source(81, 5) + SourceIndex(0) +6 >Emitted(57, 80) Source(81, 27) + SourceIndex(0) +7 >Emitted(57, 82) Source(82, 5) + SourceIndex(0) +8 >Emitted(57, 98) Source(85, 53) + SourceIndex(0) +9 >Emitted(57, 100) Source(82, 5) + SourceIndex(0) +10>Emitted(57, 173) Source(85, 53) + SourceIndex(0) +11>Emitted(57, 175) Source(83, 9) + SourceIndex(0) +12>Emitted(57, 192) Source(83, 38) + SourceIndex(0) +13>Emitted(57, 194) Source(83, 9) + SourceIndex(0) +14>Emitted(57, 237) Source(83, 38) + SourceIndex(0) +15>Emitted(57, 239) Source(84, 9) + SourceIndex(0) +16>Emitted(57, 258) Source(84, 44) + SourceIndex(0) +17>Emitted(57, 260) Source(84, 9) + SourceIndex(0) +18>Emitted(57, 307) Source(84, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(58, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(58, 22) Source(88, 22) + SourceIndex(0) +7 >Emitted(58, 23) Source(88, 23) + SourceIndex(0) +8 >Emitted(58, 24) Source(88, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(59, 2) Source(89, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..f73adeb7761 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,314 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) +} + +for (let {name: nameA = "noName" } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 28, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 28, 10)) +} +for (let {name: nameA = "noName" } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 31, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 31, 10)) +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 40)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 10)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 40)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 76)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 93)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 10)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 38, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 38, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 20)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 42, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 42, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 20)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 46, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 46, 25)) + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 20)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 35)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 45)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 64)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 20)) +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 33)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 33)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 68)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 10)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 83)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 33)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 68)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 83)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 104)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 121)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 61, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 63, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 64, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 66, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 66, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 61, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 70, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 72, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 73, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 75, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 75, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 70, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 79, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 81, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 82, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 84, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 65)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 79, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..36f67f946f0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types @@ -0,0 +1,428 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +for (let {name: nameA = "noName" } of robots) { +>name : any +>nameA : string +>"noName" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } of getRobots()) { +>name : any +>nameA : string +>"noName" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>"noName" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..1e18159d3d4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js @@ -0,0 +1,282 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for ({ name = "noName" } of robots) { + console.log(nameA); +} +for ({ name = "noName" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +for ({ name = "noName", skill = "noSkill" } of robots) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; + console.log(nameA); +} +for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { + _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; + console.log(primaryA); +} +for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { + _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; + console.log(primaryA); +} +for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { + _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; + console.log(primaryA); +} +for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { + _1 = robots_2[_0].name, name = _1 === void 0 ? "noName" : _1; + console.log(nameA); +} +for (var _2 = 0, _3 = getRobots(); _2 < _3.length; _2++) { + _4 = _3[_2].name, name = _4 === void 0 ? "noName" : _4; + console.log(nameA); +} +for (var _5 = 0, _6 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _5 < _6.length; _5++) { + _7 = _6[_5].name, name = _7 === void 0 ? "noName" : _7; + console.log(nameA); +} +for (var _8 = 0, multiRobots_2 = multiRobots; _8 < multiRobots_2.length; _8++) { + _9 = multiRobots_2[_8].skills, _10 = _9 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _9, _11 = _10.primary, primary = _11 === void 0 ? "primary" : _11, _12 = _10.secondary, secondary = _12 === void 0 ? "secondary" : _12; + console.log(primaryA); +} +for (var _13 = 0, _14 = getMultiRobots(); _13 < _14.length; _13++) { + _15 = _14[_13].skills, _16 = _15 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _15, _17 = _16.primary, primary = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondary = _18 === void 0 ? "secondary" : _18; + console.log(primaryA); +} +for (var _19 = 0, _20 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _19 < _20.length; _19++) { + _21 = _20[_19].skills, _22 = _21 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _21, _23 = _22.primary, primary = _23 === void 0 ? "primary" : _23, _24 = _22.secondary, secondary = _24 === void 0 ? "secondary" : _24; + console.log(primaryA); +} +for (var _25 = 0, robots_3 = robots; _25 < robots_3.length; _25++) { + _26 = robots_3[_25], _27 = _26.name, nameA = _27 === void 0 ? "noName" : _27, _28 = _26.skill, skillA = _28 === void 0 ? "noSkill" : _28; + console.log(nameA); +} +for (var _29 = 0, _30 = getRobots(); _29 < _30.length; _29++) { + _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skill, skillA = _33 === void 0 ? "noSkill" : _33; + console.log(nameA); +} +for (var _34 = 0, _35 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _34 < _35.length; _34++) { + _36 = _35[_34], _37 = _36.name, nameA = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skillA = _38 === void 0 ? "noSkill" : _38; + console.log(nameA); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + _40 = multiRobots_3[_39], _41 = _40.name, nameA = _41 === void 0 ? "noName" : _41, _42 = _40.skills, _43 = _42 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _42, _44 = _43.primary, primaryA = _44 === void 0 ? "primary" : _44, _45 = _43.secondary, secondaryA = _45 === void 0 ? "secondary" : _45; + console.log(nameA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + _48 = _47[_46], _49 = _48.name, nameA = _49 === void 0 ? "noName" : _49, _50 = _48.skills, _51 = _50 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _50, _52 = _51.primary, primaryA = _52 === void 0 ? "primary" : _52, _53 = _51.secondary, secondaryA = _53 === void 0 ? "secondary" : _53; + console.log(nameA); +} +for (var _54 = 0, _55 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _54 < _55.length; _54++) { + _56 = _55[_54], _57 = _56.name, nameA = _57 === void 0 ? "noName" : _57, _58 = _56.skills, _59 = _58 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _58, _60 = _59.primary, primaryA = _60 === void 0 ? "primary" : _60, _61 = _59.secondary, secondaryA = _61 === void 0 ? "secondary" : _61; + console.log(nameA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + _63 = robots_4[_62], _64 = _63.name, name = _64 === void 0 ? "noName" : _64, _65 = _63.skill, skill = _65 === void 0 ? "noSkill" : _65; + console.log(nameA); +} +for (var _66 = 0, _67 = getRobots(); _66 < _67.length; _66++) { + _68 = _67[_66], _69 = _68.name, name = _69 === void 0 ? "noName" : _69, _70 = _68.skill, skill = _70 === void 0 ? "noSkill" : _70; + console.log(nameA); +} +for (var _71 = 0, _72 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _71 < _72.length; _71++) { + _73 = _72[_71], _74 = _73.name, name = _74 === void 0 ? "noName" : _74, _75 = _73.skill, skill = _75 === void 0 ? "noSkill" : _75; + console.log(nameA); +} +for (var _76 = 0, multiRobots_4 = multiRobots; _76 < multiRobots_4.length; _76++) { + _77 = multiRobots_4[_76], _78 = _77.name, name = _78 === void 0 ? "noName" : _78, _79 = _77.skills, _80 = _79 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _79, _81 = _80.primary, primary = _81 === void 0 ? "primary" : _81, _82 = _80.secondary, secondary = _82 === void 0 ? "secondary" : _82; + console.log(nameA); +} +for (var _83 = 0, _84 = getMultiRobots(); _83 < _84.length; _83++) { + _85 = _84[_83], _86 = _85.name, name = _86 === void 0 ? "noName" : _86, _87 = _85.skills, _88 = _87 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _87, _89 = _88.primary, primary = _89 === void 0 ? "primary" : _89, _90 = _88.secondary, secondary = _90 === void 0 ? "secondary" : _90; + console.log(nameA); +} +for (var _91 = 0, _92 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _91 < _92.length; _91++) { + _93 = _92[_91], _94 = _93.name, name = _94 === void 0 ? "noName" : _94, _95 = _93.skills, _96 = _95 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _95, _97 = _96.primary, primary = _97 === void 0 ? "primary" : _97, _98 = _96.secondary, secondary = _98 === void 0 ? "secondary" : _98; + console.log(nameA); +} +var _a, _d, _g, _j, _k, _l, _m, _q, _r, _s, _t, _w, _x, _y, _z, _1, _4, _7, _9, _10, _11, _12, _15, _16, _17, _18, _21, _22, _23, _24, _26, _27, _28, _31, _32, _33, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _65, _68, _69, _70, _73, _74, _75, _77, _78, _79, _80, _81, _82, _85, _86, _87, _88, _89, _90, _93, _94, _95, _96, _97, _98; +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..0529919c803 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAA8B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,sBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAzG,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAD3D,6BACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IADhE,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC8E,EAD9E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC9E,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9E,cAC8E,EAD9E,IAC8E,CAAC;IAH5E,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAI/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAwB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA5B,sBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAjC,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAlG,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAKC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAJb,6BAGgD,EAHhD,uEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAJlB,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAL3E,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAyD,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAA/D,mBAAoD,EAAnD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAArE,cAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAAtI,cAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,wBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,cAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,cAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA4C,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAlD,mBAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAvD,cAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAiB,EAAjB,wCAAiB;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAAxH,cAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,wBAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,cAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,cAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..f80a065e9ce --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3951 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(29, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(29, 20) + SourceIndex(0) +5 >Emitted(10, 20) Source(29, 36) + SourceIndex(0) +6 >Emitted(10, 22) Source(29, 38) + SourceIndex(0) +7 >Emitted(10, 32) Source(29, 56) + SourceIndex(0) +8 >Emitted(10, 34) Source(29, 58) + SourceIndex(0) +9 >Emitted(10, 35) Source(29, 67) + SourceIndex(0) +10>Emitted(10, 37) Source(29, 69) + SourceIndex(0) +11>Emitted(10, 43) Source(29, 83) + SourceIndex(0) +12>Emitted(10, 44) Source(29, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(11, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(11, 9) Source(30, 17) + SourceIndex(0) +4 >Emitted(11, 11) Source(30, 19) + SourceIndex(0) +5 >Emitted(11, 18) Source(30, 34) + SourceIndex(0) +6 >Emitted(11, 20) Source(30, 36) + SourceIndex(0) +7 >Emitted(11, 29) Source(30, 53) + SourceIndex(0) +8 >Emitted(11, 31) Source(30, 55) + SourceIndex(0) +9 >Emitted(11, 36) Source(30, 68) + SourceIndex(0) +10>Emitted(11, 37) Source(30, 69) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^-> +1-> + > + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(32, 35) + SourceIndex(0) +5 >Emitted(12, 16) Source(32, 41) + SourceIndex(0) +6 >Emitted(12, 18) Source(32, 35) + SourceIndex(0) +7 >Emitted(12, 35) Source(32, 41) + SourceIndex(0) +8 >Emitted(12, 37) Source(32, 35) + SourceIndex(0) +9 >Emitted(12, 57) Source(32, 41) + SourceIndex(0) +10>Emitted(12, 59) Source(32, 35) + SourceIndex(0) +11>Emitted(12, 63) Source(32, 41) + SourceIndex(0) +12>Emitted(12, 64) Source(32, 42) + SourceIndex(0) +--- +>>> _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(13, 5) Source(32, 7) + SourceIndex(0) +2 >Emitted(13, 27) Source(32, 29) + SourceIndex(0) +3 >Emitted(13, 29) Source(32, 7) + SourceIndex(0) +4 >Emitted(13, 66) Source(32, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(15, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(35, 35) + SourceIndex(0) +5 >Emitted(16, 16) Source(35, 46) + SourceIndex(0) +6 >Emitted(16, 18) Source(35, 35) + SourceIndex(0) +7 >Emitted(16, 23) Source(35, 35) + SourceIndex(0) +8 >Emitted(16, 32) Source(35, 44) + SourceIndex(0) +9 >Emitted(16, 34) Source(35, 46) + SourceIndex(0) +10>Emitted(16, 36) Source(35, 35) + SourceIndex(0) +11>Emitted(16, 50) Source(35, 46) + SourceIndex(0) +12>Emitted(16, 52) Source(35, 35) + SourceIndex(0) +13>Emitted(16, 56) Source(35, 46) + SourceIndex(0) +14>Emitted(16, 57) Source(35, 47) + SourceIndex(0) +--- +>>> _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(17, 5) Source(35, 7) + SourceIndex(0) +2 >Emitted(17, 21) Source(35, 29) + SourceIndex(0) +3 >Emitted(17, 23) Source(35, 7) + SourceIndex(0) +4 >Emitted(17, 60) Source(35, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 35) + SourceIndex(0) +5 >Emitted(20, 16) Source(38, 111) + SourceIndex(0) +6 >Emitted(20, 18) Source(38, 35) + SourceIndex(0) +7 >Emitted(20, 24) Source(38, 36) + SourceIndex(0) +8 >Emitted(20, 26) Source(38, 38) + SourceIndex(0) +9 >Emitted(20, 30) Source(38, 42) + SourceIndex(0) +10>Emitted(20, 32) Source(38, 44) + SourceIndex(0) +11>Emitted(20, 39) Source(38, 51) + SourceIndex(0) +12>Emitted(20, 41) Source(38, 53) + SourceIndex(0) +13>Emitted(20, 46) Source(38, 58) + SourceIndex(0) +14>Emitted(20, 48) Source(38, 60) + SourceIndex(0) +15>Emitted(20, 56) Source(38, 68) + SourceIndex(0) +16>Emitted(20, 58) Source(38, 70) + SourceIndex(0) +17>Emitted(20, 60) Source(38, 72) + SourceIndex(0) +18>Emitted(20, 62) Source(38, 74) + SourceIndex(0) +19>Emitted(20, 66) Source(38, 78) + SourceIndex(0) +20>Emitted(20, 68) Source(38, 80) + SourceIndex(0) +21>Emitted(20, 77) Source(38, 89) + SourceIndex(0) +22>Emitted(20, 79) Source(38, 91) + SourceIndex(0) +23>Emitted(20, 84) Source(38, 96) + SourceIndex(0) +24>Emitted(20, 86) Source(38, 98) + SourceIndex(0) +25>Emitted(20, 96) Source(38, 108) + SourceIndex(0) +26>Emitted(20, 98) Source(38, 110) + SourceIndex(0) +27>Emitted(20, 99) Source(38, 111) + SourceIndex(0) +28>Emitted(20, 101) Source(38, 35) + SourceIndex(0) +29>Emitted(20, 115) Source(38, 111) + SourceIndex(0) +30>Emitted(20, 117) Source(38, 35) + SourceIndex(0) +31>Emitted(20, 121) Source(38, 111) + SourceIndex(0) +32>Emitted(20, 122) Source(38, 112) + SourceIndex(0) +--- +>>> _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1 >Emitted(21, 5) Source(38, 7) + SourceIndex(0) +2 >Emitted(21, 21) Source(38, 29) + SourceIndex(0) +3 >Emitted(21, 23) Source(38, 7) + SourceIndex(0) +4 >Emitted(21, 60) Source(38, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(42, 55) + SourceIndex(0) +5 >Emitted(24, 16) Source(42, 66) + SourceIndex(0) +6 >Emitted(24, 18) Source(42, 55) + SourceIndex(0) +7 >Emitted(24, 45) Source(42, 66) + SourceIndex(0) +8 >Emitted(24, 47) Source(42, 55) + SourceIndex(0) +9 >Emitted(24, 72) Source(42, 66) + SourceIndex(0) +10>Emitted(24, 74) Source(42, 55) + SourceIndex(0) +11>Emitted(24, 78) Source(42, 66) + SourceIndex(0) +12>Emitted(24, 79) Source(42, 67) + SourceIndex(0) +--- +>>> _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(25, 5) Source(41, 8) + SourceIndex(0) +2 >Emitted(25, 34) Source(42, 49) + SourceIndex(0) +3 >Emitted(25, 36) Source(41, 8) + SourceIndex(0) +4 >Emitted(25, 106) Source(42, 49) + SourceIndex(0) +5 >Emitted(25, 108) Source(41, 18) + SourceIndex(0) +6 >Emitted(25, 123) Source(41, 47) + SourceIndex(0) +7 >Emitted(25, 125) Source(41, 18) + SourceIndex(0) +8 >Emitted(25, 166) Source(41, 47) + SourceIndex(0) +9 >Emitted(25, 168) Source(41, 49) + SourceIndex(0) +10>Emitted(25, 185) Source(41, 84) + SourceIndex(0) +11>Emitted(25, 187) Source(41, 49) + SourceIndex(0) +12>Emitted(25, 232) Source(41, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(26, 25) Source(43, 25) + SourceIndex(0) +7 >Emitted(26, 26) Source(43, 26) + SourceIndex(0) +8 >Emitted(26, 27) Source(43, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(28, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(46, 55) + SourceIndex(0) +5 >Emitted(28, 16) Source(46, 71) + SourceIndex(0) +6 >Emitted(28, 18) Source(46, 55) + SourceIndex(0) +7 >Emitted(28, 23) Source(46, 55) + SourceIndex(0) +8 >Emitted(28, 37) Source(46, 69) + SourceIndex(0) +9 >Emitted(28, 39) Source(46, 71) + SourceIndex(0) +10>Emitted(28, 41) Source(46, 55) + SourceIndex(0) +11>Emitted(28, 55) Source(46, 71) + SourceIndex(0) +12>Emitted(28, 57) Source(46, 55) + SourceIndex(0) +13>Emitted(28, 61) Source(46, 71) + SourceIndex(0) +14>Emitted(28, 62) Source(46, 72) + SourceIndex(0) +--- +>>> _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(29, 5) Source(45, 8) + SourceIndex(0) +2 >Emitted(29, 23) Source(46, 49) + SourceIndex(0) +3 >Emitted(29, 25) Source(45, 8) + SourceIndex(0) +4 >Emitted(29, 95) Source(46, 49) + SourceIndex(0) +5 >Emitted(29, 97) Source(45, 18) + SourceIndex(0) +6 >Emitted(29, 112) Source(45, 47) + SourceIndex(0) +7 >Emitted(29, 114) Source(45, 18) + SourceIndex(0) +8 >Emitted(29, 155) Source(45, 47) + SourceIndex(0) +9 >Emitted(29, 157) Source(45, 49) + SourceIndex(0) +10>Emitted(29, 174) Source(45, 84) + SourceIndex(0) +11>Emitted(29, 176) Source(45, 49) + SourceIndex(0) +12>Emitted(29, 221) Source(45, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(30, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(30, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(30, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(30, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(30, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(30, 25) Source(47, 25) + SourceIndex(0) +7 >Emitted(30, 26) Source(47, 26) + SourceIndex(0) +8 >Emitted(30, 27) Source(47, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(31, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(32, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(32, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(32, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(32, 6) Source(51, 5) + SourceIndex(0) +5 >Emitted(32, 16) Source(52, 83) + SourceIndex(0) +6 >Emitted(32, 18) Source(51, 5) + SourceIndex(0) +7 >Emitted(32, 23) Source(51, 19) + SourceIndex(0) +8 >Emitted(32, 24) Source(51, 20) + SourceIndex(0) +9 >Emitted(32, 26) Source(51, 22) + SourceIndex(0) +10>Emitted(32, 30) Source(51, 26) + SourceIndex(0) +11>Emitted(32, 32) Source(51, 28) + SourceIndex(0) +12>Emitted(32, 39) Source(51, 35) + SourceIndex(0) +13>Emitted(32, 41) Source(51, 37) + SourceIndex(0) +14>Emitted(32, 47) Source(51, 43) + SourceIndex(0) +15>Emitted(32, 49) Source(51, 45) + SourceIndex(0) +16>Emitted(32, 51) Source(51, 47) + SourceIndex(0) +17>Emitted(32, 58) Source(51, 54) + SourceIndex(0) +18>Emitted(32, 60) Source(51, 56) + SourceIndex(0) +19>Emitted(32, 68) Source(51, 64) + SourceIndex(0) +20>Emitted(32, 70) Source(51, 66) + SourceIndex(0) +21>Emitted(32, 79) Source(51, 75) + SourceIndex(0) +22>Emitted(32, 81) Source(51, 77) + SourceIndex(0) +23>Emitted(32, 87) Source(51, 83) + SourceIndex(0) +24>Emitted(32, 89) Source(51, 85) + SourceIndex(0) +25>Emitted(32, 91) Source(51, 87) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(33, 5) Source(52, 9) + SourceIndex(0) +2 >Emitted(33, 7) Source(52, 11) + SourceIndex(0) +3 >Emitted(33, 11) Source(52, 15) + SourceIndex(0) +4 >Emitted(33, 13) Source(52, 17) + SourceIndex(0) +5 >Emitted(33, 22) Source(52, 26) + SourceIndex(0) +6 >Emitted(33, 24) Source(52, 28) + SourceIndex(0) +7 >Emitted(33, 30) Source(52, 34) + SourceIndex(0) +8 >Emitted(33, 32) Source(52, 36) + SourceIndex(0) +9 >Emitted(33, 34) Source(52, 38) + SourceIndex(0) +10>Emitted(33, 41) Source(52, 45) + SourceIndex(0) +11>Emitted(33, 43) Source(52, 47) + SourceIndex(0) +12>Emitted(33, 53) Source(52, 57) + SourceIndex(0) +13>Emitted(33, 55) Source(52, 59) + SourceIndex(0) +14>Emitted(33, 64) Source(52, 68) + SourceIndex(0) +15>Emitted(33, 66) Source(52, 70) + SourceIndex(0) +16>Emitted(33, 74) Source(52, 78) + SourceIndex(0) +17>Emitted(33, 76) Source(52, 80) + SourceIndex(0) +18>Emitted(33, 78) Source(52, 82) + SourceIndex(0) +19>Emitted(33, 79) Source(52, 83) + SourceIndex(0) +20>Emitted(33, 81) Source(51, 5) + SourceIndex(0) +21>Emitted(33, 95) Source(52, 83) + SourceIndex(0) +22>Emitted(33, 97) Source(51, 5) + SourceIndex(0) +23>Emitted(33, 101) Source(52, 83) + SourceIndex(0) +24>Emitted(33, 102) Source(52, 84) + SourceIndex(0) +--- +>>> _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(34, 5) Source(49, 8) + SourceIndex(0) +2 >Emitted(34, 23) Source(50, 49) + SourceIndex(0) +3 >Emitted(34, 25) Source(49, 8) + SourceIndex(0) +4 >Emitted(34, 95) Source(50, 49) + SourceIndex(0) +5 >Emitted(34, 97) Source(49, 18) + SourceIndex(0) +6 >Emitted(34, 112) Source(49, 47) + SourceIndex(0) +7 >Emitted(34, 114) Source(49, 18) + SourceIndex(0) +8 >Emitted(34, 155) Source(49, 47) + SourceIndex(0) +9 >Emitted(34, 157) Source(49, 49) + SourceIndex(0) +10>Emitted(34, 174) Source(49, 84) + SourceIndex(0) +11>Emitted(34, 176) Source(49, 49) + SourceIndex(0) +12>Emitted(34, 221) Source(49, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of + > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(35, 25) Source(53, 25) + SourceIndex(0) +7 >Emitted(35, 26) Source(53, 26) + SourceIndex(0) +8 >Emitted(35, 27) Source(53, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^-> +1-> + > + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(56, 29) + SourceIndex(0) +5 >Emitted(37, 16) Source(56, 35) + SourceIndex(0) +6 >Emitted(37, 18) Source(56, 29) + SourceIndex(0) +7 >Emitted(37, 35) Source(56, 35) + SourceIndex(0) +8 >Emitted(37, 37) Source(56, 29) + SourceIndex(0) +9 >Emitted(37, 57) Source(56, 35) + SourceIndex(0) +10>Emitted(37, 59) Source(56, 29) + SourceIndex(0) +11>Emitted(37, 63) Source(56, 35) + SourceIndex(0) +12>Emitted(37, 64) Source(56, 36) + SourceIndex(0) +--- +>>> _1 = robots_2[_0].name, name = _1 === void 0 ? "noName" : _1; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "noName" +3 > +4 > name = "noName" +1->Emitted(38, 5) Source(56, 8) + SourceIndex(0) +2 >Emitted(38, 27) Source(56, 23) + SourceIndex(0) +3 >Emitted(38, 29) Source(56, 8) + SourceIndex(0) +4 >Emitted(38, 65) Source(56, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(39, 22) Source(57, 22) + SourceIndex(0) +7 >Emitted(39, 23) Source(57, 23) + SourceIndex(0) +8 >Emitted(39, 24) Source(57, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = getRobots(); _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(59, 29) + SourceIndex(0) +5 >Emitted(41, 16) Source(59, 40) + SourceIndex(0) +6 >Emitted(41, 18) Source(59, 29) + SourceIndex(0) +7 >Emitted(41, 23) Source(59, 29) + SourceIndex(0) +8 >Emitted(41, 32) Source(59, 38) + SourceIndex(0) +9 >Emitted(41, 34) Source(59, 40) + SourceIndex(0) +10>Emitted(41, 36) Source(59, 29) + SourceIndex(0) +11>Emitted(41, 50) Source(59, 40) + SourceIndex(0) +12>Emitted(41, 52) Source(59, 29) + SourceIndex(0) +13>Emitted(41, 56) Source(59, 40) + SourceIndex(0) +14>Emitted(41, 57) Source(59, 41) + SourceIndex(0) +--- +>>> _4 = _3[_2].name, name = _4 === void 0 ? "noName" : _4; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "noName" +3 > +4 > name = "noName" +1->Emitted(42, 5) Source(59, 8) + SourceIndex(0) +2 >Emitted(42, 21) Source(59, 23) + SourceIndex(0) +3 >Emitted(42, 23) Source(59, 8) + SourceIndex(0) +4 >Emitted(42, 59) Source(59, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(60, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(60, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(60, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _5 = 0, _6 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _5 < _6.length; _5++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(45, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(62, 29) + SourceIndex(0) +5 >Emitted(45, 16) Source(62, 105) + SourceIndex(0) +6 >Emitted(45, 18) Source(62, 29) + SourceIndex(0) +7 >Emitted(45, 24) Source(62, 30) + SourceIndex(0) +8 >Emitted(45, 26) Source(62, 32) + SourceIndex(0) +9 >Emitted(45, 30) Source(62, 36) + SourceIndex(0) +10>Emitted(45, 32) Source(62, 38) + SourceIndex(0) +11>Emitted(45, 39) Source(62, 45) + SourceIndex(0) +12>Emitted(45, 41) Source(62, 47) + SourceIndex(0) +13>Emitted(45, 46) Source(62, 52) + SourceIndex(0) +14>Emitted(45, 48) Source(62, 54) + SourceIndex(0) +15>Emitted(45, 56) Source(62, 62) + SourceIndex(0) +16>Emitted(45, 58) Source(62, 64) + SourceIndex(0) +17>Emitted(45, 60) Source(62, 66) + SourceIndex(0) +18>Emitted(45, 62) Source(62, 68) + SourceIndex(0) +19>Emitted(45, 66) Source(62, 72) + SourceIndex(0) +20>Emitted(45, 68) Source(62, 74) + SourceIndex(0) +21>Emitted(45, 77) Source(62, 83) + SourceIndex(0) +22>Emitted(45, 79) Source(62, 85) + SourceIndex(0) +23>Emitted(45, 84) Source(62, 90) + SourceIndex(0) +24>Emitted(45, 86) Source(62, 92) + SourceIndex(0) +25>Emitted(45, 96) Source(62, 102) + SourceIndex(0) +26>Emitted(45, 98) Source(62, 104) + SourceIndex(0) +27>Emitted(45, 99) Source(62, 105) + SourceIndex(0) +28>Emitted(45, 101) Source(62, 29) + SourceIndex(0) +29>Emitted(45, 115) Source(62, 105) + SourceIndex(0) +30>Emitted(45, 117) Source(62, 29) + SourceIndex(0) +31>Emitted(45, 121) Source(62, 105) + SourceIndex(0) +32>Emitted(45, 122) Source(62, 106) + SourceIndex(0) +--- +>>> _7 = _6[_5].name, name = _7 === void 0 ? "noName" : _7; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name = "noName" +3 > +4 > name = "noName" +1 >Emitted(46, 5) Source(62, 8) + SourceIndex(0) +2 >Emitted(46, 21) Source(62, 23) + SourceIndex(0) +3 >Emitted(46, 23) Source(62, 8) + SourceIndex(0) +4 >Emitted(46, 59) Source(62, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(47, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(47, 22) Source(63, 22) + SourceIndex(0) +7 >Emitted(47, 23) Source(63, 23) + SourceIndex(0) +8 >Emitted(47, 24) Source(63, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, multiRobots_2 = multiRobots; _8 < multiRobots_2.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(70, 6) + SourceIndex(0) +5 >Emitted(49, 16) Source(70, 17) + SourceIndex(0) +6 >Emitted(49, 18) Source(70, 6) + SourceIndex(0) +7 >Emitted(49, 45) Source(70, 17) + SourceIndex(0) +8 >Emitted(49, 47) Source(70, 6) + SourceIndex(0) +9 >Emitted(49, 72) Source(70, 17) + SourceIndex(0) +10>Emitted(49, 74) Source(70, 6) + SourceIndex(0) +11>Emitted(49, 78) Source(70, 17) + SourceIndex(0) +12>Emitted(49, 79) Source(70, 18) + SourceIndex(0) +--- +>>> _9 = multiRobots_2[_8].skills, _10 = _9 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _9, _11 = _10.primary, primary = _11 === void 0 ? "primary" : _11, _12 = _10.secondary, secondary = _12 === void 0 ? "secondary" : _12; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(50, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(50, 34) Source(69, 53) + SourceIndex(0) +3 >Emitted(50, 36) Source(66, 5) + SourceIndex(0) +4 >Emitted(50, 107) Source(69, 53) + SourceIndex(0) +5 >Emitted(50, 109) Source(67, 9) + SourceIndex(0) +6 >Emitted(50, 126) Source(67, 28) + SourceIndex(0) +7 >Emitted(50, 128) Source(67, 9) + SourceIndex(0) +8 >Emitted(50, 170) Source(67, 28) + SourceIndex(0) +9 >Emitted(50, 172) Source(68, 9) + SourceIndex(0) +10>Emitted(50, 191) Source(68, 32) + SourceIndex(0) +11>Emitted(50, 193) Source(68, 9) + SourceIndex(0) +12>Emitted(50, 239) Source(68, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(51, 25) Source(71, 25) + SourceIndex(0) +7 >Emitted(51, 26) Source(71, 26) + SourceIndex(0) +8 >Emitted(51, 27) Source(71, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for (var _13 = 0, _14 = getMultiRobots(); _13 < _14.length; _13++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(78, 6) + SourceIndex(0) +5 >Emitted(53, 17) Source(78, 22) + SourceIndex(0) +6 >Emitted(53, 19) Source(78, 6) + SourceIndex(0) +7 >Emitted(53, 25) Source(78, 6) + SourceIndex(0) +8 >Emitted(53, 39) Source(78, 20) + SourceIndex(0) +9 >Emitted(53, 41) Source(78, 22) + SourceIndex(0) +10>Emitted(53, 43) Source(78, 6) + SourceIndex(0) +11>Emitted(53, 59) Source(78, 22) + SourceIndex(0) +12>Emitted(53, 61) Source(78, 6) + SourceIndex(0) +13>Emitted(53, 66) Source(78, 22) + SourceIndex(0) +14>Emitted(53, 67) Source(78, 23) + SourceIndex(0) +--- +>>> _15 = _14[_13].skills, _16 = _15 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _15, _17 = _16.primary, primary = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondary = _18 === void 0 ? "secondary" : _18; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(54, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(54, 26) Source(77, 53) + SourceIndex(0) +3 >Emitted(54, 28) Source(74, 5) + SourceIndex(0) +4 >Emitted(54, 101) Source(77, 53) + SourceIndex(0) +5 >Emitted(54, 103) Source(75, 9) + SourceIndex(0) +6 >Emitted(54, 120) Source(75, 28) + SourceIndex(0) +7 >Emitted(54, 122) Source(75, 9) + SourceIndex(0) +8 >Emitted(54, 164) Source(75, 28) + SourceIndex(0) +9 >Emitted(54, 166) Source(76, 9) + SourceIndex(0) +10>Emitted(54, 185) Source(76, 32) + SourceIndex(0) +11>Emitted(54, 187) Source(76, 9) + SourceIndex(0) +12>Emitted(54, 233) Source(76, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(55, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(55, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(55, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(55, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(57, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(57, 17) Source(87, 79) + SourceIndex(0) +6 >Emitted(57, 19) Source(86, 6) + SourceIndex(0) +7 >Emitted(57, 26) Source(86, 7) + SourceIndex(0) +8 >Emitted(57, 28) Source(86, 9) + SourceIndex(0) +9 >Emitted(57, 32) Source(86, 13) + SourceIndex(0) +10>Emitted(57, 34) Source(86, 15) + SourceIndex(0) +11>Emitted(57, 41) Source(86, 22) + SourceIndex(0) +12>Emitted(57, 43) Source(86, 24) + SourceIndex(0) +13>Emitted(57, 49) Source(86, 30) + SourceIndex(0) +14>Emitted(57, 51) Source(86, 32) + SourceIndex(0) +15>Emitted(57, 53) Source(86, 34) + SourceIndex(0) +16>Emitted(57, 60) Source(86, 41) + SourceIndex(0) +17>Emitted(57, 62) Source(86, 43) + SourceIndex(0) +18>Emitted(57, 70) Source(86, 51) + SourceIndex(0) +19>Emitted(57, 72) Source(86, 53) + SourceIndex(0) +20>Emitted(57, 81) Source(86, 62) + SourceIndex(0) +21>Emitted(57, 83) Source(86, 64) + SourceIndex(0) +22>Emitted(57, 89) Source(86, 70) + SourceIndex(0) +23>Emitted(57, 91) Source(86, 72) + SourceIndex(0) +24>Emitted(57, 93) Source(86, 74) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _19 < _20.length; _19++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(58, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(58, 7) Source(87, 7) + SourceIndex(0) +3 >Emitted(58, 11) Source(87, 11) + SourceIndex(0) +4 >Emitted(58, 13) Source(87, 13) + SourceIndex(0) +5 >Emitted(58, 22) Source(87, 22) + SourceIndex(0) +6 >Emitted(58, 24) Source(87, 24) + SourceIndex(0) +7 >Emitted(58, 30) Source(87, 30) + SourceIndex(0) +8 >Emitted(58, 32) Source(87, 32) + SourceIndex(0) +9 >Emitted(58, 34) Source(87, 34) + SourceIndex(0) +10>Emitted(58, 41) Source(87, 41) + SourceIndex(0) +11>Emitted(58, 43) Source(87, 43) + SourceIndex(0) +12>Emitted(58, 53) Source(87, 53) + SourceIndex(0) +13>Emitted(58, 55) Source(87, 55) + SourceIndex(0) +14>Emitted(58, 64) Source(87, 64) + SourceIndex(0) +15>Emitted(58, 66) Source(87, 66) + SourceIndex(0) +16>Emitted(58, 74) Source(87, 74) + SourceIndex(0) +17>Emitted(58, 76) Source(87, 76) + SourceIndex(0) +18>Emitted(58, 78) Source(87, 78) + SourceIndex(0) +19>Emitted(58, 79) Source(87, 79) + SourceIndex(0) +20>Emitted(58, 81) Source(86, 6) + SourceIndex(0) +21>Emitted(58, 97) Source(87, 79) + SourceIndex(0) +22>Emitted(58, 99) Source(86, 6) + SourceIndex(0) +23>Emitted(58, 104) Source(87, 79) + SourceIndex(0) +24>Emitted(58, 105) Source(87, 80) + SourceIndex(0) +--- +>>> _21 = _20[_19].skills, _22 = _21 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _21, _23 = _22.primary, primary = _23 === void 0 ? "primary" : _23, _24 = _22.secondary, secondary = _24 === void 0 ? "secondary" : _24; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(59, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(59, 26) Source(85, 53) + SourceIndex(0) +3 >Emitted(59, 28) Source(82, 5) + SourceIndex(0) +4 >Emitted(59, 101) Source(85, 53) + SourceIndex(0) +5 >Emitted(59, 103) Source(83, 9) + SourceIndex(0) +6 >Emitted(59, 120) Source(83, 28) + SourceIndex(0) +7 >Emitted(59, 122) Source(83, 9) + SourceIndex(0) +8 >Emitted(59, 164) Source(83, 28) + SourceIndex(0) +9 >Emitted(59, 166) Source(84, 9) + SourceIndex(0) +10>Emitted(59, 185) Source(84, 32) + SourceIndex(0) +11>Emitted(59, 187) Source(84, 9) + SourceIndex(0) +12>Emitted(59, 233) Source(84, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(60, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(60, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(60, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(60, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(60, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(60, 25) Source(88, 25) + SourceIndex(0) +7 >Emitted(60, 26) Source(88, 26) + SourceIndex(0) +8 >Emitted(60, 27) Source(88, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(61, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, robots_3 = robots; _25 < robots_3.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(62, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(62, 4) Source(92, 4) + SourceIndex(0) +3 >Emitted(62, 5) Source(92, 5) + SourceIndex(0) +4 >Emitted(62, 6) Source(92, 62) + SourceIndex(0) +5 >Emitted(62, 17) Source(92, 68) + SourceIndex(0) +6 >Emitted(62, 19) Source(92, 62) + SourceIndex(0) +7 >Emitted(62, 36) Source(92, 68) + SourceIndex(0) +8 >Emitted(62, 38) Source(92, 62) + SourceIndex(0) +9 >Emitted(62, 59) Source(92, 68) + SourceIndex(0) +10>Emitted(62, 61) Source(92, 62) + SourceIndex(0) +11>Emitted(62, 66) Source(92, 68) + SourceIndex(0) +12>Emitted(62, 67) Source(92, 69) + SourceIndex(0) +--- +>>> _26 = robots_3[_25], _27 = _26.name, nameA = _27 === void 0 ? "noName" : _27, _28 = _26.skill, skillA = _28 === void 0 ? "noSkill" : _28; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(63, 5) Source(92, 6) + SourceIndex(0) +2 >Emitted(63, 24) Source(92, 58) + SourceIndex(0) +3 >Emitted(63, 26) Source(92, 7) + SourceIndex(0) +4 >Emitted(63, 40) Source(92, 29) + SourceIndex(0) +5 >Emitted(63, 42) Source(92, 7) + SourceIndex(0) +6 >Emitted(63, 81) Source(92, 29) + SourceIndex(0) +7 >Emitted(63, 83) Source(92, 31) + SourceIndex(0) +8 >Emitted(63, 98) Source(92, 56) + SourceIndex(0) +9 >Emitted(63, 100) Source(92, 31) + SourceIndex(0) +10>Emitted(63, 141) Source(92, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(64, 22) Source(93, 22) + SourceIndex(0) +7 >Emitted(64, 23) Source(93, 23) + SourceIndex(0) +8 >Emitted(64, 24) Source(93, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(65, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _29 = 0, _30 = getRobots(); _29 < _30.length; _29++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(66, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(95, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(95, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(95, 63) + SourceIndex(0) +5 >Emitted(66, 17) Source(95, 74) + SourceIndex(0) +6 >Emitted(66, 19) Source(95, 63) + SourceIndex(0) +7 >Emitted(66, 25) Source(95, 63) + SourceIndex(0) +8 >Emitted(66, 34) Source(95, 72) + SourceIndex(0) +9 >Emitted(66, 36) Source(95, 74) + SourceIndex(0) +10>Emitted(66, 38) Source(95, 63) + SourceIndex(0) +11>Emitted(66, 54) Source(95, 74) + SourceIndex(0) +12>Emitted(66, 56) Source(95, 63) + SourceIndex(0) +13>Emitted(66, 61) Source(95, 74) + SourceIndex(0) +14>Emitted(66, 62) Source(95, 75) + SourceIndex(0) +--- +>>> _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skill, skillA = _33 === void 0 ? "noSkill" : _33; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(67, 5) Source(95, 6) + SourceIndex(0) +2 >Emitted(67, 19) Source(95, 59) + SourceIndex(0) +3 >Emitted(67, 21) Source(95, 7) + SourceIndex(0) +4 >Emitted(67, 35) Source(95, 29) + SourceIndex(0) +5 >Emitted(67, 37) Source(95, 7) + SourceIndex(0) +6 >Emitted(67, 76) Source(95, 29) + SourceIndex(0) +7 >Emitted(67, 78) Source(95, 31) + SourceIndex(0) +8 >Emitted(67, 93) Source(95, 56) + SourceIndex(0) +9 >Emitted(67, 95) Source(95, 31) + SourceIndex(0) +10>Emitted(67, 136) Source(95, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(68, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(68, 22) Source(96, 22) + SourceIndex(0) +7 >Emitted(68, 23) Source(96, 23) + SourceIndex(0) +8 >Emitted(68, 24) Source(96, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(69, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +33> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(70, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(98, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(98, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(98, 63) + SourceIndex(0) +5 >Emitted(70, 17) Source(98, 139) + SourceIndex(0) +6 >Emitted(70, 19) Source(98, 63) + SourceIndex(0) +7 >Emitted(70, 26) Source(98, 64) + SourceIndex(0) +8 >Emitted(70, 28) Source(98, 66) + SourceIndex(0) +9 >Emitted(70, 32) Source(98, 70) + SourceIndex(0) +10>Emitted(70, 34) Source(98, 72) + SourceIndex(0) +11>Emitted(70, 41) Source(98, 79) + SourceIndex(0) +12>Emitted(70, 43) Source(98, 81) + SourceIndex(0) +13>Emitted(70, 48) Source(98, 86) + SourceIndex(0) +14>Emitted(70, 50) Source(98, 88) + SourceIndex(0) +15>Emitted(70, 58) Source(98, 96) + SourceIndex(0) +16>Emitted(70, 60) Source(98, 98) + SourceIndex(0) +17>Emitted(70, 62) Source(98, 100) + SourceIndex(0) +18>Emitted(70, 64) Source(98, 102) + SourceIndex(0) +19>Emitted(70, 68) Source(98, 106) + SourceIndex(0) +20>Emitted(70, 70) Source(98, 108) + SourceIndex(0) +21>Emitted(70, 79) Source(98, 117) + SourceIndex(0) +22>Emitted(70, 81) Source(98, 119) + SourceIndex(0) +23>Emitted(70, 86) Source(98, 124) + SourceIndex(0) +24>Emitted(70, 88) Source(98, 126) + SourceIndex(0) +25>Emitted(70, 98) Source(98, 136) + SourceIndex(0) +26>Emitted(70, 100) Source(98, 138) + SourceIndex(0) +27>Emitted(70, 101) Source(98, 139) + SourceIndex(0) +28>Emitted(70, 103) Source(98, 63) + SourceIndex(0) +29>Emitted(70, 119) Source(98, 139) + SourceIndex(0) +30>Emitted(70, 121) Source(98, 63) + SourceIndex(0) +31>Emitted(70, 126) Source(98, 139) + SourceIndex(0) +32>Emitted(70, 127) Source(98, 140) + SourceIndex(0) +--- +>>> _36 = _35[_34], _37 = _36.name, nameA = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skillA = _38 === void 0 ? "noSkill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(71, 5) Source(98, 6) + SourceIndex(0) +2 >Emitted(71, 19) Source(98, 59) + SourceIndex(0) +3 >Emitted(71, 21) Source(98, 7) + SourceIndex(0) +4 >Emitted(71, 35) Source(98, 29) + SourceIndex(0) +5 >Emitted(71, 37) Source(98, 7) + SourceIndex(0) +6 >Emitted(71, 76) Source(98, 29) + SourceIndex(0) +7 >Emitted(71, 78) Source(98, 31) + SourceIndex(0) +8 >Emitted(71, 93) Source(98, 56) + SourceIndex(0) +9 >Emitted(71, 95) Source(98, 31) + SourceIndex(0) +10>Emitted(71, 136) Source(98, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(99, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(99, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(99, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(99, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(99, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(99, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(99, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(99, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(73, 2) Source(100, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(74, 1) Source(101, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(101, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(101, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(107, 6) + SourceIndex(0) +5 >Emitted(74, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(74, 19) Source(107, 6) + SourceIndex(0) +7 >Emitted(74, 46) Source(107, 17) + SourceIndex(0) +8 >Emitted(74, 48) Source(107, 6) + SourceIndex(0) +9 >Emitted(74, 74) Source(107, 17) + SourceIndex(0) +10>Emitted(74, 76) Source(107, 6) + SourceIndex(0) +11>Emitted(74, 81) Source(107, 17) + SourceIndex(0) +12>Emitted(74, 82) Source(107, 18) + SourceIndex(0) +--- +>>> _40 = multiRobots_3[_39], _41 = _40.name, nameA = _41 === void 0 ? "noName" : _41, _42 = _40.skills, _43 = _42 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _42, _44 = _43.primary, primaryA = _44 === void 0 ? "primary" : _44, _45 = _43.secondary, secondaryA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(75, 5) Source(101, 6) + SourceIndex(0) +2 >Emitted(75, 29) Source(107, 2) + SourceIndex(0) +3 >Emitted(75, 31) Source(102, 5) + SourceIndex(0) +4 >Emitted(75, 45) Source(102, 27) + SourceIndex(0) +5 >Emitted(75, 47) Source(102, 5) + SourceIndex(0) +6 >Emitted(75, 86) Source(102, 27) + SourceIndex(0) +7 >Emitted(75, 88) Source(103, 5) + SourceIndex(0) +8 >Emitted(75, 104) Source(106, 53) + SourceIndex(0) +9 >Emitted(75, 106) Source(103, 5) + SourceIndex(0) +10>Emitted(75, 179) Source(106, 53) + SourceIndex(0) +11>Emitted(75, 181) Source(104, 9) + SourceIndex(0) +12>Emitted(75, 198) Source(104, 38) + SourceIndex(0) +13>Emitted(75, 200) Source(104, 9) + SourceIndex(0) +14>Emitted(75, 243) Source(104, 38) + SourceIndex(0) +15>Emitted(75, 245) Source(105, 9) + SourceIndex(0) +16>Emitted(75, 264) Source(105, 44) + SourceIndex(0) +17>Emitted(75, 266) Source(105, 9) + SourceIndex(0) +18>Emitted(75, 313) Source(105, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(76, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(76, 22) Source(108, 22) + SourceIndex(0) +7 >Emitted(76, 23) Source(108, 23) + SourceIndex(0) +8 >Emitted(76, 24) Source(108, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(77, 2) Source(109, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(78, 1) Source(110, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(110, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(110, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(116, 6) + SourceIndex(0) +5 >Emitted(78, 17) Source(116, 22) + SourceIndex(0) +6 >Emitted(78, 19) Source(116, 6) + SourceIndex(0) +7 >Emitted(78, 25) Source(116, 6) + SourceIndex(0) +8 >Emitted(78, 39) Source(116, 20) + SourceIndex(0) +9 >Emitted(78, 41) Source(116, 22) + SourceIndex(0) +10>Emitted(78, 43) Source(116, 6) + SourceIndex(0) +11>Emitted(78, 59) Source(116, 22) + SourceIndex(0) +12>Emitted(78, 61) Source(116, 6) + SourceIndex(0) +13>Emitted(78, 66) Source(116, 22) + SourceIndex(0) +14>Emitted(78, 67) Source(116, 23) + SourceIndex(0) +--- +>>> _48 = _47[_46], _49 = _48.name, nameA = _49 === void 0 ? "noName" : _49, _50 = _48.skills, _51 = _50 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _50, _52 = _51.primary, primaryA = _52 === void 0 ? "primary" : _52, _53 = _51.secondary, secondaryA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(79, 5) Source(110, 6) + SourceIndex(0) +2 >Emitted(79, 19) Source(116, 2) + SourceIndex(0) +3 >Emitted(79, 21) Source(111, 5) + SourceIndex(0) +4 >Emitted(79, 35) Source(111, 27) + SourceIndex(0) +5 >Emitted(79, 37) Source(111, 5) + SourceIndex(0) +6 >Emitted(79, 76) Source(111, 27) + SourceIndex(0) +7 >Emitted(79, 78) Source(112, 5) + SourceIndex(0) +8 >Emitted(79, 94) Source(115, 53) + SourceIndex(0) +9 >Emitted(79, 96) Source(112, 5) + SourceIndex(0) +10>Emitted(79, 169) Source(115, 53) + SourceIndex(0) +11>Emitted(79, 171) Source(113, 9) + SourceIndex(0) +12>Emitted(79, 188) Source(113, 38) + SourceIndex(0) +13>Emitted(79, 190) Source(113, 9) + SourceIndex(0) +14>Emitted(79, 233) Source(113, 38) + SourceIndex(0) +15>Emitted(79, 235) Source(114, 9) + SourceIndex(0) +16>Emitted(79, 254) Source(114, 44) + SourceIndex(0) +17>Emitted(79, 256) Source(114, 9) + SourceIndex(0) +18>Emitted(79, 303) Source(114, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(80, 5) Source(117, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(117, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(117, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(117, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(117, 17) + SourceIndex(0) +6 >Emitted(80, 22) Source(117, 22) + SourceIndex(0) +7 >Emitted(80, 23) Source(117, 23) + SourceIndex(0) +8 >Emitted(80, 24) Source(117, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(81, 2) Source(118, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(82, 1) Source(119, 1) + SourceIndex(0) +2 >Emitted(82, 4) Source(119, 4) + SourceIndex(0) +3 >Emitted(82, 5) Source(119, 5) + SourceIndex(0) +4 >Emitted(82, 6) Source(125, 6) + SourceIndex(0) +5 >Emitted(82, 17) Source(126, 79) + SourceIndex(0) +6 >Emitted(82, 19) Source(125, 6) + SourceIndex(0) +7 >Emitted(82, 25) Source(125, 20) + SourceIndex(0) +8 >Emitted(82, 26) Source(125, 21) + SourceIndex(0) +9 >Emitted(82, 28) Source(125, 23) + SourceIndex(0) +10>Emitted(82, 32) Source(125, 27) + SourceIndex(0) +11>Emitted(82, 34) Source(125, 29) + SourceIndex(0) +12>Emitted(82, 41) Source(125, 36) + SourceIndex(0) +13>Emitted(82, 43) Source(125, 38) + SourceIndex(0) +14>Emitted(82, 49) Source(125, 44) + SourceIndex(0) +15>Emitted(82, 51) Source(125, 46) + SourceIndex(0) +16>Emitted(82, 53) Source(125, 48) + SourceIndex(0) +17>Emitted(82, 60) Source(125, 55) + SourceIndex(0) +18>Emitted(82, 62) Source(125, 57) + SourceIndex(0) +19>Emitted(82, 70) Source(125, 65) + SourceIndex(0) +20>Emitted(82, 72) Source(125, 67) + SourceIndex(0) +21>Emitted(82, 81) Source(125, 76) + SourceIndex(0) +22>Emitted(82, 83) Source(125, 78) + SourceIndex(0) +23>Emitted(82, 89) Source(125, 84) + SourceIndex(0) +24>Emitted(82, 91) Source(125, 86) + SourceIndex(0) +25>Emitted(82, 93) Source(125, 88) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _54 < _55.length; _54++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(83, 5) Source(126, 5) + SourceIndex(0) +2 >Emitted(83, 7) Source(126, 7) + SourceIndex(0) +3 >Emitted(83, 11) Source(126, 11) + SourceIndex(0) +4 >Emitted(83, 13) Source(126, 13) + SourceIndex(0) +5 >Emitted(83, 22) Source(126, 22) + SourceIndex(0) +6 >Emitted(83, 24) Source(126, 24) + SourceIndex(0) +7 >Emitted(83, 30) Source(126, 30) + SourceIndex(0) +8 >Emitted(83, 32) Source(126, 32) + SourceIndex(0) +9 >Emitted(83, 34) Source(126, 34) + SourceIndex(0) +10>Emitted(83, 41) Source(126, 41) + SourceIndex(0) +11>Emitted(83, 43) Source(126, 43) + SourceIndex(0) +12>Emitted(83, 53) Source(126, 53) + SourceIndex(0) +13>Emitted(83, 55) Source(126, 55) + SourceIndex(0) +14>Emitted(83, 64) Source(126, 64) + SourceIndex(0) +15>Emitted(83, 66) Source(126, 66) + SourceIndex(0) +16>Emitted(83, 74) Source(126, 74) + SourceIndex(0) +17>Emitted(83, 76) Source(126, 76) + SourceIndex(0) +18>Emitted(83, 78) Source(126, 78) + SourceIndex(0) +19>Emitted(83, 79) Source(126, 79) + SourceIndex(0) +20>Emitted(83, 81) Source(125, 6) + SourceIndex(0) +21>Emitted(83, 97) Source(126, 79) + SourceIndex(0) +22>Emitted(83, 99) Source(125, 6) + SourceIndex(0) +23>Emitted(83, 104) Source(126, 79) + SourceIndex(0) +24>Emitted(83, 105) Source(126, 80) + SourceIndex(0) +--- +>>> _56 = _55[_54], _57 = _56.name, nameA = _57 === void 0 ? "noName" : _57, _58 = _56.skills, _59 = _58 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _58, _60 = _59.primary, primaryA = _60 === void 0 ? "primary" : _60, _61 = _59.secondary, secondaryA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(84, 5) Source(119, 6) + SourceIndex(0) +2 >Emitted(84, 19) Source(125, 2) + SourceIndex(0) +3 >Emitted(84, 21) Source(120, 5) + SourceIndex(0) +4 >Emitted(84, 35) Source(120, 27) + SourceIndex(0) +5 >Emitted(84, 37) Source(120, 5) + SourceIndex(0) +6 >Emitted(84, 76) Source(120, 27) + SourceIndex(0) +7 >Emitted(84, 78) Source(121, 5) + SourceIndex(0) +8 >Emitted(84, 94) Source(124, 53) + SourceIndex(0) +9 >Emitted(84, 96) Source(121, 5) + SourceIndex(0) +10>Emitted(84, 169) Source(124, 53) + SourceIndex(0) +11>Emitted(84, 171) Source(122, 9) + SourceIndex(0) +12>Emitted(84, 188) Source(122, 38) + SourceIndex(0) +13>Emitted(84, 190) Source(122, 9) + SourceIndex(0) +14>Emitted(84, 233) Source(122, 38) + SourceIndex(0) +15>Emitted(84, 235) Source(123, 9) + SourceIndex(0) +16>Emitted(84, 254) Source(123, 44) + SourceIndex(0) +17>Emitted(84, 256) Source(123, 9) + SourceIndex(0) +18>Emitted(84, 303) Source(123, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(85, 5) Source(127, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(127, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(127, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(127, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(127, 17) + SourceIndex(0) +6 >Emitted(85, 22) Source(127, 22) + SourceIndex(0) +7 >Emitted(85, 23) Source(127, 23) + SourceIndex(0) +8 >Emitted(85, 24) Source(127, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(86, 2) Source(128, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(87, 1) Source(130, 1) + SourceIndex(0) +2 >Emitted(87, 4) Source(130, 4) + SourceIndex(0) +3 >Emitted(87, 5) Source(130, 5) + SourceIndex(0) +4 >Emitted(87, 6) Source(130, 49) + SourceIndex(0) +5 >Emitted(87, 17) Source(130, 55) + SourceIndex(0) +6 >Emitted(87, 19) Source(130, 49) + SourceIndex(0) +7 >Emitted(87, 36) Source(130, 55) + SourceIndex(0) +8 >Emitted(87, 38) Source(130, 49) + SourceIndex(0) +9 >Emitted(87, 59) Source(130, 55) + SourceIndex(0) +10>Emitted(87, 61) Source(130, 49) + SourceIndex(0) +11>Emitted(87, 66) Source(130, 55) + SourceIndex(0) +12>Emitted(87, 67) Source(130, 56) + SourceIndex(0) +--- +>>> _63 = robots_4[_62], _64 = _63.name, name = _64 === void 0 ? "noName" : _64, _65 = _63.skill, skill = _65 === void 0 ? "noSkill" : _65; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(88, 5) Source(130, 6) + SourceIndex(0) +2 >Emitted(88, 24) Source(130, 45) + SourceIndex(0) +3 >Emitted(88, 26) Source(130, 8) + SourceIndex(0) +4 >Emitted(88, 40) Source(130, 23) + SourceIndex(0) +5 >Emitted(88, 42) Source(130, 8) + SourceIndex(0) +6 >Emitted(88, 80) Source(130, 23) + SourceIndex(0) +7 >Emitted(88, 82) Source(130, 25) + SourceIndex(0) +8 >Emitted(88, 97) Source(130, 43) + SourceIndex(0) +9 >Emitted(88, 99) Source(130, 25) + SourceIndex(0) +10>Emitted(88, 139) Source(130, 43) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(89, 5) Source(131, 5) + SourceIndex(0) +2 >Emitted(89, 12) Source(131, 12) + SourceIndex(0) +3 >Emitted(89, 13) Source(131, 13) + SourceIndex(0) +4 >Emitted(89, 16) Source(131, 16) + SourceIndex(0) +5 >Emitted(89, 17) Source(131, 17) + SourceIndex(0) +6 >Emitted(89, 22) Source(131, 22) + SourceIndex(0) +7 >Emitted(89, 23) Source(131, 23) + SourceIndex(0) +8 >Emitted(89, 24) Source(131, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(90, 2) Source(132, 2) + SourceIndex(0) +--- +>>>for (var _66 = 0, _67 = getRobots(); _66 < _67.length; _66++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(91, 1) Source(133, 1) + SourceIndex(0) +2 >Emitted(91, 4) Source(133, 4) + SourceIndex(0) +3 >Emitted(91, 5) Source(133, 5) + SourceIndex(0) +4 >Emitted(91, 6) Source(133, 49) + SourceIndex(0) +5 >Emitted(91, 17) Source(133, 60) + SourceIndex(0) +6 >Emitted(91, 19) Source(133, 49) + SourceIndex(0) +7 >Emitted(91, 25) Source(133, 49) + SourceIndex(0) +8 >Emitted(91, 34) Source(133, 58) + SourceIndex(0) +9 >Emitted(91, 36) Source(133, 60) + SourceIndex(0) +10>Emitted(91, 38) Source(133, 49) + SourceIndex(0) +11>Emitted(91, 54) Source(133, 60) + SourceIndex(0) +12>Emitted(91, 56) Source(133, 49) + SourceIndex(0) +13>Emitted(91, 61) Source(133, 60) + SourceIndex(0) +14>Emitted(91, 62) Source(133, 61) + SourceIndex(0) +--- +>>> _68 = _67[_66], _69 = _68.name, name = _69 === void 0 ? "noName" : _69, _70 = _68.skill, skill = _70 === void 0 ? "noSkill" : _70; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(92, 5) Source(133, 6) + SourceIndex(0) +2 >Emitted(92, 19) Source(133, 45) + SourceIndex(0) +3 >Emitted(92, 21) Source(133, 8) + SourceIndex(0) +4 >Emitted(92, 35) Source(133, 23) + SourceIndex(0) +5 >Emitted(92, 37) Source(133, 8) + SourceIndex(0) +6 >Emitted(92, 75) Source(133, 23) + SourceIndex(0) +7 >Emitted(92, 77) Source(133, 25) + SourceIndex(0) +8 >Emitted(92, 92) Source(133, 42) + SourceIndex(0) +9 >Emitted(92, 94) Source(133, 25) + SourceIndex(0) +10>Emitted(92, 134) Source(133, 42) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(93, 5) Source(134, 5) + SourceIndex(0) +2 >Emitted(93, 12) Source(134, 12) + SourceIndex(0) +3 >Emitted(93, 13) Source(134, 13) + SourceIndex(0) +4 >Emitted(93, 16) Source(134, 16) + SourceIndex(0) +5 >Emitted(93, 17) Source(134, 17) + SourceIndex(0) +6 >Emitted(93, 22) Source(134, 22) + SourceIndex(0) +7 >Emitted(93, 23) Source(134, 23) + SourceIndex(0) +8 >Emitted(93, 24) Source(134, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(94, 2) Source(135, 2) + SourceIndex(0) +--- +>>>for (var _71 = 0, _72 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _71 < _72.length; _71++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +33> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(95, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(95, 4) Source(136, 4) + SourceIndex(0) +3 >Emitted(95, 5) Source(136, 5) + SourceIndex(0) +4 >Emitted(95, 6) Source(136, 49) + SourceIndex(0) +5 >Emitted(95, 17) Source(136, 125) + SourceIndex(0) +6 >Emitted(95, 19) Source(136, 49) + SourceIndex(0) +7 >Emitted(95, 26) Source(136, 50) + SourceIndex(0) +8 >Emitted(95, 28) Source(136, 52) + SourceIndex(0) +9 >Emitted(95, 32) Source(136, 56) + SourceIndex(0) +10>Emitted(95, 34) Source(136, 58) + SourceIndex(0) +11>Emitted(95, 41) Source(136, 65) + SourceIndex(0) +12>Emitted(95, 43) Source(136, 67) + SourceIndex(0) +13>Emitted(95, 48) Source(136, 72) + SourceIndex(0) +14>Emitted(95, 50) Source(136, 74) + SourceIndex(0) +15>Emitted(95, 58) Source(136, 82) + SourceIndex(0) +16>Emitted(95, 60) Source(136, 84) + SourceIndex(0) +17>Emitted(95, 62) Source(136, 86) + SourceIndex(0) +18>Emitted(95, 64) Source(136, 88) + SourceIndex(0) +19>Emitted(95, 68) Source(136, 92) + SourceIndex(0) +20>Emitted(95, 70) Source(136, 94) + SourceIndex(0) +21>Emitted(95, 79) Source(136, 103) + SourceIndex(0) +22>Emitted(95, 81) Source(136, 105) + SourceIndex(0) +23>Emitted(95, 86) Source(136, 110) + SourceIndex(0) +24>Emitted(95, 88) Source(136, 112) + SourceIndex(0) +25>Emitted(95, 98) Source(136, 122) + SourceIndex(0) +26>Emitted(95, 100) Source(136, 124) + SourceIndex(0) +27>Emitted(95, 101) Source(136, 125) + SourceIndex(0) +28>Emitted(95, 103) Source(136, 49) + SourceIndex(0) +29>Emitted(95, 119) Source(136, 125) + SourceIndex(0) +30>Emitted(95, 121) Source(136, 49) + SourceIndex(0) +31>Emitted(95, 126) Source(136, 125) + SourceIndex(0) +32>Emitted(95, 127) Source(136, 126) + SourceIndex(0) +--- +>>> _73 = _72[_71], _74 = _73.name, name = _74 === void 0 ? "noName" : _74, _75 = _73.skill, skill = _75 === void 0 ? "noSkill" : _75; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(96, 5) Source(136, 6) + SourceIndex(0) +2 >Emitted(96, 19) Source(136, 45) + SourceIndex(0) +3 >Emitted(96, 21) Source(136, 8) + SourceIndex(0) +4 >Emitted(96, 35) Source(136, 23) + SourceIndex(0) +5 >Emitted(96, 37) Source(136, 8) + SourceIndex(0) +6 >Emitted(96, 75) Source(136, 23) + SourceIndex(0) +7 >Emitted(96, 77) Source(136, 25) + SourceIndex(0) +8 >Emitted(96, 92) Source(136, 43) + SourceIndex(0) +9 >Emitted(96, 94) Source(136, 25) + SourceIndex(0) +10>Emitted(96, 134) Source(136, 43) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(97, 5) Source(137, 5) + SourceIndex(0) +2 >Emitted(97, 12) Source(137, 12) + SourceIndex(0) +3 >Emitted(97, 13) Source(137, 13) + SourceIndex(0) +4 >Emitted(97, 16) Source(137, 16) + SourceIndex(0) +5 >Emitted(97, 17) Source(137, 17) + SourceIndex(0) +6 >Emitted(97, 22) Source(137, 22) + SourceIndex(0) +7 >Emitted(97, 23) Source(137, 23) + SourceIndex(0) +8 >Emitted(97, 24) Source(137, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(98, 2) Source(138, 2) + SourceIndex(0) +--- +>>>for (var _76 = 0, multiRobots_4 = multiRobots; _76 < multiRobots_4.length; _76++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(99, 1) Source(139, 1) + SourceIndex(0) +2 >Emitted(99, 4) Source(139, 4) + SourceIndex(0) +3 >Emitted(99, 5) Source(139, 5) + SourceIndex(0) +4 >Emitted(99, 6) Source(145, 6) + SourceIndex(0) +5 >Emitted(99, 17) Source(145, 17) + SourceIndex(0) +6 >Emitted(99, 19) Source(145, 6) + SourceIndex(0) +7 >Emitted(99, 46) Source(145, 17) + SourceIndex(0) +8 >Emitted(99, 48) Source(145, 6) + SourceIndex(0) +9 >Emitted(99, 74) Source(145, 17) + SourceIndex(0) +10>Emitted(99, 76) Source(145, 6) + SourceIndex(0) +11>Emitted(99, 81) Source(145, 17) + SourceIndex(0) +12>Emitted(99, 82) Source(145, 18) + SourceIndex(0) +--- +>>> _77 = multiRobots_4[_76], _78 = _77.name, name = _78 === void 0 ? "noName" : _78, _79 = _77.skills, _80 = _79 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _79, _81 = _80.primary, primary = _81 === void 0 ? "primary" : _81, _82 = _80.secondary, secondary = _82 === void 0 ? "secondary" : _82; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(100, 5) Source(139, 6) + SourceIndex(0) +2 >Emitted(100, 29) Source(145, 2) + SourceIndex(0) +3 >Emitted(100, 31) Source(140, 5) + SourceIndex(0) +4 >Emitted(100, 45) Source(140, 20) + SourceIndex(0) +5 >Emitted(100, 47) Source(140, 5) + SourceIndex(0) +6 >Emitted(100, 85) Source(140, 20) + SourceIndex(0) +7 >Emitted(100, 87) Source(141, 5) + SourceIndex(0) +8 >Emitted(100, 103) Source(144, 53) + SourceIndex(0) +9 >Emitted(100, 105) Source(141, 5) + SourceIndex(0) +10>Emitted(100, 178) Source(144, 53) + SourceIndex(0) +11>Emitted(100, 180) Source(142, 9) + SourceIndex(0) +12>Emitted(100, 197) Source(142, 28) + SourceIndex(0) +13>Emitted(100, 199) Source(142, 9) + SourceIndex(0) +14>Emitted(100, 241) Source(142, 28) + SourceIndex(0) +15>Emitted(100, 243) Source(143, 9) + SourceIndex(0) +16>Emitted(100, 262) Source(143, 32) + SourceIndex(0) +17>Emitted(100, 264) Source(143, 9) + SourceIndex(0) +18>Emitted(100, 310) Source(143, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(101, 5) Source(146, 5) + SourceIndex(0) +2 >Emitted(101, 12) Source(146, 12) + SourceIndex(0) +3 >Emitted(101, 13) Source(146, 13) + SourceIndex(0) +4 >Emitted(101, 16) Source(146, 16) + SourceIndex(0) +5 >Emitted(101, 17) Source(146, 17) + SourceIndex(0) +6 >Emitted(101, 22) Source(146, 22) + SourceIndex(0) +7 >Emitted(101, 23) Source(146, 23) + SourceIndex(0) +8 >Emitted(101, 24) Source(146, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(102, 2) Source(147, 2) + SourceIndex(0) +--- +>>>for (var _83 = 0, _84 = getMultiRobots(); _83 < _84.length; _83++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(103, 1) Source(148, 1) + SourceIndex(0) +2 >Emitted(103, 4) Source(148, 4) + SourceIndex(0) +3 >Emitted(103, 5) Source(148, 5) + SourceIndex(0) +4 >Emitted(103, 6) Source(154, 6) + SourceIndex(0) +5 >Emitted(103, 17) Source(154, 22) + SourceIndex(0) +6 >Emitted(103, 19) Source(154, 6) + SourceIndex(0) +7 >Emitted(103, 25) Source(154, 6) + SourceIndex(0) +8 >Emitted(103, 39) Source(154, 20) + SourceIndex(0) +9 >Emitted(103, 41) Source(154, 22) + SourceIndex(0) +10>Emitted(103, 43) Source(154, 6) + SourceIndex(0) +11>Emitted(103, 59) Source(154, 22) + SourceIndex(0) +12>Emitted(103, 61) Source(154, 6) + SourceIndex(0) +13>Emitted(103, 66) Source(154, 22) + SourceIndex(0) +14>Emitted(103, 67) Source(154, 23) + SourceIndex(0) +--- +>>> _85 = _84[_83], _86 = _85.name, name = _86 === void 0 ? "noName" : _86, _87 = _85.skills, _88 = _87 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _87, _89 = _88.primary, primary = _89 === void 0 ? "primary" : _89, _90 = _88.secondary, secondary = _90 === void 0 ? "secondary" : _90; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(104, 5) Source(148, 6) + SourceIndex(0) +2 >Emitted(104, 19) Source(154, 2) + SourceIndex(0) +3 >Emitted(104, 21) Source(149, 5) + SourceIndex(0) +4 >Emitted(104, 35) Source(149, 20) + SourceIndex(0) +5 >Emitted(104, 37) Source(149, 5) + SourceIndex(0) +6 >Emitted(104, 75) Source(149, 20) + SourceIndex(0) +7 >Emitted(104, 77) Source(150, 5) + SourceIndex(0) +8 >Emitted(104, 93) Source(153, 53) + SourceIndex(0) +9 >Emitted(104, 95) Source(150, 5) + SourceIndex(0) +10>Emitted(104, 168) Source(153, 53) + SourceIndex(0) +11>Emitted(104, 170) Source(151, 9) + SourceIndex(0) +12>Emitted(104, 187) Source(151, 28) + SourceIndex(0) +13>Emitted(104, 189) Source(151, 9) + SourceIndex(0) +14>Emitted(104, 231) Source(151, 28) + SourceIndex(0) +15>Emitted(104, 233) Source(152, 9) + SourceIndex(0) +16>Emitted(104, 252) Source(152, 32) + SourceIndex(0) +17>Emitted(104, 254) Source(152, 9) + SourceIndex(0) +18>Emitted(104, 300) Source(152, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(105, 5) Source(155, 5) + SourceIndex(0) +2 >Emitted(105, 12) Source(155, 12) + SourceIndex(0) +3 >Emitted(105, 13) Source(155, 13) + SourceIndex(0) +4 >Emitted(105, 16) Source(155, 16) + SourceIndex(0) +5 >Emitted(105, 17) Source(155, 17) + SourceIndex(0) +6 >Emitted(105, 22) Source(155, 22) + SourceIndex(0) +7 >Emitted(105, 23) Source(155, 23) + SourceIndex(0) +8 >Emitted(105, 24) Source(155, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(106, 2) Source(156, 2) + SourceIndex(0) +--- +>>>for (var _91 = 0, _92 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(107, 1) Source(157, 1) + SourceIndex(0) +2 >Emitted(107, 4) Source(157, 4) + SourceIndex(0) +3 >Emitted(107, 5) Source(157, 5) + SourceIndex(0) +4 >Emitted(107, 6) Source(163, 6) + SourceIndex(0) +5 >Emitted(107, 17) Source(164, 79) + SourceIndex(0) +6 >Emitted(107, 19) Source(163, 6) + SourceIndex(0) +7 >Emitted(107, 26) Source(163, 7) + SourceIndex(0) +8 >Emitted(107, 28) Source(163, 9) + SourceIndex(0) +9 >Emitted(107, 32) Source(163, 13) + SourceIndex(0) +10>Emitted(107, 34) Source(163, 15) + SourceIndex(0) +11>Emitted(107, 41) Source(163, 22) + SourceIndex(0) +12>Emitted(107, 43) Source(163, 24) + SourceIndex(0) +13>Emitted(107, 49) Source(163, 30) + SourceIndex(0) +14>Emitted(107, 51) Source(163, 32) + SourceIndex(0) +15>Emitted(107, 53) Source(163, 34) + SourceIndex(0) +16>Emitted(107, 60) Source(163, 41) + SourceIndex(0) +17>Emitted(107, 62) Source(163, 43) + SourceIndex(0) +18>Emitted(107, 70) Source(163, 51) + SourceIndex(0) +19>Emitted(107, 72) Source(163, 53) + SourceIndex(0) +20>Emitted(107, 81) Source(163, 62) + SourceIndex(0) +21>Emitted(107, 83) Source(163, 64) + SourceIndex(0) +22>Emitted(107, 89) Source(163, 70) + SourceIndex(0) +23>Emitted(107, 91) Source(163, 72) + SourceIndex(0) +24>Emitted(107, 93) Source(163, 74) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _91 < _92.length; _91++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(108, 5) Source(164, 5) + SourceIndex(0) +2 >Emitted(108, 7) Source(164, 7) + SourceIndex(0) +3 >Emitted(108, 11) Source(164, 11) + SourceIndex(0) +4 >Emitted(108, 13) Source(164, 13) + SourceIndex(0) +5 >Emitted(108, 22) Source(164, 22) + SourceIndex(0) +6 >Emitted(108, 24) Source(164, 24) + SourceIndex(0) +7 >Emitted(108, 30) Source(164, 30) + SourceIndex(0) +8 >Emitted(108, 32) Source(164, 32) + SourceIndex(0) +9 >Emitted(108, 34) Source(164, 34) + SourceIndex(0) +10>Emitted(108, 41) Source(164, 41) + SourceIndex(0) +11>Emitted(108, 43) Source(164, 43) + SourceIndex(0) +12>Emitted(108, 53) Source(164, 53) + SourceIndex(0) +13>Emitted(108, 55) Source(164, 55) + SourceIndex(0) +14>Emitted(108, 64) Source(164, 64) + SourceIndex(0) +15>Emitted(108, 66) Source(164, 66) + SourceIndex(0) +16>Emitted(108, 74) Source(164, 74) + SourceIndex(0) +17>Emitted(108, 76) Source(164, 76) + SourceIndex(0) +18>Emitted(108, 78) Source(164, 78) + SourceIndex(0) +19>Emitted(108, 79) Source(164, 79) + SourceIndex(0) +20>Emitted(108, 81) Source(163, 6) + SourceIndex(0) +21>Emitted(108, 97) Source(164, 79) + SourceIndex(0) +22>Emitted(108, 99) Source(163, 6) + SourceIndex(0) +23>Emitted(108, 104) Source(164, 79) + SourceIndex(0) +24>Emitted(108, 105) Source(164, 80) + SourceIndex(0) +--- +>>> _93 = _92[_91], _94 = _93.name, name = _94 === void 0 ? "noName" : _94, _95 = _93.skills, _96 = _95 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _95, _97 = _96.primary, primary = _97 === void 0 ? "primary" : _97, _98 = _96.secondary, secondary = _98 === void 0 ? "secondary" : _98; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(109, 5) Source(157, 6) + SourceIndex(0) +2 >Emitted(109, 19) Source(163, 2) + SourceIndex(0) +3 >Emitted(109, 21) Source(158, 5) + SourceIndex(0) +4 >Emitted(109, 35) Source(158, 20) + SourceIndex(0) +5 >Emitted(109, 37) Source(158, 5) + SourceIndex(0) +6 >Emitted(109, 75) Source(158, 20) + SourceIndex(0) +7 >Emitted(109, 77) Source(159, 5) + SourceIndex(0) +8 >Emitted(109, 93) Source(162, 53) + SourceIndex(0) +9 >Emitted(109, 95) Source(159, 5) + SourceIndex(0) +10>Emitted(109, 168) Source(162, 53) + SourceIndex(0) +11>Emitted(109, 170) Source(160, 9) + SourceIndex(0) +12>Emitted(109, 187) Source(160, 28) + SourceIndex(0) +13>Emitted(109, 189) Source(160, 9) + SourceIndex(0) +14>Emitted(109, 231) Source(160, 28) + SourceIndex(0) +15>Emitted(109, 233) Source(161, 9) + SourceIndex(0) +16>Emitted(109, 252) Source(161, 32) + SourceIndex(0) +17>Emitted(109, 254) Source(161, 9) + SourceIndex(0) +18>Emitted(109, 300) Source(161, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(110, 5) Source(165, 5) + SourceIndex(0) +2 >Emitted(110, 12) Source(165, 12) + SourceIndex(0) +3 >Emitted(110, 13) Source(165, 13) + SourceIndex(0) +4 >Emitted(110, 16) Source(165, 16) + SourceIndex(0) +5 >Emitted(110, 17) Source(165, 17) + SourceIndex(0) +6 >Emitted(110, 22) Source(165, 22) + SourceIndex(0) +7 >Emitted(110, 23) Source(165, 23) + SourceIndex(0) +8 >Emitted(110, 24) Source(165, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(111, 2) Source(166, 2) + SourceIndex(0) +--- +>>>var _a, _d, _g, _j, _k, _l, _m, _q, _r, _s, _t, _w, _x, _y, _z, _1, _4, _7, _9, _10, _11, _12, _15, _16, _17, _18, _21, _22, _23, _24, _26, _27, _28, _31, _32, _33, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _65, _68, _69, _70, _73, _74, _75, _77, _78, _79, _80, _81, _82, _85, _86, _87, _88, _89, _90, _93, _94, _95, _96, _97, _98; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..7194270c784 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols @@ -0,0 +1,564 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 53)) + +for ({name: nameA = "noName" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 36)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 51)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 72)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 89)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 41, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 41, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 45, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 45, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 49, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 49, 25)) + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 20)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 35)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 45)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 64)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 9)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 26)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 36)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 57)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} + +for ({ name = "noName" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 55, 6)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 58, 6)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 6)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 30)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 45)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 66)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 83)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 64, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 65, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 66, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 68, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 68, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 72, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 73, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 74, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 76, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 76, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 80, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 81, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 82, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 84, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 7)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 91, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 91, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 94, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 94, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 64)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 79)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 100)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 117)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 100, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 101, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 102, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 103, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 105, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 105, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 109, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 110, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 111, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 112, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 114, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 114, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 118, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 119, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 120, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 121, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 123, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 123, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 65)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} + +for ({ name = "noName", skill = "noSkill" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 129, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 129, 23)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 132, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 132, 23)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 23)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 50)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 65)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 86)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 103)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 138, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 139, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 140, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 141, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 143, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 143, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 147, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 148, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 149, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 150, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 152, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 152, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 156, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 157, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 158, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 159, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 161, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 161, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 7)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..fe630aafccc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types @@ -0,0 +1,829 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA = "noName" } of robots) { +>{name: nameA = "noName" } : { name: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } of getRobots()) { +>{name: nameA = "noName" } : { name: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA = "noName" } : { name: string; } +>name : { name: string; skill: string; } +>nameA = "noName" : string +>nameA : string +>"noName" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName" } of robots) { +>{ name = "noName" } : { name: string; } +>name : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } of getRobots()) { +>{ name = "noName" } : { name: string; } +>name : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{ name = "noName" } : { name: string; } +>name : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : Robot +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : Robot +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : { name: string; skill: string; } +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +for ({ name = "noName", skill = "noSkill" } of robots) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>skill : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : MultiRobot + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : MultiRobot + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : { name: string; skills: { primary: string; secondary: string; }; } + + skills: { +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js new file mode 100644 index 00000000000..4c7c0d6307b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js @@ -0,0 +1,54 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + console.log(primaryA); +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + console.log(secondaryB); +} +function foo3({ skills }: Robot) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function foo1(_a) { + var _b = _a.skills, primaryA = _b.primary, secondaryA = _b.secondary; + console.log(primaryA); +} +function foo2(_a) { + var nameC = _a.name, _b = _a.skills, primaryB = _b.primary, secondaryB = _b.secondary; + console.log(secondaryB); +} +function foo3(_a) { + var skills = _a.skills; + console.log(skills.primary); +} +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map new file mode 100644 index 00000000000..b05ceecbc4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AAExF,cAAc,EAA+D;QAA7D,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,cAAc,EAA4E;QAA1E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAC3E,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AACD,cAAc,EAAiB;QAAf,kBAAM;IAClB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..8e39fd676d0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt @@ -0,0 +1,578 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { skills: { primary: primaryA, secondary: secondaryA } }: Robot +1 >Emitted(2, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(13, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(13, 78) + SourceIndex(0) +--- +>>> var _b = _a.skills, primaryA = _b.primary, secondaryA = _b.secondary; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(3, 9) Source(13, 17) + SourceIndex(0) +2 >Emitted(3, 23) Source(13, 69) + SourceIndex(0) +3 >Emitted(3, 25) Source(13, 27) + SourceIndex(0) +4 >Emitted(3, 46) Source(13, 44) + SourceIndex(0) +5 >Emitted(3, 48) Source(13, 46) + SourceIndex(0) +6 >Emitted(3, 73) Source(13, 67) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(14, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(14, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(14, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(14, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(14, 17) + SourceIndex(0) +6 >Emitted(4, 25) Source(14, 25) + SourceIndex(0) +7 >Emitted(4, 26) Source(14, 26) + SourceIndex(0) +8 >Emitted(4, 27) Source(14, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(15, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot +1->Emitted(6, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(16, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(16, 91) + SourceIndex(0) +--- +>>> var nameC = _a.name, _b = _a.skills, primaryB = _b.primary, secondaryB = _b.secondary; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameC +3 > , +4 > skills: { primary: primaryB, secondary: secondaryB } +5 > +6 > primary: primaryB +7 > , +8 > secondary: secondaryB +1->Emitted(7, 9) Source(16, 17) + SourceIndex(0) +2 >Emitted(7, 24) Source(16, 28) + SourceIndex(0) +3 >Emitted(7, 26) Source(16, 30) + SourceIndex(0) +4 >Emitted(7, 40) Source(16, 82) + SourceIndex(0) +5 >Emitted(7, 42) Source(16, 40) + SourceIndex(0) +6 >Emitted(7, 63) Source(16, 57) + SourceIndex(0) +7 >Emitted(7, 65) Source(16, 59) + SourceIndex(0) +8 >Emitted(7, 90) Source(16, 80) + SourceIndex(0) +--- +>>> console.log(secondaryB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 > } }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > secondaryB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(17, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(17, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(17, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(17, 17) + SourceIndex(0) +6 >Emitted(8, 27) Source(17, 27) + SourceIndex(0) +7 >Emitted(8, 28) Source(17, 28) + SourceIndex(0) +8 >Emitted(8, 29) Source(17, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(18, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { skills }: Robot +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(19, 32) + SourceIndex(0) +--- +>>> var skills = _a.skills; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^-> +1-> +2 > skills +1->Emitted(11, 9) Source(19, 17) + SourceIndex(0) +2 >Emitted(11, 27) Source(19, 23) + SourceIndex(0) +--- +>>> console.log(skills.primary); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skills +7 > . +8 > primary +9 > ) +10> ; +1->Emitted(12, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(20, 24) + SourceIndex(0) +8 >Emitted(12, 31) Source(20, 31) + SourceIndex(0) +9 >Emitted(12, 32) Source(20, 32) + SourceIndex(0) +10>Emitted(12, 33) Source(20, 33) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(15, 8) Source(24, 8) + SourceIndex(0) +5 >Emitted(15, 12) Source(24, 12) + SourceIndex(0) +6 >Emitted(15, 14) Source(24, 14) + SourceIndex(0) +7 >Emitted(15, 21) Source(24, 21) + SourceIndex(0) +8 >Emitted(15, 23) Source(24, 23) + SourceIndex(0) +9 >Emitted(15, 29) Source(24, 29) + SourceIndex(0) +10>Emitted(15, 31) Source(24, 31) + SourceIndex(0) +11>Emitted(15, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(15, 40) Source(24, 40) + SourceIndex(0) +13>Emitted(15, 42) Source(24, 42) + SourceIndex(0) +14>Emitted(15, 50) Source(24, 50) + SourceIndex(0) +15>Emitted(15, 52) Source(24, 52) + SourceIndex(0) +16>Emitted(15, 61) Source(24, 61) + SourceIndex(0) +17>Emitted(15, 63) Source(24, 63) + SourceIndex(0) +18>Emitted(15, 80) Source(24, 80) + SourceIndex(0) +19>Emitted(15, 82) Source(24, 82) + SourceIndex(0) +20>Emitted(15, 84) Source(24, 84) + SourceIndex(0) +21>Emitted(15, 85) Source(24, 85) + SourceIndex(0) +22>Emitted(15, 86) Source(24, 86) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(17, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(17, 8) Source(27, 8) + SourceIndex(0) +5 >Emitted(17, 12) Source(27, 12) + SourceIndex(0) +6 >Emitted(17, 14) Source(27, 14) + SourceIndex(0) +7 >Emitted(17, 21) Source(27, 21) + SourceIndex(0) +8 >Emitted(17, 23) Source(27, 23) + SourceIndex(0) +9 >Emitted(17, 29) Source(27, 29) + SourceIndex(0) +10>Emitted(17, 31) Source(27, 31) + SourceIndex(0) +11>Emitted(17, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(17, 40) Source(27, 40) + SourceIndex(0) +13>Emitted(17, 42) Source(27, 42) + SourceIndex(0) +14>Emitted(17, 50) Source(27, 50) + SourceIndex(0) +15>Emitted(17, 52) Source(27, 52) + SourceIndex(0) +16>Emitted(17, 61) Source(27, 61) + SourceIndex(0) +17>Emitted(17, 63) Source(27, 63) + SourceIndex(0) +18>Emitted(17, 80) Source(27, 80) + SourceIndex(0) +19>Emitted(17, 82) Source(27, 82) + SourceIndex(0) +20>Emitted(17, 84) Source(27, 84) + SourceIndex(0) +21>Emitted(17, 85) Source(27, 85) + SourceIndex(0) +22>Emitted(17, 86) Source(27, 86) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +23> ^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(19, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(19, 8) Source(30, 8) + SourceIndex(0) +5 >Emitted(19, 12) Source(30, 12) + SourceIndex(0) +6 >Emitted(19, 14) Source(30, 14) + SourceIndex(0) +7 >Emitted(19, 21) Source(30, 21) + SourceIndex(0) +8 >Emitted(19, 23) Source(30, 23) + SourceIndex(0) +9 >Emitted(19, 29) Source(30, 29) + SourceIndex(0) +10>Emitted(19, 31) Source(30, 31) + SourceIndex(0) +11>Emitted(19, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(19, 40) Source(30, 40) + SourceIndex(0) +13>Emitted(19, 42) Source(30, 42) + SourceIndex(0) +14>Emitted(19, 50) Source(30, 50) + SourceIndex(0) +15>Emitted(19, 52) Source(30, 52) + SourceIndex(0) +16>Emitted(19, 61) Source(30, 61) + SourceIndex(0) +17>Emitted(19, 63) Source(30, 63) + SourceIndex(0) +18>Emitted(19, 80) Source(30, 80) + SourceIndex(0) +19>Emitted(19, 82) Source(30, 82) + SourceIndex(0) +20>Emitted(19, 84) Source(30, 84) + SourceIndex(0) +21>Emitted(19, 85) Source(30, 85) + SourceIndex(0) +22>Emitted(19, 86) Source(30, 86) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols new file mode 100644 index 00000000000..3b2a89b2bda --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols @@ -0,0 +1,112 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 65)) + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 25)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 44)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 25)) +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 15)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 38)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 57)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(secondaryB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 57)) +} +function foo3({ skills }: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 18, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(skills.primary); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>skills.primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 18, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 50)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 50)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 50)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types new file mode 100644 index 00000000000..029e47cd3a0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -0,0 +1,141 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>Robot : Robot + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>primaryA : string +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>name : any +>nameC : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>Robot : Robot + + console.log(secondaryB); +>console.log(secondaryB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>secondaryB : string +} +function foo3({ skills }: Robot) { +>foo3 : ({ skills }: Robot) => void +>skills : { primary: string; secondary: string; } +>Robot : Robot + + console.log(skills.primary); +>console.log(skills.primary) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skills.primary : string +>skills : { primary: string; secondary: string; } +>primary : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ skills }: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo3 : ({ skills }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..b67f5047965 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js @@ -0,0 +1,67 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1( + { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(primaryA); +} +function foo2( + { + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(secondaryB); +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function foo1(_a) { + var _b = (_a === void 0 ? robotA : _a).skills, _c = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b, _d = _c.primary, primaryA = _d === void 0 ? "primary" : _d, _e = _c.secondary, secondaryA = _e === void 0 ? "secondary" : _e; + console.log(primaryA); +} +function foo2(_a) { + var _b = _a === void 0 ? robotA : _a, _c = _b.name, nameC = _c === void 0 ? "name" : _c, _d = _b.skills, _e = _d === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _d, _f = _e.primary, primaryB = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryB = _g === void 0 ? "secondary" : _g; + console.log(secondaryB); +} +function foo3(_a) { + var _b = (_a === void 0 ? robotA : _a).skills, skills = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b; + console.log(skills.primary); +} +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..0fdd3c9bcec --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AAExF,cACI,EAKiB;QAJb,yCAGoD,EAHpD,0EAGoD,EAFhD,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAG3C,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,cACI,EAMiB;QANjB,gCAMiB,EALb,YAAoB,EAApB,mCAAoB,EACpB,cAGoD,EAHpD,0EAGoD,EAFhD,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAG3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AACD,cAAc,EAA8E;QAA5E,yCAAyD,EAAzD,8EAAyD;IACrE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..aca1d58bcac --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,669 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( + > +3 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +1 >Emitted(2, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(14, 5) + SourceIndex(0) +3 >Emitted(2, 17) Source(19, 22) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? robotA : _a).skills, _c = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b, _d = _c.primary, primaryA = _d === void 0 ? "primary" : _d, _e = _c.secondary, secondaryA = _e === void 0 ? "secondary" : _e; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +3 > +4 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , + > +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(3, 9) Source(15, 9) + SourceIndex(0) +2 >Emitted(3, 50) Source(18, 61) + SourceIndex(0) +3 >Emitted(3, 52) Source(15, 9) + SourceIndex(0) +4 >Emitted(3, 126) Source(18, 61) + SourceIndex(0) +5 >Emitted(3, 128) Source(16, 13) + SourceIndex(0) +6 >Emitted(3, 143) Source(16, 42) + SourceIndex(0) +7 >Emitted(3, 145) Source(16, 13) + SourceIndex(0) +8 >Emitted(3, 186) Source(16, 42) + SourceIndex(0) +9 >Emitted(3, 188) Source(17, 13) + SourceIndex(0) +10>Emitted(3, 205) Source(17, 48) + SourceIndex(0) +11>Emitted(3, 207) Source(17, 13) + SourceIndex(0) +12>Emitted(3, 252) Source(17, 48) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(4, 25) Source(20, 25) + SourceIndex(0) +7 >Emitted(4, 26) Source(20, 26) + SourceIndex(0) +8 >Emitted(4, 27) Source(20, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( + > +3 > { + > name: nameC = "name", + > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(23, 5) + SourceIndex(0) +3 >Emitted(6, 17) Source(29, 22) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? robotA : _a, _c = _b.name, nameC = _c === void 0 ? "name" : _c, _d = _b.skills, _e = _d === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _d, _f = _e.primary, primaryB = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryB = _g === void 0 ? "secondary" : _g; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameC = "name", + > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +3 > +4 > name: nameC = "name" +5 > +6 > name: nameC = "name" +7 > , + > +8 > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +9 > +10> skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +11> +12> primary: primaryB = "primary" +13> +14> primary: primaryB = "primary" +15> , + > +16> secondary: secondaryB = "secondary" +17> +18> secondary: secondaryB = "secondary" +1->Emitted(7, 9) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 41) Source(29, 22) + SourceIndex(0) +3 >Emitted(7, 43) Source(24, 9) + SourceIndex(0) +4 >Emitted(7, 55) Source(24, 29) + SourceIndex(0) +5 >Emitted(7, 57) Source(24, 9) + SourceIndex(0) +6 >Emitted(7, 92) Source(24, 29) + SourceIndex(0) +7 >Emitted(7, 94) Source(25, 9) + SourceIndex(0) +8 >Emitted(7, 108) Source(28, 61) + SourceIndex(0) +9 >Emitted(7, 110) Source(25, 9) + SourceIndex(0) +10>Emitted(7, 184) Source(28, 61) + SourceIndex(0) +11>Emitted(7, 186) Source(26, 13) + SourceIndex(0) +12>Emitted(7, 201) Source(26, 42) + SourceIndex(0) +13>Emitted(7, 203) Source(26, 13) + SourceIndex(0) +14>Emitted(7, 244) Source(26, 42) + SourceIndex(0) +15>Emitted(7, 246) Source(27, 13) + SourceIndex(0) +16>Emitted(7, 263) Source(27, 48) + SourceIndex(0) +17>Emitted(7, 265) Source(27, 13) + SourceIndex(0) +18>Emitted(7, 310) Source(27, 48) + SourceIndex(0) +--- +>>> console.log(secondaryB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > secondaryB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(8, 27) Source(30, 27) + SourceIndex(0) +7 >Emitted(8, 28) Source(30, 28) + SourceIndex(0) +8 >Emitted(8, 29) Source(30, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(31, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA +1->Emitted(10, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(32, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(32, 93) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? robotA : _a).skills, skills = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills = { primary: "SomeSkill", secondary: "someSkill" } +3 > +4 > skills = { primary: "SomeSkill", secondary: "someSkill" } +1->Emitted(11, 9) Source(32, 17) + SourceIndex(0) +2 >Emitted(11, 50) Source(32, 74) + SourceIndex(0) +3 >Emitted(11, 52) Source(32, 17) + SourceIndex(0) +4 >Emitted(11, 130) Source(32, 74) + SourceIndex(0) +--- +>>> console.log(skills.primary); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +1 > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skills +7 > . +8 > primary +9 > ) +10> ; +1 >Emitted(12, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(33, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(33, 24) + SourceIndex(0) +8 >Emitted(12, 31) Source(33, 31) + SourceIndex(0) +9 >Emitted(12, 32) Source(33, 32) + SourceIndex(0) +10>Emitted(12, 33) Source(33, 33) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(34, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(36, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(36, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(36, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(36, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(15, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(37, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(37, 6) + SourceIndex(0) +4 >Emitted(15, 8) Source(37, 8) + SourceIndex(0) +5 >Emitted(15, 12) Source(37, 12) + SourceIndex(0) +6 >Emitted(15, 14) Source(37, 14) + SourceIndex(0) +7 >Emitted(15, 21) Source(37, 21) + SourceIndex(0) +8 >Emitted(15, 23) Source(37, 23) + SourceIndex(0) +9 >Emitted(15, 29) Source(37, 29) + SourceIndex(0) +10>Emitted(15, 31) Source(37, 31) + SourceIndex(0) +11>Emitted(15, 33) Source(37, 33) + SourceIndex(0) +12>Emitted(15, 40) Source(37, 40) + SourceIndex(0) +13>Emitted(15, 42) Source(37, 42) + SourceIndex(0) +14>Emitted(15, 50) Source(37, 50) + SourceIndex(0) +15>Emitted(15, 52) Source(37, 52) + SourceIndex(0) +16>Emitted(15, 61) Source(37, 61) + SourceIndex(0) +17>Emitted(15, 63) Source(37, 63) + SourceIndex(0) +18>Emitted(15, 80) Source(37, 80) + SourceIndex(0) +19>Emitted(15, 82) Source(37, 82) + SourceIndex(0) +20>Emitted(15, 84) Source(37, 84) + SourceIndex(0) +21>Emitted(15, 85) Source(37, 85) + SourceIndex(0) +22>Emitted(15, 86) Source(37, 86) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(39, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(39, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(39, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(39, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(39, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(17, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(40, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(40, 6) + SourceIndex(0) +4 >Emitted(17, 8) Source(40, 8) + SourceIndex(0) +5 >Emitted(17, 12) Source(40, 12) + SourceIndex(0) +6 >Emitted(17, 14) Source(40, 14) + SourceIndex(0) +7 >Emitted(17, 21) Source(40, 21) + SourceIndex(0) +8 >Emitted(17, 23) Source(40, 23) + SourceIndex(0) +9 >Emitted(17, 29) Source(40, 29) + SourceIndex(0) +10>Emitted(17, 31) Source(40, 31) + SourceIndex(0) +11>Emitted(17, 33) Source(40, 33) + SourceIndex(0) +12>Emitted(17, 40) Source(40, 40) + SourceIndex(0) +13>Emitted(17, 42) Source(40, 42) + SourceIndex(0) +14>Emitted(17, 50) Source(40, 50) + SourceIndex(0) +15>Emitted(17, 52) Source(40, 52) + SourceIndex(0) +16>Emitted(17, 61) Source(40, 61) + SourceIndex(0) +17>Emitted(17, 63) Source(40, 63) + SourceIndex(0) +18>Emitted(17, 80) Source(40, 80) + SourceIndex(0) +19>Emitted(17, 82) Source(40, 82) + SourceIndex(0) +20>Emitted(17, 84) Source(40, 84) + SourceIndex(0) +21>Emitted(17, 85) Source(40, 85) + SourceIndex(0) +22>Emitted(17, 86) Source(40, 86) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(42, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(42, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(42, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(42, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(42, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +23> ^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(19, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(43, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(43, 6) + SourceIndex(0) +4 >Emitted(19, 8) Source(43, 8) + SourceIndex(0) +5 >Emitted(19, 12) Source(43, 12) + SourceIndex(0) +6 >Emitted(19, 14) Source(43, 14) + SourceIndex(0) +7 >Emitted(19, 21) Source(43, 21) + SourceIndex(0) +8 >Emitted(19, 23) Source(43, 23) + SourceIndex(0) +9 >Emitted(19, 29) Source(43, 29) + SourceIndex(0) +10>Emitted(19, 31) Source(43, 31) + SourceIndex(0) +11>Emitted(19, 33) Source(43, 33) + SourceIndex(0) +12>Emitted(19, 40) Source(43, 40) + SourceIndex(0) +13>Emitted(19, 42) Source(43, 42) + SourceIndex(0) +14>Emitted(19, 50) Source(43, 50) + SourceIndex(0) +15>Emitted(19, 52) Source(43, 52) + SourceIndex(0) +16>Emitted(19, 61) Source(43, 61) + SourceIndex(0) +17>Emitted(19, 63) Source(43, 63) + SourceIndex(0) +18>Emitted(19, 80) Source(43, 80) + SourceIndex(0) +19>Emitted(19, 82) Source(43, 82) + SourceIndex(0) +20>Emitted(19, 84) Source(43, 84) + SourceIndex(0) +21>Emitted(19, 85) Source(43, 85) + SourceIndex(0) +22>Emitted(19, 86) Source(43, 86) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..229e9acb6da --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 65)) + +function foo1( +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) + { + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 14, 17)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 15, 42)) + + } = { primary: "SomeSkill", secondary: "someSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 17, 13)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 17, 35)) + + }: Robot = robotA) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 14, 17)) +} +function foo2( +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) + { + name: nameC = "name", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 22, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary: primaryB = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 24, 17)) + + secondary: secondaryB = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 25, 42)) + + } = { primary: "SomeSkill", secondary: "someSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 27, 13)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 27, 35)) + + }: Robot = robotA) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(secondaryB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 25, 42)) +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 26)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 48)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(skills.primary); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>skills.primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 50)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 50)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 50)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..a9e5c2d6ee6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -0,0 +1,219 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function foo1( +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void + { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "SomeSkill", secondary: "someSkill" } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string + + }: Robot = robotA) { +>Robot : Robot +>robotA : Robot + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>primaryA : string +} +function foo2( +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void + { + name: nameC = "name", +>name : any +>nameC : string +>"name" : string + + skills: { +>skills : any + + primary: primaryB = "primary", +>primary : any +>primaryB : string +>"primary" : string + + secondary: secondaryB = "secondary" +>secondary : any +>secondaryB : string +>"secondary" : string + + } = { primary: "SomeSkill", secondary: "someSkill" } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string + + }: Robot = robotA) { +>Robot : Robot +>robotA : Robot + + console.log(secondaryB); +>console.log(secondaryB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>secondaryB : string +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>skills : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string +>Robot : Robot +>robotA : Robot + + console.log(skills.primary); +>console.log(skills.primary) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skills.primary : string +>skills : { primary?: string; secondary?: string; } +>primary : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js new file mode 100644 index 00000000000..4a56f449ecc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js @@ -0,0 +1,53 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); + + +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +function foo1(_a) { + var nameA = _a.name; + console.log(nameA); +} +function foo2(_a) { + var nameB = _a.name, skillB = _a.skill; + console.log(nameB); +} +function foo3(_a) { + var name = _a.name; + console.log(name); +} +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map new file mode 100644 index 00000000000..adc7a7dbb90 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterObjectBindingPattern.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEvD,cAAc,EAAsB;QAApB,eAAW;IACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAqC;QAAnC,eAAW,EAAE,iBAAa;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAe;QAAb,cAAI;IAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..ee826647f54 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt @@ -0,0 +1,472 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringParameterObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringParameterObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { name: nameA }: Robot +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(3, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(3, 17) Source(11, 37) + SourceIndex(0) +--- +>>> var nameA = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > name: nameA +1->Emitted(4, 9) Source(11, 17) + SourceIndex(0) +2 >Emitted(4, 24) Source(11, 28) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(5, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(5, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(5, 22) Source(12, 22) + SourceIndex(0) +7 >Emitted(5, 23) Source(12, 23) + SourceIndex(0) +8 >Emitted(5, 24) Source(12, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameB, skill: skillB }: Robot +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 15) Source(14, 15) + SourceIndex(0) +3 >Emitted(7, 17) Source(14, 52) + SourceIndex(0) +--- +>>> var nameB = _a.name, skillB = _a.skill; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameB +3 > , +4 > skill: skillB +1->Emitted(8, 9) Source(14, 17) + SourceIndex(0) +2 >Emitted(8, 24) Source(14, 28) + SourceIndex(0) +3 >Emitted(8, 26) Source(14, 30) + SourceIndex(0) +4 >Emitted(8, 43) Source(14, 43) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(9, 22) Source(15, 22) + SourceIndex(0) +7 >Emitted(9, 23) Source(15, 23) + SourceIndex(0) +8 >Emitted(9, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { name }: Robot +1->Emitted(11, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(11, 15) Source(17, 15) + SourceIndex(0) +3 >Emitted(11, 17) Source(17, 30) + SourceIndex(0) +--- +>>> var name = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > name +1->Emitted(12, 9) Source(17, 17) + SourceIndex(0) +2 >Emitted(12, 23) Source(17, 21) + SourceIndex(0) +--- +>>> console.log(name); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > name +7 > ) +8 > ; +1->Emitted(13, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(13, 21) Source(18, 21) + SourceIndex(0) +7 >Emitted(13, 22) Source(18, 22) + SourceIndex(0) +8 >Emitted(13, 23) Source(18, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(19, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(15, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(15, 12) Source(21, 12) + SourceIndex(0) +5 >Emitted(15, 13) Source(21, 13) + SourceIndex(0) +6 >Emitted(15, 14) Source(21, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(16, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(16, 8) Source(22, 8) + SourceIndex(0) +5 >Emitted(16, 12) Source(22, 12) + SourceIndex(0) +6 >Emitted(16, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(16, 21) Source(22, 21) + SourceIndex(0) +8 >Emitted(16, 23) Source(22, 23) + SourceIndex(0) +9 >Emitted(16, 28) Source(22, 28) + SourceIndex(0) +10>Emitted(16, 30) Source(22, 30) + SourceIndex(0) +11>Emitted(16, 45) Source(22, 45) + SourceIndex(0) +12>Emitted(16, 47) Source(22, 47) + SourceIndex(0) +13>Emitted(16, 48) Source(22, 48) + SourceIndex(0) +14>Emitted(16, 49) Source(22, 49) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(17, 12) Source(24, 12) + SourceIndex(0) +5 >Emitted(17, 13) Source(24, 13) + SourceIndex(0) +6 >Emitted(17, 14) Source(24, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(18, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(18, 8) Source(25, 8) + SourceIndex(0) +5 >Emitted(18, 12) Source(25, 12) + SourceIndex(0) +6 >Emitted(18, 14) Source(25, 14) + SourceIndex(0) +7 >Emitted(18, 21) Source(25, 21) + SourceIndex(0) +8 >Emitted(18, 23) Source(25, 23) + SourceIndex(0) +9 >Emitted(18, 28) Source(25, 28) + SourceIndex(0) +10>Emitted(18, 30) Source(25, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(25, 45) + SourceIndex(0) +12>Emitted(18, 47) Source(25, 47) + SourceIndex(0) +13>Emitted(18, 48) Source(25, 48) + SourceIndex(0) +14>Emitted(18, 49) Source(25, 49) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +5 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 14) Source(27, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(20, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(20, 8) Source(28, 8) + SourceIndex(0) +5 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +6 >Emitted(20, 14) Source(28, 14) + SourceIndex(0) +7 >Emitted(20, 21) Source(28, 21) + SourceIndex(0) +8 >Emitted(20, 23) Source(28, 23) + SourceIndex(0) +9 >Emitted(20, 28) Source(28, 28) + SourceIndex(0) +10>Emitted(20, 30) Source(28, 30) + SourceIndex(0) +11>Emitted(20, 45) Source(28, 45) + SourceIndex(0) +12>Emitted(20, 47) Source(28, 47) + SourceIndex(0) +13>Emitted(20, 48) Source(28, 48) + SourceIndex(0) +14>Emitted(20, 49) Source(28, 49) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols new file mode 100644 index 00000000000..9b810165c1b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 36)) + +function foo1({ name: nameA }: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 28)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +} +function foo3({ name }: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(name); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 21)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 21)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 21)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types new file mode 100644 index 00000000000..894cd714c73 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -0,0 +1,113 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +function foo1({ name: nameA }: Robot) { +>foo1 : ({ name: nameA }: Robot) => void +>name : any +>nameA : string +>Robot : Robot + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameA : string +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>name : any +>nameB : string +>skill : any +>skillB : string +>Robot : Robot + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameB : string +} +function foo3({ name }: Robot) { +>foo3 : ({ name }: Robot) => void +>name : string +>Robot : Robot + + console.log(name); +>console.log(name) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>name : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ name: nameA }: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1({ name: "Edger", skill: "cutting edges" }) : void +>foo1 : ({ name: nameA }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2({ name: "Edger", skill: "cutting edges" }) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ name }: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3({ name: "Edger", skill: "cutting edges" }) : void +>foo3 : ({ name }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..9fd269c62cc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js @@ -0,0 +1,53 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts] +interface Robot { + name?: string; + skill?: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA = "" }: Robot = { }) { + console.log(nameA); +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + console.log(nameB); +} +function foo3({ name = "" }: Robot = {}) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); + + +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +function foo1(_a) { + var _b = (_a === void 0 ? {} : _a).name, nameA = _b === void 0 ? "" : _b; + console.log(nameA); +} +function foo2(_a) { + var _b = _a === void 0 ? {} : _a, _c = _b.name, nameB = _c === void 0 ? "" : _c, _d = _b.skill, skillB = _d === void 0 ? "noSkill" : _d; + console.log(nameB); +} +function foo3(_a) { + var _b = (_a === void 0 ? {} : _a).name, name = _b === void 0 ? "" : _b; + console.log(name); +} +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..ddf41d9e59f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEvD,cAAc,EAAyC;QAAvC,mCAAwB,EAAxB,uCAAwB;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAmE;QAAnE,4BAAmE,EAAjE,YAAwB,EAAxB,uCAAwB,EAAE,aAAyB,EAAzB,uCAAyB;IAC/D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAiC;QAA/B,mCAAiB,EAAjB,sCAAiB;IAC7B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..555bc560797 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,500 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name?: string; + > skill?: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { name: nameA = "" }: Robot = { } +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(3, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(3, 17) Source(11, 56) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? {} : _a).name, nameA = _b === void 0 ? "" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "" +3 > +4 > name: nameA = "" +1->Emitted(4, 9) Source(11, 17) + SourceIndex(0) +2 >Emitted(4, 44) Source(11, 41) + SourceIndex(0) +3 >Emitted(4, 46) Source(11, 17) + SourceIndex(0) +4 >Emitted(4, 85) Source(11, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot = { }) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(5, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(5, 22) Source(12, 22) + SourceIndex(0) +7 >Emitted(5, 23) Source(12, 23) + SourceIndex(0) +8 >Emitted(5, 24) Source(12, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameB = "", skill: skillB = "noSkill" }: Robot = {} +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 15) Source(14, 15) + SourceIndex(0) +3 >Emitted(7, 17) Source(14, 82) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? {} : _a, _c = _b.name, nameB = _c === void 0 ? "" : _c, _d = _b.skill, skillB = _d === void 0 ? "noSkill" : _d; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name: nameB = "", skill: skillB = "noSkill" }: Robot = {} +3 > +4 > name: nameB = "" +5 > +6 > name: nameB = "" +7 > , +8 > skill: skillB = "noSkill" +9 > +10> skill: skillB = "noSkill" +1->Emitted(8, 9) Source(14, 15) + SourceIndex(0) +2 >Emitted(8, 37) Source(14, 82) + SourceIndex(0) +3 >Emitted(8, 39) Source(14, 17) + SourceIndex(0) +4 >Emitted(8, 51) Source(14, 41) + SourceIndex(0) +5 >Emitted(8, 53) Source(14, 17) + SourceIndex(0) +6 >Emitted(8, 92) Source(14, 41) + SourceIndex(0) +7 >Emitted(8, 94) Source(14, 43) + SourceIndex(0) +8 >Emitted(8, 107) Source(14, 68) + SourceIndex(0) +9 >Emitted(8, 109) Source(14, 43) + SourceIndex(0) +10>Emitted(8, 148) Source(14, 68) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot = {}) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(9, 22) Source(15, 22) + SourceIndex(0) +7 >Emitted(9, 23) Source(15, 23) + SourceIndex(0) +8 >Emitted(9, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { name = "" }: Robot = {} +1->Emitted(11, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(11, 15) Source(17, 15) + SourceIndex(0) +3 >Emitted(11, 17) Source(17, 48) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? {} : _a).name, name = _b === void 0 ? "" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "" +3 > +4 > name = "" +1->Emitted(12, 9) Source(17, 17) + SourceIndex(0) +2 >Emitted(12, 44) Source(17, 34) + SourceIndex(0) +3 >Emitted(12, 46) Source(17, 17) + SourceIndex(0) +4 >Emitted(12, 84) Source(17, 34) + SourceIndex(0) +--- +>>> console.log(name); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1 > }: Robot = {}) { + > +2 > console +3 > . +4 > log +5 > ( +6 > name +7 > ) +8 > ; +1 >Emitted(13, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(13, 21) Source(18, 21) + SourceIndex(0) +7 >Emitted(13, 22) Source(18, 22) + SourceIndex(0) +8 >Emitted(13, 23) Source(18, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(19, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(15, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(15, 12) Source(21, 12) + SourceIndex(0) +5 >Emitted(15, 13) Source(21, 13) + SourceIndex(0) +6 >Emitted(15, 14) Source(21, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(16, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(16, 8) Source(22, 8) + SourceIndex(0) +5 >Emitted(16, 12) Source(22, 12) + SourceIndex(0) +6 >Emitted(16, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(16, 21) Source(22, 21) + SourceIndex(0) +8 >Emitted(16, 23) Source(22, 23) + SourceIndex(0) +9 >Emitted(16, 28) Source(22, 28) + SourceIndex(0) +10>Emitted(16, 30) Source(22, 30) + SourceIndex(0) +11>Emitted(16, 45) Source(22, 45) + SourceIndex(0) +12>Emitted(16, 47) Source(22, 47) + SourceIndex(0) +13>Emitted(16, 48) Source(22, 48) + SourceIndex(0) +14>Emitted(16, 49) Source(22, 49) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(17, 12) Source(24, 12) + SourceIndex(0) +5 >Emitted(17, 13) Source(24, 13) + SourceIndex(0) +6 >Emitted(17, 14) Source(24, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(18, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(18, 8) Source(25, 8) + SourceIndex(0) +5 >Emitted(18, 12) Source(25, 12) + SourceIndex(0) +6 >Emitted(18, 14) Source(25, 14) + SourceIndex(0) +7 >Emitted(18, 21) Source(25, 21) + SourceIndex(0) +8 >Emitted(18, 23) Source(25, 23) + SourceIndex(0) +9 >Emitted(18, 28) Source(25, 28) + SourceIndex(0) +10>Emitted(18, 30) Source(25, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(25, 45) + SourceIndex(0) +12>Emitted(18, 47) Source(25, 47) + SourceIndex(0) +13>Emitted(18, 48) Source(25, 48) + SourceIndex(0) +14>Emitted(18, 49) Source(25, 49) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +5 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 14) Source(27, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(20, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(20, 8) Source(28, 8) + SourceIndex(0) +5 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +6 >Emitted(20, 14) Source(28, 14) + SourceIndex(0) +7 >Emitted(20, 21) Source(28, 21) + SourceIndex(0) +8 >Emitted(20, 23) Source(28, 23) + SourceIndex(0) +9 >Emitted(20, 28) Source(28, 28) + SourceIndex(0) +10>Emitted(20, 30) Source(28, 30) + SourceIndex(0) +11>Emitted(20, 45) Source(28, 45) + SourceIndex(0) +12>Emitted(20, 47) Source(28, 47) + SourceIndex(0) +13>Emitted(20, 48) Source(28, 48) + SourceIndex(0) +14>Emitted(20, 49) Source(28, 49) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..7e3804a5e88 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + name?: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) + + skill?: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 1, 18)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 36)) + +function foo1({ name: nameA = "" }: Robot = { }) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 10, 15)) +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 15)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 1, 18)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 41)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 15)) +} +function foo3({ name = "" }: Robot = {}) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 16, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(name); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 16, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 21, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 21, 21)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 24, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 24, 21)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 27, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 27, 21)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..669708f412f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -0,0 +1,120 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts === +interface Robot { +>Robot : Robot + + name?: string; +>name : string + + skill?: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +function foo1({ name: nameA = "" }: Robot = { }) { +>foo1 : ({ name: nameA = "" }?: Robot) => void +>name : any +>nameA : string +>"" : string +>Robot : Robot +>{ } : {} + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameA : string +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>name : any +>nameB : string +>"" : string +>skill : any +>skillB : string +>"noSkill" : string +>Robot : Robot +>{} : {} + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameB : string +} +function foo3({ name = "" }: Robot = {}) { +>foo3 : ({ name = "" }?: Robot) => void +>name : string +>"" : string +>Robot : Robot +>{} : {} + + console.log(name); +>console.log(name) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>name : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ name: nameA = "" }?: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1({ name: "Edger", skill: "cutting edges" }) : void +>foo1 : ({ name: nameA = "" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2({ name: "Edger", skill: "cutting edges" }) : void +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ name = "" }?: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3({ name: "Edger", skill: "cutting edges" }) : void +>foo3 : ({ name = "" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js new file mode 100644 index 00000000000..faa7b8dcde9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA]: Robot) { + console.log(nameA); +} + +function foo2([numberB]: Robot) { + console.log(numberB); +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { + console.log(nameA2); +} + +function foo4([numberA3, ...robotAInfo]: Robot) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +function foo1(_a) { + var nameA = _a[1]; + console.log(nameA); +} +function foo2(_a) { + var numberB = _a[0]; + console.log(numberB); +} +function foo3(_a) { + var numberA2 = _a[0], nameA2 = _a[1], skillA2 = _a[2]; + console.log(nameA2); +} +function foo4(_a) { + var numberA3 = _a[0], robotAInfo = _a.slice(1); + console.log(robotAInfo); +} +foo1(robotA); +foo1([2, "trimmer", "trimming"]); +foo2(robotA); +foo2([2, "trimmer", "trimming"]); +foo3(robotA); +foo3([2, "trimmer", "trimming"]); +foo4(robotA); +foo4([2, "trimmer", "trimming"]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map new file mode 100644 index 00000000000..246a2da30a4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE3C,cAAc,EAAgB;QAAb,aAAK;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,cAAc,EAAgB;QAAf,eAAO;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,cAAc,EAAkC;QAAjC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IACpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAgC;QAA/B,gBAAQ,EAAE,wBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..098cb5058a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt @@ -0,0 +1,558 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, nameA]: Robot +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 31) + SourceIndex(0) +--- +>>> var nameA = _a[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > nameA +1->Emitted(3, 9) Source(7, 18) + SourceIndex(0) +2 >Emitted(3, 22) Source(7, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 22) Source(8, 22) + SourceIndex(0) +7 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +8 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [numberB]: Robot +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 31) + SourceIndex(0) +--- +>>> var numberB = _a[0]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > numberB +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 24) Source(11, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +7 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +8 >Emitted(8, 26) Source(12, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [numberA2, nameA2, skillA2]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 49) + SourceIndex(0) +--- +>>> var numberA2 = _a[0], nameA2 = _a[1], skillA2 = _a[2]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +1-> +2 > numberA2 +3 > , +4 > nameA2 +5 > , +6 > skillA2 +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 25) Source(15, 24) + SourceIndex(0) +3 >Emitted(11, 27) Source(15, 26) + SourceIndex(0) +4 >Emitted(11, 41) Source(15, 32) + SourceIndex(0) +5 >Emitted(11, 43) Source(15, 34) + SourceIndex(0) +6 >Emitted(11, 58) Source(15, 41) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [numberA3, ...robotAInfo]: Robot +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 47) + SourceIndex(0) +--- +>>> var numberA3 = _a[0], robotAInfo = _a.slice(1); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberA3 +3 > , +4 > ...robotAInfo +1->Emitted(15, 9) Source(19, 16) + SourceIndex(0) +2 >Emitted(15, 25) Source(19, 24) + SourceIndex(0) +3 >Emitted(15, 27) Source(19, 26) + SourceIndex(0) +4 >Emitted(15, 51) Source(19, 39) + SourceIndex(0) +--- +>>> console.log(robotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > robotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 27) Source(20, 27) + SourceIndex(0) +7 >Emitted(16, 28) Source(20, 28) + SourceIndex(0) +8 >Emitted(16, 29) Source(20, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 8) Source(24, 8) + SourceIndex(0) +6 >Emitted(19, 10) Source(24, 10) + SourceIndex(0) +7 >Emitted(19, 19) Source(24, 19) + SourceIndex(0) +8 >Emitted(19, 21) Source(24, 21) + SourceIndex(0) +9 >Emitted(19, 31) Source(24, 31) + SourceIndex(0) +10>Emitted(19, 32) Source(24, 32) + SourceIndex(0) +11>Emitted(19, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(19, 34) Source(24, 34) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 8) Source(27, 8) + SourceIndex(0) +6 >Emitted(21, 10) Source(27, 10) + SourceIndex(0) +7 >Emitted(21, 19) Source(27, 19) + SourceIndex(0) +8 >Emitted(21, 21) Source(27, 21) + SourceIndex(0) +9 >Emitted(21, 31) Source(27, 31) + SourceIndex(0) +10>Emitted(21, 32) Source(27, 32) + SourceIndex(0) +11>Emitted(21, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(21, 34) Source(27, 34) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 8) Source(30, 8) + SourceIndex(0) +6 >Emitted(23, 10) Source(30, 10) + SourceIndex(0) +7 >Emitted(23, 19) Source(30, 19) + SourceIndex(0) +8 >Emitted(23, 21) Source(30, 21) + SourceIndex(0) +9 >Emitted(23, 31) Source(30, 31) + SourceIndex(0) +10>Emitted(23, 32) Source(30, 32) + SourceIndex(0) +11>Emitted(23, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(23, 34) Source(30, 34) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 8) Source(33, 8) + SourceIndex(0) +6 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) +7 >Emitted(25, 19) Source(33, 19) + SourceIndex(0) +8 >Emitted(25, 21) Source(33, 21) + SourceIndex(0) +9 >Emitted(25, 31) Source(33, 31) + SourceIndex(0) +10>Emitted(25, 32) Source(33, 32) + SourceIndex(0) +11>Emitted(25, 33) Source(33, 33) + SourceIndex(0) +12>Emitted(25, 34) Source(33, 34) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols new file mode 100644 index 00000000000..a1370b132c2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + +function foo1([, nameA]: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 6, 16)) +} + +function foo2([numberB]: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 10, 15)) +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 15)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 32)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 24)) +} + +function foo4([numberA3, ...robotAInfo]: Robot) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 15)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 24)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(robotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 24)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo1([2, "trimmer", "trimming"]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo2([2, "trimmer", "trimming"]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo3([2, "trimmer", "trimming"]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo4([2, "trimmer", "trimming"]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types new file mode 100644 index 00000000000..9c695f1c0dd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function foo1([, nameA]: Robot) { +>foo1 : ([, nameA]: [number, string, string]) => void +> : undefined +>nameA : string +>Robot : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +function foo2([numberB]: Robot) { +>foo2 : ([numberB]: [number, string, string]) => void +>numberB : number +>Robot : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>numberA2 : number +>nameA2 : string +>skillA2 : string +>Robot : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} + +function foo4([numberA3, ...robotAInfo]: Robot) { +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>numberA3 : number +>robotAInfo : (number | string)[] +>Robot : [number, string, string] + + console.log(robotAInfo); +>console.log(robotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>robotAInfo : (number | string)[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, nameA]: [number, string, string]) => void +>robotA : [number, string, string] + +foo1([2, "trimmer", "trimming"]); +>foo1([2, "trimmer", "trimming"]) : void +>foo1 : ([, nameA]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([numberB]: [number, string, string]) => void +>robotA : [number, string, string] + +foo2([2, "trimmer", "trimming"]); +>foo2([2, "trimmer", "trimming"]) : void +>foo2 : ([numberB]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>robotA : [number, string, string] + +foo3([2, "trimmer", "trimming"]); +>foo3([2, "trimmer", "trimming"]) : void +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>robotA : [number, string, string] + +foo4([2, "trimmer", "trimming"]); +>foo4([2, "trimmer", "trimming"]) : void +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js new file mode 100644 index 00000000000..0aa302e0990 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [string, [string, string]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA]: Robot) { + console.log(skillA); +} + +function foo2([nameMB]: Robot) { + console.log(nameMB); +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + console.log(nameMA); +} + +function foo4([...multiRobotAInfo]: Robot) { + console.log(multiRobotAInfo); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.js] +var robotA = ["trimmer", ["trimming", "edging"]]; +function foo1(_a) { + var skillA = _a[1]; + console.log(skillA); +} +function foo2(_a) { + var nameMB = _a[0]; + console.log(nameMB); +} +function foo3(_a) { + var nameMA = _a[0], _b = _a[1], primarySkillA = _b[0], secondarySkillA = _b[1]; + console.log(nameMA); +} +function foo4(_a) { + var multiRobotAInfo = _a.slice(0); + console.log(multiRobotAInfo); +} +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map new file mode 100644 index 00000000000..b242ccd9114 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExD,cAAc,EAAiB;QAAd,cAAM;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAe;QAAd,cAAM;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAiD;QAAhD,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IAClD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA2B;QAA1B,6BAAkB;IAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..491e5025ecd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,588 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = ["trimmer", ["trimming", "edging"]]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [string, [string, string]]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 24) Source(5, 31) + SourceIndex(0) +7 >Emitted(1, 26) Source(5, 33) + SourceIndex(0) +8 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +9 >Emitted(1, 37) Source(5, 44) + SourceIndex(0) +10>Emitted(1, 39) Source(5, 46) + SourceIndex(0) +11>Emitted(1, 47) Source(5, 54) + SourceIndex(0) +12>Emitted(1, 48) Source(5, 55) + SourceIndex(0) +13>Emitted(1, 49) Source(5, 56) + SourceIndex(0) +14>Emitted(1, 50) Source(5, 57) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, skillA]: Robot +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 32) + SourceIndex(0) +--- +>>> var skillA = _a[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > skillA +1->Emitted(3, 9) Source(7, 18) + SourceIndex(0) +2 >Emitted(3, 23) Source(7, 24) + SourceIndex(0) +--- +>>> console.log(skillA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > ) +8 > ; +1->Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +8 >Emitted(4, 25) Source(8, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [nameMB]: Robot +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 30) + SourceIndex(0) +--- +>>> var nameMB = _a[0]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > nameMB +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 23) Source(11, 22) + SourceIndex(0) +--- +>>> console.log(nameMB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMB +7 > ) +8 > ; +1->Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(12, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [nameMA, [primarySkillA, secondarySkillA]]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 64) + SourceIndex(0) +--- +>>> var nameMA = _a[0], _b = _a[1], primarySkillA = _b[0], secondarySkillA = _b[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMA +3 > , +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 23) Source(15, 22) + SourceIndex(0) +3 >Emitted(11, 25) Source(15, 24) + SourceIndex(0) +4 >Emitted(11, 35) Source(15, 56) + SourceIndex(0) +5 >Emitted(11, 37) Source(15, 25) + SourceIndex(0) +6 >Emitted(11, 58) Source(15, 38) + SourceIndex(0) +7 >Emitted(11, 60) Source(15, 40) + SourceIndex(0) +8 >Emitted(11, 83) Source(15, 55) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [...multiRobotAInfo]: Robot +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 42) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _a.slice(0); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > ...multiRobotAInfo +1->Emitted(15, 9) Source(19, 16) + SourceIndex(0) +2 >Emitted(15, 38) Source(19, 34) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 32) Source(20, 32) + SourceIndex(0) +7 >Emitted(16, 33) Source(20, 33) + SourceIndex(0) +8 >Emitted(16, 34) Source(20, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 15) Source(24, 15) + SourceIndex(0) +6 >Emitted(19, 17) Source(24, 17) + SourceIndex(0) +7 >Emitted(19, 18) Source(24, 18) + SourceIndex(0) +8 >Emitted(19, 26) Source(24, 26) + SourceIndex(0) +9 >Emitted(19, 28) Source(24, 28) + SourceIndex(0) +10>Emitted(19, 37) Source(24, 37) + SourceIndex(0) +11>Emitted(19, 38) Source(24, 38) + SourceIndex(0) +12>Emitted(19, 39) Source(24, 39) + SourceIndex(0) +13>Emitted(19, 40) Source(24, 40) + SourceIndex(0) +14>Emitted(19, 41) Source(24, 41) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 15) Source(27, 15) + SourceIndex(0) +6 >Emitted(21, 17) Source(27, 17) + SourceIndex(0) +7 >Emitted(21, 18) Source(27, 18) + SourceIndex(0) +8 >Emitted(21, 26) Source(27, 26) + SourceIndex(0) +9 >Emitted(21, 28) Source(27, 28) + SourceIndex(0) +10>Emitted(21, 37) Source(27, 37) + SourceIndex(0) +11>Emitted(21, 38) Source(27, 38) + SourceIndex(0) +12>Emitted(21, 39) Source(27, 39) + SourceIndex(0) +13>Emitted(21, 40) Source(27, 40) + SourceIndex(0) +14>Emitted(21, 41) Source(27, 41) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 15) Source(30, 15) + SourceIndex(0) +6 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +7 >Emitted(23, 18) Source(30, 18) + SourceIndex(0) +8 >Emitted(23, 26) Source(30, 26) + SourceIndex(0) +9 >Emitted(23, 28) Source(30, 28) + SourceIndex(0) +10>Emitted(23, 37) Source(30, 37) + SourceIndex(0) +11>Emitted(23, 38) Source(30, 38) + SourceIndex(0) +12>Emitted(23, 39) Source(30, 39) + SourceIndex(0) +13>Emitted(23, 40) Source(30, 40) + SourceIndex(0) +14>Emitted(23, 41) Source(30, 41) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 15) Source(33, 15) + SourceIndex(0) +6 >Emitted(25, 17) Source(33, 17) + SourceIndex(0) +7 >Emitted(25, 18) Source(33, 18) + SourceIndex(0) +8 >Emitted(25, 26) Source(33, 26) + SourceIndex(0) +9 >Emitted(25, 28) Source(33, 28) + SourceIndex(0) +10>Emitted(25, 37) Source(33, 37) + SourceIndex(0) +11>Emitted(25, 38) Source(33, 38) + SourceIndex(0) +12>Emitted(25, 39) Source(33, 39) + SourceIndex(0) +13>Emitted(25, 40) Source(33, 40) + SourceIndex(0) +14>Emitted(25, 41) Source(33, 41) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols new file mode 100644 index 00000000000..26797210f4b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [string, [string, string]]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + +function foo1([, skillA]: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(skillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 6, 16)) +} + +function foo2([nameMB]: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(nameMB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 10, 15)) +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 15)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 24)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 38)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 15)) +} + +function foo4([...multiRobotAInfo]: Robot) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 18, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 18, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo4(["roomba", ["vaccum", "mopping"]]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types new file mode 100644 index 00000000000..b3e09d962c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -0,0 +1,131 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [string, [string, string]]; +>Robot : [string, [string, string]] + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : [string, [string, string]] +>Robot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function foo1([, skillA]: Robot) { +>foo1 : ([, skillA]: [string, [string, string]]) => void +> : undefined +>skillA : [string, string] +>Robot : [string, [string, string]] + + console.log(skillA); +>console.log(skillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillA : [string, string] +} + +function foo2([nameMB]: Robot) { +>foo2 : ([nameMB]: [string, [string, string]]) => void +>nameMB : string +>Robot : [string, [string, string]] + + console.log(nameMB); +>console.log(nameMB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMB : string +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>Robot : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +function foo4([...multiRobotAInfo]: Robot) { +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>multiRobotAInfo : (string | [string, string])[] +>Robot : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, skillA]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1(["roomba", ["vaccum", "mopping"]]) : void +>foo1 : ([, skillA]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([nameMB]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2(["roomba", ["vaccum", "mopping"]]) : void +>foo2 : ([nameMB]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3(["roomba", ["vaccum", "mopping"]]) : void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo4(["roomba", ["vaccum", "mopping"]]); +>foo4(["roomba", ["vaccum", "mopping"]]) : void +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..327791a6416 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + console.log(nameA); +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + console.log(numberB); +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + console.log(nameA2); +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +function foo1(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[1], nameA = _c === void 0 ? "noName" : _c; + console.log(nameA); +} +function foo2(_a) { + var _b = (_a === void 0 ? [-1, "name", "skill"] : _a)[0], numberB = _b === void 0 ? -1 : _b; + console.log(numberB); +} +function foo3(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA2 = _c === void 0 ? -1 : _c, _d = _b[1], nameA2 = _d === void 0 ? "name" : _d, _e = _b[2], skillA2 = _e === void 0 ? "skill" : _e; + console.log(nameA2); +} +function foo4(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA3 = _c === void 0 ? -1 : _c, robotAInfo = _b.slice(1); + console.log(robotAInfo); +} +foo1(robotA); +foo1([2, "trimmer", "trimming"]); +foo2(robotA); +foo2([2, "trimmer", "trimming"]); +foo3(robotA); +foo3([2, "trimmer", "trimming"]); +foo4(robotA); +foo4([2, "trimmer", "trimming"]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..7fdda34358b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE3C,cAAc,EAAmD;QAAnD,+CAAmD,EAAhD,UAAgB,EAAhB,qCAAgB;IAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,cAAc,EAA6C;QAA5C,oDAAY,EAAZ,iCAAY;IACvB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,cAAc,EAAkF;QAAlF,+CAAkF,EAAjF,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB;IAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA6D;QAA7D,+CAA6D,EAA5D,UAAa,EAAb,kCAAa,EAAE,wBAAa;IACvC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..250d7ec2931 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,610 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, nameA = "noName"]: Robot = [-1, "name", "skill"] +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 66) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[1], nameA = _c === void 0 ? "noName" : _c; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"]: Robot = [-1, "name", "skill"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(3, 9) Source(7, 15) + SourceIndex(0) +2 >Emitted(3, 56) Source(7, 66) + SourceIndex(0) +3 >Emitted(3, 58) Source(7, 18) + SourceIndex(0) +4 >Emitted(3, 68) Source(7, 34) + SourceIndex(0) +5 >Emitted(3, 70) Source(7, 18) + SourceIndex(0) +6 >Emitted(3, 107) Source(7, 34) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 22) Source(8, 22) + SourceIndex(0) +7 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +8 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [numberB = -1]: Robot = [-1, "name", "skill"] +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 60) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? [-1, "name", "skill"] : _a)[0], numberB = _b === void 0 ? -1 : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 61) Source(11, 28) + SourceIndex(0) +3 >Emitted(7, 63) Source(11, 16) + SourceIndex(0) +4 >Emitted(7, 96) Source(11, 28) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +7 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +8 >Emitted(8, 26) Source(12, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"] +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 97) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA2 = _c === void 0 ? -1 : _c, _d = _b[1], nameA2 = _d === void 0 ? "name" : _d, _e = _b[2], skillA2 = _e === void 0 ? "skill" : _e; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "name" +9 > +10> nameA2 = "name" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(11, 9) Source(15, 15) + SourceIndex(0) +2 >Emitted(11, 56) Source(15, 97) + SourceIndex(0) +3 >Emitted(11, 58) Source(15, 16) + SourceIndex(0) +4 >Emitted(11, 68) Source(15, 29) + SourceIndex(0) +5 >Emitted(11, 70) Source(15, 16) + SourceIndex(0) +6 >Emitted(11, 104) Source(15, 29) + SourceIndex(0) +7 >Emitted(11, 106) Source(15, 31) + SourceIndex(0) +8 >Emitted(11, 116) Source(15, 46) + SourceIndex(0) +9 >Emitted(11, 118) Source(15, 31) + SourceIndex(0) +10>Emitted(11, 154) Source(15, 46) + SourceIndex(0) +11>Emitted(11, 156) Source(15, 48) + SourceIndex(0) +12>Emitted(11, 166) Source(15, 65) + SourceIndex(0) +13>Emitted(11, 168) Source(15, 48) + SourceIndex(0) +14>Emitted(11, 206) Source(15, 65) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"] +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 76) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA3 = _c === void 0 ? -1 : _c, robotAInfo = _b.slice(1); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(15, 9) Source(19, 15) + SourceIndex(0) +2 >Emitted(15, 56) Source(19, 76) + SourceIndex(0) +3 >Emitted(15, 58) Source(19, 16) + SourceIndex(0) +4 >Emitted(15, 68) Source(19, 29) + SourceIndex(0) +5 >Emitted(15, 70) Source(19, 16) + SourceIndex(0) +6 >Emitted(15, 104) Source(19, 29) + SourceIndex(0) +7 >Emitted(15, 106) Source(19, 31) + SourceIndex(0) +8 >Emitted(15, 130) Source(19, 44) + SourceIndex(0) +--- +>>> console.log(robotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > robotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 27) Source(20, 27) + SourceIndex(0) +7 >Emitted(16, 28) Source(20, 28) + SourceIndex(0) +8 >Emitted(16, 29) Source(20, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 8) Source(24, 8) + SourceIndex(0) +6 >Emitted(19, 10) Source(24, 10) + SourceIndex(0) +7 >Emitted(19, 19) Source(24, 19) + SourceIndex(0) +8 >Emitted(19, 21) Source(24, 21) + SourceIndex(0) +9 >Emitted(19, 31) Source(24, 31) + SourceIndex(0) +10>Emitted(19, 32) Source(24, 32) + SourceIndex(0) +11>Emitted(19, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(19, 34) Source(24, 34) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 8) Source(27, 8) + SourceIndex(0) +6 >Emitted(21, 10) Source(27, 10) + SourceIndex(0) +7 >Emitted(21, 19) Source(27, 19) + SourceIndex(0) +8 >Emitted(21, 21) Source(27, 21) + SourceIndex(0) +9 >Emitted(21, 31) Source(27, 31) + SourceIndex(0) +10>Emitted(21, 32) Source(27, 32) + SourceIndex(0) +11>Emitted(21, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(21, 34) Source(27, 34) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 8) Source(30, 8) + SourceIndex(0) +6 >Emitted(23, 10) Source(30, 10) + SourceIndex(0) +7 >Emitted(23, 19) Source(30, 19) + SourceIndex(0) +8 >Emitted(23, 21) Source(30, 21) + SourceIndex(0) +9 >Emitted(23, 31) Source(30, 31) + SourceIndex(0) +10>Emitted(23, 32) Source(30, 32) + SourceIndex(0) +11>Emitted(23, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(23, 34) Source(30, 34) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 8) Source(33, 8) + SourceIndex(0) +6 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) +7 >Emitted(25, 19) Source(33, 19) + SourceIndex(0) +8 >Emitted(25, 21) Source(33, 21) + SourceIndex(0) +9 >Emitted(25, 31) Source(33, 31) + SourceIndex(0) +10>Emitted(25, 32) Source(33, 32) + SourceIndex(0) +11>Emitted(25, 33) Source(33, 33) + SourceIndex(0) +12>Emitted(25, 34) Source(33, 34) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..e3502b769a8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 6, 16)) +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 10, 15)) +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 15)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 29)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 46)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 29)) +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 15)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 29)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(robotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 29)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo1([2, "trimmer", "trimming"]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo2([2, "trimmer", "trimming"]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo3([2, "trimmer", "trimming"]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo4([2, "trimmer", "trimming"]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..8e12e876b1d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -0,0 +1,156 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +> : undefined +>nameA : string +>"noName" : string +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>numberB : number +>-1 : number +>1 : number +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(robotAInfo); +>console.log(robotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>robotAInfo : (number | string)[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo1([2, "trimmer", "trimming"]); +>foo1([2, "trimmer", "trimming"]) : void +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo2([2, "trimmer", "trimming"]); +>foo2([2, "trimmer", "trimming"]) : void +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo3([2, "trimmer", "trimming"]); +>foo3([2, "trimmer", "trimming"]) : void +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo4([2, "trimmer", "trimming"]); +>foo4([2, "trimmer", "trimming"]) : void +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..81add872b0d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js @@ -0,0 +1,52 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [string, string[]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + console.log(skillA); +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + console.log(nameMB); +} + +function foo3([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: Robot) { + console.log(nameMA); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js] +var robotA = ["trimmer", ["trimming", "edging"]]; +function foo1(_a) { + var _b = _a === void 0 ? ["name", ["skill1", "skill2"]] : _a, _c = _b[1], skillA = _c === void 0 ? ["noSkill", "noSkill"] : _c; + console.log(skillA); +} +function foo2(_a) { + var _b = (_a === void 0 ? ["name", ["skill1", "skill2"]] : _a)[0], nameMB = _b === void 0 ? "noName" : _b; + console.log(nameMB); +} +function foo3(_a) { + var _b = _a[0], nameMA = _b === void 0 ? "noName" : _b, _c = _a[1], _d = _c === void 0 ? ["noSkill", "noSkill"] : _c, _e = _d[0], primarySkillA = _e === void 0 ? "primary" : _e, _f = _d[1], secondarySkillA = _f === void 0 ? "secondary" : _f; + console.log(nameMA); +} +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..a489a3e41bf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExD,cAAc,EAA0E;QAA1E,wDAA0E,EAAvE,UAA+B,EAA/B,oDAA+B;IAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA2D;QAA1D,6DAAiB,EAAjB,sCAAiB;IAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAGoB;QAHnB,UAAiB,EAAjB,sCAAiB,EAAE,UAGR,EAHQ,gDAGR,EAFtB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..28f94da65a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = ["trimmer", ["trimming", "edging"]]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [string, string[]]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 24) Source(5, 31) + SourceIndex(0) +7 >Emitted(1, 26) Source(5, 33) + SourceIndex(0) +8 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +9 >Emitted(1, 37) Source(5, 44) + SourceIndex(0) +10>Emitted(1, 39) Source(5, 46) + SourceIndex(0) +11>Emitted(1, 47) Source(5, 54) + SourceIndex(0) +12>Emitted(1, 48) Source(5, 55) + SourceIndex(0) +13>Emitted(1, 49) Source(5, 56) + SourceIndex(0) +14>Emitted(1, 50) Source(5, 57) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]] +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 89) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? ["name", ["skill1", "skill2"]] : _a, _c = _b[1], skillA = _c === void 0 ? ["noSkill", "noSkill"] : _c; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]] +3 > +4 > skillA = ["noSkill", "noSkill"] +5 > +6 > skillA = ["noSkill", "noSkill"] +1->Emitted(3, 9) Source(7, 15) + SourceIndex(0) +2 >Emitted(3, 65) Source(7, 89) + SourceIndex(0) +3 >Emitted(3, 67) Source(7, 18) + SourceIndex(0) +4 >Emitted(3, 77) Source(7, 49) + SourceIndex(0) +5 >Emitted(3, 79) Source(7, 18) + SourceIndex(0) +6 >Emitted(3, 131) Source(7, 49) + SourceIndex(0) +--- +>>> console.log(skillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot= ["name", ["skill1", "skill2"]]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +8 >Emitted(4, 25) Source(8, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]] +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 74) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? ["name", ["skill1", "skill2"]] : _a)[0], nameMB = _b === void 0 ? "noName" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMB = "noName" +3 > +4 > nameMB = "noName" +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 70) Source(11, 33) + SourceIndex(0) +3 >Emitted(7, 72) Source(11, 16) + SourceIndex(0) +4 >Emitted(7, 110) Source(11, 33) + SourceIndex(0) +--- +>>> console.log(nameMB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = ["name", ["skill1", "skill2"]]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(12, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"]]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(18, 35) + SourceIndex(0) +--- +>>> var _b = _a[0], nameMA = _b === void 0 ? "noName" : _b, _c = _a[1], _d = _c === void 0 ? ["noSkill", "noSkill"] : _c, _e = _d[0], primarySkillA = _e === void 0 ? "primary" : _e, _f = _d[1], secondarySkillA = _f === void 0 ? "secondary" : _f; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMA = "noName" +3 > +4 > nameMA = "noName" +5 > , +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"] +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , + > +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 19) Source(15, 33) + SourceIndex(0) +3 >Emitted(11, 21) Source(15, 16) + SourceIndex(0) +4 >Emitted(11, 59) Source(15, 33) + SourceIndex(0) +5 >Emitted(11, 61) Source(15, 35) + SourceIndex(0) +6 >Emitted(11, 71) Source(18, 27) + SourceIndex(0) +7 >Emitted(11, 73) Source(15, 35) + SourceIndex(0) +8 >Emitted(11, 121) Source(18, 27) + SourceIndex(0) +9 >Emitted(11, 123) Source(16, 5) + SourceIndex(0) +10>Emitted(11, 133) Source(16, 30) + SourceIndex(0) +11>Emitted(11, 135) Source(16, 5) + SourceIndex(0) +12>Emitted(11, 181) Source(16, 30) + SourceIndex(0) +13>Emitted(11, 183) Source(17, 5) + SourceIndex(0) +14>Emitted(11, 193) Source(17, 34) + SourceIndex(0) +15>Emitted(11, 195) Source(17, 5) + SourceIndex(0) +16>Emitted(11, 245) Source(17, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["noSkill", "noSkill"]]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(19, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(19, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(19, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(20, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(22, 14) + SourceIndex(0) +--- +>>>foo1(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(15, 7) Source(23, 7) + SourceIndex(0) +5 >Emitted(15, 15) Source(23, 15) + SourceIndex(0) +6 >Emitted(15, 17) Source(23, 17) + SourceIndex(0) +7 >Emitted(15, 18) Source(23, 18) + SourceIndex(0) +8 >Emitted(15, 26) Source(23, 26) + SourceIndex(0) +9 >Emitted(15, 28) Source(23, 28) + SourceIndex(0) +10>Emitted(15, 37) Source(23, 37) + SourceIndex(0) +11>Emitted(15, 38) Source(23, 38) + SourceIndex(0) +12>Emitted(15, 39) Source(23, 39) + SourceIndex(0) +13>Emitted(15, 40) Source(23, 40) + SourceIndex(0) +14>Emitted(15, 41) Source(23, 41) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(25, 14) + SourceIndex(0) +--- +>>>foo2(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(17, 7) Source(26, 7) + SourceIndex(0) +5 >Emitted(17, 15) Source(26, 15) + SourceIndex(0) +6 >Emitted(17, 17) Source(26, 17) + SourceIndex(0) +7 >Emitted(17, 18) Source(26, 18) + SourceIndex(0) +8 >Emitted(17, 26) Source(26, 26) + SourceIndex(0) +9 >Emitted(17, 28) Source(26, 28) + SourceIndex(0) +10>Emitted(17, 37) Source(26, 37) + SourceIndex(0) +11>Emitted(17, 38) Source(26, 38) + SourceIndex(0) +12>Emitted(17, 39) Source(26, 39) + SourceIndex(0) +13>Emitted(17, 40) Source(26, 40) + SourceIndex(0) +14>Emitted(17, 41) Source(26, 41) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(28, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(28, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(28, 14) + SourceIndex(0) +--- +>>>foo3(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(19, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(29, 7) + SourceIndex(0) +5 >Emitted(19, 15) Source(29, 15) + SourceIndex(0) +6 >Emitted(19, 17) Source(29, 17) + SourceIndex(0) +7 >Emitted(19, 18) Source(29, 18) + SourceIndex(0) +8 >Emitted(19, 26) Source(29, 26) + SourceIndex(0) +9 >Emitted(19, 28) Source(29, 28) + SourceIndex(0) +10>Emitted(19, 37) Source(29, 37) + SourceIndex(0) +11>Emitted(19, 38) Source(29, 38) + SourceIndex(0) +12>Emitted(19, 39) Source(29, 39) + SourceIndex(0) +13>Emitted(19, 40) Source(29, 40) + SourceIndex(0) +14>Emitted(19, 41) Source(29, 41) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..923e8327e6c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [string, string[]]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(skillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 6, 16)) +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(nameMB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 10, 15)) +} + +function foo3([nameMA = "noName", [ +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 15)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 35)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 15, 30)) + +] = ["noSkill", "noSkill"]]: Robot) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..52423dfce21 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -0,0 +1,139 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [string, string[]]; +>Robot : [string, string[]] + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : [string, string[]] +>Robot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +> : undefined +>skillA : string[] +>["noSkill", "noSkill"] : string[] +>"noSkill" : string +>"noSkill" : string +>Robot : [string, string[]] +>["name", ["skill1", "skill2"]] : [string, string[]] +>"name" : string +>["skill1", "skill2"] : string[] +>"skill1" : string +>"skill2" : string + + console.log(skillA); +>console.log(skillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillA : string[] +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>nameMB : string +>"noName" : string +>Robot : [string, string[]] +>["name", ["skill1", "skill2"]] : [string, string[]] +>"name" : string +>["skill1", "skill2"] : string[] +>"skill1" : string +>"skill2" : string + + console.log(nameMB); +>console.log(nameMB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMB : string +} + +function foo3([nameMA = "noName", [ +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["noSkill", "noSkill"]]: Robot) { +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>Robot : [string, string[]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>robotA : [string, string[]] + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1(["roomba", ["vaccum", "mopping"]]) : void +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>robotA : [string, string[]] + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2(["roomba", ["vaccum", "mopping"]]) : void +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>robotA : [string, string[]] + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3(["roomba", ["vaccum", "mopping"]]) : void +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js new file mode 100644 index 00000000000..4bd4feab384 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatement.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA } = robotA; +var { name: nameB, skill: skillB } = robotB; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatement.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var nameA = robotA.name; +var nameB = robotB.name, skillB = robotB.skill; +var _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map new file mode 100644 index 00000000000..17d9a9b0411 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatement.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,uBAAW,CAAY;AACvB,uBAAW,EAAE,qBAAa,CAAY;AAC5C,IAAA,8CAA8E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAC/E,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt new file mode 100644 index 00000000000..f066ec465cf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt @@ -0,0 +1,313 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatement.js +mapUrl: sourceMapValidationDestructuringVariableStatement.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatement.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.js +sourceFile:sourceMapValidationDestructuringVariableStatement.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var nameA = robotA.name; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >var { +2 >name: nameA +3 > } = robotA; +1 >Emitted(4, 1) Source(11, 7) + SourceIndex(0) +2 >Emitted(4, 24) Source(11, 18) + SourceIndex(0) +3 >Emitted(4, 25) Source(11, 30) + SourceIndex(0) +--- +>>>var nameB = robotB.name, skillB = robotB.skill; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skill: skillB +5 > } = robotB; +1->Emitted(5, 1) Source(12, 7) + SourceIndex(0) +2 >Emitted(5, 24) Source(12, 18) + SourceIndex(0) +3 >Emitted(5, 26) Source(12, 20) + SourceIndex(0) +4 >Emitted(5, 47) Source(12, 33) + SourceIndex(0) +5 >Emitted(5, 48) Source(12, 45) + SourceIndex(0) +--- +>>>var _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 > +3 > var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC +6 > , +7 > skill: skillC +8 > } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 79) + SourceIndex(0) +4 >Emitted(6, 53) Source(13, 7) + SourceIndex(0) +5 >Emitted(6, 68) Source(13, 18) + SourceIndex(0) +6 >Emitted(6, 70) Source(13, 20) + SourceIndex(0) +7 >Emitted(6, 87) Source(13, 33) + SourceIndex(0) +8 >Emitted(6, 88) Source(13, 80) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) +3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) +4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) +9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) +10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) +4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(18, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols new file mode 100644 index 00000000000..3d8e925d8b3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatement.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 38)) + +var { name: nameA } = robotA; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 10, 5)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 3)) + +var { name: nameB, skill: skillB } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 5)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 3)) + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 38)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 5)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 53)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 18)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 38)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 53)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 10, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 5)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 18)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types new file mode 100644 index 00000000000..82a2ffe88f6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types @@ -0,0 +1,82 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var { name: nameA } = robotA; +>name : any +>nameA : string +>robotA : Robot + +var { name: nameB, skill: skillB } = robotB; +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js new file mode 100644 index 00000000000..cdf4451195e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js @@ -0,0 +1,49 @@ +//// [sourceMapValidationDestructuringVariableStatement1.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var a: string, { name: nameA } = robotA; +var b: string, { name: nameB, skill: skillB } = robotB; +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + +var { name: nameA } = robotA, a = hello; +var { name: nameB, skill: skillB } = robotB, b = " hello"; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + +var a = hello, { name: nameA } = robotA, a1= "hello"; +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatement1.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var a, nameA = robotA.name; +var b, nameB = robotB.name, skillB = robotB.skill; +var c, _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +var nameA = robotA.name, a = hello; +var nameB = robotB.name, skillB = robotB.skill, b = " hello"; +var _b = { name: "Edger", skill: "cutting edges" }, nameC = _b.name, skillC = _b.skill, c = hello; +var a = hello, nameA = robotA.name, a1 = "hello"; +var b = hello, nameB = robotB.name, skillB = robotB.skill, b1 = "hello"; +var c = hello, _c = { name: "Edger", skill: "cutting edges" }, nameC = _c.name, skillC = _c.skill, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map new file mode 100644 index 00000000000..cc2ae54143d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatement1.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement1.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC3D,IAAI,CAAS,EAAI,mBAAW,CAAY;AACxC,IAAI,CAAS,EAAI,mBAAW,EAAE,qBAAa,CAAY;AACvD,IAAI,CAAS,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAEpF,uBAAW,EAAa,CAAC,GAAG,KAAK,CAAC;AAClC,uBAAW,EAAE,qBAAa,EAAa,CAAC,GAAG,QAAQ,CAAC;AAC1D,IAAA,8CAA8E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,CAAC,GAAG,KAAK,CAAC;AAE1F,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAa,EAAE,GAAE,OAAO,CAAC;AACrD,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAE,qBAAa,EAAa,EAAE,GAAG,OAAO,CAAC;AACrE,IAAI,CAAC,GAAG,KAAK,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,EAAE,GAAG,KAAK,CAAC;AACtG,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt new file mode 100644 index 00000000000..70407ad9f81 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt @@ -0,0 +1,571 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatement1.js +mapUrl: sourceMapValidationDestructuringVariableStatement1.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatement1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.js +sourceFile:sourceMapValidationDestructuringVariableStatement1.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var a, nameA = robotA.name; +1 > +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > a: string +4 > , { +5 > name: nameA +6 > } = robotA; +1 >Emitted(4, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(4, 6) Source(11, 14) + SourceIndex(0) +4 >Emitted(4, 8) Source(11, 18) + SourceIndex(0) +5 >Emitted(4, 27) Source(11, 29) + SourceIndex(0) +6 >Emitted(4, 28) Source(11, 41) + SourceIndex(0) +--- +>>>var b, nameB = robotB.name, skillB = robotB.skill; +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > b: string +4 > , { +5 > name: nameB +6 > , +7 > skill: skillB +8 > } = robotB; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 6) Source(12, 14) + SourceIndex(0) +4 >Emitted(5, 8) Source(12, 18) + SourceIndex(0) +5 >Emitted(5, 27) Source(12, 29) + SourceIndex(0) +6 >Emitted(5, 29) Source(12, 31) + SourceIndex(0) +7 >Emitted(5, 50) Source(12, 44) + SourceIndex(0) +8 >Emitted(5, 51) Source(12, 56) + SourceIndex(0) +--- +>>>var c, _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^ +10> ^ +1-> + > +2 >var +3 > c: string +4 > , +5 > { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +6 > +7 > name: nameC +8 > , +9 > skill: skillC +10> } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 6) Source(13, 14) + SourceIndex(0) +4 >Emitted(6, 8) Source(13, 16) + SourceIndex(0) +5 >Emitted(6, 54) Source(13, 90) + SourceIndex(0) +6 >Emitted(6, 56) Source(13, 18) + SourceIndex(0) +7 >Emitted(6, 71) Source(13, 29) + SourceIndex(0) +8 >Emitted(6, 73) Source(13, 31) + SourceIndex(0) +9 >Emitted(6, 90) Source(13, 44) + SourceIndex(0) +10>Emitted(6, 91) Source(13, 91) + SourceIndex(0) +--- +>>>var nameA = robotA.name, a = hello; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >var { +2 >name: nameA +3 > } = robotA, +4 > a +5 > = +6 > hello +7 > ; +1 >Emitted(7, 1) Source(15, 7) + SourceIndex(0) +2 >Emitted(7, 24) Source(15, 18) + SourceIndex(0) +3 >Emitted(7, 26) Source(15, 31) + SourceIndex(0) +4 >Emitted(7, 27) Source(15, 32) + SourceIndex(0) +5 >Emitted(7, 30) Source(15, 35) + SourceIndex(0) +6 >Emitted(7, 35) Source(15, 40) + SourceIndex(0) +7 >Emitted(7, 36) Source(15, 41) + SourceIndex(0) +--- +>>>var nameB = robotB.name, skillB = robotB.skill, b = " hello"; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skill: skillB +5 > } = robotB, +6 > b +7 > = +8 > " hello" +9 > ; +1->Emitted(8, 1) Source(16, 7) + SourceIndex(0) +2 >Emitted(8, 24) Source(16, 18) + SourceIndex(0) +3 >Emitted(8, 26) Source(16, 20) + SourceIndex(0) +4 >Emitted(8, 47) Source(16, 33) + SourceIndex(0) +5 >Emitted(8, 49) Source(16, 46) + SourceIndex(0) +6 >Emitted(8, 50) Source(16, 47) + SourceIndex(0) +7 >Emitted(8, 53) Source(16, 50) + SourceIndex(0) +8 >Emitted(8, 61) Source(16, 58) + SourceIndex(0) +9 >Emitted(8, 62) Source(16, 59) + SourceIndex(0) +--- +>>>var _b = { name: "Edger", skill: "cutting edges" }, nameC = _b.name, skillC = _b.skill, c = hello; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC +6 > , +7 > skill: skillC +8 > } = { name: "Edger", skill: "cutting edges" }, +9 > c +10> = +11> hello +12> ; +1->Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(17, 1) + SourceIndex(0) +3 >Emitted(9, 51) Source(17, 79) + SourceIndex(0) +4 >Emitted(9, 53) Source(17, 7) + SourceIndex(0) +5 >Emitted(9, 68) Source(17, 18) + SourceIndex(0) +6 >Emitted(9, 70) Source(17, 20) + SourceIndex(0) +7 >Emitted(9, 87) Source(17, 33) + SourceIndex(0) +8 >Emitted(9, 89) Source(17, 81) + SourceIndex(0) +9 >Emitted(9, 90) Source(17, 82) + SourceIndex(0) +10>Emitted(9, 93) Source(17, 85) + SourceIndex(0) +11>Emitted(9, 98) Source(17, 90) + SourceIndex(0) +12>Emitted(9, 99) Source(17, 91) + SourceIndex(0) +--- +>>>var a = hello, nameA = robotA.name, a1 = "hello"; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^ +11> ^^^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >var +3 > a +4 > = +5 > hello +6 > , { +7 > name: nameA +8 > } = robotA, +9 > a1 +10> = +11> "hello" +12> ; +1 >Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(19, 6) + SourceIndex(0) +4 >Emitted(10, 9) Source(19, 9) + SourceIndex(0) +5 >Emitted(10, 14) Source(19, 14) + SourceIndex(0) +6 >Emitted(10, 16) Source(19, 18) + SourceIndex(0) +7 >Emitted(10, 35) Source(19, 29) + SourceIndex(0) +8 >Emitted(10, 37) Source(19, 42) + SourceIndex(0) +9 >Emitted(10, 39) Source(19, 44) + SourceIndex(0) +10>Emitted(10, 42) Source(19, 46) + SourceIndex(0) +11>Emitted(10, 49) Source(19, 53) + SourceIndex(0) +12>Emitted(10, 50) Source(19, 54) + SourceIndex(0) +--- +>>>var b = hello, nameB = robotB.name, skillB = robotB.skill, b1 = "hello"; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^ +12> ^^^ +13> ^^^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > b +4 > = +5 > hello +6 > , { +7 > name: nameB +8 > , +9 > skill: skillB +10> } = robotB, +11> b1 +12> = +13> "hello" +14> ; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(11, 6) Source(20, 6) + SourceIndex(0) +4 >Emitted(11, 9) Source(20, 9) + SourceIndex(0) +5 >Emitted(11, 14) Source(20, 14) + SourceIndex(0) +6 >Emitted(11, 16) Source(20, 18) + SourceIndex(0) +7 >Emitted(11, 35) Source(20, 29) + SourceIndex(0) +8 >Emitted(11, 37) Source(20, 31) + SourceIndex(0) +9 >Emitted(11, 58) Source(20, 44) + SourceIndex(0) +10>Emitted(11, 60) Source(20, 57) + SourceIndex(0) +11>Emitted(11, 62) Source(20, 59) + SourceIndex(0) +12>Emitted(11, 65) Source(20, 62) + SourceIndex(0) +13>Emitted(11, 72) Source(20, 69) + SourceIndex(0) +14>Emitted(11, 73) Source(20, 70) + SourceIndex(0) +--- +>>>var c = hello, _c = { name: "Edger", skill: "cutting edges" }, nameC = _c.name, skillC = _c.skill, c1 = hello; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^ +14> ^^^ +15> ^^^^^ +16> ^ +1-> + > +2 >var +3 > c +4 > = +5 > hello +6 > , +7 > { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +8 > +9 > name: nameC +10> , +11> skill: skillC +12> } = { name: "Edger", skill: "cutting edges" }, +13> c1 +14> = +15> hello +16> ; +1->Emitted(12, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(12, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(12, 9) Source(21, 9) + SourceIndex(0) +5 >Emitted(12, 14) Source(21, 14) + SourceIndex(0) +6 >Emitted(12, 16) Source(21, 16) + SourceIndex(0) +7 >Emitted(12, 62) Source(21, 90) + SourceIndex(0) +8 >Emitted(12, 64) Source(21, 18) + SourceIndex(0) +9 >Emitted(12, 79) Source(21, 29) + SourceIndex(0) +10>Emitted(12, 81) Source(21, 31) + SourceIndex(0) +11>Emitted(12, 98) Source(21, 44) + SourceIndex(0) +12>Emitted(12, 100) Source(21, 92) + SourceIndex(0) +13>Emitted(12, 102) Source(21, 94) + SourceIndex(0) +14>Emitted(12, 105) Source(21, 97) + SourceIndex(0) +15>Emitted(12, 110) Source(21, 102) + SourceIndex(0) +16>Emitted(12, 111) Source(21, 103) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 3) Source(22, 3) + SourceIndex(0) +3 >Emitted(13, 4) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 5) Source(22, 5) + SourceIndex(0) +5 >Emitted(13, 10) Source(22, 10) + SourceIndex(0) +6 >Emitted(13, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(13, 19) Source(22, 19) + SourceIndex(0) +8 >Emitted(13, 20) Source(22, 20) + SourceIndex(0) +9 >Emitted(13, 21) Source(22, 21) + SourceIndex(0) +10>Emitted(13, 22) Source(22, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(14, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(23, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(23, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(23, 17) + SourceIndex(0) +6 >Emitted(14, 23) Source(23, 23) + SourceIndex(0) +7 >Emitted(14, 24) Source(23, 24) + SourceIndex(0) +8 >Emitted(14, 25) Source(23, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(24, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(16, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(16, 7) Source(25, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(17, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(26, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(26, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(26, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(26, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(26, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(27, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols new file mode 100644 index 00000000000..eb009ba9ad7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 38)) + +var a: string, { name: nameA } = robotA; +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) + +var b: string, { name: nameB, skill: skillB } = robotB; +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) + +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 49)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 64)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 64)) + +var { name: nameA } = robotA, a = hello; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var { name: nameB, skill: skillB } = robotB, b = " hello"; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 38)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 53)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 38)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 53)) +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var a = hello, { name: nameA } = robotA, a1= "hello"; +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>a1 : Symbol(a1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 40)) + +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>b1 : Symbol(b1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 55)) + +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 49)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 64)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 64)) +>c1 : Symbol(c1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 90)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types new file mode 100644 index 00000000000..9d8023f5f74 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types @@ -0,0 +1,149 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var a: string, { name: nameA } = robotA; +>a : string +>name : any +>nameA : string +>robotA : Robot + +var b: string, { name: nameB, skill: skillB } = robotB; +>b : string +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot + +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>c : string +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +var { name: nameA } = robotA, a = hello; +>name : any +>nameA : string +>robotA : Robot +>a : string +>hello : string + +var { name: nameB, skill: skillB } = robotB, b = " hello"; +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot +>b : string +>" hello" : string + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string +>c : string +>hello : string + +var a = hello, { name: nameA } = robotA, a1= "hello"; +>a : string +>hello : string +>name : any +>nameA : string +>robotA : Robot +>a1 : string +>"hello" : string + +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +>b : string +>hello : string +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot +>b1 : string +>"hello" : string + +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +>c : string +>hello : string +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string +>c1 : string +>hello : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js new file mode 100644 index 00000000000..fea40d4b900 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + + +let [, nameA] = robotA; +let [numberB] = robotB; +let [numberA2, nameA2, skillA2] = robotA; + +let [numberC2] = [3, "edging", "Trimming edges"]; +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + +let [numberA3, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var nameA = robotA[1]; +var numberB = robotB[0]; +var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2]; +var numberC2 = [3, "edging", "Trimming edges"][0]; +var _a = [3, "edging", "Trimming edges"], numberC = _a[0], nameC = _a[1], skillC = _a[2]; +var numberA3 = robotA[0], robotAInfo = robotA.slice(1); +if (nameA == nameA2) { + console.log(skillA2); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map new file mode 100644 index 00000000000..cf91be353da --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAGxC,qBAAK,CAAW;AAClB,uBAAO,CAAW;AAClB,wBAAQ,EAAE,kBAAM,EAAE,mBAAO,CAAW;AAEpC,iDAAQ,CAAoC;AACjD,IAAA,oCAA8D,EAAzD,eAAO,EAAE,aAAK,EAAE,cAAM,CAAoC;AAE1D,wBAAQ,EAAE,4BAAa,CAAW;AAEvC,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..43bcf108a9d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt @@ -0,0 +1,283 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(6, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(6, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(6, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(6, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(6, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(6, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(6, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(6, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(6, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(6, 48) + SourceIndex(0) +--- +>>>var nameA = robotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^-> +1 > + > + > + >let [, +2 >nameA +3 > ] = robotA; +1 >Emitted(3, 1) Source(9, 8) + SourceIndex(0) +2 >Emitted(3, 22) Source(9, 13) + SourceIndex(0) +3 >Emitted(3, 23) Source(9, 24) + SourceIndex(0) +--- +>>>var numberB = robotB[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >let [ +2 >numberB +3 > ] = robotB; +1->Emitted(4, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(4, 24) Source(10, 13) + SourceIndex(0) +3 >Emitted(4, 25) Source(10, 24) + SourceIndex(0) +--- +>>>var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + >let [ +2 >numberA2 +3 > , +4 > nameA2 +5 > , +6 > skillA2 +7 > ] = robotA; +1->Emitted(5, 1) Source(11, 6) + SourceIndex(0) +2 >Emitted(5, 25) Source(11, 14) + SourceIndex(0) +3 >Emitted(5, 27) Source(11, 16) + SourceIndex(0) +4 >Emitted(5, 45) Source(11, 22) + SourceIndex(0) +5 >Emitted(5, 47) Source(11, 24) + SourceIndex(0) +6 >Emitted(5, 66) Source(11, 31) + SourceIndex(0) +7 >Emitted(5, 67) Source(11, 42) + SourceIndex(0) +--- +>>>var numberC2 = [3, "edging", "Trimming edges"][0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >numberC2 +3 > ] = [3, "edging", "Trimming edges"]; +1 >Emitted(6, 1) Source(13, 6) + SourceIndex(0) +2 >Emitted(6, 50) Source(13, 14) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 50) + SourceIndex(0) +--- +>>>var _a = [3, "edging", "Trimming edges"], numberC = _a[0], nameC = _a[1], skillC = _a[2]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^ +1-> + > +2 > +3 > let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"] +4 > +5 > numberC +6 > , +7 > nameC +8 > , +9 > skillC +10> ] = [3, "edging", "Trimming edges"]; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 1) + SourceIndex(0) +3 >Emitted(7, 41) Source(14, 63) + SourceIndex(0) +4 >Emitted(7, 43) Source(14, 6) + SourceIndex(0) +5 >Emitted(7, 58) Source(14, 13) + SourceIndex(0) +6 >Emitted(7, 60) Source(14, 15) + SourceIndex(0) +7 >Emitted(7, 73) Source(14, 20) + SourceIndex(0) +8 >Emitted(7, 75) Source(14, 22) + SourceIndex(0) +9 >Emitted(7, 89) Source(14, 28) + SourceIndex(0) +10>Emitted(7, 90) Source(14, 64) + SourceIndex(0) +--- +>>>var numberA3 = robotA[0], robotAInfo = robotA.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1 > + > + >let [ +2 >numberA3 +3 > , +4 > ...robotAInfo +5 > ] = robotA; +1 >Emitted(8, 1) Source(16, 6) + SourceIndex(0) +2 >Emitted(8, 25) Source(16, 14) + SourceIndex(0) +3 >Emitted(8, 27) Source(16, 16) + SourceIndex(0) +4 >Emitted(8, 55) Source(16, 29) + SourceIndex(0) +5 >Emitted(8, 56) Source(16, 40) + SourceIndex(0) +--- +>>>if (nameA == nameA2) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameA2 +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(18, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(18, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(18, 5) + SourceIndex(0) +5 >Emitted(9, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(9, 14) Source(18, 14) + SourceIndex(0) +7 >Emitted(9, 20) Source(18, 20) + SourceIndex(0) +8 >Emitted(9, 21) Source(18, 21) + SourceIndex(0) +9 >Emitted(9, 22) Source(18, 22) + SourceIndex(0) +10>Emitted(9, 23) Source(18, 23) + SourceIndex(0) +--- +>>> console.log(skillA2); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA2 +7 > ) +8 > ; +1->Emitted(10, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(10, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(10, 25) Source(19, 25) + SourceIndex(0) +8 >Emitted(10, 26) Source(19, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(20, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols new file mode 100644 index 00000000000..943f9e1c400 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 5, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + + +let [, nameA] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 8, 6)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +let [numberB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 9, 5)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 5, 3)) + +let [numberA2, nameA2, skillA2] = robotA; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 5)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 14)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 22)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +let [numberC2] = [3, "edging", "Trimming edges"]; +>numberC2 : Symbol(numberC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 12, 5)) + +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +>numberC : Symbol(numberC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 5)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 13)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 20)) + +let [numberA3, ...robotAInfo] = robotA; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 15, 5)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 15, 14)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +if (nameA == nameA2) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 8, 6)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 14)) + + console.log(skillA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 22)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types new file mode 100644 index 00000000000..73006f4ec45 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + + +let [, nameA] = robotA; +> : undefined +>nameA : string +>robotA : [number, string, string] + +let [numberB] = robotB; +>numberB : number +>robotB : [number, string, string] + +let [numberA2, nameA2, skillA2] = robotA; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] + +let [numberC2] = [3, "edging", "Trimming edges"]; +>numberC2 : number +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +>numberC : number +>nameC : string +>skillC : string +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberA3, ...robotAInfo] = robotA; +>numberA3 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] + +if (nameA == nameA2) { +>nameA == nameA2 : boolean +>nameA : string +>nameA2 : string + + console.log(skillA2); +>console.log(skillA2) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA2 : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js new file mode 100644 index 00000000000..b93acc66a10 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js @@ -0,0 +1,34 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts] +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, [string, string]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA] = multiRobotA; +let [nameMB] = multiRobotB; +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + +let [...multiRobotAInfo] = multiRobotA; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js] +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var skillA = multiRobotA[1]; +var nameMB = multiRobotB[0]; +var nameMA = multiRobotA[0], _a = multiRobotA[1], primarySkillA = _a[0], secondarySkillA = _a[1]; +var nameMC = ["roomba", ["vaccum", "mopping"]][0]; +var _b = ["roomba", ["vaccum", "mopping"]], nameMC2 = _b[0], _c = _b[1], primarySkillC = _c[0], secondarySkillC = _c[1]; +var multiRobotAInfo = multiRobotA.slice(0); +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map new file mode 100644 index 00000000000..6d0bcc3b9b2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,2BAAM,CAAgB;AACxB,2BAAM,CAAgB;AACtB,2BAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AAExD,iDAAM,CAAsC;AACjD,IAAA,sCAAmF,EAA9E,eAAO,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAuC;AAE/E,0CAAkB,CAAgB;AAEvC,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..64e22a28771 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,324 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type MultiSkilledRobot = [string, [string, string]]; + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 16) Source(5, 16) + SourceIndex(0) +4 >Emitted(1, 19) Source(5, 38) + SourceIndex(0) +5 >Emitted(1, 20) Source(5, 39) + SourceIndex(0) +6 >Emitted(1, 27) Source(5, 46) + SourceIndex(0) +7 >Emitted(1, 29) Source(5, 48) + SourceIndex(0) +8 >Emitted(1, 30) Source(5, 49) + SourceIndex(0) +9 >Emitted(1, 38) Source(5, 57) + SourceIndex(0) +10>Emitted(1, 40) Source(5, 59) + SourceIndex(0) +11>Emitted(1, 42) Source(5, 61) + SourceIndex(0) +12>Emitted(1, 43) Source(5, 62) + SourceIndex(0) +13>Emitted(1, 44) Source(5, 63) + SourceIndex(0) +14>Emitted(1, 45) Source(5, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(6, 38) + SourceIndex(0) +5 >Emitted(2, 20) Source(6, 39) + SourceIndex(0) +6 >Emitted(2, 29) Source(6, 48) + SourceIndex(0) +7 >Emitted(2, 31) Source(6, 50) + SourceIndex(0) +8 >Emitted(2, 32) Source(6, 51) + SourceIndex(0) +9 >Emitted(2, 42) Source(6, 61) + SourceIndex(0) +10>Emitted(2, 44) Source(6, 63) + SourceIndex(0) +11>Emitted(2, 52) Source(6, 71) + SourceIndex(0) +12>Emitted(2, 53) Source(6, 72) + SourceIndex(0) +13>Emitted(2, 54) Source(6, 73) + SourceIndex(0) +14>Emitted(2, 55) Source(6, 74) + SourceIndex(0) +--- +>>>var skillA = multiRobotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^-> +1 > + > + >let [, +2 >skillA +3 > ] = multiRobotA; +1 >Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 28) Source(8, 14) + SourceIndex(0) +3 >Emitted(3, 29) Source(8, 30) + SourceIndex(0) +--- +>>>var nameMB = multiRobotB[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >let [ +2 >nameMB +3 > ] = multiRobotB; +1->Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 28) Source(9, 12) + SourceIndex(0) +3 >Emitted(4, 29) Source(9, 28) + SourceIndex(0) +--- +>>>var nameMA = multiRobotA[0], _a = multiRobotA[1], primarySkillA = _a[0], secondarySkillA = _a[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +1-> + >let [ +2 >nameMA +3 > , +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +9 > ]] = multiRobotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 28) Source(10, 12) + SourceIndex(0) +3 >Emitted(5, 30) Source(10, 14) + SourceIndex(0) +4 >Emitted(5, 49) Source(10, 46) + SourceIndex(0) +5 >Emitted(5, 51) Source(10, 15) + SourceIndex(0) +6 >Emitted(5, 72) Source(10, 28) + SourceIndex(0) +7 >Emitted(5, 74) Source(10, 30) + SourceIndex(0) +8 >Emitted(5, 97) Source(10, 45) + SourceIndex(0) +9 >Emitted(5, 98) Source(10, 62) + SourceIndex(0) +--- +>>>var nameMC = ["roomba", ["vaccum", "mopping"]][0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >nameMC +3 > ] = ["roomba", ["vaccum", "mopping"]]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 50) Source(12, 12) + SourceIndex(0) +3 >Emitted(6, 51) Source(12, 50) + SourceIndex(0) +--- +>>>var _b = ["roomba", ["vaccum", "mopping"]], nameMC2 = _b[0], _c = _b[1], primarySkillC = _c[0], secondarySkillC = _c[1]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]] +4 > +5 > nameMC2 +6 > , +7 > [primarySkillC, secondarySkillC] +8 > +9 > primarySkillC +10> , +11> secondarySkillC +12> ]] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 43) Source(13, 84) + SourceIndex(0) +4 >Emitted(7, 45) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 60) Source(13, 13) + SourceIndex(0) +6 >Emitted(7, 62) Source(13, 15) + SourceIndex(0) +7 >Emitted(7, 72) Source(13, 47) + SourceIndex(0) +8 >Emitted(7, 74) Source(13, 16) + SourceIndex(0) +9 >Emitted(7, 95) Source(13, 29) + SourceIndex(0) +10>Emitted(7, 97) Source(13, 31) + SourceIndex(0) +11>Emitted(7, 120) Source(13, 46) + SourceIndex(0) +12>Emitted(7, 121) Source(13, 85) + SourceIndex(0) +--- +>>>var multiRobotAInfo = multiRobotA.slice(0); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1 > + > + >let [ +2 >...multiRobotAInfo +3 > ] = multiRobotA; +1 >Emitted(8, 1) Source(15, 6) + SourceIndex(0) +2 >Emitted(8, 43) Source(15, 24) + SourceIndex(0) +3 >Emitted(8, 44) Source(15, 40) + SourceIndex(0) +--- +>>>if (nameMB == nameMA) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameMB +6 > == +7 > nameMA +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +5 >Emitted(9, 11) Source(17, 11) + SourceIndex(0) +6 >Emitted(9, 15) Source(17, 15) + SourceIndex(0) +7 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) +8 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) +9 >Emitted(9, 23) Source(17, 23) + SourceIndex(0) +10>Emitted(9, 24) Source(17, 24) + SourceIndex(0) +--- +>>> console.log(skillA[0] + skillA[1]); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > [ +8 > 0 +9 > ] +10> + +11> skillA +12> [ +13> 1 +14> ] +15> ) +16> ; +1->Emitted(10, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(10, 23) Source(18, 23) + SourceIndex(0) +7 >Emitted(10, 24) Source(18, 24) + SourceIndex(0) +8 >Emitted(10, 25) Source(18, 25) + SourceIndex(0) +9 >Emitted(10, 26) Source(18, 26) + SourceIndex(0) +10>Emitted(10, 29) Source(18, 29) + SourceIndex(0) +11>Emitted(10, 35) Source(18, 35) + SourceIndex(0) +12>Emitted(10, 36) Source(18, 36) + SourceIndex(0) +13>Emitted(10, 37) Source(18, 37) + SourceIndex(0) +14>Emitted(10, 38) Source(18, 38) + SourceIndex(0) +15>Emitted(10, 39) Source(18, 39) + SourceIndex(0) +16>Emitted(10, 40) Source(18, 40) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols new file mode 100644 index 00000000000..d2a61e2a5ef --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 1, 8)) +} +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 5, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +let [, skillA] = multiRobotA; +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +let [nameMB] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 8, 5)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 5, 3)) + +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 5)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 14)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 28)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : Symbol(nameMC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 11, 5)) + +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : Symbol(nameMC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 5)) +>primarySkillC : Symbol(primarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 15)) +>secondarySkillC : Symbol(secondarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 29)) + +let [...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 14, 5)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +if (nameMB == nameMA) { +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 8, 5)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 5)) + + console.log(skillA[0] + skillA[1]); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>0 : Symbol(0) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>1 : Symbol(1) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types new file mode 100644 index 00000000000..57d4b271c2f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types @@ -0,0 +1,84 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let [, skillA] = multiRobotA; +> : undefined +>skillA : [string, string] +>multiRobotA : [string, [string, string]] + +let [nameMB] = multiRobotB; +>nameMB : string +>multiRobotB : [string, [string, string]] + +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : string +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : string +>primarySkillC : string +>secondarySkillC : string +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +let [...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] + +if (nameMB == nameMA) { +>nameMB == nameMA : boolean +>nameMB : string +>nameMA : string + + console.log(skillA[0] + skillA[1]); +>console.log(skillA[0] + skillA[1]) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA[0] + skillA[1] : string +>skillA[0] : string +>skillA : [string, string] +>0 : number +>skillA[1] : string +>skillA : [string, string] +>1 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js new file mode 100644 index 00000000000..32862b978db --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js @@ -0,0 +1,102 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | [string, string])[]; + +[, nameA] = robotA; +[, nameB] = getRobotB(); +[, nameB] = [2, "trimmer", "trimming"]; +[, multiSkillB] = multiRobotB; +[, multiSkillB] = getMultiRobotB(); +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + +[numberB] = robotB; +[numberB] = getRobotB(); +[numberB] = [2, "trimmer", "trimming"]; +[nameMB] = multiRobotB; +[nameMB] = getMultiRobotB(); +[nameMB] = ["trimmer", ["trimming", "edging"]]; + +[numberB, nameB, skillB] = robotB; +[numberB, nameB, skillB] = getRobotB(); +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + +[numberB, ...robotAInfo] = robotB; +[numberB, ...robotAInfo] = getRobotB(); +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +[...multiRobotAInfo] = multiRobotA; +[...multiRobotAInfo] = getMultiRobotB(); +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var nameA, numberB, nameB, skillB; +var robotAInfo; +var multiSkillB, nameMB, primarySkillB, secondarySkillB; +var multiRobotAInfo; +nameA = robotA[1]; +_a = getRobotB(), nameB = _a[1]; +_b = [2, "trimmer", "trimming"], nameB = _b[1]; +multiSkillB = multiRobotB[1]; +_c = getMultiRobotB(), multiSkillB = _c[1]; +_d = ["roomba", ["vaccum", "mopping"]], multiSkillB = _d[1]; +numberB = robotB[0]; +numberB = getRobotB()[0]; +numberB = [2, "trimmer", "trimming"][0]; +nameMB = multiRobotB[0]; +nameMB = getMultiRobotB()[0]; +nameMB = ["trimmer", ["trimming", "edging"]][0]; +numberB = robotB[0], nameB = robotB[1], skillB = robotB[2]; +_e = getRobotB(), numberB = _e[0], nameB = _e[1], skillB = _e[2]; +_f = [2, "trimmer", "trimming"], numberB = _f[0], nameB = _f[1], skillB = _f[2]; +nameMB = multiRobotB[0], _g = multiRobotB[1], primarySkillB = _g[0], secondarySkillB = _g[1]; +_h = getMultiRobotB(), nameMB = _h[0], _j = _h[1], primarySkillB = _j[0], secondarySkillB = _j[1]; +_k = ["trimmer", ["trimming", "edging"]], nameMB = _k[0], _l = _k[1], primarySkillB = _l[0], secondarySkillB = _l[1]; +numberB = robotB[0], robotAInfo = robotB.slice(1); +_m = getRobotB(), numberB = _m[0], robotAInfo = _m.slice(1); +_o = [2, "trimmer", "trimming"], numberB = _o[0], robotAInfo = _o.slice(1); +multiRobotAInfo = multiRobotA.slice(0); +multiRobotAInfo = getMultiRobotB().slice(0); +multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0); +if (nameA == nameB) { + console.log(skillB); +} +function getRobotB() { + return robotB; +} +function getMultiRobotB() { + return multiRobotB; +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map new file mode 100644 index 00000000000..1b6c788952d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAA6B,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClG,IAAI,eAA8C,CAAC;AAEhD,iBAAK,CAAW;AACnB,gBAAuB,EAApB,aAAK,CAAgB;AACxB,+BAAsC,EAAnC,aAAK,CAA+B;AACpC,4BAAW,CAAgB;AAC9B,qBAAkC,EAA/B,mBAAW,CAAqB;AACnC,sCAAmD,EAAhD,mBAAW,CAAsC;AAEnD,mBAAO,CAAW;AAClB,wBAAO,CAAgB;AACvB,uCAAO,CAA+B;AACtC,uBAAM,CAAgB;AACtB,4BAAM,CAAqB;AAC3B,+CAAM,CAAwC;AAE9C,mBAAO,EAAE,iBAAK,EAAE,kBAAM,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,aAAK,EAAE,cAAM,CAAgB;AACvC,+BAAqD,EAApD,eAAO,EAAE,aAAK,EAAE,cAAM,CAA+B;AACrD,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AACzD,qBAA6D,EAA5D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAsB;AAC9D,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAyC;AAEhF,mBAAO,EAAE,4BAAa,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,wBAAa,CAAgB;AACvC,+BAA4D,EAA3D,eAAO,EAAE,wBAAa,CAAsC;AAC5D,sCAAkB,CAAgB;AAClC,2CAAkB,CAAqB;AACvC,8DAAkB,CAAwC;AAE3D,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt new file mode 100644 index 00000000000..466b36630c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt @@ -0,0 +1,909 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 16) Source(9, 16) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 38) + SourceIndex(0) +5 >Emitted(3, 20) Source(9, 39) + SourceIndex(0) +6 >Emitted(3, 27) Source(9, 46) + SourceIndex(0) +7 >Emitted(3, 29) Source(9, 48) + SourceIndex(0) +8 >Emitted(3, 30) Source(9, 49) + SourceIndex(0) +9 >Emitted(3, 38) Source(9, 57) + SourceIndex(0) +10>Emitted(3, 40) Source(9, 59) + SourceIndex(0) +11>Emitted(3, 42) Source(9, 61) + SourceIndex(0) +12>Emitted(3, 43) Source(9, 62) + SourceIndex(0) +13>Emitted(3, 44) Source(9, 63) + SourceIndex(0) +14>Emitted(3, 45) Source(9, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(4, 16) Source(10, 16) + SourceIndex(0) +4 >Emitted(4, 19) Source(10, 38) + SourceIndex(0) +5 >Emitted(4, 20) Source(10, 39) + SourceIndex(0) +6 >Emitted(4, 29) Source(10, 48) + SourceIndex(0) +7 >Emitted(4, 31) Source(10, 50) + SourceIndex(0) +8 >Emitted(4, 32) Source(10, 51) + SourceIndex(0) +9 >Emitted(4, 42) Source(10, 61) + SourceIndex(0) +10>Emitted(4, 44) Source(10, 63) + SourceIndex(0) +11>Emitted(4, 52) Source(10, 71) + SourceIndex(0) +12>Emitted(4, 53) Source(10, 72) + SourceIndex(0) +13>Emitted(4, 54) Source(10, 73) + SourceIndex(0) +14>Emitted(4, 55) Source(10, 74) + SourceIndex(0) +--- +>>>var nameA, numberB, nameB, skillB; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +1 > + > + > +2 >let +3 > nameA: string +4 > , +5 > numberB: number +6 > , +7 > nameB: string +8 > , +9 > skillB: string +10> ; +1 >Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 10) Source(12, 18) + SourceIndex(0) +4 >Emitted(5, 12) Source(12, 20) + SourceIndex(0) +5 >Emitted(5, 19) Source(12, 35) + SourceIndex(0) +6 >Emitted(5, 21) Source(12, 37) + SourceIndex(0) +7 >Emitted(5, 26) Source(12, 50) + SourceIndex(0) +8 >Emitted(5, 28) Source(12, 52) + SourceIndex(0) +9 >Emitted(5, 34) Source(12, 66) + SourceIndex(0) +10>Emitted(5, 35) Source(12, 67) + SourceIndex(0) +--- +>>>var robotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > robotAInfo: (number | string)[] +4 > ; +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 15) Source(13, 36) + SourceIndex(0) +4 >Emitted(6, 16) Source(13, 37) + SourceIndex(0) +--- +>>>var multiSkillB, nameMB, primarySkillB, secondarySkillB; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^ +1-> + > + > +2 >let +3 > multiSkillB: [string, string] +4 > , +5 > nameMB: string +6 > , +7 > primarySkillB: string +8 > , +9 > secondarySkillB: string +10> ; +1->Emitted(7, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(15, 34) + SourceIndex(0) +4 >Emitted(7, 18) Source(15, 36) + SourceIndex(0) +5 >Emitted(7, 24) Source(15, 50) + SourceIndex(0) +6 >Emitted(7, 26) Source(15, 52) + SourceIndex(0) +7 >Emitted(7, 39) Source(15, 73) + SourceIndex(0) +8 >Emitted(7, 41) Source(15, 75) + SourceIndex(0) +9 >Emitted(7, 56) Source(15, 98) + SourceIndex(0) +10>Emitted(7, 57) Source(15, 99) + SourceIndex(0) +--- +>>>var multiRobotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^ +1 > + > +2 >let +3 > multiRobotAInfo: (string | [string, string])[] +4 > ; +1 >Emitted(8, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(8, 20) Source(16, 51) + SourceIndex(0) +4 >Emitted(8, 21) Source(16, 52) + SourceIndex(0) +--- +>>>nameA = robotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^-> +1 > + > + >[, +2 >nameA +3 > ] = robotA; +1 >Emitted(9, 1) Source(18, 4) + SourceIndex(0) +2 >Emitted(9, 18) Source(18, 9) + SourceIndex(0) +3 >Emitted(9, 19) Source(18, 20) + SourceIndex(0) +--- +>>>_a = getRobotB(), nameB = _a[1]; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, nameB] = getRobotB() +3 > +4 > nameB +5 > ] = getRobotB(); +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 17) Source(19, 24) + SourceIndex(0) +3 >Emitted(10, 19) Source(19, 4) + SourceIndex(0) +4 >Emitted(10, 32) Source(19, 9) + SourceIndex(0) +5 >Emitted(10, 33) Source(19, 25) + SourceIndex(0) +--- +>>>_b = [2, "trimmer", "trimming"], nameB = _b[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^ +1-> + > +2 >[, nameB] = [2, "trimmer", "trimming"] +3 > +4 > nameB +5 > ] = [2, "trimmer", "trimming"]; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 32) Source(20, 39) + SourceIndex(0) +3 >Emitted(11, 34) Source(20, 4) + SourceIndex(0) +4 >Emitted(11, 47) Source(20, 9) + SourceIndex(0) +5 >Emitted(11, 48) Source(20, 40) + SourceIndex(0) +--- +>>>multiSkillB = multiRobotB[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^-> +1 > + >[, +2 >multiSkillB +3 > ] = multiRobotB; +1 >Emitted(12, 1) Source(21, 4) + SourceIndex(0) +2 >Emitted(12, 29) Source(21, 15) + SourceIndex(0) +3 >Emitted(12, 30) Source(21, 31) + SourceIndex(0) +--- +>>>_c = getMultiRobotB(), multiSkillB = _c[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, multiSkillB] = getMultiRobotB() +3 > +4 > multiSkillB +5 > ] = getMultiRobotB(); +1->Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 22) Source(22, 35) + SourceIndex(0) +3 >Emitted(13, 24) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 43) Source(22, 15) + SourceIndex(0) +5 >Emitted(13, 44) Source(22, 36) + SourceIndex(0) +--- +>>>_d = ["roomba", ["vaccum", "mopping"]], multiSkillB = _d[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > +2 >[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] +3 > +4 > multiSkillB +5 > ] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 39) Source(23, 52) + SourceIndex(0) +3 >Emitted(14, 41) Source(23, 4) + SourceIndex(0) +4 >Emitted(14, 60) Source(23, 15) + SourceIndex(0) +5 >Emitted(14, 61) Source(23, 53) + SourceIndex(0) +--- +>>>numberB = robotB[0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + > + >[ +2 >numberB +3 > ] = robotB; +1 >Emitted(15, 1) Source(25, 2) + SourceIndex(0) +2 >Emitted(15, 20) Source(25, 9) + SourceIndex(0) +3 >Emitted(15, 21) Source(25, 20) + SourceIndex(0) +--- +>>>numberB = getRobotB()[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >numberB +3 > ] = getRobotB(); +1->Emitted(16, 1) Source(26, 2) + SourceIndex(0) +2 >Emitted(16, 25) Source(26, 9) + SourceIndex(0) +3 >Emitted(16, 26) Source(26, 25) + SourceIndex(0) +--- +>>>numberB = [2, "trimmer", "trimming"][0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1-> + >[ +2 >numberB +3 > ] = [2, "trimmer", "trimming"]; +1->Emitted(17, 1) Source(27, 2) + SourceIndex(0) +2 >Emitted(17, 40) Source(27, 9) + SourceIndex(0) +3 >Emitted(17, 41) Source(27, 40) + SourceIndex(0) +--- +>>>nameMB = multiRobotB[0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + >[ +2 >nameMB +3 > ] = multiRobotB; +1 >Emitted(18, 1) Source(28, 2) + SourceIndex(0) +2 >Emitted(18, 24) Source(28, 8) + SourceIndex(0) +3 >Emitted(18, 25) Source(28, 24) + SourceIndex(0) +--- +>>>nameMB = getMultiRobotB()[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB +3 > ] = getMultiRobotB(); +1->Emitted(19, 1) Source(29, 2) + SourceIndex(0) +2 >Emitted(19, 29) Source(29, 8) + SourceIndex(0) +3 >Emitted(19, 30) Source(29, 29) + SourceIndex(0) +--- +>>>nameMB = ["trimmer", ["trimming", "edging"]][0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB +3 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(20, 1) Source(30, 2) + SourceIndex(0) +2 >Emitted(20, 48) Source(30, 8) + SourceIndex(0) +3 >Emitted(20, 49) Source(30, 48) + SourceIndex(0) +--- +>>>numberB = robotB[0], nameB = robotB[1], skillB = robotB[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^-> +1-> + > + >[ +2 >numberB +3 > , +4 > nameB +5 > , +6 > skillB +7 > ] = robotB; +1->Emitted(21, 1) Source(32, 2) + SourceIndex(0) +2 >Emitted(21, 20) Source(32, 9) + SourceIndex(0) +3 >Emitted(21, 22) Source(32, 11) + SourceIndex(0) +4 >Emitted(21, 39) Source(32, 16) + SourceIndex(0) +5 >Emitted(21, 41) Source(32, 18) + SourceIndex(0) +6 >Emitted(21, 59) Source(32, 24) + SourceIndex(0) +7 >Emitted(21, 60) Source(32, 35) + SourceIndex(0) +--- +>>>_e = getRobotB(), numberB = _e[0], nameB = _e[1], skillB = _e[2]; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, nameB, skillB] = getRobotB() +3 > +4 > numberB +5 > , +6 > nameB +7 > , +8 > skillB +9 > ] = getRobotB(); +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 17) Source(33, 39) + SourceIndex(0) +3 >Emitted(22, 19) Source(33, 2) + SourceIndex(0) +4 >Emitted(22, 34) Source(33, 9) + SourceIndex(0) +5 >Emitted(22, 36) Source(33, 11) + SourceIndex(0) +6 >Emitted(22, 49) Source(33, 16) + SourceIndex(0) +7 >Emitted(22, 51) Source(33, 18) + SourceIndex(0) +8 >Emitted(22, 65) Source(33, 24) + SourceIndex(0) +9 >Emitted(22, 66) Source(33, 40) + SourceIndex(0) +--- +>>>_f = [2, "trimmer", "trimming"], numberB = _f[0], nameB = _f[1], skillB = _f[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"] +3 > +4 > numberB +5 > , +6 > nameB +7 > , +8 > skillB +9 > ] = [2, "trimmer", "trimming"]; +1->Emitted(23, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(23, 32) Source(34, 54) + SourceIndex(0) +3 >Emitted(23, 34) Source(34, 2) + SourceIndex(0) +4 >Emitted(23, 49) Source(34, 9) + SourceIndex(0) +5 >Emitted(23, 51) Source(34, 11) + SourceIndex(0) +6 >Emitted(23, 64) Source(34, 16) + SourceIndex(0) +7 >Emitted(23, 66) Source(34, 18) + SourceIndex(0) +8 >Emitted(23, 80) Source(34, 24) + SourceIndex(0) +9 >Emitted(23, 81) Source(34, 55) + SourceIndex(0) +--- +>>>nameMB = multiRobotB[0], _g = multiRobotB[1], primarySkillB = _g[0], secondarySkillB = _g[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^-> +1-> + >[ +2 >nameMB +3 > , +4 > [primarySkillB, secondarySkillB] +5 > +6 > primarySkillB +7 > , +8 > secondarySkillB +9 > ]] = multiRobotB; +1->Emitted(24, 1) Source(35, 2) + SourceIndex(0) +2 >Emitted(24, 24) Source(35, 8) + SourceIndex(0) +3 >Emitted(24, 26) Source(35, 10) + SourceIndex(0) +4 >Emitted(24, 45) Source(35, 42) + SourceIndex(0) +5 >Emitted(24, 47) Source(35, 11) + SourceIndex(0) +6 >Emitted(24, 68) Source(35, 24) + SourceIndex(0) +7 >Emitted(24, 70) Source(35, 26) + SourceIndex(0) +8 >Emitted(24, 93) Source(35, 41) + SourceIndex(0) +9 >Emitted(24, 94) Source(35, 58) + SourceIndex(0) +--- +>>>_h = getMultiRobotB(), nameMB = _h[0], _j = _h[1], primarySkillB = _j[0], secondarySkillB = _j[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^ +12> ^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB() +3 > +4 > nameMB +5 > , +6 > [primarySkillB, secondarySkillB] +7 > +8 > primarySkillB +9 > , +10> secondarySkillB +11> ]] = getMultiRobotB(); +1->Emitted(25, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(25, 22) Source(36, 62) + SourceIndex(0) +3 >Emitted(25, 24) Source(36, 2) + SourceIndex(0) +4 >Emitted(25, 38) Source(36, 8) + SourceIndex(0) +5 >Emitted(25, 40) Source(36, 10) + SourceIndex(0) +6 >Emitted(25, 50) Source(36, 42) + SourceIndex(0) +7 >Emitted(25, 52) Source(36, 11) + SourceIndex(0) +8 >Emitted(25, 73) Source(36, 24) + SourceIndex(0) +9 >Emitted(25, 75) Source(36, 26) + SourceIndex(0) +10>Emitted(25, 98) Source(36, 41) + SourceIndex(0) +11>Emitted(25, 99) Source(36, 63) + SourceIndex(0) +--- +>>>_k = ["trimmer", ["trimming", "edging"]], nameMB = _k[0], _l = _k[1], primarySkillB = _l[0], secondarySkillB = _l[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^ +1-> + > +2 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] +3 > +4 > nameMB +5 > , +6 > [primarySkillB, secondarySkillB] +7 > +8 > primarySkillB +9 > , +10> secondarySkillB +11> ]] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(26, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(26, 41) Source(37, 81) + SourceIndex(0) +3 >Emitted(26, 43) Source(37, 2) + SourceIndex(0) +4 >Emitted(26, 57) Source(37, 8) + SourceIndex(0) +5 >Emitted(26, 59) Source(37, 10) + SourceIndex(0) +6 >Emitted(26, 69) Source(37, 42) + SourceIndex(0) +7 >Emitted(26, 71) Source(37, 11) + SourceIndex(0) +8 >Emitted(26, 92) Source(37, 24) + SourceIndex(0) +9 >Emitted(26, 94) Source(37, 26) + SourceIndex(0) +10>Emitted(26, 117) Source(37, 41) + SourceIndex(0) +11>Emitted(26, 118) Source(37, 82) + SourceIndex(0) +--- +>>>numberB = robotB[0], robotAInfo = robotB.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1 > + > + >[ +2 >numberB +3 > , +4 > ...robotAInfo +5 > ] = robotB; +1 >Emitted(27, 1) Source(39, 2) + SourceIndex(0) +2 >Emitted(27, 20) Source(39, 9) + SourceIndex(0) +3 >Emitted(27, 22) Source(39, 11) + SourceIndex(0) +4 >Emitted(27, 50) Source(39, 24) + SourceIndex(0) +5 >Emitted(27, 51) Source(39, 35) + SourceIndex(0) +--- +>>>_m = getRobotB(), numberB = _m[0], robotAInfo = _m.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, ...robotAInfo] = getRobotB() +3 > +4 > numberB +5 > , +6 > ...robotAInfo +7 > ] = getRobotB(); +1->Emitted(28, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(28, 17) Source(40, 39) + SourceIndex(0) +3 >Emitted(28, 19) Source(40, 2) + SourceIndex(0) +4 >Emitted(28, 34) Source(40, 9) + SourceIndex(0) +5 >Emitted(28, 36) Source(40, 11) + SourceIndex(0) +6 >Emitted(28, 60) Source(40, 24) + SourceIndex(0) +7 >Emitted(28, 61) Source(40, 40) + SourceIndex(0) +--- +>>>_o = [2, "trimmer", "trimming"], numberB = _o[0], robotAInfo = _o.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"] +3 > +4 > numberB +5 > , +6 > ...robotAInfo +7 > ] = [2, "trimmer", "trimming"]; +1->Emitted(29, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(29, 32) Source(41, 61) + SourceIndex(0) +3 >Emitted(29, 34) Source(41, 2) + SourceIndex(0) +4 >Emitted(29, 49) Source(41, 9) + SourceIndex(0) +5 >Emitted(29, 51) Source(41, 11) + SourceIndex(0) +6 >Emitted(29, 75) Source(41, 24) + SourceIndex(0) +7 >Emitted(29, 76) Source(41, 62) + SourceIndex(0) +--- +>>>multiRobotAInfo = multiRobotA.slice(0); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + >[ +2 >...multiRobotAInfo +3 > ] = multiRobotA; +1 >Emitted(30, 1) Source(42, 2) + SourceIndex(0) +2 >Emitted(30, 39) Source(42, 20) + SourceIndex(0) +3 >Emitted(30, 40) Source(42, 36) + SourceIndex(0) +--- +>>>multiRobotAInfo = getMultiRobotB().slice(0); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >...multiRobotAInfo +3 > ] = getMultiRobotB(); +1->Emitted(31, 1) Source(43, 2) + SourceIndex(0) +2 >Emitted(31, 44) Source(43, 20) + SourceIndex(0) +3 >Emitted(31, 45) Source(43, 41) + SourceIndex(0) +--- +>>>multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1-> + >[ +2 >...multiRobotAInfo +3 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(32, 1) Source(44, 2) + SourceIndex(0) +2 >Emitted(32, 63) Source(44, 20) + SourceIndex(0) +3 >Emitted(32, 64) Source(44, 60) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(33, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(33, 3) Source(46, 3) + SourceIndex(0) +3 >Emitted(33, 4) Source(46, 4) + SourceIndex(0) +4 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) +5 >Emitted(33, 10) Source(46, 10) + SourceIndex(0) +6 >Emitted(33, 14) Source(46, 14) + SourceIndex(0) +7 >Emitted(33, 19) Source(46, 19) + SourceIndex(0) +8 >Emitted(33, 20) Source(46, 20) + SourceIndex(0) +9 >Emitted(33, 21) Source(46, 21) + SourceIndex(0) +10>Emitted(33, 22) Source(46, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(34, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(34, 23) Source(47, 23) + SourceIndex(0) +7 >Emitted(34, 24) Source(47, 24) + SourceIndex(0) +8 >Emitted(34, 25) Source(47, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(48, 2) + SourceIndex(0) +--- +>>>function getRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(36, 1) Source(50, 1) + SourceIndex(0) +--- +>>> return robotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobotB() { + > +2 > return +3 > +4 > robotB +5 > ; +1->Emitted(37, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(37, 11) Source(51, 11) + SourceIndex(0) +3 >Emitted(37, 12) Source(51, 12) + SourceIndex(0) +4 >Emitted(37, 18) Source(51, 18) + SourceIndex(0) +5 >Emitted(37, 19) Source(51, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(52, 2) + SourceIndex(0) +--- +>>>function getMultiRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(39, 1) Source(54, 1) + SourceIndex(0) +--- +>>> return multiRobotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobotB() { + > +2 > return +3 > +4 > multiRobotB +5 > ; +1->Emitted(40, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(40, 11) Source(55, 11) + SourceIndex(0) +3 >Emitted(40, 12) Source(55, 12) + SourceIndex(0) +4 >Emitted(40, 23) Source(55, 23) + SourceIndex(0) +5 >Emitted(40, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(56, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols new file mode 100644 index 00000000000..931523c6b26 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols @@ -0,0 +1,176 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 8, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) + +let robotAInfo: (number | string)[]; +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) + +let multiRobotAInfo: (string | [string, string])[]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) + +[, nameA] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 6, 3)) + +[, nameB] = getRobotB(); +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[, nameB] = [2, "trimmer", "trimming"]; +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) + +[, multiSkillB] = multiRobotB; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[, multiSkillB] = getMultiRobotB(); +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) + +[numberB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) + +[nameMB] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[nameMB] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[nameMB] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) + +[numberB, nameB, skillB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB, nameB, skillB] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) + +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) + +[numberB, ...robotAInfo] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB, ...robotAInfo] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +[...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 8, 3)) + +[...multiRobotAInfo] = getMultiRobotB(); +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +} + +function getRobotB() { +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + + return robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) +} + +function getMultiRobotB() { +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + + return multiRobotB; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types new file mode 100644 index 00000000000..5ca93029977 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types @@ -0,0 +1,304 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : string +>numberB : number +>nameB : string +>skillB : string + +let robotAInfo: (number | string)[]; +>robotAInfo : (number | string)[] + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : [string, string] +>nameMB : string +>primarySkillB : string +>secondarySkillB : string + +let multiRobotAInfo: (string | [string, string])[]; +>multiRobotAInfo : (string | [string, string])[] + +[, nameA] = robotA; +>[, nameA] = robotA : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>robotA : [number, string, string] + +[, nameB] = getRobotB(); +>[, nameB] = getRobotB() : [number, string, string] +>[, nameB] : [undefined, string] +> : undefined +>nameB : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[, nameB] = [2, "trimmer", "trimming"]; +>[, nameB] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB] : [undefined, string] +> : undefined +>nameB : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[, multiSkillB] = multiRobotB; +>[, multiSkillB] = multiRobotB : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>multiRobotB : [string, [string, string]] + +[, multiSkillB] = getMultiRobotB(); +>[, multiSkillB] = getMultiRobotB() : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +>[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +[numberB] = robotB; +>[numberB] = robotB : [number, string, string] +>[numberB] : [number] +>numberB : number +>robotB : [number, string, string] + +[numberB] = getRobotB(); +>[numberB] = getRobotB() : [number, string, string] +>[numberB] : [number] +>numberB : number +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB] = [2, "trimmer", "trimming"]; +>[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] : [number] +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB] = multiRobotB; +>[nameMB] = multiRobotB : [string, [string, string]] +>[nameMB] : [string] +>nameMB : string +>multiRobotB : [string, [string, string]] + +[nameMB] = getMultiRobotB(); +>[nameMB] = getMultiRobotB() : [string, [string, string]] +>[nameMB] : [string] +>nameMB : string +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[nameMB] = ["trimmer", ["trimming", "edging"]]; +>[nameMB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB] : [string] +>nameMB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +[numberB, nameB, skillB] = robotB; +>[numberB, nameB, skillB] = robotB : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>robotB : [number, string, string] + +[numberB, nameB, skillB] = getRobotB(); +>[numberB, nameB, skillB] = getRobotB() : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +>[numberB, nameB, skillB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +>[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>multiRobotB : [string, [string, string]] + +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +>[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB() : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +>[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +[numberB, ...robotAInfo] = robotB; +>[numberB, ...robotAInfo] = robotB : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotB : [number, string, string] + +[numberB, ...robotAInfo] = getRobotB(); +>[numberB, ...robotAInfo] = getRobotB() : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +>[numberB, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[...multiRobotAInfo] = multiRobotA; +>[...multiRobotAInfo] = multiRobotA : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] + +[...multiRobotAInfo] = getMultiRobotB(); +>[...multiRobotAInfo] = getMultiRobotB() : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillB : string +} + +function getRobotB() { +>getRobotB : () => [number, string, string] + + return robotB; +>robotB : [number, string, string] +} + +function getMultiRobotB() { +>getMultiRobotB : () => [string, [string, string]] + + return multiRobotB; +>multiRobotB : [string, [string, string]] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..8cc61944e76 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js @@ -0,0 +1,34 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + +let [, nameA = "noName"] = robotA; +let [numberB = -1] = robotB; +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + +let [numberA3 = -1, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var _a = robotA[1], nameA = _a === void 0 ? "noName" : _a; +var _b = robotB[0], numberB = _b === void 0 ? -1 : _b; +var _c = robotA[0], numberA2 = _c === void 0 ? -1 : _c, _d = robotA[1], nameA2 = _d === void 0 ? "noName" : _d, _e = robotA[2], skillA2 = _e === void 0 ? "noSkill" : _e; +var _f = [3, "edging", "Trimming edges"][0], numberC2 = _f === void 0 ? -1 : _f; +var _g = [3, "edging", "Trimming edges"], _h = _g[0], numberC = _h === void 0 ? -1 : _h, _j = _g[1], nameC = _j === void 0 ? "noName" : _j, _k = _g[2], skillC = _k === void 0 ? "noSkill" : _k; +var _l = robotA[0], numberA3 = _l === void 0 ? -1 : _l, robotAInfo = robotA.slice(1); +if (nameA == nameA2) { + console.log(skillA2); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..ce017fbbbcd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAExC,kBAAgB,EAAhB,qCAAgB,CAAW;AAC7B,kBAAY,EAAZ,iCAAY,CAAW;AACvB,kBAAa,EAAb,kCAAa,EAAE,cAAiB,EAAjB,sCAAiB,EAAE,cAAmB,EAAnB,wCAAmB,CAAW;AAEhE,2CAAa,EAAb,kCAAa,CAAoC;AACtD,IAAA,oCAA0F,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAgB,EAAhB,qCAAgB,EAAE,UAAkB,EAAlB,uCAAkB,CAAoC;AAEtF,kBAAa,EAAb,kCAAa,EAAE,4BAAa,CAAW;AAE5C,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..9df44518ca1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,342 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(6, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(6, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(6, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(6, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(6, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(6, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(6, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(6, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(6, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(6, 48) + SourceIndex(0) +--- +>>>var _a = robotA[1], nameA = _a === void 0 ? "noName" : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > + >let [, +2 >nameA = "noName" +3 > +4 > nameA = "noName" +5 > ] = robotA; +1->Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 19) Source(8, 24) + SourceIndex(0) +3 >Emitted(3, 21) Source(8, 8) + SourceIndex(0) +4 >Emitted(3, 58) Source(8, 24) + SourceIndex(0) +5 >Emitted(3, 59) Source(8, 35) + SourceIndex(0) +--- +>>>var _b = robotB[0], numberB = _b === void 0 ? -1 : _b; +1 > +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >let [ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = robotB; +1 >Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 19) Source(9, 18) + SourceIndex(0) +3 >Emitted(4, 21) Source(9, 6) + SourceIndex(0) +4 >Emitted(4, 54) Source(9, 18) + SourceIndex(0) +5 >Emitted(4, 55) Source(9, 29) + SourceIndex(0) +--- +>>>var _c = robotA[0], numberA2 = _c === void 0 ? -1 : _c, _d = robotA[1], nameA2 = _d === void 0 ? "noName" : _d, _e = robotA[2], skillA2 = _e === void 0 ? "noSkill" : _e; +1-> +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +1-> + >let [ +2 >numberA2 = -1 +3 > +4 > numberA2 = -1 +5 > , +6 > nameA2 = "noName" +7 > +8 > nameA2 = "noName" +9 > , +10> skillA2 = "noSkill" +11> +12> skillA2 = "noSkill" +13> ] = robotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) +3 >Emitted(5, 21) Source(10, 6) + SourceIndex(0) +4 >Emitted(5, 55) Source(10, 19) + SourceIndex(0) +5 >Emitted(5, 57) Source(10, 21) + SourceIndex(0) +6 >Emitted(5, 71) Source(10, 38) + SourceIndex(0) +7 >Emitted(5, 73) Source(10, 21) + SourceIndex(0) +8 >Emitted(5, 111) Source(10, 38) + SourceIndex(0) +9 >Emitted(5, 113) Source(10, 40) + SourceIndex(0) +10>Emitted(5, 127) Source(10, 59) + SourceIndex(0) +11>Emitted(5, 129) Source(10, 40) + SourceIndex(0) +12>Emitted(5, 169) Source(10, 59) + SourceIndex(0) +13>Emitted(5, 170) Source(10, 70) + SourceIndex(0) +--- +>>>var _f = [3, "edging", "Trimming edges"][0], numberC2 = _f === void 0 ? -1 : _f; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >numberC2 = -1 +3 > +4 > numberC2 = -1 +5 > ] = [3, "edging", "Trimming edges"]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 44) Source(12, 19) + SourceIndex(0) +3 >Emitted(6, 46) Source(12, 6) + SourceIndex(0) +4 >Emitted(6, 80) Source(12, 19) + SourceIndex(0) +5 >Emitted(6, 81) Source(12, 55) + SourceIndex(0) +--- +>>>var _g = [3, "edging", "Trimming edges"], _h = _g[0], numberC = _h === void 0 ? -1 : _h, _j = _g[1], nameC = _j === void 0 ? "noName" : _j, _k = _g[2], skillC = _k === void 0 ? "noSkill" : _k; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^ +1-> + > +2 > +3 > let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"] +4 > +5 > numberC = -1 +6 > +7 > numberC = -1 +8 > , +9 > nameC = "noName" +10> +11> nameC = "noName" +12> , +13> skillC = "noSkill" +14> +15> skillC = "noSkill" +16> ] = [3, "edging", "Trimming edges"]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 41) Source(13, 91) + SourceIndex(0) +4 >Emitted(7, 43) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 53) Source(13, 18) + SourceIndex(0) +6 >Emitted(7, 55) Source(13, 6) + SourceIndex(0) +7 >Emitted(7, 88) Source(13, 18) + SourceIndex(0) +8 >Emitted(7, 90) Source(13, 20) + SourceIndex(0) +9 >Emitted(7, 100) Source(13, 36) + SourceIndex(0) +10>Emitted(7, 102) Source(13, 20) + SourceIndex(0) +11>Emitted(7, 139) Source(13, 36) + SourceIndex(0) +12>Emitted(7, 141) Source(13, 38) + SourceIndex(0) +13>Emitted(7, 151) Source(13, 56) + SourceIndex(0) +14>Emitted(7, 153) Source(13, 38) + SourceIndex(0) +15>Emitted(7, 192) Source(13, 56) + SourceIndex(0) +16>Emitted(7, 193) Source(13, 92) + SourceIndex(0) +--- +>>>var _l = robotA[0], numberA3 = _l === void 0 ? -1 : _l, robotAInfo = robotA.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1 > + > + >let [ +2 >numberA3 = -1 +3 > +4 > numberA3 = -1 +5 > , +6 > ...robotAInfo +7 > ] = robotA; +1 >Emitted(8, 1) Source(15, 6) + SourceIndex(0) +2 >Emitted(8, 19) Source(15, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(15, 6) + SourceIndex(0) +4 >Emitted(8, 55) Source(15, 19) + SourceIndex(0) +5 >Emitted(8, 57) Source(15, 21) + SourceIndex(0) +6 >Emitted(8, 85) Source(15, 34) + SourceIndex(0) +7 >Emitted(8, 86) Source(15, 45) + SourceIndex(0) +--- +>>>if (nameA == nameA2) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameA2 +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +5 >Emitted(9, 10) Source(17, 10) + SourceIndex(0) +6 >Emitted(9, 14) Source(17, 14) + SourceIndex(0) +7 >Emitted(9, 20) Source(17, 20) + SourceIndex(0) +8 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) +9 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) +10>Emitted(9, 23) Source(17, 23) + SourceIndex(0) +--- +>>> console.log(skillA2); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA2 +7 > ) +8 > ; +1->Emitted(10, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(10, 24) Source(18, 24) + SourceIndex(0) +7 >Emitted(10, 25) Source(18, 25) + SourceIndex(0) +8 >Emitted(10, 26) Source(18, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..1800b3bd03c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 5, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +let [, nameA = "noName"] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 7, 6)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +let [numberB = -1] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 8, 5)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 5, 3)) + +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 5)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 38)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +>numberC2 : Symbol(numberC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 11, 5)) + +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +>numberC : Symbol(numberC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 5)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 18)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 36)) + +let [numberA3 = -1, ...robotAInfo] = robotA; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 14, 5)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 14, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +if (nameA == nameA2) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 7, 6)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 19)) + + console.log(skillA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 38)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..2dad459725e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let [, nameA = "noName"] = robotA; +> : undefined +>nameA : string +>"noName" : string +>robotA : [number, string, string] + +let [numberB = -1] = robotB; +>numberB : number +>-1 : number +>1 : number +>robotB : [number, string, string] + +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"noSkill" : string +>robotA : [number, string, string] + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +>numberC2 : number +>-1 : number +>1 : number +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +>numberC : number +>-1 : number +>1 : number +>nameC : string +>"noName" : string +>skillC : string +>"noSkill" : string +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberA3 = -1, ...robotAInfo] = robotA; +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] + +if (nameA == nameA2) { +>nameA == nameA2 : boolean +>nameA : string +>nameA2 : string + + console.log(skillA2); +>console.log(skillA2) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA2 : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..b20e0be4fe0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js @@ -0,0 +1,31 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, string[]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +let [nameMB = "noName" ] = multiRobotB; +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js] +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var _a = multiRobotA[1], skillA = _a === void 0 ? ["noSkill", "noSkill"] : _a; +var _b = multiRobotB[0], nameMB = _b === void 0 ? "noName" : _b; +var _c = multiRobotA[0], nameMA = _c === void 0 ? "noName" : _c, _d = multiRobotA[1], _e = _d === void 0 ? ["noSkill", "noSkill"] : _d, _f = _e[0], primarySkillA = _f === void 0 ? "noSkill" : _f, _g = _e[1], secondarySkillA = _g === void 0 ? "noSkill" : _g; +var _h = ["roomba", ["vaccum", "mopping"]][0], nameMC = _h === void 0 ? "noName" : _h; +var _j = ["roomba", ["vaccum", "mopping"]], _k = _j[0], nameMC2 = _k === void 0 ? "noName" : _k, _l = _j[1], _m = _l === void 0 ? ["noSkill", "noSkill"] : _l, _o = _m[0], primarySkillC = _o === void 0 ? "noSkill" : _o, _p = _m[1], secondarySkillC = _p === void 0 ? "noSkill" : _p; +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..11ca67c19ad --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,uBAA+B,EAA/B,oDAA+B,CAAgB;AACjD,uBAAiB,EAAjB,sCAAiB,CAAiB;AAClC,uBAAiB,EAAjB,sCAAiB,EAAE,mBAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAA0C;AAEpH,6CAAiB,EAAjB,sCAAiB,CAAuC;AAC7D,IAAA,sCAA+I,EAA1I,UAAkB,EAAlB,uCAAkB,EAAE,UAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAgE;AAEhJ,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..30f2ee65592 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,377 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type MultiSkilledRobot = [string, string[]]; + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 16) Source(5, 16) + SourceIndex(0) +4 >Emitted(1, 19) Source(5, 38) + SourceIndex(0) +5 >Emitted(1, 20) Source(5, 39) + SourceIndex(0) +6 >Emitted(1, 27) Source(5, 46) + SourceIndex(0) +7 >Emitted(1, 29) Source(5, 48) + SourceIndex(0) +8 >Emitted(1, 30) Source(5, 49) + SourceIndex(0) +9 >Emitted(1, 38) Source(5, 57) + SourceIndex(0) +10>Emitted(1, 40) Source(5, 59) + SourceIndex(0) +11>Emitted(1, 42) Source(5, 61) + SourceIndex(0) +12>Emitted(1, 43) Source(5, 62) + SourceIndex(0) +13>Emitted(1, 44) Source(5, 63) + SourceIndex(0) +14>Emitted(1, 45) Source(5, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(6, 38) + SourceIndex(0) +5 >Emitted(2, 20) Source(6, 39) + SourceIndex(0) +6 >Emitted(2, 29) Source(6, 48) + SourceIndex(0) +7 >Emitted(2, 31) Source(6, 50) + SourceIndex(0) +8 >Emitted(2, 32) Source(6, 51) + SourceIndex(0) +9 >Emitted(2, 42) Source(6, 61) + SourceIndex(0) +10>Emitted(2, 44) Source(6, 63) + SourceIndex(0) +11>Emitted(2, 52) Source(6, 71) + SourceIndex(0) +12>Emitted(2, 53) Source(6, 72) + SourceIndex(0) +13>Emitted(2, 54) Source(6, 73) + SourceIndex(0) +14>Emitted(2, 55) Source(6, 74) + SourceIndex(0) +--- +>>>var _a = multiRobotA[1], skillA = _a === void 0 ? ["noSkill", "noSkill"] : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > + >let [, +2 >skillA = ["noSkill", "noSkill"] +3 > +4 > skillA = ["noSkill", "noSkill"] +5 > ] = multiRobotA; +1->Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 24) Source(8, 39) + SourceIndex(0) +3 >Emitted(3, 26) Source(8, 8) + SourceIndex(0) +4 >Emitted(3, 78) Source(8, 39) + SourceIndex(0) +5 >Emitted(3, 79) Source(8, 55) + SourceIndex(0) +--- +>>>var _b = multiRobotB[0], nameMB = _b === void 0 ? "noName" : _b; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >let [ +2 >nameMB = "noName" +3 > +4 > nameMB = "noName" +5 > ] = multiRobotB; +1 >Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 24) Source(9, 23) + SourceIndex(0) +3 >Emitted(4, 26) Source(9, 6) + SourceIndex(0) +4 >Emitted(4, 64) Source(9, 23) + SourceIndex(0) +5 >Emitted(4, 65) Source(9, 40) + SourceIndex(0) +--- +>>>var _c = multiRobotA[0], nameMA = _c === void 0 ? "noName" : _c, _d = multiRobotA[1], _e = _d === void 0 ? ["noSkill", "noSkill"] : _d, _f = _e[0], primarySkillA = _f === void 0 ? "noSkill" : _f, _g = _e[1], secondarySkillA = _g === void 0 ? "noSkill" : _g; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +1-> + >let [ +2 >nameMA = "noName" +3 > +4 > nameMA = "noName" +5 > , +6 > [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] +7 > +8 > [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] +9 > +10> primarySkillA = "noSkill" +11> +12> primarySkillA = "noSkill" +13> , +14> secondarySkillA = "noSkill" +15> +16> secondarySkillA = "noSkill" +17> ] = ["noSkill", "noSkill"]] = multiRobotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 24) Source(10, 23) + SourceIndex(0) +3 >Emitted(5, 26) Source(10, 6) + SourceIndex(0) +4 >Emitted(5, 64) Source(10, 23) + SourceIndex(0) +5 >Emitted(5, 66) Source(10, 25) + SourceIndex(0) +6 >Emitted(5, 85) Source(10, 106) + SourceIndex(0) +7 >Emitted(5, 87) Source(10, 25) + SourceIndex(0) +8 >Emitted(5, 135) Source(10, 106) + SourceIndex(0) +9 >Emitted(5, 137) Source(10, 26) + SourceIndex(0) +10>Emitted(5, 147) Source(10, 51) + SourceIndex(0) +11>Emitted(5, 149) Source(10, 26) + SourceIndex(0) +12>Emitted(5, 195) Source(10, 51) + SourceIndex(0) +13>Emitted(5, 197) Source(10, 53) + SourceIndex(0) +14>Emitted(5, 207) Source(10, 80) + SourceIndex(0) +15>Emitted(5, 209) Source(10, 53) + SourceIndex(0) +16>Emitted(5, 257) Source(10, 80) + SourceIndex(0) +17>Emitted(5, 258) Source(10, 122) + SourceIndex(0) +--- +>>>var _h = ["roomba", ["vaccum", "mopping"]][0], nameMC = _h === void 0 ? "noName" : _h; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >nameMC = "noName" +3 > +4 > nameMC = "noName" +5 > ] = ["roomba", ["vaccum", "mopping"]]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 46) Source(12, 23) + SourceIndex(0) +3 >Emitted(6, 48) Source(12, 6) + SourceIndex(0) +4 >Emitted(6, 86) Source(12, 23) + SourceIndex(0) +5 >Emitted(6, 87) Source(12, 62) + SourceIndex(0) +--- +>>>var _j = ["roomba", ["vaccum", "mopping"]], _k = _j[0], nameMC2 = _k === void 0 ? "noName" : _k, _l = _j[1], _m = _l === void 0 ? ["noSkill", "noSkill"] : _l, _o = _m[0], primarySkillC = _o === void 0 ? "noSkill" : _o, _p = _m[1], secondarySkillC = _p === void 0 ? "noSkill" : _p; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^ +1-> + > +2 > +3 > let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]] +4 > +5 > nameMC2 = "noName" +6 > +7 > nameMC2 = "noName" +8 > , +9 > [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] +10> +11> [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] +12> +13> primarySkillC = "noSkill" +14> +15> primarySkillC = "noSkill" +16> , +17> secondarySkillC = "noSkill" +18> +19> secondarySkillC = "noSkill" +20> ] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 43) Source(13, 144) + SourceIndex(0) +4 >Emitted(7, 45) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 55) Source(13, 24) + SourceIndex(0) +6 >Emitted(7, 57) Source(13, 6) + SourceIndex(0) +7 >Emitted(7, 96) Source(13, 24) + SourceIndex(0) +8 >Emitted(7, 98) Source(13, 26) + SourceIndex(0) +9 >Emitted(7, 108) Source(13, 107) + SourceIndex(0) +10>Emitted(7, 110) Source(13, 26) + SourceIndex(0) +11>Emitted(7, 158) Source(13, 107) + SourceIndex(0) +12>Emitted(7, 160) Source(13, 27) + SourceIndex(0) +13>Emitted(7, 170) Source(13, 52) + SourceIndex(0) +14>Emitted(7, 172) Source(13, 27) + SourceIndex(0) +15>Emitted(7, 218) Source(13, 52) + SourceIndex(0) +16>Emitted(7, 220) Source(13, 54) + SourceIndex(0) +17>Emitted(7, 230) Source(13, 81) + SourceIndex(0) +18>Emitted(7, 232) Source(13, 54) + SourceIndex(0) +19>Emitted(7, 280) Source(13, 81) + SourceIndex(0) +20>Emitted(7, 281) Source(13, 145) + SourceIndex(0) +--- +>>>if (nameMB == nameMA) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameMB +6 > == +7 > nameMA +8 > ) +9 > +10> { +1 >Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 3) Source(15, 3) + SourceIndex(0) +3 >Emitted(8, 4) Source(15, 4) + SourceIndex(0) +4 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +5 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +6 >Emitted(8, 15) Source(15, 15) + SourceIndex(0) +7 >Emitted(8, 21) Source(15, 21) + SourceIndex(0) +8 >Emitted(8, 22) Source(15, 22) + SourceIndex(0) +9 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +10>Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>> console.log(skillA[0] + skillA[1]); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > [ +8 > 0 +9 > ] +10> + +11> skillA +12> [ +13> 1 +14> ] +15> ) +16> ; +1->Emitted(9, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(9, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(9, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(9, 25) Source(16, 25) + SourceIndex(0) +9 >Emitted(9, 26) Source(16, 26) + SourceIndex(0) +10>Emitted(9, 29) Source(16, 29) + SourceIndex(0) +11>Emitted(9, 35) Source(16, 35) + SourceIndex(0) +12>Emitted(9, 36) Source(16, 36) + SourceIndex(0) +13>Emitted(9, 37) Source(16, 37) + SourceIndex(0) +14>Emitted(9, 38) Source(16, 38) + SourceIndex(0) +15>Emitted(9, 39) Source(16, 39) + SourceIndex(0) +16>Emitted(9, 40) Source(16, 40) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(17, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..76be77a8095 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 5, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) + +let [nameMB = "noName" ] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 8, 5)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 5, 3)) + +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 5)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 25)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 51)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : Symbol(nameMC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 11, 5)) + +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : Symbol(nameMC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 5)) +>primarySkillC : Symbol(primarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 26)) +>secondarySkillC : Symbol(secondarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 52)) + +if (nameMB == nameMA) { +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 8, 5)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 5)) + + console.log(skillA[0] + skillA[1]); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..12215507d4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types @@ -0,0 +1,97 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +> : undefined +>skillA : string[] +>["noSkill", "noSkill"] : string[] +>"noSkill" : string +>"noSkill" : string +>multiRobotA : [string, string[]] + +let [nameMB = "noName" ] = multiRobotB; +>nameMB : string +>"noName" : string +>multiRobotB : [string, string[]] + +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +>nameMA : string +>"noName" : string +>primarySkillA : string +>"noSkill" : string +>secondarySkillA : string +>"noSkill" : string +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>multiRobotA : [string, string[]] + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : string +>"noName" : string +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : string +>"noName" : string +>primarySkillC : string +>"noSkill" : string +>secondarySkillC : string +>"noSkill" : string +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +if (nameMB == nameMA) { +>nameMB == nameMA : boolean +>nameMB : string +>nameMA : string + + console.log(skillA[0] + skillA[1]); +>console.log(skillA[0] + skillA[1]) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA[0] + skillA[1] : string +>skillA[0] : string +>skillA : string[] +>0 : number +>skillA[1] : string +>skillA : string[] +>1 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js new file mode 100644 index 00000000000..deb2680000f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js @@ -0,0 +1,97 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | string[])[]; + +[, nameA = "helloNoName"] = robotA; +[, nameB = "helloNoName"] = getRobotB(); +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +[, multiSkillB = []] = multiRobotB; +[, multiSkillB = []] = getMultiRobotB(); +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + +[numberB = -1] = robotB; +[numberB = -1] = getRobotB(); +[numberB = -1] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName"] = multiRobotB; +[nameMB = "helloNoName"] = getMultiRobotB(); +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +[numberB = -1, ...robotAInfo] = getRobotB(); +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var nameA, numberB, nameB, skillB; +var robotAInfo; +var multiSkillB, nameMB, primarySkillB, secondarySkillB; +var multiRobotAInfo; +_a = robotA[1], nameA = _a === void 0 ? "helloNoName" : _a; +_b = getRobotB(), _c = _b[1], nameB = _c === void 0 ? "helloNoName" : _c; +_d = [2, "trimmer", "trimming"], _e = _d[1], nameB = _e === void 0 ? "helloNoName" : _e; +_f = multiRobotB[1], multiSkillB = _f === void 0 ? [] : _f; +_g = getMultiRobotB(), _h = _g[1], multiSkillB = _h === void 0 ? [] : _h; +_j = ["roomba", ["vaccum", "mopping"]], _k = _j[1], multiSkillB = _k === void 0 ? [] : _k; +_l = robotB[0], numberB = _l === void 0 ? -1 : _l; +_m = getRobotB()[0], numberB = _m === void 0 ? -1 : _m; +_o = [2, "trimmer", "trimming"][0], numberB = _o === void 0 ? -1 : _o; +_p = multiRobotB[0], nameMB = _p === void 0 ? "helloNoName" : _p; +_q = getMultiRobotB()[0], nameMB = _q === void 0 ? "helloNoName" : _q; +_r = ["trimmer", ["trimming", "edging"]][0], nameMB = _r === void 0 ? "helloNoName" : _r; +_s = robotB[0], numberB = _s === void 0 ? -1 : _s, _t = robotB[1], nameB = _t === void 0 ? "helloNoName" : _t, _u = robotB[2], skillB = _u === void 0 ? "noSkill" : _u; +_v = getRobotB(), _w = _v[0], numberB = _w === void 0 ? -1 : _w, _x = _v[1], nameB = _x === void 0 ? "helloNoName" : _x, _y = _v[2], skillB = _y === void 0 ? "noSkill" : _y; +_z = [2, "trimmer", "trimming"], _0 = _z[0], numberB = _0 === void 0 ? -1 : _0, _1 = _z[1], nameB = _1 === void 0 ? "helloNoName" : _1, _2 = _z[2], skillB = _2 === void 0 ? "noSkill" : _2; +_3 = multiRobotB[0], nameMB = _3 === void 0 ? "helloNoName" : _3, _4 = multiRobotB[1], _5 = _4 === void 0 ? [] : _4, _6 = _5[0], primarySkillB = _6 === void 0 ? "noSkill" : _6, _7 = _5[1], secondarySkillB = _7 === void 0 ? "noSkill" : _7; +_8 = getMultiRobotB(), _9 = _8[0], nameMB = _9 === void 0 ? "helloNoName" : _9, _10 = _8[1], _11 = _10 === void 0 ? [] : _10, _12 = _11[0], primarySkillB = _12 === void 0 ? "noSkill" : _12, _13 = _11[1], secondarySkillB = _13 === void 0 ? "noSkill" : _13; +_14 = ["trimmer", ["trimming", "edging"]], _15 = _14[0], nameMB = _15 === void 0 ? "helloNoName" : _15, _16 = _14[1], _17 = _16 === void 0 ? [] : _16, _18 = _17[0], primarySkillB = _18 === void 0 ? "noSkill" : _18, _19 = _17[1], secondarySkillB = _19 === void 0 ? "noSkill" : _19; +_20 = robotB[0], numberB = _20 === void 0 ? -1 : _20, robotAInfo = robotB.slice(1); +_21 = getRobotB(), _22 = _21[0], numberB = _22 === void 0 ? -1 : _22, robotAInfo = _21.slice(1); +_23 = [2, "trimmer", "trimming"], _24 = _23[0], numberB = _24 === void 0 ? -1 : _24, robotAInfo = _23.slice(1); +if (nameA == nameB) { + console.log(skillB); +} +function getRobotB() { + return robotB; +} +function getMultiRobotB() { + return multiRobotB; +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24; +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map new file mode 100644 index 00000000000..1b7453826e4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAAqB,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAC1F,IAAI,eAAsC,CAAC;AAExC,cAAqB,EAArB,0CAAqB,CAAW;AACnC,gBAAuC,EAApC,UAAqB,EAArB,0CAAqB,CAAgB;AACxC,+BAAsD,EAAnD,UAAqB,EAArB,0CAAqB,CAA+B;AACpD,mBAAgB,EAAhB,qCAAgB,CAAgB;AACnC,qBAAuC,EAApC,UAAgB,EAAhB,qCAAgB,CAAqB;AACxC,sCAAwD,EAArD,UAAgB,EAAhB,qCAAgB,CAAsC;AAExD,cAAY,EAAZ,iCAAY,CAAW;AACvB,mBAAY,EAAZ,iCAAY,CAAgB;AAC5B,kCAAY,EAAZ,iCAAY,CAA+B;AAC3C,mBAAsB,EAAtB,2CAAsB,CAAgB;AACtC,wBAAsB,EAAtB,2CAAsB,CAAqB;AAC3C,2CAAsB,EAAtB,2CAAsB,CAAwC;AAE9D,cAAY,EAAZ,iCAAY,EAAE,cAAqB,EAArB,0CAAqB,EAAE,cAAkB,EAAlB,uCAAkB,CAAW;AACnE,gBAAuE,EAAtE,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAAgB;AACxE,+BAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAA+B;AACtF,mBAAsB,EAAtB,2CAAsB,EAAE,mBAA6D,EAA7D,4BAA6D,EAA5D,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAsB;AACtG,qBAA0G,EAAzG,UAAsB,EAAtB,2CAAsB,EAAE,WAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CAA2B;AAC3G,yCACuC,EADtC,YAAsB,EAAtB,6CAAsB,EAAE,YAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CACxC;AAEvC,eAAY,EAAZ,mCAAY,EAAE,4BAAa,CAAW;AACvC,iBAA2C,EAA1C,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAgB;AAC5C,gCAAiE,EAAhE,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAsC;AAElE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt new file mode 100644 index 00000000000..c9784dc30a3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt @@ -0,0 +1,1090 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, string[]]; + > + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 16) Source(9, 16) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 38) + SourceIndex(0) +5 >Emitted(3, 20) Source(9, 39) + SourceIndex(0) +6 >Emitted(3, 27) Source(9, 46) + SourceIndex(0) +7 >Emitted(3, 29) Source(9, 48) + SourceIndex(0) +8 >Emitted(3, 30) Source(9, 49) + SourceIndex(0) +9 >Emitted(3, 38) Source(9, 57) + SourceIndex(0) +10>Emitted(3, 40) Source(9, 59) + SourceIndex(0) +11>Emitted(3, 42) Source(9, 61) + SourceIndex(0) +12>Emitted(3, 43) Source(9, 62) + SourceIndex(0) +13>Emitted(3, 44) Source(9, 63) + SourceIndex(0) +14>Emitted(3, 45) Source(9, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(4, 16) Source(10, 16) + SourceIndex(0) +4 >Emitted(4, 19) Source(10, 38) + SourceIndex(0) +5 >Emitted(4, 20) Source(10, 39) + SourceIndex(0) +6 >Emitted(4, 29) Source(10, 48) + SourceIndex(0) +7 >Emitted(4, 31) Source(10, 50) + SourceIndex(0) +8 >Emitted(4, 32) Source(10, 51) + SourceIndex(0) +9 >Emitted(4, 42) Source(10, 61) + SourceIndex(0) +10>Emitted(4, 44) Source(10, 63) + SourceIndex(0) +11>Emitted(4, 52) Source(10, 71) + SourceIndex(0) +12>Emitted(4, 53) Source(10, 72) + SourceIndex(0) +13>Emitted(4, 54) Source(10, 73) + SourceIndex(0) +14>Emitted(4, 55) Source(10, 74) + SourceIndex(0) +--- +>>>var nameA, numberB, nameB, skillB; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +1 > + > + > +2 >let +3 > nameA: string +4 > , +5 > numberB: number +6 > , +7 > nameB: string +8 > , +9 > skillB: string +10> ; +1 >Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 10) Source(12, 18) + SourceIndex(0) +4 >Emitted(5, 12) Source(12, 20) + SourceIndex(0) +5 >Emitted(5, 19) Source(12, 35) + SourceIndex(0) +6 >Emitted(5, 21) Source(12, 37) + SourceIndex(0) +7 >Emitted(5, 26) Source(12, 50) + SourceIndex(0) +8 >Emitted(5, 28) Source(12, 52) + SourceIndex(0) +9 >Emitted(5, 34) Source(12, 66) + SourceIndex(0) +10>Emitted(5, 35) Source(12, 67) + SourceIndex(0) +--- +>>>var robotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > robotAInfo: (number | string)[] +4 > ; +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 15) Source(13, 36) + SourceIndex(0) +4 >Emitted(6, 16) Source(13, 37) + SourceIndex(0) +--- +>>>var multiSkillB, nameMB, primarySkillB, secondarySkillB; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^ +1-> + > + > +2 >let +3 > multiSkillB: string[] +4 > , +5 > nameMB: string +6 > , +7 > primarySkillB: string +8 > , +9 > secondarySkillB: string +10> ; +1->Emitted(7, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(15, 26) + SourceIndex(0) +4 >Emitted(7, 18) Source(15, 28) + SourceIndex(0) +5 >Emitted(7, 24) Source(15, 42) + SourceIndex(0) +6 >Emitted(7, 26) Source(15, 44) + SourceIndex(0) +7 >Emitted(7, 39) Source(15, 65) + SourceIndex(0) +8 >Emitted(7, 41) Source(15, 67) + SourceIndex(0) +9 >Emitted(7, 56) Source(15, 90) + SourceIndex(0) +10>Emitted(7, 57) Source(15, 91) + SourceIndex(0) +--- +>>>var multiRobotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > multiRobotAInfo: (string | string[])[] +4 > ; +1 >Emitted(8, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(8, 20) Source(16, 43) + SourceIndex(0) +4 >Emitted(8, 21) Source(16, 44) + SourceIndex(0) +--- +>>>_a = robotA[1], nameA = _a === void 0 ? "helloNoName" : _a; +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> +1-> + > + >[, +2 >nameA = "helloNoName" +3 > +4 > nameA = "helloNoName" +5 > ] = robotA; +1->Emitted(9, 1) Source(18, 4) + SourceIndex(0) +2 >Emitted(9, 15) Source(18, 25) + SourceIndex(0) +3 >Emitted(9, 17) Source(18, 4) + SourceIndex(0) +4 >Emitted(9, 59) Source(18, 25) + SourceIndex(0) +5 >Emitted(9, 60) Source(18, 36) + SourceIndex(0) +--- +>>>_b = getRobotB(), _c = _b[1], nameB = _c === void 0 ? "helloNoName" : _c; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, nameB = "helloNoName"] = getRobotB() +3 > +4 > nameB = "helloNoName" +5 > +6 > nameB = "helloNoName" +7 > ] = getRobotB(); +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 17) Source(19, 40) + SourceIndex(0) +3 >Emitted(10, 19) Source(19, 4) + SourceIndex(0) +4 >Emitted(10, 29) Source(19, 25) + SourceIndex(0) +5 >Emitted(10, 31) Source(19, 4) + SourceIndex(0) +6 >Emitted(10, 73) Source(19, 25) + SourceIndex(0) +7 >Emitted(10, 74) Source(19, 41) + SourceIndex(0) +--- +>>>_d = [2, "trimmer", "trimming"], _e = _d[1], nameB = _e === void 0 ? "helloNoName" : _e; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] +3 > +4 > nameB = "helloNoName" +5 > +6 > nameB = "helloNoName" +7 > ] = [2, "trimmer", "trimming"]; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 32) Source(20, 55) + SourceIndex(0) +3 >Emitted(11, 34) Source(20, 4) + SourceIndex(0) +4 >Emitted(11, 44) Source(20, 25) + SourceIndex(0) +5 >Emitted(11, 46) Source(20, 4) + SourceIndex(0) +6 >Emitted(11, 88) Source(20, 25) + SourceIndex(0) +7 >Emitted(11, 89) Source(20, 56) + SourceIndex(0) +--- +>>>_f = multiRobotB[1], multiSkillB = _f === void 0 ? [] : _f; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> +1 > + >[, +2 >multiSkillB = [] +3 > +4 > multiSkillB = [] +5 > ] = multiRobotB; +1 >Emitted(12, 1) Source(21, 4) + SourceIndex(0) +2 >Emitted(12, 20) Source(21, 20) + SourceIndex(0) +3 >Emitted(12, 22) Source(21, 4) + SourceIndex(0) +4 >Emitted(12, 59) Source(21, 20) + SourceIndex(0) +5 >Emitted(12, 60) Source(21, 36) + SourceIndex(0) +--- +>>>_g = getMultiRobotB(), _h = _g[1], multiSkillB = _h === void 0 ? [] : _h; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, multiSkillB = []] = getMultiRobotB() +3 > +4 > multiSkillB = [] +5 > +6 > multiSkillB = [] +7 > ] = getMultiRobotB(); +1->Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 22) Source(22, 40) + SourceIndex(0) +3 >Emitted(13, 24) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 34) Source(22, 20) + SourceIndex(0) +5 >Emitted(13, 36) Source(22, 4) + SourceIndex(0) +6 >Emitted(13, 73) Source(22, 20) + SourceIndex(0) +7 >Emitted(13, 74) Source(22, 41) + SourceIndex(0) +--- +>>>_j = ["roomba", ["vaccum", "mopping"]], _k = _j[1], multiSkillB = _k === void 0 ? [] : _k; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]] +3 > +4 > multiSkillB = [] +5 > +6 > multiSkillB = [] +7 > ] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 39) Source(23, 57) + SourceIndex(0) +3 >Emitted(14, 41) Source(23, 4) + SourceIndex(0) +4 >Emitted(14, 51) Source(23, 20) + SourceIndex(0) +5 >Emitted(14, 53) Source(23, 4) + SourceIndex(0) +6 >Emitted(14, 90) Source(23, 20) + SourceIndex(0) +7 >Emitted(14, 91) Source(23, 58) + SourceIndex(0) +--- +>>>_l = robotB[0], numberB = _l === void 0 ? -1 : _l; +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^-> +1 > + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = robotB; +1 >Emitted(15, 1) Source(25, 2) + SourceIndex(0) +2 >Emitted(15, 15) Source(25, 14) + SourceIndex(0) +3 >Emitted(15, 17) Source(25, 2) + SourceIndex(0) +4 >Emitted(15, 50) Source(25, 14) + SourceIndex(0) +5 >Emitted(15, 51) Source(25, 25) + SourceIndex(0) +--- +>>>_m = getRobotB()[0], numberB = _m === void 0 ? -1 : _m; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = getRobotB(); +1->Emitted(16, 1) Source(26, 2) + SourceIndex(0) +2 >Emitted(16, 20) Source(26, 14) + SourceIndex(0) +3 >Emitted(16, 22) Source(26, 2) + SourceIndex(0) +4 >Emitted(16, 55) Source(26, 14) + SourceIndex(0) +5 >Emitted(16, 56) Source(26, 30) + SourceIndex(0) +--- +>>>_o = [2, "trimmer", "trimming"][0], numberB = _o === void 0 ? -1 : _o; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = [2, "trimmer", "trimming"]; +1->Emitted(17, 1) Source(27, 2) + SourceIndex(0) +2 >Emitted(17, 35) Source(27, 14) + SourceIndex(0) +3 >Emitted(17, 37) Source(27, 2) + SourceIndex(0) +4 >Emitted(17, 70) Source(27, 14) + SourceIndex(0) +5 >Emitted(17, 71) Source(27, 45) + SourceIndex(0) +--- +>>>_p = multiRobotB[0], nameMB = _p === void 0 ? "helloNoName" : _p; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^-> +1 > + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = multiRobotB; +1 >Emitted(18, 1) Source(28, 2) + SourceIndex(0) +2 >Emitted(18, 20) Source(28, 24) + SourceIndex(0) +3 >Emitted(18, 22) Source(28, 2) + SourceIndex(0) +4 >Emitted(18, 65) Source(28, 24) + SourceIndex(0) +5 >Emitted(18, 66) Source(28, 40) + SourceIndex(0) +--- +>>>_q = getMultiRobotB()[0], nameMB = _q === void 0 ? "helloNoName" : _q; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = getMultiRobotB(); +1->Emitted(19, 1) Source(29, 2) + SourceIndex(0) +2 >Emitted(19, 25) Source(29, 24) + SourceIndex(0) +3 >Emitted(19, 27) Source(29, 2) + SourceIndex(0) +4 >Emitted(19, 70) Source(29, 24) + SourceIndex(0) +5 >Emitted(19, 71) Source(29, 45) + SourceIndex(0) +--- +>>>_r = ["trimmer", ["trimming", "edging"]][0], nameMB = _r === void 0 ? "helloNoName" : _r; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(20, 1) Source(30, 2) + SourceIndex(0) +2 >Emitted(20, 44) Source(30, 24) + SourceIndex(0) +3 >Emitted(20, 46) Source(30, 2) + SourceIndex(0) +4 >Emitted(20, 89) Source(30, 24) + SourceIndex(0) +5 >Emitted(20, 90) Source(30, 64) + SourceIndex(0) +--- +>>>_s = robotB[0], numberB = _s === void 0 ? -1 : _s, _t = robotB[1], nameB = _t === void 0 ? "helloNoName" : _t, _u = robotB[2], skillB = _u === void 0 ? "noSkill" : _u; +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^^-> +1-> + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > , +6 > nameB = "helloNoName" +7 > +8 > nameB = "helloNoName" +9 > , +10> skillB = "noSkill" +11> +12> skillB = "noSkill" +13> ] = robotB; +1->Emitted(21, 1) Source(32, 2) + SourceIndex(0) +2 >Emitted(21, 15) Source(32, 14) + SourceIndex(0) +3 >Emitted(21, 17) Source(32, 2) + SourceIndex(0) +4 >Emitted(21, 50) Source(32, 14) + SourceIndex(0) +5 >Emitted(21, 52) Source(32, 16) + SourceIndex(0) +6 >Emitted(21, 66) Source(32, 37) + SourceIndex(0) +7 >Emitted(21, 68) Source(32, 16) + SourceIndex(0) +8 >Emitted(21, 110) Source(32, 37) + SourceIndex(0) +9 >Emitted(21, 112) Source(32, 39) + SourceIndex(0) +10>Emitted(21, 126) Source(32, 57) + SourceIndex(0) +11>Emitted(21, 128) Source(32, 39) + SourceIndex(0) +12>Emitted(21, 167) Source(32, 57) + SourceIndex(0) +13>Emitted(21, 168) Source(32, 68) + SourceIndex(0) +--- +>>>_v = getRobotB(), _w = _v[0], numberB = _w === void 0 ? -1 : _w, _x = _v[1], nameB = _x === void 0 ? "helloNoName" : _x, _y = _v[2], skillB = _y === void 0 ? "noSkill" : _y; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^ +16> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > nameB = "helloNoName" +9 > +10> nameB = "helloNoName" +11> , +12> skillB = "noSkill" +13> +14> skillB = "noSkill" +15> ] = getRobotB(); +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 17) Source(33, 72) + SourceIndex(0) +3 >Emitted(22, 19) Source(33, 2) + SourceIndex(0) +4 >Emitted(22, 29) Source(33, 14) + SourceIndex(0) +5 >Emitted(22, 31) Source(33, 2) + SourceIndex(0) +6 >Emitted(22, 64) Source(33, 14) + SourceIndex(0) +7 >Emitted(22, 66) Source(33, 16) + SourceIndex(0) +8 >Emitted(22, 76) Source(33, 37) + SourceIndex(0) +9 >Emitted(22, 78) Source(33, 16) + SourceIndex(0) +10>Emitted(22, 120) Source(33, 37) + SourceIndex(0) +11>Emitted(22, 122) Source(33, 39) + SourceIndex(0) +12>Emitted(22, 132) Source(33, 57) + SourceIndex(0) +13>Emitted(22, 134) Source(33, 39) + SourceIndex(0) +14>Emitted(22, 173) Source(33, 57) + SourceIndex(0) +15>Emitted(22, 174) Source(33, 73) + SourceIndex(0) +--- +>>>_z = [2, "trimmer", "trimming"], _0 = _z[0], numberB = _0 === void 0 ? -1 : _0, _1 = _z[1], nameB = _1 === void 0 ? "helloNoName" : _1, _2 = _z[2], skillB = _2 === void 0 ? "noSkill" : _2; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > nameB = "helloNoName" +9 > +10> nameB = "helloNoName" +11> , +12> skillB = "noSkill" +13> +14> skillB = "noSkill" +15> ] = [2, "trimmer", "trimming"]; +1->Emitted(23, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(23, 32) Source(34, 87) + SourceIndex(0) +3 >Emitted(23, 34) Source(34, 2) + SourceIndex(0) +4 >Emitted(23, 44) Source(34, 14) + SourceIndex(0) +5 >Emitted(23, 46) Source(34, 2) + SourceIndex(0) +6 >Emitted(23, 79) Source(34, 14) + SourceIndex(0) +7 >Emitted(23, 81) Source(34, 16) + SourceIndex(0) +8 >Emitted(23, 91) Source(34, 37) + SourceIndex(0) +9 >Emitted(23, 93) Source(34, 16) + SourceIndex(0) +10>Emitted(23, 135) Source(34, 37) + SourceIndex(0) +11>Emitted(23, 137) Source(34, 39) + SourceIndex(0) +12>Emitted(23, 147) Source(34, 57) + SourceIndex(0) +13>Emitted(23, 149) Source(34, 39) + SourceIndex(0) +14>Emitted(23, 188) Source(34, 57) + SourceIndex(0) +15>Emitted(23, 189) Source(34, 88) + SourceIndex(0) +--- +>>>_3 = multiRobotB[0], nameMB = _3 === void 0 ? "helloNoName" : _3, _4 = multiRobotB[1], _5 = _4 === void 0 ? [] : _4, _6 = _5[0], primarySkillB = _6 === void 0 ? "noSkill" : _6, _7 = _5[1], secondarySkillB = _7 === void 0 ? "noSkill" : _7; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +18> ^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > , +6 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +7 > +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> primarySkillB = "noSkill" +11> +12> primarySkillB = "noSkill" +13> , +14> secondarySkillB = "noSkill" +15> +16> secondarySkillB = "noSkill" +17> ] = []] = multiRobotB; +1->Emitted(24, 1) Source(35, 2) + SourceIndex(0) +2 >Emitted(24, 20) Source(35, 24) + SourceIndex(0) +3 >Emitted(24, 22) Source(35, 2) + SourceIndex(0) +4 >Emitted(24, 65) Source(35, 24) + SourceIndex(0) +5 >Emitted(24, 67) Source(35, 26) + SourceIndex(0) +6 >Emitted(24, 86) Source(35, 87) + SourceIndex(0) +7 >Emitted(24, 88) Source(35, 26) + SourceIndex(0) +8 >Emitted(24, 116) Source(35, 87) + SourceIndex(0) +9 >Emitted(24, 118) Source(35, 27) + SourceIndex(0) +10>Emitted(24, 128) Source(35, 52) + SourceIndex(0) +11>Emitted(24, 130) Source(35, 27) + SourceIndex(0) +12>Emitted(24, 176) Source(35, 52) + SourceIndex(0) +13>Emitted(24, 178) Source(35, 54) + SourceIndex(0) +14>Emitted(24, 188) Source(35, 81) + SourceIndex(0) +15>Emitted(24, 190) Source(35, 54) + SourceIndex(0) +16>Emitted(24, 238) Source(35, 81) + SourceIndex(0) +17>Emitted(24, 239) Source(35, 103) + SourceIndex(0) +--- +>>>_8 = getMultiRobotB(), _9 = _8[0], nameMB = _9 === void 0 ? "helloNoName" : _9, _10 = _8[1], _11 = _10 === void 0 ? [] : _10, _12 = _11[0], primarySkillB = _12 === void 0 ? "noSkill" : _12, _13 = _11[1], secondarySkillB = _13 === void 0 ? "noSkill" : _13; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() +3 > +4 > nameMB = "helloNoName" +5 > +6 > nameMB = "helloNoName" +7 > , +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +11> +12> primarySkillB = "noSkill" +13> +14> primarySkillB = "noSkill" +15> , +16> secondarySkillB = "noSkill" +17> +18> secondarySkillB = "noSkill" +19> ] = []] = getMultiRobotB(); +1->Emitted(25, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(25, 22) Source(36, 107) + SourceIndex(0) +3 >Emitted(25, 24) Source(36, 2) + SourceIndex(0) +4 >Emitted(25, 34) Source(36, 24) + SourceIndex(0) +5 >Emitted(25, 36) Source(36, 2) + SourceIndex(0) +6 >Emitted(25, 79) Source(36, 24) + SourceIndex(0) +7 >Emitted(25, 81) Source(36, 26) + SourceIndex(0) +8 >Emitted(25, 92) Source(36, 87) + SourceIndex(0) +9 >Emitted(25, 94) Source(36, 26) + SourceIndex(0) +10>Emitted(25, 125) Source(36, 87) + SourceIndex(0) +11>Emitted(25, 127) Source(36, 27) + SourceIndex(0) +12>Emitted(25, 139) Source(36, 52) + SourceIndex(0) +13>Emitted(25, 141) Source(36, 27) + SourceIndex(0) +14>Emitted(25, 189) Source(36, 52) + SourceIndex(0) +15>Emitted(25, 191) Source(36, 54) + SourceIndex(0) +16>Emitted(25, 203) Source(36, 81) + SourceIndex(0) +17>Emitted(25, 205) Source(36, 54) + SourceIndex(0) +18>Emitted(25, 255) Source(36, 81) + SourceIndex(0) +19>Emitted(25, 256) Source(36, 108) + SourceIndex(0) +--- +>>>_14 = ["trimmer", ["trimming", "edging"]], _15 = _14[0], nameMB = _15 === void 0 ? "helloNoName" : _15, _16 = _14[1], _17 = _16 === void 0 ? [] : _16, _18 = _17[0], primarySkillB = _18 === void 0 ? "noSkill" : _18, _19 = _17[1], secondarySkillB = _19 === void 0 ? "noSkill" : _19; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^ +1-> + > +2 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + > ["trimmer", ["trimming", "edging"]] +3 > +4 > nameMB = "helloNoName" +5 > +6 > nameMB = "helloNoName" +7 > , +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +11> +12> primarySkillB = "noSkill" +13> +14> primarySkillB = "noSkill" +15> , +16> secondarySkillB = "noSkill" +17> +18> secondarySkillB = "noSkill" +19> ] = []] = + > ["trimmer", ["trimming", "edging"]]; +1->Emitted(26, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(26, 42) Source(38, 40) + SourceIndex(0) +3 >Emitted(26, 44) Source(37, 2) + SourceIndex(0) +4 >Emitted(26, 56) Source(37, 24) + SourceIndex(0) +5 >Emitted(26, 58) Source(37, 2) + SourceIndex(0) +6 >Emitted(26, 103) Source(37, 24) + SourceIndex(0) +7 >Emitted(26, 105) Source(37, 26) + SourceIndex(0) +8 >Emitted(26, 117) Source(37, 87) + SourceIndex(0) +9 >Emitted(26, 119) Source(37, 26) + SourceIndex(0) +10>Emitted(26, 150) Source(37, 87) + SourceIndex(0) +11>Emitted(26, 152) Source(37, 27) + SourceIndex(0) +12>Emitted(26, 164) Source(37, 52) + SourceIndex(0) +13>Emitted(26, 166) Source(37, 27) + SourceIndex(0) +14>Emitted(26, 214) Source(37, 52) + SourceIndex(0) +15>Emitted(26, 216) Source(37, 54) + SourceIndex(0) +16>Emitted(26, 228) Source(37, 81) + SourceIndex(0) +17>Emitted(26, 230) Source(37, 54) + SourceIndex(0) +18>Emitted(26, 280) Source(37, 81) + SourceIndex(0) +19>Emitted(26, 281) Source(38, 41) + SourceIndex(0) +--- +>>>_20 = robotB[0], numberB = _20 === void 0 ? -1 : _20, robotAInfo = robotB.slice(1); +1 > +2 >^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^-> +1 > + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > , +6 > ...robotAInfo +7 > ] = robotB; +1 >Emitted(27, 1) Source(40, 2) + SourceIndex(0) +2 >Emitted(27, 16) Source(40, 14) + SourceIndex(0) +3 >Emitted(27, 18) Source(40, 2) + SourceIndex(0) +4 >Emitted(27, 53) Source(40, 14) + SourceIndex(0) +5 >Emitted(27, 55) Source(40, 16) + SourceIndex(0) +6 >Emitted(27, 83) Source(40, 29) + SourceIndex(0) +7 >Emitted(27, 84) Source(40, 40) + SourceIndex(0) +--- +>>>_21 = getRobotB(), _22 = _21[0], numberB = _22 === void 0 ? -1 : _22, robotAInfo = _21.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, ...robotAInfo] = getRobotB() +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > ...robotAInfo +9 > ] = getRobotB(); +1->Emitted(28, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(28, 18) Source(41, 44) + SourceIndex(0) +3 >Emitted(28, 20) Source(41, 2) + SourceIndex(0) +4 >Emitted(28, 32) Source(41, 14) + SourceIndex(0) +5 >Emitted(28, 34) Source(41, 2) + SourceIndex(0) +6 >Emitted(28, 69) Source(41, 14) + SourceIndex(0) +7 >Emitted(28, 71) Source(41, 16) + SourceIndex(0) +8 >Emitted(28, 96) Source(41, 29) + SourceIndex(0) +9 >Emitted(28, 97) Source(41, 45) + SourceIndex(0) +--- +>>>_23 = [2, "trimmer", "trimming"], _24 = _23[0], numberB = _24 === void 0 ? -1 : _24, robotAInfo = _23.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +1-> + > +2 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > ...robotAInfo +9 > ] = [2, "trimmer", "trimming"]; +1->Emitted(29, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(29, 33) Source(42, 66) + SourceIndex(0) +3 >Emitted(29, 35) Source(42, 2) + SourceIndex(0) +4 >Emitted(29, 47) Source(42, 14) + SourceIndex(0) +5 >Emitted(29, 49) Source(42, 2) + SourceIndex(0) +6 >Emitted(29, 84) Source(42, 14) + SourceIndex(0) +7 >Emitted(29, 86) Source(42, 16) + SourceIndex(0) +8 >Emitted(29, 111) Source(42, 29) + SourceIndex(0) +9 >Emitted(29, 112) Source(42, 67) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 3) Source(44, 3) + SourceIndex(0) +3 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) +4 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +5 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) +6 >Emitted(30, 14) Source(44, 14) + SourceIndex(0) +7 >Emitted(30, 19) Source(44, 19) + SourceIndex(0) +8 >Emitted(30, 20) Source(44, 20) + SourceIndex(0) +9 >Emitted(30, 21) Source(44, 21) + SourceIndex(0) +10>Emitted(30, 22) Source(44, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(31, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(31, 23) Source(45, 23) + SourceIndex(0) +7 >Emitted(31, 24) Source(45, 24) + SourceIndex(0) +8 >Emitted(31, 25) Source(45, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(46, 2) + SourceIndex(0) +--- +>>>function getRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(33, 1) Source(48, 1) + SourceIndex(0) +--- +>>> return robotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobotB() { + > +2 > return +3 > +4 > robotB +5 > ; +1->Emitted(34, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(34, 11) Source(49, 11) + SourceIndex(0) +3 >Emitted(34, 12) Source(49, 12) + SourceIndex(0) +4 >Emitted(34, 18) Source(49, 18) + SourceIndex(0) +5 >Emitted(34, 19) Source(49, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(50, 2) + SourceIndex(0) +--- +>>>function getMultiRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(36, 1) Source(52, 1) + SourceIndex(0) +--- +>>> return multiRobotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobotB() { + > +2 > return +3 > +4 > multiRobotB +5 > ; +1->Emitted(37, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(37, 11) Source(53, 11) + SourceIndex(0) +3 >Emitted(37, 12) Source(53, 12) + SourceIndex(0) +4 >Emitted(37, 23) Source(53, 23) + SourceIndex(0) +5 >Emitted(37, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(54, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24; +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols new file mode 100644 index 00000000000..c4d6b52fc4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols @@ -0,0 +1,167 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 8, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) + +let robotAInfo: (number | string)[]; +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) + +let multiRobotAInfo: (string | string[])[]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 15, 3)) + +[, nameA = "helloNoName"] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 6, 3)) + +[, nameB = "helloNoName"] = getRobotB(); +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) + +[, multiSkillB = []] = multiRobotB; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[, multiSkillB = []] = getMultiRobotB(); +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) + +[numberB = -1] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) + +[nameMB = "helloNoName"] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[nameMB = "helloNoName"] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) + + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1, ...robotAInfo] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +} + +function getRobotB() { +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + + return robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) +} + +function getMultiRobotB() { +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + + return multiRobotB; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types new file mode 100644 index 00000000000..7edf6c63e4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -0,0 +1,361 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : string +>numberB : number +>nameB : string +>skillB : string + +let robotAInfo: (number | string)[]; +>robotAInfo : (number | string)[] + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : string[] +>nameMB : string +>primarySkillB : string +>secondarySkillB : string + +let multiRobotAInfo: (string | string[])[]; +>multiRobotAInfo : (string | string[])[] + +[, nameA = "helloNoName"] = robotA; +>[, nameA = "helloNoName"] = robotA : [number, string, string] +>[, nameA = "helloNoName"] : [undefined, string] +> : undefined +>nameA = "helloNoName" : string +>nameA : string +>"helloNoName" : string +>robotA : [number, string, string] + +[, nameB = "helloNoName"] = getRobotB(); +>[, nameB = "helloNoName"] = getRobotB() : [number, string, string] +>[, nameB = "helloNoName"] : [undefined, string] +> : undefined +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +>[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB = "helloNoName"] : [undefined, string] +> : undefined +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[, multiSkillB = []] = multiRobotB; +>[, multiSkillB = []] = multiRobotB : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>multiRobotB : [string, string[]] + +[, multiSkillB = []] = getMultiRobotB(); +>[, multiSkillB = []] = getMultiRobotB() : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +>[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]] : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +[numberB = -1] = robotB; +>[numberB = -1] = robotB : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robotB : [number, string, string] + +[numberB = -1] = getRobotB(); +>[numberB = -1] = getRobotB() : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1] = [2, "trimmer", "trimming"]; +>[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB = "helloNoName"] = multiRobotB; +>[nameMB = "helloNoName"] = multiRobotB : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>multiRobotB : [string, string[]] + +[nameMB = "helloNoName"] = getMultiRobotB(); +>[nameMB = "helloNoName"] = getMultiRobotB() : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +>[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>robotB : [number, string, string] + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] +>multiRobotB : [string, string[]] + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] + + ["trimmer", ["trimming", "edging"]]; +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +[numberB = -1, ...robotAInfo] = robotB; +>[numberB = -1, ...robotAInfo] = robotB : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotB : [number, string, string] + +[numberB = -1, ...robotAInfo] = getRobotB(); +>[numberB = -1, ...robotAInfo] = getRobotB() : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +>[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillB : string +} + +function getRobotB() { +>getRobotB : () => [number, string, string] + + return robotB; +>robotB : [number, string, string] +} + +function getMultiRobotB() { +>getMultiRobotB : () => [string, string[]] + + return multiRobotB; +>multiRobotB : [string, string[]] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js new file mode 100644 index 00000000000..64dea954ae7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA = "" } = robotA; +var { name: nameB = "", skill: skillB = "" } = robotB; +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var _a = robotA.name, nameA = _a === void 0 ? "" : _a; +var _b = robotB.name, nameB = _b === void 0 ? "" : _b, _c = robotB.skill, skillB = _c === void 0 ? "" : _c; +var _d = { name: "Edger", skill: "cutting edges" }, _e = _d.name, nameC = _e === void 0 ? "" : _e, _f = _d.skill, skillC = _f === void 0 ? "" : _f; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map new file mode 100644 index 00000000000..d85d9d2d669 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,oBAAwB,EAAxB,uCAAwB,CAAY;AACpC,oBAAwB,EAAxB,uCAAwB,EAAE,iBAAoC,EAApC,kDAAoC,CAAY;AAChF,IAAA,8CAAkH,EAA5G,YAAwB,EAAxB,uCAAwB,EAAE,aAAoC,EAApC,kDAAoC,CAA+C;AACnH,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..12e5526e77c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt @@ -0,0 +1,344 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var _a = robotA.name, nameA = _a === void 0 ? "" : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameA = "" +3 > +4 > name: nameA = "" +5 > } = robotA; +1->Emitted(4, 1) Source(11, 7) + SourceIndex(0) +2 >Emitted(4, 21) Source(11, 31) + SourceIndex(0) +3 >Emitted(4, 23) Source(11, 7) + SourceIndex(0) +4 >Emitted(4, 62) Source(11, 31) + SourceIndex(0) +5 >Emitted(4, 63) Source(11, 43) + SourceIndex(0) +--- +>>>var _b = robotB.name, nameB = _b === void 0 ? "" : _b, _c = robotB.skill, skillB = _c === void 0 ? "" : _c; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB = "" +3 > +4 > name: nameB = "" +5 > , +6 > skill: skillB = "" +7 > +8 > skill: skillB = "" +9 > } = robotB; +1->Emitted(5, 1) Source(12, 7) + SourceIndex(0) +2 >Emitted(5, 21) Source(12, 31) + SourceIndex(0) +3 >Emitted(5, 23) Source(12, 7) + SourceIndex(0) +4 >Emitted(5, 62) Source(12, 31) + SourceIndex(0) +5 >Emitted(5, 64) Source(12, 33) + SourceIndex(0) +6 >Emitted(5, 81) Source(12, 69) + SourceIndex(0) +7 >Emitted(5, 83) Source(12, 33) + SourceIndex(0) +8 >Emitted(5, 133) Source(12, 69) + SourceIndex(0) +9 >Emitted(5, 134) Source(12, 81) + SourceIndex(0) +--- +>>>var _d = { name: "Edger", skill: "cutting edges" }, _e = _d.name, nameC = _e === void 0 ? "" : _e, _f = _d.skill, skillC = _f === void 0 ? "" : _f; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC = "" +6 > +7 > name: nameC = "" +8 > , +9 > skill: skillC = "" +10> +11> skill: skillC = "" +12> } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 115) + SourceIndex(0) +4 >Emitted(6, 53) Source(13, 7) + SourceIndex(0) +5 >Emitted(6, 65) Source(13, 31) + SourceIndex(0) +6 >Emitted(6, 67) Source(13, 7) + SourceIndex(0) +7 >Emitted(6, 106) Source(13, 31) + SourceIndex(0) +8 >Emitted(6, 108) Source(13, 33) + SourceIndex(0) +9 >Emitted(6, 121) Source(13, 69) + SourceIndex(0) +10>Emitted(6, 123) Source(13, 33) + SourceIndex(0) +11>Emitted(6, 173) Source(13, 69) + SourceIndex(0) +12>Emitted(6, 174) Source(13, 116) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) +3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) +4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) +9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) +10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) +4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(18, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols new file mode 100644 index 00000000000..1fc07bf4a17 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 38)) + +var { name: nameA = "" } = robotA; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 10, 5)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 3)) + +var { name: nameB = "", skill: skillB = "" } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 5)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 31)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 3)) + +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 74)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 5)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 89)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 31)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 74)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 89)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 10, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 5)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 31)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types new file mode 100644 index 00000000000..0ad3330e867 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types @@ -0,0 +1,87 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var { name: nameA = "" } = robotA; +>name : any +>nameA : string +>"" : string +>robotA : Robot + +var { name: nameB = "", skill: skillB = "" } = robotB; +>name : any +>nameB : string +>"" : string +>skill : any +>skillB : string +>"" : string +>robotB : Robot + +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +>name : any +>nameC : string +>"" : string +>skill : any +>skillC : string +>"" : string +>{ name: "Edger", skill: "cutting edges" } : { name?: string; skill?: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js new file mode 100644 index 00000000000..4988514324b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js @@ -0,0 +1,38 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +var _a = robotA.skills, primaryA = _a.primary, secondaryA = _a.secondary; +var nameB = robotB.name, _b = robotB.skills, primaryB = _b.primary, secondaryB = _b.secondary; +var _c = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, nameC = _c.name, _d = _c.skills, primaryB = _d.primary, secondaryB = _d.secondary; +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map new file mode 100644 index 00000000000..cd7a9813374 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAExF,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAChE,uBAAW,EAAE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AACnF,IAAA,mFAA0J,EAApJ,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAsF;AAE3J,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..4d0845e1a75 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt @@ -0,0 +1,380 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "trimming" +16> , +17> secondary +18> : +19> "edging" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(12, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(12, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(12, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(12, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(12, 29) + SourceIndex(0) +8 >Emitted(2, 31) Source(12, 38) + SourceIndex(0) +9 >Emitted(2, 33) Source(12, 40) + SourceIndex(0) +10>Emitted(2, 39) Source(12, 46) + SourceIndex(0) +11>Emitted(2, 41) Source(12, 48) + SourceIndex(0) +12>Emitted(2, 43) Source(12, 50) + SourceIndex(0) +13>Emitted(2, 50) Source(12, 57) + SourceIndex(0) +14>Emitted(2, 52) Source(12, 59) + SourceIndex(0) +15>Emitted(2, 62) Source(12, 69) + SourceIndex(0) +16>Emitted(2, 64) Source(12, 71) + SourceIndex(0) +17>Emitted(2, 73) Source(12, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(12, 82) + SourceIndex(0) +19>Emitted(2, 83) Source(12, 90) + SourceIndex(0) +20>Emitted(2, 85) Source(12, 92) + SourceIndex(0) +21>Emitted(2, 87) Source(12, 94) + SourceIndex(0) +22>Emitted(2, 88) Source(12, 95) + SourceIndex(0) +--- +>>>var _a = robotA.skills, primaryA = _a.primary, secondaryA = _a.secondary; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >var { +2 >skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +7 > } } = robotA; +1 >Emitted(3, 1) Source(14, 7) + SourceIndex(0) +2 >Emitted(3, 23) Source(14, 59) + SourceIndex(0) +3 >Emitted(3, 25) Source(14, 17) + SourceIndex(0) +4 >Emitted(3, 46) Source(14, 34) + SourceIndex(0) +5 >Emitted(3, 48) Source(14, 36) + SourceIndex(0) +6 >Emitted(3, 73) Source(14, 57) + SourceIndex(0) +7 >Emitted(3, 74) Source(14, 71) + SourceIndex(0) +--- +>>>var nameB = robotB.name, _b = robotB.skills, primaryB = _b.primary, secondaryB = _b.secondary; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skills: { primary: primaryB, secondary: secondaryB } +5 > +6 > primary: primaryB +7 > , +8 > secondary: secondaryB +9 > } } = robotB; +1->Emitted(4, 1) Source(15, 7) + SourceIndex(0) +2 >Emitted(4, 24) Source(15, 18) + SourceIndex(0) +3 >Emitted(4, 26) Source(15, 20) + SourceIndex(0) +4 >Emitted(4, 44) Source(15, 72) + SourceIndex(0) +5 >Emitted(4, 46) Source(15, 30) + SourceIndex(0) +6 >Emitted(4, 67) Source(15, 47) + SourceIndex(0) +7 >Emitted(4, 69) Source(15, 49) + SourceIndex(0) +8 >Emitted(4, 94) Source(15, 70) + SourceIndex(0) +9 >Emitted(4, 95) Source(15, 84) + SourceIndex(0) +--- +>>>var _c = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, nameC = _c.name, _d = _c.skills, primaryB = _d.primary, secondaryB = _d.secondary; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } +4 > +5 > name: nameC +6 > , +7 > skills: { primary: primaryB, secondary: secondaryB } +8 > +9 > primary: primaryB +10> , +11> secondary: secondaryB +12> } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +1->Emitted(5, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(16, 1) + SourceIndex(0) +3 >Emitted(5, 88) Source(16, 155) + SourceIndex(0) +4 >Emitted(5, 90) Source(16, 7) + SourceIndex(0) +5 >Emitted(5, 105) Source(16, 18) + SourceIndex(0) +6 >Emitted(5, 107) Source(16, 20) + SourceIndex(0) +7 >Emitted(5, 121) Source(16, 72) + SourceIndex(0) +8 >Emitted(5, 123) Source(16, 30) + SourceIndex(0) +9 >Emitted(5, 144) Source(16, 47) + SourceIndex(0) +10>Emitted(5, 146) Source(16, 49) + SourceIndex(0) +11>Emitted(5, 171) Source(16, 70) + SourceIndex(0) +12>Emitted(5, 172) Source(16, 156) + SourceIndex(0) +--- +>>>if (nameB == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameB +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(6, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(6, 3) Source(18, 3) + SourceIndex(0) +3 >Emitted(6, 4) Source(18, 4) + SourceIndex(0) +4 >Emitted(6, 5) Source(18, 5) + SourceIndex(0) +5 >Emitted(6, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(6, 14) Source(18, 14) + SourceIndex(0) +7 >Emitted(6, 19) Source(18, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(18, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(18, 21) + SourceIndex(0) +10>Emitted(6, 22) Source(18, 22) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(7, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(7, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(7, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(7, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(7, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(7, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(7, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(7, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(20, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(9, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(9, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(9, 7) Source(21, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(10, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(23, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols new file mode 100644 index 00000000000..09b66f24ad8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 65)) + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 38)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 48)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 69)) + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 13, 15)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 13, 34)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 3)) + +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 3, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 28), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 28)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 47), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 47)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 3)) + +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 77)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 92)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 102)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 28), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 28)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 121)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 47), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 47)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 77)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 92)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 102)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 121)) + +if (nameB == nameB) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) + + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types new file mode 100644 index 00000000000..1101b01b1a7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types @@ -0,0 +1,107 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>robotA : Robot + +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +>name : any +>nameB : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>robotB : Robot + +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>name : any +>nameC : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +if (nameB == nameB) { +>nameB == nameB : boolean +>nameB : string +>nameB : string + + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js new file mode 100644 index 00000000000..694f1d9d30c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js @@ -0,0 +1,55 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { + skills: { + primary: primaryA = "noSkill", + secondary: secondaryA = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotA; +var { + name: nameB = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotB; +var { + name: nameC = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +var _a = robotA.skills, _b = _a === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _a, _c = _b.primary, primaryA = _c === void 0 ? "noSkill" : _c, _d = _b.secondary, secondaryA = _d === void 0 ? "noSkill" : _d; +var _e = robotB.name, nameB = _e === void 0 ? "noNameSpecified" : _e, _f = robotB.skills, _g = _f === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _f, _h = _g.primary, primaryB = _h === void 0 ? "noSkill" : _h, _j = _g.secondary, secondaryB = _j === void 0 ? "noSkill" : _j; +var _k = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, _l = _k.name, nameC = _l === void 0 ? "noNameSpecified" : _l, _m = _k.skills, _o = _m === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _m, _p = _o.primary, primaryB = _p === void 0 ? "noSkill" : _p, _q = _o.secondary, secondaryB = _q === void 0 ? "noSkill" : _q; +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map new file mode 100644 index 00000000000..9ad442f4698 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAG1F,sBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AAEP,oBAA+B,EAA/B,8CAA+B,EAC/B,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AACX,IAAA,mFAMyF,EALrF,YAA+B,EAA/B,8CAA+B,EAC/B,cAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAEiD;AAE1F,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..5e007440890 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt @@ -0,0 +1,484 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "trimming" +16> , +17> secondary +18> : +19> "edging" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(12, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(12, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(12, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(12, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(12, 29) + SourceIndex(0) +8 >Emitted(2, 31) Source(12, 38) + SourceIndex(0) +9 >Emitted(2, 33) Source(12, 40) + SourceIndex(0) +10>Emitted(2, 39) Source(12, 46) + SourceIndex(0) +11>Emitted(2, 41) Source(12, 48) + SourceIndex(0) +12>Emitted(2, 43) Source(12, 50) + SourceIndex(0) +13>Emitted(2, 50) Source(12, 57) + SourceIndex(0) +14>Emitted(2, 52) Source(12, 59) + SourceIndex(0) +15>Emitted(2, 62) Source(12, 69) + SourceIndex(0) +16>Emitted(2, 64) Source(12, 71) + SourceIndex(0) +17>Emitted(2, 73) Source(12, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(12, 82) + SourceIndex(0) +19>Emitted(2, 83) Source(12, 90) + SourceIndex(0) +20>Emitted(2, 85) Source(12, 92) + SourceIndex(0) +21>Emitted(2, 87) Source(12, 94) + SourceIndex(0) +22>Emitted(2, 88) Source(12, 95) + SourceIndex(0) +--- +>>>var _a = robotA.skills, _b = _a === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _a, _c = _b.primary, primaryA = _c === void 0 ? "noSkill" : _c, _d = _b.secondary, secondaryA = _d === void 0 ? "noSkill" : _d; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >var { + > +2 >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "noSkill" +7 > +8 > primary: primaryA = "noSkill" +9 > , + > +10> secondary: secondaryA = "noSkill" +11> +12> secondary: secondaryA = "noSkill" +13> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = robotA; +1->Emitted(3, 1) Source(15, 5) + SourceIndex(0) +2 >Emitted(3, 23) Source(18, 53) + SourceIndex(0) +3 >Emitted(3, 25) Source(15, 5) + SourceIndex(0) +4 >Emitted(3, 95) Source(18, 53) + SourceIndex(0) +5 >Emitted(3, 97) Source(16, 9) + SourceIndex(0) +6 >Emitted(3, 112) Source(16, 38) + SourceIndex(0) +7 >Emitted(3, 114) Source(16, 9) + SourceIndex(0) +8 >Emitted(3, 155) Source(16, 38) + SourceIndex(0) +9 >Emitted(3, 157) Source(17, 9) + SourceIndex(0) +10>Emitted(3, 174) Source(17, 42) + SourceIndex(0) +11>Emitted(3, 176) Source(17, 9) + SourceIndex(0) +12>Emitted(3, 219) Source(17, 42) + SourceIndex(0) +13>Emitted(3, 220) Source(19, 12) + SourceIndex(0) +--- +>>>var _e = robotB.name, nameB = _e === void 0 ? "noNameSpecified" : _e, _f = robotB.skills, _g = _f === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _f, _h = _g.primary, primaryB = _h === void 0 ? "noSkill" : _h, _j = _g.secondary, secondaryB = _j === void 0 ? "noSkill" : _j; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { + > +2 >name: nameB = "noNameSpecified" +3 > +4 > name: nameB = "noNameSpecified" +5 > , + > +6 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +7 > +8 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> primary: primaryB = "noSkill" +11> +12> primary: primaryB = "noSkill" +13> , + > +14> secondary: secondaryB = "noSkill" +15> +16> secondary: secondaryB = "noSkill" +17> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = robotB; +1->Emitted(4, 1) Source(21, 5) + SourceIndex(0) +2 >Emitted(4, 21) Source(21, 36) + SourceIndex(0) +3 >Emitted(4, 23) Source(21, 5) + SourceIndex(0) +4 >Emitted(4, 69) Source(21, 36) + SourceIndex(0) +5 >Emitted(4, 71) Source(22, 5) + SourceIndex(0) +6 >Emitted(4, 89) Source(25, 53) + SourceIndex(0) +7 >Emitted(4, 91) Source(22, 5) + SourceIndex(0) +8 >Emitted(4, 161) Source(25, 53) + SourceIndex(0) +9 >Emitted(4, 163) Source(23, 9) + SourceIndex(0) +10>Emitted(4, 178) Source(23, 38) + SourceIndex(0) +11>Emitted(4, 180) Source(23, 9) + SourceIndex(0) +12>Emitted(4, 221) Source(23, 38) + SourceIndex(0) +13>Emitted(4, 223) Source(24, 9) + SourceIndex(0) +14>Emitted(4, 240) Source(24, 42) + SourceIndex(0) +15>Emitted(4, 242) Source(24, 9) + SourceIndex(0) +16>Emitted(4, 285) Source(24, 42) + SourceIndex(0) +17>Emitted(4, 286) Source(26, 12) + SourceIndex(0) +--- +>>>var _k = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, _l = _k.name, nameC = _l === void 0 ? "noNameSpecified" : _l, _m = _k.skills, _o = _m === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _m, _p = _o.primary, primaryB = _p === void 0 ? "noSkill" : _p, _q = _o.secondary, secondaryB = _q === void 0 ? "noSkill" : _q; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^ +1-> + > +2 > +3 > var { + > name: nameC = "noNameSpecified", + > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + > } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } +4 > +5 > name: nameC = "noNameSpecified" +6 > +7 > name: nameC = "noNameSpecified" +8 > , + > +9 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +10> +11> skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +12> +13> primary: primaryB = "noSkill" +14> +15> primary: primaryB = "noSkill" +16> , + > +17> secondary: secondaryB = "noSkill" +18> +19> secondary: secondaryB = "noSkill" +20> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +1->Emitted(5, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(27, 1) + SourceIndex(0) +3 >Emitted(5, 88) Source(33, 90) + SourceIndex(0) +4 >Emitted(5, 90) Source(28, 5) + SourceIndex(0) +5 >Emitted(5, 102) Source(28, 36) + SourceIndex(0) +6 >Emitted(5, 104) Source(28, 5) + SourceIndex(0) +7 >Emitted(5, 150) Source(28, 36) + SourceIndex(0) +8 >Emitted(5, 152) Source(29, 5) + SourceIndex(0) +9 >Emitted(5, 166) Source(32, 53) + SourceIndex(0) +10>Emitted(5, 168) Source(29, 5) + SourceIndex(0) +11>Emitted(5, 238) Source(32, 53) + SourceIndex(0) +12>Emitted(5, 240) Source(30, 9) + SourceIndex(0) +13>Emitted(5, 255) Source(30, 38) + SourceIndex(0) +14>Emitted(5, 257) Source(30, 9) + SourceIndex(0) +15>Emitted(5, 298) Source(30, 38) + SourceIndex(0) +16>Emitted(5, 300) Source(31, 9) + SourceIndex(0) +17>Emitted(5, 317) Source(31, 42) + SourceIndex(0) +18>Emitted(5, 319) Source(31, 9) + SourceIndex(0) +19>Emitted(5, 362) Source(31, 42) + SourceIndex(0) +20>Emitted(5, 363) Source(33, 91) + SourceIndex(0) +--- +>>>if (nameB == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameB +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(6, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(6, 3) Source(35, 3) + SourceIndex(0) +3 >Emitted(6, 4) Source(35, 4) + SourceIndex(0) +4 >Emitted(6, 5) Source(35, 5) + SourceIndex(0) +5 >Emitted(6, 10) Source(35, 10) + SourceIndex(0) +6 >Emitted(6, 14) Source(35, 14) + SourceIndex(0) +7 >Emitted(6, 19) Source(35, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(35, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(35, 21) + SourceIndex(0) +10>Emitted(6, 22) Source(35, 22) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(7, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(7, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(7, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(7, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(7, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(7, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(7, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(7, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(37, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(9, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(38, 5) + SourceIndex(0) +3 >Emitted(9, 6) Source(38, 6) + SourceIndex(0) +4 >Emitted(9, 7) Source(38, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(10, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(40, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols new file mode 100644 index 00000000000..a9a3a91f824 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 65)) + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 38)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 48)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 69)) + +var { + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryA = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 14, 13)) + + secondary: secondaryA = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 15, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 17, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 17, 29)) + +} = robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 3)) + +var { + name: nameB = "noNameSpecified", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryB = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 21, 13), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 28, 13)) + + secondary: secondaryB = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 22, 38), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 29, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 24, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 24, 29)) + +} = robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 3)) + +var { + name: nameC = "noNameSpecified", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryB = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 21, 13), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 28, 13)) + + secondary: secondaryB = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 22, 38), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 29, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 31, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 31, 29)) + +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 12)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 27)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 37)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 56)) + +if (nameB == nameB) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) + + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types new file mode 100644 index 00000000000..e3fdec19339 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types @@ -0,0 +1,163 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +var { + skills: { +>skills : any + + primary: primaryA = "noSkill", +>primary : any +>primaryA : string +>"noSkill" : string + + secondary: secondaryA = "noSkill" +>secondary : any +>secondaryA : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = robotA; +>robotA : Robot + +var { + name: nameB = "noNameSpecified", +>name : any +>nameB : string +>"noNameSpecified" : string + + skills: { +>skills : any + + primary: primaryB = "noSkill", +>primary : any +>primaryB : string +>"noSkill" : string + + secondary: secondaryB = "noSkill" +>secondary : any +>secondaryB : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = robotB; +>robotB : Robot + +var { + name: nameC = "noNameSpecified", +>name : any +>nameC : string +>"noNameSpecified" : string + + skills: { +>skills : any + + primary: primaryB = "noSkill", +>primary : any +>primaryB : string +>"noSkill" : string + + secondary: secondaryB = "noSkill" +>secondary : any +>secondaryB : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : Robot +>Robot : Robot +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +if (nameB == nameB) { +>nameB == nameB : boolean +>nameB : string +>nameB : string + + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationFor.js.map b/tests/baselines/reference/sourceMapValidationFor.js.map index 15d038297c7..5d6491ae1e5 100644 --- a/tests/baselines/reference/sourceMapValidationFor.js.map +++ b/tests/baselines/reference/sourceMapValidationFor.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFor.js.map] -{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt index 609f9548a6b..583e60d75cf 100644 --- a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt @@ -13,56 +13,53 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^ -15> ^ -16> ^^ -17> ^^ -18> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^ 1 > 2 >for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> 10 -14> ; -15> i -16> ++ -17> ) -18> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 10 +13> ; +14> i +15> ++ +16> ) +17> { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) -9 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) -11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) -12>Emitted(1, 21) Source(1, 21) + SourceIndex(0) -13>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -14>Emitted(1, 25) Source(1, 25) + SourceIndex(0) -15>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -16>Emitted(1, 28) Source(1, 28) + SourceIndex(0) -17>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -18>Emitted(1, 31) Source(1, 31) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +9 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) +10>Emitted(1, 18) Source(1, 18) + SourceIndex(0) +11>Emitted(1, 21) Source(1, 21) + SourceIndex(0) +12>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +13>Emitted(1, 25) Source(1, 25) + SourceIndex(0) +14>Emitted(1, 26) Source(1, 26) + SourceIndex(0) +15>Emitted(1, 28) Source(1, 28) + SourceIndex(0) +16>Emitted(1, 30) Source(1, 30) + SourceIndex(0) +17>Emitted(1, 31) Source(1, 31) + SourceIndex(0) --- >>> WScript.Echo("i: " + i); 1 >^^^^ @@ -208,48 +205,45 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^^ -15> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^^ +14> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> 10 -14> ; ) -15> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> 10 +13> ; ) +14> { 1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) 2 >Emitted(7, 4) Source(8, 4) + SourceIndex(0) 3 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) 4 >Emitted(7, 6) Source(8, 6) + SourceIndex(0) -5 >Emitted(7, 9) Source(8, 9) + SourceIndex(0) -6 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) -7 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) -8 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) -9 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) -10>Emitted(7, 17) Source(8, 17) + SourceIndex(0) -11>Emitted(7, 18) Source(8, 18) + SourceIndex(0) -12>Emitted(7, 21) Source(8, 21) + SourceIndex(0) -13>Emitted(7, 23) Source(8, 23) + SourceIndex(0) -14>Emitted(7, 26) Source(8, 27) + SourceIndex(0) -15>Emitted(7, 27) Source(8, 28) + SourceIndex(0) +5 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +6 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +7 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +8 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) +9 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +10>Emitted(7, 18) Source(8, 18) + SourceIndex(0) +11>Emitted(7, 21) Source(8, 21) + SourceIndex(0) +12>Emitted(7, 23) Source(8, 23) + SourceIndex(0) +13>Emitted(7, 26) Source(8, 27) + SourceIndex(0) +14>Emitted(7, 27) Source(8, 28) + SourceIndex(0) --- >>> j++; 1 >^^^^ @@ -405,45 +399,42 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^^ -14> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^^ +13> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > k -8 > = -9 > 0 -10> ;; -11> k -12> ++ -13> ) -14> { +5 > var +6 > k +7 > = +8 > 0 +9 > ;; +10> k +11> ++ +12> ) +13> { 1->Emitted(16, 1) Source(18, 1) + SourceIndex(0) 2 >Emitted(16, 4) Source(18, 4) + SourceIndex(0) 3 >Emitted(16, 5) Source(18, 5) + SourceIndex(0) 4 >Emitted(16, 6) Source(18, 6) + SourceIndex(0) -5 >Emitted(16, 9) Source(18, 9) + SourceIndex(0) -6 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) -7 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) -8 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) -9 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) -10>Emitted(16, 18) Source(18, 18) + SourceIndex(0) -11>Emitted(16, 19) Source(18, 19) + SourceIndex(0) -12>Emitted(16, 21) Source(18, 21) + SourceIndex(0) -13>Emitted(16, 23) Source(18, 23) + SourceIndex(0) -14>Emitted(16, 24) Source(18, 24) + SourceIndex(0) +5 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) +7 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) +8 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) +9 >Emitted(16, 18) Source(18, 18) + SourceIndex(0) +10>Emitted(16, 19) Source(18, 19) + SourceIndex(0) +11>Emitted(16, 21) Source(18, 21) + SourceIndex(0) +12>Emitted(16, 23) Source(18, 23) + SourceIndex(0) +13>Emitted(16, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationForIn.js.map b/tests/baselines/reference/sourceMapValidationForIn.js.map index 2c12dd5cdc1..2281e36f605 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.js.map +++ b/tests/baselines/reference/sourceMapValidationForIn.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationForIn.js.map] -{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt index ae7e34c025c..e84bb2323c4 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt @@ -13,38 +13,35 @@ sourceFile:sourceMapValidationForIn.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ 1 > 2 >for 3 > 4 > ( -5 > var -6 > -7 > x -8 > in -9 > String -10> ) -11> -12> { +5 > var +6 > x +7 > in +8 > String +9 > ) +10> +11> { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -9 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 22) Source(1, 22) + SourceIndex(0) -11>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -12>Emitted(1, 24) Source(1, 24) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(1, 22) Source(1, 22) + SourceIndex(0) +10>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +11>Emitted(1, 24) Source(1, 24) + SourceIndex(0) --- >>> WScript.Echo(x); 1 >^^^^ @@ -159,40 +156,37 @@ sourceFile:sourceMapValidationForIn.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > x2 -8 > in -9 > String -10> ) -11> +5 > var +6 > x2 +7 > in +8 > String +9 > ) +10> > -12> { +11> { 1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) 2 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) 3 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) 4 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) -5 >Emitted(7, 9) Source(7, 9) + SourceIndex(0) -6 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) -7 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) -8 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) -9 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) -10>Emitted(7, 23) Source(7, 23) + SourceIndex(0) -11>Emitted(7, 24) Source(8, 1) + SourceIndex(0) -12>Emitted(7, 25) Source(8, 2) + SourceIndex(0) +5 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +6 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +7 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) +8 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) +9 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +10>Emitted(7, 24) Source(8, 1) + SourceIndex(0) +11>Emitted(7, 25) Source(8, 2) + SourceIndex(0) --- >>> WScript.Echo(x2); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index b4b5c48fc22..464ab4dc002 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACT,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACR,CAAC;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACD,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,CAAE;IAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACb,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAE;IAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACP,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,GAAG,EAAE,CAAC;QACR,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,SAAS,CAAC;YACN,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,KAAK,CAAC;QAEV,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QACZ,CAAC,EAAE,CAAC;IACR,CAAC;IACD,GAAG,CAAC;QACA,CAAC,EAAE,CAAC;IACR,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACT,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACR,CAAC;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACD,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,CAAE;IAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACb,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAE;IAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACP,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,GAAG,EAAE,CAAC;QACR,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,SAAS,CAAC;YACN,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,KAAK,CAAC;QAEV,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QACZ,CAAC,EAAE,CAAC;IACR,CAAC;IACD,GAAG,CAAC;QACA,CAAC,EAAE,CAAC;IACR,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index 41212b9b3db..ed7c9395d2f 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -57,57 +57,54 @@ sourceFile:sourceMapValidationStatements.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^ -15> ^ -16> ^^ -17> ^^ -18> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> 10 -14> ; -15> i -16> ++ -17> ) -18> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 10 +13> ; +14> i +15> ++ +16> ) +17> { 1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) 2 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) 3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) 4 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) -5 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) -6 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) -7 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) -8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) -10>Emitted(4, 21) Source(4, 21) + SourceIndex(0) -11>Emitted(4, 22) Source(4, 22) + SourceIndex(0) -12>Emitted(4, 25) Source(4, 25) + SourceIndex(0) -13>Emitted(4, 27) Source(4, 27) + SourceIndex(0) -14>Emitted(4, 29) Source(4, 29) + SourceIndex(0) -15>Emitted(4, 30) Source(4, 30) + SourceIndex(0) -16>Emitted(4, 32) Source(4, 32) + SourceIndex(0) -17>Emitted(4, 34) Source(4, 34) + SourceIndex(0) -18>Emitted(4, 35) Source(4, 35) + SourceIndex(0) +5 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +6 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) +7 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) +8 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) +9 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +10>Emitted(4, 22) Source(4, 22) + SourceIndex(0) +11>Emitted(4, 25) Source(4, 25) + SourceIndex(0) +12>Emitted(4, 27) Source(4, 27) + SourceIndex(0) +13>Emitted(4, 29) Source(4, 29) + SourceIndex(0) +14>Emitted(4, 30) Source(4, 30) + SourceIndex(0) +15>Emitted(4, 32) Source(4, 32) + SourceIndex(0) +16>Emitted(4, 34) Source(4, 34) + SourceIndex(0) +17>Emitted(4, 35) Source(4, 35) + SourceIndex(0) --- >>> x += i; 1 >^^^^^^^^ @@ -390,39 +387,36 @@ sourceFile:sourceMapValidationStatements.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > in -9 > a -10> ) -11> -12> { +5 > var +6 > j +7 > in +8 > a +9 > ) +10> +11> { 1->Emitted(24, 5) Source(23, 5) + SourceIndex(0) 2 >Emitted(24, 8) Source(23, 8) + SourceIndex(0) 3 >Emitted(24, 9) Source(23, 9) + SourceIndex(0) 4 >Emitted(24, 10) Source(23, 10) + SourceIndex(0) -5 >Emitted(24, 13) Source(23, 13) + SourceIndex(0) -6 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) -7 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) -8 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) -9 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) -10>Emitted(24, 21) Source(23, 21) + SourceIndex(0) -11>Emitted(24, 22) Source(23, 22) + SourceIndex(0) -12>Emitted(24, 23) Source(23, 23) + SourceIndex(0) +5 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) +6 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) +7 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) +8 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) +9 >Emitted(24, 21) Source(23, 21) + SourceIndex(0) +10>Emitted(24, 22) Source(23, 22) + SourceIndex(0) +11>Emitted(24, 23) Source(23, 23) + SourceIndex(0) --- >>> obj.z = a[j]; 1 >^^^^^^^^ diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index 568fd800e35..32f0fb093bc 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -51,9 +51,9 @@ for (var i = 0; ;) { throw i; } >i : number for (var idx in {}) { throw idx; } ->idx : any +>idx : string >{} : {} ->idx : any +>idx : string do { throw null; }while(true) >null : null diff --git a/tests/baselines/reference/tsxElementResolution13.symbols b/tests/baselines/reference/tsxElementResolution13.symbols index 94758b291ac..4b6a5b4f4e7 100644 --- a/tests/baselines/reference/tsxElementResolution13.symbols +++ b/tests/baselines/reference/tsxElementResolution13.symbols @@ -22,5 +22,6 @@ var obj1: Obj1; >Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1)) ; // Error +>obj1 : Symbol(unknown) >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution14.symbols b/tests/baselines/reference/tsxElementResolution14.symbols index 2400ef620eb..a605606b1ed 100644 --- a/tests/baselines/reference/tsxElementResolution14.symbols +++ b/tests/baselines/reference/tsxElementResolution14.symbols @@ -17,5 +17,6 @@ var obj1: Obj1; >Obj1 : Symbol(Obj1, Decl(file.tsx, 2, 1)) ; // OK +>obj1 : Symbol(unknown) >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution5.symbols b/tests/baselines/reference/tsxElementResolution5.symbols index 461ffd78aaa..e0fc1147083 100644 --- a/tests/baselines/reference/tsxElementResolution5.symbols +++ b/tests/baselines/reference/tsxElementResolution5.symbols @@ -8,5 +8,6 @@ declare module JSX { // OK, but implicit any
; +>div : Symbol(unknown) >n : Symbol(unknown) diff --git a/tests/baselines/reference/tsxErrorRecovery1.errors.txt b/tests/baselines/reference/tsxErrorRecovery1.errors.txt index 0937b0d37ac..c368e48ddd1 100644 --- a/tests/baselines/reference/tsxErrorRecovery1.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery1.errors.txt @@ -1,15 +1,18 @@ +tests/cases/conformance/jsx/file.tsx(5,11): error TS17008: JSX element 'div' has no corresponding closing tag. tests/cases/conformance/jsx/file.tsx(5,19): error TS1109: Expression expected. tests/cases/conformance/jsx/file.tsx(8,11): error TS2304: Cannot find name 'a'. tests/cases/conformance/jsx/file.tsx(8,12): error TS1005: '}' expected. -tests/cases/conformance/jsx/file.tsx(9,1): error TS17002: Expected corresponding JSX closing tag for 'div'. +tests/cases/conformance/jsx/file.tsx(9,1): error TS1005: ' {
+ ~~~ +!!! error TS17008: JSX element 'div' has no corresponding closing tag. ~~ !!! error TS1109: Expression expected. } @@ -21,4 +24,4 @@ tests/cases/conformance/jsx/file.tsx(9,1): error TS17002: Expected corresponding !!! error TS1005: '}' expected. -!!! error TS17002: Expected corresponding JSX closing tag for 'div'. \ No newline at end of file +!!! error TS1005: ' { >render : Symbol(render, Decl(button.tsx, 2, 55)) return ; +>button : Symbol(unknown) +>button : Symbol(unknown) } } diff --git a/tests/baselines/reference/tsxNoJsx.symbols b/tests/baselines/reference/tsxNoJsx.symbols index 6744c2edb10..4492e83cf10 100644 --- a/tests/baselines/reference/tsxNoJsx.symbols +++ b/tests/baselines/reference/tsxNoJsx.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/jsx/tsxNoJsx.tsx === -No type information for this code.; -No type information for this code. -No type information for this code. \ No newline at end of file +; +>nope : Symbol(unknown) + diff --git a/tests/baselines/reference/tsxPreserveEmit1.js b/tests/baselines/reference/tsxPreserveEmit1.js index 7ac6c18ebca..6d795c946c3 100644 --- a/tests/baselines/reference/tsxPreserveEmit1.js +++ b/tests/baselines/reference/tsxPreserveEmit1.js @@ -34,7 +34,7 @@ module M { //// [test.jsx] -define(["require", "exports", 'react-router'], function (require, exports, ReactRouter) { +define(["require", "exports", 'react', 'react-router'], function (require, exports, React, ReactRouter) { "use strict"; var Route = ReactRouter.Route; var routes1 = ; diff --git a/tests/baselines/reference/tsxPreserveEmit2.js b/tests/baselines/reference/tsxPreserveEmit2.js new file mode 100644 index 00000000000..6a87da7b285 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit2.js @@ -0,0 +1,10 @@ +//// [test.tsx] + + +var Route: any; +var routes1 = ; + + +//// [test.jsx] +var Route; +var routes1 = ; diff --git a/tests/baselines/reference/tsxPreserveEmit2.symbols b/tests/baselines/reference/tsxPreserveEmit2.symbols new file mode 100644 index 00000000000..4013b2e35ea --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit2.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/jsx/test.tsx === + + +var Route: any; +>Route : Symbol(Route, Decl(test.tsx, 2, 3)) + +var routes1 = ; +>routes1 : Symbol(routes1, Decl(test.tsx, 3, 3)) +>Route : Symbol(Route, Decl(test.tsx, 2, 3)) + diff --git a/tests/baselines/reference/tsxPreserveEmit2.types b/tests/baselines/reference/tsxPreserveEmit2.types new file mode 100644 index 00000000000..c01f564ff53 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit2.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/jsx/test.tsx === + + +var Route: any; +>Route : any + +var routes1 = ; +>routes1 : any +> : any +>Route : any + diff --git a/tests/baselines/reference/tsxPreserveEmit3.js b/tests/baselines/reference/tsxPreserveEmit3.js new file mode 100644 index 00000000000..500b7d26c93 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit3.js @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/jsx/tsxPreserveEmit3.tsx] //// + +//// [file.tsx] + +declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } +} + +//// [test.d.ts] +export var React; + +//// [react-consumer.tsx] +// This import should be elided +import {React} from "./test"; + + +//// [file.jsx] +//// [react-consumer.jsx] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); diff --git a/tests/baselines/reference/tsxPreserveEmit3.symbols b/tests/baselines/reference/tsxPreserveEmit3.symbols new file mode 100644 index 00000000000..ab534241049 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit3.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/jsx/file.tsx === + +declare module JSX { +>JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) + + interface Element { } +>Element : Symbol(Element, Decl(file.tsx, 1, 20)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22)) + + [s: string]: any; +>s : Symbol(s, Decl(file.tsx, 4, 3)) + } +} + +=== tests/cases/conformance/jsx/test.d.ts === +export var React; +>React : Symbol(React, Decl(test.d.ts, 0, 10)) + +=== tests/cases/conformance/jsx/react-consumer.tsx === +// This import should be elided +import {React} from "./test"; +>React : Symbol(React, Decl(react-consumer.tsx, 1, 8)) + diff --git a/tests/baselines/reference/tsxPreserveEmit3.types b/tests/baselines/reference/tsxPreserveEmit3.types new file mode 100644 index 00000000000..152f742a240 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit3.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/jsx/file.tsx === + +declare module JSX { +>JSX : any + + interface Element { } +>Element : Element + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [s: string]: any; +>s : string + } +} + +=== tests/cases/conformance/jsx/test.d.ts === +export var React; +>React : any + +=== tests/cases/conformance/jsx/react-consumer.tsx === +// This import should be elided +import {React} from "./test"; +>React : any + diff --git a/tests/baselines/reference/tsxReactEmitEntities.js b/tests/baselines/reference/tsxReactEmitEntities.js index c1fba50fd8f..a20f3380bf7 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.js +++ b/tests/baselines/reference/tsxReactEmitEntities.js @@ -8,7 +8,9 @@ declare module JSX { declare var React: any;
Dot goes here: · ¬AnEntity;
; +
Be careful of "-ed strings!
; //// [file.js] React.createElement("div", null, "Dot goes here: · ¬AnEntity; "); +React.createElement("div", null, "Be careful of \"-ed strings!"); diff --git a/tests/baselines/reference/tsxReactEmitEntities.symbols b/tests/baselines/reference/tsxReactEmitEntities.symbols index b633f57ec13..5a0274029e4 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.symbols +++ b/tests/baselines/reference/tsxReactEmitEntities.symbols @@ -19,3 +19,7 @@ declare var React: any; >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +
Be careful of "-ed strings!
; +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types index d6d6c285d79..111653ea140 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.types +++ b/tests/baselines/reference/tsxReactEmitEntities.types @@ -20,3 +20,8 @@ declare var React: any; >div : any >div : any +
Be careful of "-ed strings!
; +>
Be careful of "-ed strings!
: JSX.Element +>div : any +>div : any + diff --git a/tests/baselines/reference/tsxTypeErrors.symbols b/tests/baselines/reference/tsxTypeErrors.symbols index 94399b95d1f..2b87e994477 100644 --- a/tests/baselines/reference/tsxTypeErrors.symbols +++ b/tests/baselines/reference/tsxTypeErrors.symbols @@ -3,11 +3,13 @@ // A built-in element (OK) var a1 =
; >a1 : Symbol(a1, Decl(tsxTypeErrors.tsx, 2, 3)) +>div : Symbol(unknown) >id : Symbol(unknown) // A built-in element with a mistyped property (error) var a2 = >a2 : Symbol(a2, Decl(tsxTypeErrors.tsx, 5, 3)) +>img : Symbol(unknown) >srce : Symbol(unknown) // A built-in element with a badly-typed attribute value (error) @@ -17,12 +19,14 @@ var thing = { oops: 100 }; var a3 =
>a3 : Symbol(a3, Decl(tsxTypeErrors.tsx, 9, 3)) +>div : Symbol(unknown) >id : Symbol(unknown) >thing : Symbol(thing, Decl(tsxTypeErrors.tsx, 8, 3)) // Mistyped html name (error) var e1 = >e1 : Symbol(e1, Decl(tsxTypeErrors.tsx, 12, 3)) +>imag : Symbol(unknown) >src : Symbol(unknown) // A custom type diff --git a/tests/baselines/reference/typedArrays.js b/tests/baselines/reference/typedArrays.js index 89e6f43ecae..6159edc1187 100644 --- a/tests/baselines/reference/typedArrays.js +++ b/tests/baselines/reference/typedArrays.js @@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { return typedArrays; } -/* function CreateTypedArraysOf(obj) { var typedArrays = []; typedArrays[0] = Int8Array.of(...obj); @@ -90,7 +89,6 @@ function CreateTypedArraysOf(obj) { return typedArrays; } -*/ function CreateTypedArraysOf2() { var typedArrays = []; @@ -203,7 +201,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj) { typedArrays[8] = Uint8ClampedArray.from(obj); return typedArrays; } -/* function CreateTypedArraysOf(obj) { var typedArrays = []; typedArrays[0] = Int8Array.of(...obj); @@ -215,10 +212,8 @@ function CreateTypedArraysOf(obj) { typedArrays[6] = Float32Array.of(...obj); typedArrays[7] = Float64Array.of(...obj); typedArrays[8] = Uint8ClampedArray.of(...obj); - return typedArrays; } -*/ function CreateTypedArraysOf2() { var typedArrays = []; typedArrays[0] = Int8Array.of(1, 2, 3, 4); diff --git a/tests/baselines/reference/typedArrays.symbols b/tests/baselines/reference/typedArrays.symbols index cf5e68b956a..7282e8b8879 100644 --- a/tests/baselines/reference/typedArrays.symbols +++ b/tests/baselines/reference/typedArrays.symbols @@ -307,267 +307,324 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) } -/* function CreateTypedArraysOf(obj) { +>CreateTypedArraysOf : Symbol(CreateTypedArraysOf, Decl(typedArrays.ts, 74, 1)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + var typedArrays = []; +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) + typedArrays[0] = Int8Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[1] = Uint8Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[2] = Int16Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[3] = Uint16Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[4] = Int32Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[5] = Uint32Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[6] = Float32Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[7] = Float64Array.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) + typedArrays[8] = Uint8ClampedArray.of(...obj); +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) +>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --)) +>obj : Symbol(obj, Decl(typedArrays.ts, 76, 29)) return typedArrays; +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 77, 7)) } -*/ function CreateTypedArraysOf2() { ->CreateTypedArraysOf2 : Symbol(CreateTypedArraysOf2, Decl(typedArrays.ts, 74, 1)) +>CreateTypedArraysOf2 : Symbol(CreateTypedArraysOf2, Decl(typedArrays.ts, 89, 1)) var typedArrays = []; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) typedArrays[0] = Int8Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[1] = Uint8Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[2] = Int16Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[3] = Uint16Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[4] = Int32Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[5] = Uint32Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[6] = Float32Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[7] = Float64Array.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, --, --)) typedArrays[8] = Uint8ClampedArray.of(1,2,3,4); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) >Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, --, --)) return typedArrays; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 92, 7)) } function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:number)=> number) { ->CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 106, 1)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) +>CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 104, 1)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) >ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, --, --)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) ->n : Symbol(n, Decl(typedArrays.ts, 108, 67)) ->v : Symbol(v, Decl(typedArrays.ts, 108, 76)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) +>n : Symbol(n, Decl(typedArrays.ts, 106, 67)) +>v : Symbol(v, Decl(typedArrays.ts, 106, 76)) var typedArrays = []; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) typedArrays[0] = Int8Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[1] = Uint8Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[2] = Int16Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[3] = Uint16Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[4] = Int32Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[5] = Uint32Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[6] = Float32Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[7] = Float64Array.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) >Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) +>obj : Symbol(obj, Decl(typedArrays.ts, 106, 36)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 106, 58)) return typedArrays; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 107, 7)) } function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v:number)=> number, thisArg: {}) { ->CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 121, 1)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) +>CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 119, 1)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) >ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, --, --)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->n : Symbol(n, Decl(typedArrays.ts, 123, 69)) ->v : Symbol(v, Decl(typedArrays.ts, 123, 78)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>n : Symbol(n, Decl(typedArrays.ts, 121, 69)) +>v : Symbol(v, Decl(typedArrays.ts, 121, 78)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) var typedArrays = []; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) typedArrays[0] = Int8Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[2] = Int16Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[4] = Int32Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[6] = Float32Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[7] = Float64Array.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg); ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) >Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) ->thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) +>obj : Symbol(obj, Decl(typedArrays.ts, 121, 38)) +>mapFn : Symbol(mapFn, Decl(typedArrays.ts, 121, 60)) +>thisArg : Symbol(thisArg, Decl(typedArrays.ts, 121, 98)) return typedArrays; ->typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) +>typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 122, 7)) } diff --git a/tests/baselines/reference/typedArrays.types b/tests/baselines/reference/typedArrays.types index 9886982c0f2..f7d3cbdd19f 100644 --- a/tests/baselines/reference/typedArrays.types +++ b/tests/baselines/reference/typedArrays.types @@ -483,22 +483,125 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] } -/* function CreateTypedArraysOf(obj) { +>CreateTypedArraysOf : (obj: any) => any[] +>obj : any + var typedArrays = []; +>typedArrays : any[] +>[] : undefined[] + typedArrays[0] = Int8Array.of(...obj); +>typedArrays[0] = Int8Array.of(...obj) : Int8Array +>typedArrays[0] : any +>typedArrays : any[] +>0 : number +>Int8Array.of(...obj) : Int8Array +>Int8Array.of : (...items: number[]) => Int8Array +>Int8Array : Int8ArrayConstructor +>of : (...items: number[]) => Int8Array +>...obj : any +>obj : any + typedArrays[1] = Uint8Array.of(...obj); +>typedArrays[1] = Uint8Array.of(...obj) : Uint8Array +>typedArrays[1] : any +>typedArrays : any[] +>1 : number +>Uint8Array.of(...obj) : Uint8Array +>Uint8Array.of : (...items: number[]) => Uint8Array +>Uint8Array : Uint8ArrayConstructor +>of : (...items: number[]) => Uint8Array +>...obj : any +>obj : any + typedArrays[2] = Int16Array.of(...obj); +>typedArrays[2] = Int16Array.of(...obj) : Int16Array +>typedArrays[2] : any +>typedArrays : any[] +>2 : number +>Int16Array.of(...obj) : Int16Array +>Int16Array.of : (...items: number[]) => Int16Array +>Int16Array : Int16ArrayConstructor +>of : (...items: number[]) => Int16Array +>...obj : any +>obj : any + typedArrays[3] = Uint16Array.of(...obj); +>typedArrays[3] = Uint16Array.of(...obj) : Uint16Array +>typedArrays[3] : any +>typedArrays : any[] +>3 : number +>Uint16Array.of(...obj) : Uint16Array +>Uint16Array.of : (...items: number[]) => Uint16Array +>Uint16Array : Uint16ArrayConstructor +>of : (...items: number[]) => Uint16Array +>...obj : any +>obj : any + typedArrays[4] = Int32Array.of(...obj); +>typedArrays[4] = Int32Array.of(...obj) : Int32Array +>typedArrays[4] : any +>typedArrays : any[] +>4 : number +>Int32Array.of(...obj) : Int32Array +>Int32Array.of : (...items: number[]) => Int32Array +>Int32Array : Int32ArrayConstructor +>of : (...items: number[]) => Int32Array +>...obj : any +>obj : any + typedArrays[5] = Uint32Array.of(...obj); +>typedArrays[5] = Uint32Array.of(...obj) : Uint32Array +>typedArrays[5] : any +>typedArrays : any[] +>5 : number +>Uint32Array.of(...obj) : Uint32Array +>Uint32Array.of : (...items: number[]) => Uint32Array +>Uint32Array : Uint32ArrayConstructor +>of : (...items: number[]) => Uint32Array +>...obj : any +>obj : any + typedArrays[6] = Float32Array.of(...obj); +>typedArrays[6] = Float32Array.of(...obj) : Float32Array +>typedArrays[6] : any +>typedArrays : any[] +>6 : number +>Float32Array.of(...obj) : Float32Array +>Float32Array.of : (...items: number[]) => Float32Array +>Float32Array : Float32ArrayConstructor +>of : (...items: number[]) => Float32Array +>...obj : any +>obj : any + typedArrays[7] = Float64Array.of(...obj); +>typedArrays[7] = Float64Array.of(...obj) : Float64Array +>typedArrays[7] : any +>typedArrays : any[] +>7 : number +>Float64Array.of(...obj) : Float64Array +>Float64Array.of : (...items: number[]) => Float64Array +>Float64Array : Float64ArrayConstructor +>of : (...items: number[]) => Float64Array +>...obj : any +>obj : any + typedArrays[8] = Uint8ClampedArray.of(...obj); +>typedArrays[8] = Uint8ClampedArray.of(...obj) : Uint8ClampedArray +>typedArrays[8] : any +>typedArrays : any[] +>8 : number +>Uint8ClampedArray.of(...obj) : Uint8ClampedArray +>Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray +>Uint8ClampedArray : Uint8ClampedArrayConstructor +>of : (...items: number[]) => Uint8ClampedArray +>...obj : any +>obj : any return typedArrays; +>typedArrays : any[] } -*/ function CreateTypedArraysOf2() { >CreateTypedArraysOf2 : () => any[] diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt new file mode 100644 index 00000000000..bd3422b4826 --- /dev/null +++ b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt @@ -0,0 +1,545 @@ +tests/cases/compiler/typedArraysCrossAssignability01.ts(14,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(15,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(16,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(17,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(18,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(19,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(20,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(21,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(23,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(25,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(26,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(27,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(28,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(29,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(30,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(31,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(33,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(34,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(36,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(37,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(38,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(39,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(40,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(41,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(43,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(44,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(45,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(47,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(48,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(49,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(50,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(51,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(53,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(54,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(55,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(56,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(58,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(59,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(60,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(61,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(63,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(64,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(65,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(66,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(67,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(68,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(70,5): error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(71,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(73,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(74,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(75,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(76,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(77,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(78,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(79,5): error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(81,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(83,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(84,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(85,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(86,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(87,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(88,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. +tests/cases/compiler/typedArraysCrossAssignability01.ts(90,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. + + +==== tests/cases/compiler/typedArraysCrossAssignability01.ts (64 errors) ==== + + function CheckAssignability() { + let arr_Int8Array = new Int8Array(1); + let arr_Uint8Array = new Uint8Array(1); + let arr_Int16Array = new Int16Array(1); + let arr_Uint16Array = new Uint16Array(1); + let arr_Int32Array = new Int32Array(1); + let arr_Uint32Array = new Uint32Array(1); + let arr_Float32Array = new Float32Array(1); + let arr_Float64Array = new Float64Array(1); + let arr_Uint8ClampedArray = new Uint8ClampedArray(1); + + arr_Int8Array = arr_Int8Array; + arr_Int8Array = arr_Uint8Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Int16Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Uint16Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Int32Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Uint32Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Float32Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Float64Array; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int8Array"'. + arr_Int8Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. + + arr_Uint8Array = arr_Int8Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Uint8Array; + arr_Uint8Array = arr_Int16Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Uint16Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Int32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Uint32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Float32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Float64Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"UInt8Array"'. + arr_Uint8Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. + + arr_Int16Array = arr_Int8Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Uint8Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Int16Array; + arr_Int16Array = arr_Uint16Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Int32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Uint32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Float32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Float64Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int16Array"'. + arr_Int16Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. + + arr_Uint16Array = arr_Int8Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Uint8Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Int16Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Uint16Array; + arr_Uint16Array = arr_Int32Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Uint32Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Float32Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Float64Array; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint16Array"'. + arr_Uint16Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. + + arr_Int32Array = arr_Int8Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Uint8Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Int16Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Uint16Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Int32Array; + arr_Int32Array = arr_Uint32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Float32Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Float64Array; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int32Array"'. + arr_Int32Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. + + arr_Float32Array = arr_Int8Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Uint8Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Int16Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Uint16Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Int32Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Uint32Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Float32Array; + arr_Float32Array = arr_Float64Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Float32Array"'. + arr_Float32Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. + + arr_Float64Array = arr_Int8Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Uint8Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Int16Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Uint16Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Int32Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Uint32Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Float32Array; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Float64Array"'. + arr_Float64Array = arr_Float64Array; + arr_Float64Array = arr_Uint8ClampedArray; + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. + + arr_Uint8ClampedArray = arr_Int8Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Uint8Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Int16Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Uint16Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Int32Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Uint32Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Float32Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Float64Array; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. + arr_Uint8ClampedArray = arr_Uint8ClampedArray; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.js b/tests/baselines/reference/typedArraysCrossAssignability01.js new file mode 100644 index 00000000000..9572bfcaf59 --- /dev/null +++ b/tests/baselines/reference/typedArraysCrossAssignability01.js @@ -0,0 +1,180 @@ +//// [typedArraysCrossAssignability01.ts] + +function CheckAssignability() { + let arr_Int8Array = new Int8Array(1); + let arr_Uint8Array = new Uint8Array(1); + let arr_Int16Array = new Int16Array(1); + let arr_Uint16Array = new Uint16Array(1); + let arr_Int32Array = new Int32Array(1); + let arr_Uint32Array = new Uint32Array(1); + let arr_Float32Array = new Float32Array(1); + let arr_Float64Array = new Float64Array(1); + let arr_Uint8ClampedArray = new Uint8ClampedArray(1); + + arr_Int8Array = arr_Int8Array; + arr_Int8Array = arr_Uint8Array; + arr_Int8Array = arr_Int16Array; + arr_Int8Array = arr_Uint16Array; + arr_Int8Array = arr_Int32Array; + arr_Int8Array = arr_Uint32Array; + arr_Int8Array = arr_Float32Array; + arr_Int8Array = arr_Float64Array; + arr_Int8Array = arr_Uint8ClampedArray; + + arr_Uint8Array = arr_Int8Array; + arr_Uint8Array = arr_Uint8Array; + arr_Uint8Array = arr_Int16Array; + arr_Uint8Array = arr_Uint16Array; + arr_Uint8Array = arr_Int32Array; + arr_Uint8Array = arr_Uint32Array; + arr_Uint8Array = arr_Float32Array; + arr_Uint8Array = arr_Float64Array; + arr_Uint8Array = arr_Uint8ClampedArray; + + arr_Int16Array = arr_Int8Array; + arr_Int16Array = arr_Uint8Array; + arr_Int16Array = arr_Int16Array; + arr_Int16Array = arr_Uint16Array; + arr_Int16Array = arr_Int32Array; + arr_Int16Array = arr_Uint32Array; + arr_Int16Array = arr_Float32Array; + arr_Int16Array = arr_Float64Array; + arr_Int16Array = arr_Uint8ClampedArray; + + arr_Uint16Array = arr_Int8Array; + arr_Uint16Array = arr_Uint8Array; + arr_Uint16Array = arr_Int16Array; + arr_Uint16Array = arr_Uint16Array; + arr_Uint16Array = arr_Int32Array; + arr_Uint16Array = arr_Uint32Array; + arr_Uint16Array = arr_Float32Array; + arr_Uint16Array = arr_Float64Array; + arr_Uint16Array = arr_Uint8ClampedArray; + + arr_Int32Array = arr_Int8Array; + arr_Int32Array = arr_Uint8Array; + arr_Int32Array = arr_Int16Array; + arr_Int32Array = arr_Uint16Array; + arr_Int32Array = arr_Int32Array; + arr_Int32Array = arr_Uint32Array; + arr_Int32Array = arr_Float32Array; + arr_Int32Array = arr_Float64Array; + arr_Int32Array = arr_Uint8ClampedArray; + + arr_Float32Array = arr_Int8Array; + arr_Float32Array = arr_Uint8Array; + arr_Float32Array = arr_Int16Array; + arr_Float32Array = arr_Uint16Array; + arr_Float32Array = arr_Int32Array; + arr_Float32Array = arr_Uint32Array; + arr_Float32Array = arr_Float32Array; + arr_Float32Array = arr_Float64Array; + arr_Float32Array = arr_Uint8ClampedArray; + + arr_Float64Array = arr_Int8Array; + arr_Float64Array = arr_Uint8Array; + arr_Float64Array = arr_Int16Array; + arr_Float64Array = arr_Uint16Array; + arr_Float64Array = arr_Int32Array; + arr_Float64Array = arr_Uint32Array; + arr_Float64Array = arr_Float32Array; + arr_Float64Array = arr_Float64Array; + arr_Float64Array = arr_Uint8ClampedArray; + + arr_Uint8ClampedArray = arr_Int8Array; + arr_Uint8ClampedArray = arr_Uint8Array; + arr_Uint8ClampedArray = arr_Int16Array; + arr_Uint8ClampedArray = arr_Uint16Array; + arr_Uint8ClampedArray = arr_Int32Array; + arr_Uint8ClampedArray = arr_Uint32Array; + arr_Uint8ClampedArray = arr_Float32Array; + arr_Uint8ClampedArray = arr_Float64Array; + arr_Uint8ClampedArray = arr_Uint8ClampedArray; + +} + + +//// [typedArraysCrossAssignability01.js] +function CheckAssignability() { + let arr_Int8Array = new Int8Array(1); + let arr_Uint8Array = new Uint8Array(1); + let arr_Int16Array = new Int16Array(1); + let arr_Uint16Array = new Uint16Array(1); + let arr_Int32Array = new Int32Array(1); + let arr_Uint32Array = new Uint32Array(1); + let arr_Float32Array = new Float32Array(1); + let arr_Float64Array = new Float64Array(1); + let arr_Uint8ClampedArray = new Uint8ClampedArray(1); + arr_Int8Array = arr_Int8Array; + arr_Int8Array = arr_Uint8Array; + arr_Int8Array = arr_Int16Array; + arr_Int8Array = arr_Uint16Array; + arr_Int8Array = arr_Int32Array; + arr_Int8Array = arr_Uint32Array; + arr_Int8Array = arr_Float32Array; + arr_Int8Array = arr_Float64Array; + arr_Int8Array = arr_Uint8ClampedArray; + arr_Uint8Array = arr_Int8Array; + arr_Uint8Array = arr_Uint8Array; + arr_Uint8Array = arr_Int16Array; + arr_Uint8Array = arr_Uint16Array; + arr_Uint8Array = arr_Int32Array; + arr_Uint8Array = arr_Uint32Array; + arr_Uint8Array = arr_Float32Array; + arr_Uint8Array = arr_Float64Array; + arr_Uint8Array = arr_Uint8ClampedArray; + arr_Int16Array = arr_Int8Array; + arr_Int16Array = arr_Uint8Array; + arr_Int16Array = arr_Int16Array; + arr_Int16Array = arr_Uint16Array; + arr_Int16Array = arr_Int32Array; + arr_Int16Array = arr_Uint32Array; + arr_Int16Array = arr_Float32Array; + arr_Int16Array = arr_Float64Array; + arr_Int16Array = arr_Uint8ClampedArray; + arr_Uint16Array = arr_Int8Array; + arr_Uint16Array = arr_Uint8Array; + arr_Uint16Array = arr_Int16Array; + arr_Uint16Array = arr_Uint16Array; + arr_Uint16Array = arr_Int32Array; + arr_Uint16Array = arr_Uint32Array; + arr_Uint16Array = arr_Float32Array; + arr_Uint16Array = arr_Float64Array; + arr_Uint16Array = arr_Uint8ClampedArray; + arr_Int32Array = arr_Int8Array; + arr_Int32Array = arr_Uint8Array; + arr_Int32Array = arr_Int16Array; + arr_Int32Array = arr_Uint16Array; + arr_Int32Array = arr_Int32Array; + arr_Int32Array = arr_Uint32Array; + arr_Int32Array = arr_Float32Array; + arr_Int32Array = arr_Float64Array; + arr_Int32Array = arr_Uint8ClampedArray; + arr_Float32Array = arr_Int8Array; + arr_Float32Array = arr_Uint8Array; + arr_Float32Array = arr_Int16Array; + arr_Float32Array = arr_Uint16Array; + arr_Float32Array = arr_Int32Array; + arr_Float32Array = arr_Uint32Array; + arr_Float32Array = arr_Float32Array; + arr_Float32Array = arr_Float64Array; + arr_Float32Array = arr_Uint8ClampedArray; + arr_Float64Array = arr_Int8Array; + arr_Float64Array = arr_Uint8Array; + arr_Float64Array = arr_Int16Array; + arr_Float64Array = arr_Uint16Array; + arr_Float64Array = arr_Int32Array; + arr_Float64Array = arr_Uint32Array; + arr_Float64Array = arr_Float32Array; + arr_Float64Array = arr_Float64Array; + arr_Float64Array = arr_Uint8ClampedArray; + arr_Uint8ClampedArray = arr_Int8Array; + arr_Uint8ClampedArray = arr_Uint8Array; + arr_Uint8ClampedArray = arr_Int16Array; + arr_Uint8ClampedArray = arr_Uint16Array; + arr_Uint8ClampedArray = arr_Int32Array; + arr_Uint8ClampedArray = arr_Uint32Array; + arr_Uint8ClampedArray = arr_Float32Array; + arr_Uint8ClampedArray = arr_Float64Array; + arr_Uint8ClampedArray = arr_Uint8ClampedArray; +} diff --git a/tests/cases/compiler/capturedLetConstInLoop5.ts b/tests/cases/compiler/capturedLetConstInLoop5.ts index 475137c14cc..5eedd5aac85 100644 --- a/tests/cases/compiler/capturedLetConstInLoop5.ts +++ b/tests/cases/compiler/capturedLetConstInLoop5.ts @@ -19,7 +19,7 @@ function foo00(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -158,7 +158,7 @@ function foo00_c(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } diff --git a/tests/cases/compiler/capturedLetConstInLoop5_ES6.ts b/tests/cases/compiler/capturedLetConstInLoop5_ES6.ts index 035e21b9e84..224ffa823bf 100644 --- a/tests/cases/compiler/capturedLetConstInLoop5_ES6.ts +++ b/tests/cases/compiler/capturedLetConstInLoop5_ES6.ts @@ -21,7 +21,7 @@ function foo00(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -160,7 +160,7 @@ function foo00_c(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } diff --git a/tests/cases/compiler/capturedLetConstInLoop6.ts b/tests/cases/compiler/capturedLetConstInLoop6.ts index 321d20e3c20..a854be46195 100644 --- a/tests/cases/compiler/capturedLetConstInLoop6.ts +++ b/tests/cases/compiler/capturedLetConstInLoop6.ts @@ -13,10 +13,10 @@ for (let x of []) { for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -132,10 +132,10 @@ for (const x of []) { for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } diff --git a/tests/cases/compiler/capturedLetConstInLoop6_ES6.ts b/tests/cases/compiler/capturedLetConstInLoop6_ES6.ts index f43fe5851d2..ad10f1fcb74 100644 --- a/tests/cases/compiler/capturedLetConstInLoop6_ES6.ts +++ b/tests/cases/compiler/capturedLetConstInLoop6_ES6.ts @@ -14,10 +14,10 @@ for (let x of []) { for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -133,10 +133,10 @@ for (const x of []) { for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } diff --git a/tests/cases/compiler/capturedLetConstInLoop7.ts b/tests/cases/compiler/capturedLetConstInLoop7.ts index a1d35c4038b..12805411f96 100644 --- a/tests/cases/compiler/capturedLetConstInLoop7.ts +++ b/tests/cases/compiler/capturedLetConstInLoop7.ts @@ -21,16 +21,16 @@ l00: for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00; } } @@ -209,16 +209,16 @@ l00_c: for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00_c; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00_c; } } diff --git a/tests/cases/compiler/capturedLetConstInLoop7_ES6.ts b/tests/cases/compiler/capturedLetConstInLoop7_ES6.ts index 14b1d0c85af..2e2784f9a16 100644 --- a/tests/cases/compiler/capturedLetConstInLoop7_ES6.ts +++ b/tests/cases/compiler/capturedLetConstInLoop7_ES6.ts @@ -22,16 +22,16 @@ l00: for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00; } } @@ -210,16 +210,16 @@ l00_c: for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00_c; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00_c; } } diff --git a/tests/cases/compiler/reExportGlobalDeclaration1.ts b/tests/cases/compiler/reExportGlobalDeclaration1.ts new file mode 100644 index 00000000000..9b3f0c030de --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration1.ts @@ -0,0 +1,19 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare var x: number; +declare var x1: number; +declare let {a, b}: {a: number, b: number}; + +// @filename: file2.ts +export {x, x as y}; +export {x1, x1 as y1}; + +export {a, a as a1}; +export {b, b as b1}; + + +export {x as z}; +export {x1 as z1}; +export {a as a2}; +export {b as b2}; diff --git a/tests/cases/compiler/reExportGlobalDeclaration2.ts b/tests/cases/compiler/reExportGlobalDeclaration2.ts new file mode 100644 index 00000000000..4dba4fd20fa --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration2.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare interface I1 { + x: number +} + +declare interface I2 { + x: number +} + +// @filename: file2.ts +export {I1, I1 as II1}; +export {I2, I2 as II2}; +export {I1 as III1}; +export {I2 as III2}; \ No newline at end of file diff --git a/tests/cases/compiler/reExportGlobalDeclaration3.ts b/tests/cases/compiler/reExportGlobalDeclaration3.ts new file mode 100644 index 00000000000..dc188ac6fb5 --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration3.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare namespace NS1 { + export var foo: number; +} + +declare namespace NS2 { + export var foo: number; +} + +// @filename: file2.ts +export {NS1, NS1 as NNS1}; +export {NS2, NS2 as NNS2}; +export {NS1 as NNNS1}; +export {NS2 as NNNS2}; \ No newline at end of file diff --git a/tests/cases/compiler/reExportGlobalDeclaration4.ts b/tests/cases/compiler/reExportGlobalDeclaration4.ts new file mode 100644 index 00000000000..7298aa682fe --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration4.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare class Cls1 { + x: number +} +declare class Cls2 { + x: number +} + + +// @filename: file2.ts +export {Cls1, Cls1 as CCls1}; +export {Cls2, Cls2 as CCls2}; +export {Cls1 as CCCls1}; +export {Cls2 as CCCls2}; \ No newline at end of file diff --git a/tests/cases/compiler/reactNamespaceImportPresevation.tsx b/tests/cases/compiler/reactNamespaceImportPresevation.tsx new file mode 100644 index 00000000000..ec7e5d0d6ac --- /dev/null +++ b/tests/cases/compiler/reactNamespaceImportPresevation.tsx @@ -0,0 +1,15 @@ +//@jsx: preserve +//@module: commonjs +//@reactNamespace: myReactLib + +//@filename: modules.d.ts +declare module "my-React-Lib" { + var a: any; + export = a; +} + +//@filename: test.tsx +import * as myReactLib from "my-React-Lib"; // should not be elided +declare var foo: any; + +; diff --git a/tests/cases/compiler/reactNamespaceInvalidInput.tsx b/tests/cases/compiler/reactNamespaceInvalidInput.tsx new file mode 100644 index 00000000000..a8595de5d6e --- /dev/null +++ b/tests/cases/compiler/reactNamespaceInvalidInput.tsx @@ -0,0 +1,4 @@ +//@jsx: react +//@reactNamespace: my-React-Lib + +; diff --git a/tests/cases/compiler/reactNamespaceJSXEmit.tsx b/tests/cases/compiler/reactNamespaceJSXEmit.tsx new file mode 100644 index 00000000000..f5ec957a78b --- /dev/null +++ b/tests/cases/compiler/reactNamespaceJSXEmit.tsx @@ -0,0 +1,13 @@ +//@jsx: react +//@reactNamespace: myReactLib + +declare var myReactLib: any; +declare var foo: any; +declare var Bar: any; +declare var x: any; + +; +; +; +; +; diff --git a/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx b/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx new file mode 100644 index 00000000000..fdfed629606 --- /dev/null +++ b/tests/cases/compiler/reactNamespaceMissingDeclaration.tsx @@ -0,0 +1,5 @@ +//@jsx: react +//@reactNamespace: myReactLib + +// Error myReactLib not declared + \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts new file mode 100644 index 00000000000..cd1ad012b25 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts @@ -0,0 +1,93 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts new file mode 100644 index 00000000000..597f40afe86 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts @@ -0,0 +1,99 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..36c3c8cb48c --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,109 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..4e0e5d053b3 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,115 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts new file mode 100644 index 00000000000..7d5471db324 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts @@ -0,0 +1,67 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts new file mode 100644 index 00000000000..3e018b2a6d5 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts @@ -0,0 +1,111 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..22c9ecdf66d --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,98 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..0240a82c40b --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts @@ -0,0 +1,175 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..f2fb461f443 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts @@ -0,0 +1,96 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA] of robots) { + console.log(nameA); +} +for (let [, nameA] of getRobots()) { + console.log(nameA); +} +for (let [, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB] of robots) { + console.log(numberB); +} +for (let [numberB] of getRobots()) { + console.log(numberB); +} +for (let [numberB] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB] of multiRobots) { + console.log(nameB); +} +for (let [nameB] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts new file mode 100644 index 00000000000..365a030f8e9 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts @@ -0,0 +1,101 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA] of robots) { + console.log(nameA); +} +for ([, nameA] of getRobots()) { + console.log(nameA); +} +for ([, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB] of robots) { + console.log(numberB); +} +for ([numberB] of getRobots()) { + console.log(numberB); +} +for ([numberB] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB] of multiRobots) { + console.log(nameB); +} +for ([nameB] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for ([...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..a619fc1c42f --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,105 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA = "noName"] of robots) { + console.log(nameA); +} +for (let [, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for (let [, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB = -1] of robots) { + console.log(numberB); +} +for (let [numberB = -1] of getRobots()) { + console.log(numberB); +} +for (let [numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for (let [nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..ac0c8774567 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,110 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA = "noName"] of robots) { + console.log(nameA); +} +for ([, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for ([, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB = -1] of robots) { + console.log(numberB); +} +for ([numberB = -1] of getRobots()) { + console.log(numberB); +} +for ([numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for ([nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..df822f89bc0 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts @@ -0,0 +1,68 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA } of robots) { + console.log(nameA); +} +for (let {name: nameA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts new file mode 100644 index 00000000000..7f71e7d6bdd --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts @@ -0,0 +1,110 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA } of robots) { + console.log(nameA); +} +for ({name: nameA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} +for ({name } of robots) { + console.log(nameA); +} +for ({name } of getRobots()) { + console.log(nameA); +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} +for ({name, skill } of robots) { + console.log(nameA); +} +for ({name, skill } of getRobots()) { + console.log(nameA); +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of multiRobots) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..d8f88189c01 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,90 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA = "noName" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..01d2f6133a3 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts @@ -0,0 +1,167 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for ({ name = "noName" } of robots) { + console.log(nameA); +} +for ({ name = "noName" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +for ({ name = "noName", skill = "noSkill" } of robots) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..062acd823ac --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts @@ -0,0 +1,31 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + console.log(primaryA); +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + console.log(secondaryB); +} +function foo3({ skills }: Robot) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..c9dd735e8b6 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts @@ -0,0 +1,44 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1( + { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(primaryA); +} +function foo2( + { + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(secondaryB); +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts new file mode 100644 index 00000000000..0f52806dd16 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts @@ -0,0 +1,29 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..6fc9c5a605e --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts @@ -0,0 +1,29 @@ +// @sourcemap: true +interface Robot { + name?: string; + skill?: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA = "" }: Robot = { }) { + console.log(nameA); +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + console.log(nameB); +} +function foo3({ name = "" }: Robot = {}) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts new file mode 100644 index 00000000000..731dc7f2657 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA]: Robot) { + console.log(nameA); +} + +function foo2([numberB]: Robot) { + console.log(numberB); +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { + console.log(nameA2); +} + +function foo4([numberA3, ...robotAInfo]: Robot) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts new file mode 100644 index 00000000000..07c2a24e70e --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [string, [string, string]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA]: Robot) { + console.log(skillA); +} + +function foo2([nameMB]: Robot) { + console.log(nameMB); +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + console.log(nameMA); +} + +function foo4([...multiRobotAInfo]: Robot) { + console.log(multiRobotAInfo); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..345d3965156 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + console.log(nameA); +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + console.log(numberB); +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + console.log(nameA2); +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..83f95c09c02 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,30 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [string, string[]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + console.log(skillA); +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + console.log(nameMB); +} + +function foo3([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: Robot) { + console.log(nameMA); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts new file mode 100644 index 00000000000..88e49498f60 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA } = robotA; +var { name: nameB, skill: skillB } = robotB; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts new file mode 100644 index 00000000000..3697402bbcf --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts @@ -0,0 +1,28 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var a: string, { name: nameA } = robotA; +var b: string, { name: nameB, skill: skillB } = robotB; +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + +var { name: nameA } = robotA, a = hello; +var { name: nameB, skill: skillB } = robotB, b = " hello"; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + +var a = hello, { name: nameA } = robotA, a1= "hello"; +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..3ac03143aa2 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts @@ -0,0 +1,21 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + + +let [, nameA] = robotA; +let [numberB] = robotB; +let [numberA2, nameA2, skillA2] = robotA; + +let [numberC2] = [3, "edging", "Trimming edges"]; +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + +let [numberA3, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts new file mode 100644 index 00000000000..27497f2c220 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, [string, string]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA] = multiRobotA; +let [nameMB] = multiRobotB; +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + +let [...multiRobotAInfo] = multiRobotA; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts new file mode 100644 index 00000000000..78ed29c397b --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts @@ -0,0 +1,57 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | [string, string])[]; + +[, nameA] = robotA; +[, nameB] = getRobotB(); +[, nameB] = [2, "trimmer", "trimming"]; +[, multiSkillB] = multiRobotB; +[, multiSkillB] = getMultiRobotB(); +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + +[numberB] = robotB; +[numberB] = getRobotB(); +[numberB] = [2, "trimmer", "trimming"]; +[nameMB] = multiRobotB; +[nameMB] = getMultiRobotB(); +[nameMB] = ["trimmer", ["trimming", "edging"]]; + +[numberB, nameB, skillB] = robotB; +[numberB, nameB, skillB] = getRobotB(); +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + +[numberB, ...robotAInfo] = robotB; +[numberB, ...robotAInfo] = getRobotB(); +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +[...multiRobotAInfo] = multiRobotA; +[...multiRobotAInfo] = getMultiRobotB(); +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..fb942310389 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + +let [, nameA = "noName"] = robotA; +let [numberB = -1] = robotB; +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + +let [numberA3 = -1, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..4b4ef07d232 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,18 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, string[]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +let [nameMB = "noName" ] = multiRobotB; +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts new file mode 100644 index 00000000000..253d96d4b35 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts @@ -0,0 +1,55 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | string[])[]; + +[, nameA = "helloNoName"] = robotA; +[, nameB = "helloNoName"] = getRobotB(); +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +[, multiSkillB = []] = multiRobotB; +[, multiSkillB = []] = getMultiRobotB(); +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + +[numberB = -1] = robotB; +[numberB = -1] = getRobotB(); +[numberB = -1] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName"] = multiRobotB; +[nameMB = "helloNoName"] = getMultiRobotB(); +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +[numberB = -1, ...robotAInfo] = getRobotB(); +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts new file mode 100644 index 00000000000..b95e7e5464a --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA = "" } = robotA; +var { name: nameB = "", skill: skillB = "" } = robotB; +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..a40e5f11ebb --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts @@ -0,0 +1,24 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts new file mode 100644 index 00000000000..95eda6f2050 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts @@ -0,0 +1,41 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { + skills: { + primary: primaryA = "noSkill", + secondary: secondaryA = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotA; +var { + name: nameB = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotB; +var { + name: nameC = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/typedArrays.ts b/tests/cases/compiler/typedArrays.ts index 4508632f6d6..602e15dc2d7 100644 --- a/tests/cases/compiler/typedArrays.ts +++ b/tests/cases/compiler/typedArrays.ts @@ -75,7 +75,6 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { return typedArrays; } -/* function CreateTypedArraysOf(obj) { var typedArrays = []; typedArrays[0] = Int8Array.of(...obj); @@ -90,7 +89,6 @@ function CreateTypedArraysOf(obj) { return typedArrays; } -*/ function CreateTypedArraysOf2() { var typedArrays = []; diff --git a/tests/cases/compiler/typedArraysCrossAssignability01.ts b/tests/cases/compiler/typedArraysCrossAssignability01.ts new file mode 100644 index 00000000000..27607b64161 --- /dev/null +++ b/tests/cases/compiler/typedArraysCrossAssignability01.ts @@ -0,0 +1,94 @@ +// @target: ES6 + +function CheckAssignability() { + let arr_Int8Array = new Int8Array(1); + let arr_Uint8Array = new Uint8Array(1); + let arr_Int16Array = new Int16Array(1); + let arr_Uint16Array = new Uint16Array(1); + let arr_Int32Array = new Int32Array(1); + let arr_Uint32Array = new Uint32Array(1); + let arr_Float32Array = new Float32Array(1); + let arr_Float64Array = new Float64Array(1); + let arr_Uint8ClampedArray = new Uint8ClampedArray(1); + + arr_Int8Array = arr_Int8Array; + arr_Int8Array = arr_Uint8Array; + arr_Int8Array = arr_Int16Array; + arr_Int8Array = arr_Uint16Array; + arr_Int8Array = arr_Int32Array; + arr_Int8Array = arr_Uint32Array; + arr_Int8Array = arr_Float32Array; + arr_Int8Array = arr_Float64Array; + arr_Int8Array = arr_Uint8ClampedArray; + + arr_Uint8Array = arr_Int8Array; + arr_Uint8Array = arr_Uint8Array; + arr_Uint8Array = arr_Int16Array; + arr_Uint8Array = arr_Uint16Array; + arr_Uint8Array = arr_Int32Array; + arr_Uint8Array = arr_Uint32Array; + arr_Uint8Array = arr_Float32Array; + arr_Uint8Array = arr_Float64Array; + arr_Uint8Array = arr_Uint8ClampedArray; + + arr_Int16Array = arr_Int8Array; + arr_Int16Array = arr_Uint8Array; + arr_Int16Array = arr_Int16Array; + arr_Int16Array = arr_Uint16Array; + arr_Int16Array = arr_Int32Array; + arr_Int16Array = arr_Uint32Array; + arr_Int16Array = arr_Float32Array; + arr_Int16Array = arr_Float64Array; + arr_Int16Array = arr_Uint8ClampedArray; + + arr_Uint16Array = arr_Int8Array; + arr_Uint16Array = arr_Uint8Array; + arr_Uint16Array = arr_Int16Array; + arr_Uint16Array = arr_Uint16Array; + arr_Uint16Array = arr_Int32Array; + arr_Uint16Array = arr_Uint32Array; + arr_Uint16Array = arr_Float32Array; + arr_Uint16Array = arr_Float64Array; + arr_Uint16Array = arr_Uint8ClampedArray; + + arr_Int32Array = arr_Int8Array; + arr_Int32Array = arr_Uint8Array; + arr_Int32Array = arr_Int16Array; + arr_Int32Array = arr_Uint16Array; + arr_Int32Array = arr_Int32Array; + arr_Int32Array = arr_Uint32Array; + arr_Int32Array = arr_Float32Array; + arr_Int32Array = arr_Float64Array; + arr_Int32Array = arr_Uint8ClampedArray; + + arr_Float32Array = arr_Int8Array; + arr_Float32Array = arr_Uint8Array; + arr_Float32Array = arr_Int16Array; + arr_Float32Array = arr_Uint16Array; + arr_Float32Array = arr_Int32Array; + arr_Float32Array = arr_Uint32Array; + arr_Float32Array = arr_Float32Array; + arr_Float32Array = arr_Float64Array; + arr_Float32Array = arr_Uint8ClampedArray; + + arr_Float64Array = arr_Int8Array; + arr_Float64Array = arr_Uint8Array; + arr_Float64Array = arr_Int16Array; + arr_Float64Array = arr_Uint16Array; + arr_Float64Array = arr_Int32Array; + arr_Float64Array = arr_Uint32Array; + arr_Float64Array = arr_Float32Array; + arr_Float64Array = arr_Float64Array; + arr_Float64Array = arr_Uint8ClampedArray; + + arr_Uint8ClampedArray = arr_Int8Array; + arr_Uint8ClampedArray = arr_Uint8Array; + arr_Uint8ClampedArray = arr_Int16Array; + arr_Uint8ClampedArray = arr_Uint16Array; + arr_Uint8ClampedArray = arr_Int32Array; + arr_Uint8ClampedArray = arr_Uint32Array; + arr_Uint8ClampedArray = arr_Float32Array; + arr_Uint8ClampedArray = arr_Float64Array; + arr_Uint8ClampedArray = arr_Uint8ClampedArray; + +} diff --git a/tests/cases/conformance/jsx/jsxParsingError2.tsx b/tests/cases/conformance/jsx/jsxParsingError2.tsx new file mode 100644 index 00000000000..241978106ae --- /dev/null +++ b/tests/cases/conformance/jsx/jsxParsingError2.tsx @@ -0,0 +1,28 @@ +//@jsx: preserve + +//@filename: file.tsx +declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } +} + +// @filename: Error1.tsx +// Issue error about missing span closing tag, not missing div closing tag +let x1 =
; + +// @filename: Error2.tsx +let x2 =
; + + +// @filename: Error3.tsx +let x3 =
; + + +// @filename: Error4.tsx +let x4 =
; + +// @filename: Error5.tsx +let x5 =
+ diff --git a/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx b/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx new file mode 100644 index 00000000000..978c96a2019 --- /dev/null +++ b/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx @@ -0,0 +1,8 @@ +//@module: amd +//@jsx: preserve +//@target: ES5 + +//@Filename: test.tsx + +var Route: any; +var routes1 = ; diff --git a/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx b/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx new file mode 100644 index 00000000000..d7565cacbe2 --- /dev/null +++ b/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx @@ -0,0 +1,17 @@ +//@jsx: preserve +//@module: amd + +//@filename: file.tsx +declare module JSX { + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } +} + +//@filename: test.d.ts +export var React; + +//@filename: react-consumer.tsx +// This import should be elided +import {React} from "./test"; diff --git a/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx b/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx index 4b7dc5780f8..4726008d6be 100644 --- a/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx +++ b/tests/cases/conformance/jsx/tsxReactEmitEntities.tsx @@ -9,3 +9,4 @@ declare module JSX { declare var React: any;
Dot goes here: · ¬AnEntity;
; +
Be careful of "-ed strings!
; diff --git a/tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts b/tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts new file mode 100644 index 00000000000..6acf8d4b355 --- /dev/null +++ b/tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts @@ -0,0 +1,38 @@ +let a: Date[]; +let b: boolean[]; + +for (let x in a) { + let a1 = a[x]; + let a2 = a[(x)]; + let a3 = a[+x]; + let b1 = b[x]; + let b2 = b[(x)]; + let b3 = b[+x]; +} + +for (let x in a) { + for (let y in a) { + for (let z in a) { + let a1 = a[x]; + let a2 = a[y]; + let a3 = a[z]; + } + } +} + +let i: string; +let j: string; +for (i in a) { + for (j in b) { + let a1 = a[i]; + let a2 = a[j]; + } +} + +var s: string; +for (var s in a) { + let a1 = a[s]; +} +for (s in a) { + let a1 = a[s]; +} diff --git a/tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts b/tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts new file mode 100644 index 00000000000..c87ab6cea03 --- /dev/null +++ b/tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts @@ -0,0 +1,19 @@ +// @noImplicitAny: true + +let a: Date[]; + +for (let x in a) { + let a1 = a[x + 1]; + let a2 = a[x - 1]; + if (x === 1) { + } + let a3 = x.unknownProperty; +} + +var i: number; +for (var i in a ) { +} + +var j: any; +for (var j in a ) { +} diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts new file mode 100644 index 00000000000..167369a020b --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts @@ -0,0 +1,5 @@ +// @noImplicitAny: true + +let x: (a: string) => string; + +x = (100, a => a); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts new file mode 100644 index 00000000000..11e743b583e --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts @@ -0,0 +1,8 @@ +// @noImplicitAny: true + +let x: (a: string) => string; + +x = (100, a => { + const b: number = a; + return b; +}); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts new file mode 100644 index 00000000000..321eb99d153 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts @@ -0,0 +1,5 @@ +// @noImplicitAny: true + +let x: (a: string) => string; + +x = (a => a, b => b); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx new file mode 100644 index 00000000000..ce6f4b7ac2f --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx @@ -0,0 +1,16 @@ +// @jsx: preserve +// @declaration: true + +namespace JSX { + interface IntrinsicElements { + span: {}; + } +} + +const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo}; + +; +; + +; +; \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts new file mode 100644 index 00000000000..30e46429fa1 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts @@ -0,0 +1,6 @@ +// @noImplicitAny: true + +let x: (a: string) => string; +let y = true; + +x = y && (a => a); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts new file mode 100644 index 00000000000..26e58ae49ec --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts @@ -0,0 +1,9 @@ +// @noImplicitAny: true + +let x: (a: string) => string; +let y = true; + +x = y && (a => { + const b: number = a; + return b; +}); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts new file mode 100644 index 00000000000..1fba96c048a --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts @@ -0,0 +1,6 @@ +// @noImplicitAny: true + +let x: (a: string) => string; +let y = true; + +x = (a => a) && (b => b); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts new file mode 100644 index 00000000000..c87268684b5 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts @@ -0,0 +1,94 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////let i: number; +////for ([, nameA] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([numberB] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..80e4a811fed --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,109 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////let i: number; +////for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +//// ] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts new file mode 100644 index 00000000000..298fb2f9580 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts @@ -0,0 +1,107 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({ name: nameA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skill } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skills: { primary, secondary } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..161b58c91c2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,168 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..5c30799813b --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts @@ -0,0 +1,95 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////for ([, nameA] of robots) { +//// console.log(nameA); +////} +////for ([, nameA] of getRobots()) { +//// console.log(nameA); +////} +////for ([, nameA] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for ([numberB] of robots) { +//// console.log(numberB); +////} +////for ([numberB] of getRobots()) { +//// console.log(numberB); +////} +////for ([numberB] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for ([nameB] of multiRobots) { +//// console.log(nameB); +////} +////for ([nameB] of getMultiRobots()) { +//// console.log(nameB); +////} +////for ([nameB] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for ([numberA2, nameA2, skillA2] of robots) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] of getRobots()) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for ([numberA3, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +////for ([...multiRobotAInfo] of multiRobots) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] of getMultiRobots()) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +//// console.log(multiRobotAInfo); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..8942987c468 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,104 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////for ([, nameA = "noName"] of robots) { +//// console.log(nameA); +////} +////for ([, nameA = "noName"] of getRobots()) { +//// console.log(nameA); +////} +////for ([, nameA = "noName"] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for ([numberB = -1] of robots) { +//// console.log(numberB); +////} +////for ([numberB = -1] of getRobots()) { +//// console.log(numberB); +////} +////for ([numberB = -1] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for ([nameB = "noName"] of multiRobots) { +//// console.log(nameB); +////} +////for ([nameB = "noName"] of getMultiRobots()) { +//// console.log(nameB); +////} +////for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for ([numberA3 = -1, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..38a4832f14d --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts @@ -0,0 +1,104 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name } of robots) { +//// console.log(nameA); +////} +////for ({name } of getRobots()) { +//// console.log(nameA); +////} +////for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary, secondary } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name: nameA, skill: skillA } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA, skill: skillA } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +////for ({name, skill } of robots) { +//// console.log(nameA); +////} +////for ({name, skill } of getRobots()) { +//// console.log(nameA); +////} +////for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of multiRobots) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..2ec090d716d --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,159 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA = "noName" } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of +//// [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({ name = "noName" } of robots) { +//// console.log(nameA); +////} +////for ({ name = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..5fe69b42f1a --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts @@ -0,0 +1,55 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +//// +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let nameA: string, numberB: number, nameB: string, skillB: string; +////let robotAInfo: (number | string)[]; +//// +////let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +////let multiRobotAInfo: (string | [string, string])[]; +//// +////[, nameA] = robotA; +////[, nameB] = getRobotB(); +////[, nameB] = [2, "trimmer", "trimming"]; +////[, multiSkillB] = multiRobotB; +////[, multiSkillB] = getMultiRobotB(); +////[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +//// +////[numberB] = robotB; +////[numberB] = getRobotB(); +////[numberB] = [2, "trimmer", "trimming"]; +////[nameMB] = multiRobotB; +////[nameMB] = getMultiRobotB(); +////[nameMB] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB, nameB, skillB] = robotB; +////[numberB, nameB, skillB] = getRobotB(); +////[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +////[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +////[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +////[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB, ...robotAInfo] = robotB; +////[numberB, ...robotAInfo] = getRobotB(); +////[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +////[...multiRobotAInfo] = multiRobotA; +////[...multiRobotAInfo] = getMultiRobotB(); +////[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +//// +////function getRobotB() { +//// return robotB; +////} +//// +////function getMultiRobotB() { +//// return multiRobotB; +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..354ec145aa4 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,53 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, string[]]; +//// +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let nameA: string, numberB: number, nameB: string, skillB: string; +////let robotAInfo: (number | string)[]; +//// +////let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +////let multiRobotAInfo: (string | string[])[]; +//// +////[, nameA = "helloNoName"] = robotA; +////[, nameB = "helloNoName"] = getRobotB(); +////[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +////[, multiSkillB = []] = multiRobotB; +////[, multiSkillB = []] = getMultiRobotB(); +////[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +//// +////[numberB = -1] = robotB; +////[numberB = -1] = getRobotB(); +////[numberB = -1] = [2, "trimmer", "trimming"]; +////[nameMB = "helloNoName"] = multiRobotB; +////[nameMB = "helloNoName"] = getMultiRobotB(); +////[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +//// ["trimmer", ["trimming", "edging"]]; +//// +////[numberB = -1, ...robotAInfo] = robotB; +////[numberB = -1, ...robotAInfo] = getRobotB(); +////[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +//// +////function getRobotB() { +//// return robotB; +////} +//// +////function getMultiRobotB() { +//// return multiRobotB; +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts new file mode 100644 index 00000000000..c86ac7b0f30 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts @@ -0,0 +1,95 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +//// +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +//// +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +//// +////for (let [, nameA] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +//// +////for (let [numberB] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +//// +////for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +//// +////for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..2ea402297b8 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,104 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, string[]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let +//// [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +//// ] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts new file mode 100644 index 00000000000..fedbe748034 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts @@ -0,0 +1,64 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////for (let {name: nameA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..9ee1e75b0bf --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,96 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..90a726c9066 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts @@ -0,0 +1,91 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let [, nameA] of robots) { +//// console.log(nameA); +////} +////for (let [, nameA] of getRobots()) { +//// console.log(nameA); +////} +////for (let [, nameA] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for (let [numberB] of robots) { +//// console.log(numberB); +////} +////for (let [numberB] of getRobots()) { +//// console.log(numberB); +////} +////for (let [numberB] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for (let [nameB] of multiRobots) { +//// console.log(nameB); +////} +////for (let [nameB] of getMultiRobots()) { +//// console.log(nameB); +////} +////for (let [nameB] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for (let [numberA2, nameA2, skillA2] of robots) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] of getRobots()) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for (let [numberA3, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +////for (let [...multiRobotAInfo] of multiRobots) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] of getMultiRobots()) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +//// console.log(multiRobotAInfo); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..12689236080 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,100 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let [, nameA = "noName"] of robots) { +//// console.log(nameA); +////} +////for (let [, nameA = "noName"] of getRobots()) { +//// console.log(nameA); +////} +////for (let [, nameA = "noName"] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for (let [numberB = -1] of robots) { +//// console.log(numberB); +////} +////for (let [numberB = -1] of getRobots()) { +//// console.log(numberB); +////} +////for (let [numberB = -1] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for (let [nameB = "noName"] of multiRobots) { +//// console.log(nameB); +////} +////for (let [nameB = "noName"] of getMultiRobots()) { +//// console.log(nameB); +////} +////for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for (let [numberA3 = -1, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..8fc1b29bbc0 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts @@ -0,0 +1,63 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let {name: nameA } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skill: skillA } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..ded0584ec43 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,85 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let {name: nameA = "noName" } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of +//// [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts new file mode 100644 index 00000000000..c3f91122010 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts @@ -0,0 +1,29 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////function foo1([, nameA]: Robot) { +//// console.log(nameA); +////} +////function foo2([numberB]: Robot) { +//// console.log(numberB); +////} +////function foo3([numberA2, nameA2, skillA2]: Robot) { +//// console.log(nameA2); +////} +////function foo4([numberA3, ...robotAInfo]: Robot) { +//// console.log(robotAInfo); +////} +////foo1(robotA); +////foo1([2, "trimmer", "trimming"]); +////foo2(robotA); +////foo2([2, "trimmer", "trimming"]); +////foo3(robotA); +////foo3([2, "trimmer", "trimming"]); +////foo4(robotA); +////foo4([2, "trimmer", "trimming"]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts new file mode 100644 index 00000000000..fbedbe4abb0 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts @@ -0,0 +1,29 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [string, [string, string]]; +////var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +////function foo1([, skillA]: Robot) { +//// console.log(skillA); +////} +////function foo2([nameMB]: Robot) { +//// console.log(nameMB); +////} +////function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +//// console.log(nameMA); +////} +////function foo4([...multiRobotAInfo]: Robot) { +//// console.log(multiRobotAInfo); +////} +////foo1(robotA); +////foo1(["roomba", ["vaccum", "mopping"]]); +////foo2(robotA); +////foo2(["roomba", ["vaccum", "mopping"]]); +////foo3(robotA); +////foo3(["roomba", ["vaccum", "mopping"]]); +////foo4(robotA); +////foo4(["roomba", ["vaccum", "mopping"]]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..275135ca520 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts @@ -0,0 +1,28 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +//// console.log(nameA); +////} +////function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +//// console.log(numberB); +////} +////function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +//// console.log(nameA2); +////} +////function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +//// console.log(robotAInfo); +////} +////foo1(robotA); +////foo1([2, "trimmer", "trimming"]); +////foo2(robotA); +////foo2([2, "trimmer", "trimming"]); +////foo3(robotA); +////foo3([2, "trimmer", "trimming"]); +////foo4(robotA); +////foo4([2, "trimmer", "trimming"]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..17d964618d1 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,25 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [string, string[]]; +////var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +////function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +//// console.log(skillA); +////} +////function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +//// console.log(nameMB); +////} +////function foo3([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["noSkill", "noSkill"]]: Robot) { +//// console.log(nameMA); +////} +////foo1(robotA); +////foo1(["roomba", ["vaccum", "mopping"]]); +////foo2(robotA); +////foo2(["roomba", ["vaccum", "mopping"]]); +////foo3(robotA); +////foo3(["roomba", ["vaccum", "mopping"]]); +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..34b23d9fca2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts @@ -0,0 +1,28 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +//// console.log(primaryA); +////} +////function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +//// console.log(secondaryB); +////} +////function foo3({ skills }: Robot) { +//// console.log(skills.primary); +////} +////foo1(robotA); +////foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo2(robotA); +////foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo3(robotA); +////foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..8eab866428b --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts @@ -0,0 +1,41 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function foo1( +//// { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "SomeSkill", secondary: "someSkill" } +//// }: Robot = robotA) { +//// console.log(primaryA); +////} +////function foo2( +//// { +//// name: nameC = "name", +//// skills: { +//// primary: primaryB = "primary", +//// secondary: secondaryB = "secondary" +//// } = { primary: "SomeSkill", secondary: "someSkill" } +//// }: Robot = robotA) { +//// console.log(secondaryB); +////} +////function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +//// console.log(skills.primary); +////} +////foo1(robotA); +////foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo2(robotA); +////foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo3(robotA); +////foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts new file mode 100644 index 00000000000..1e3d7c905d4 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts @@ -0,0 +1,26 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////function foo1({ name: nameA }: Robot) { +//// console.log(nameA); +////} +////function foo2({ name: nameB, skill: skillB }: Robot) { +//// console.log(nameB); +////} +////function foo3({ name }: Robot) { +//// console.log(name); +////} +////foo1(robotA); +////foo1({ name: "Edger", skill: "cutting edges" }); +////foo2(robotA); +////foo2({ name: "Edger", skill: "cutting edges" }); +////foo3(robotA); +////foo3({ name: "Edger", skill: "cutting edges" }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..bd87e346f6f --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts @@ -0,0 +1,26 @@ +/// +////interface Robot { +//// name?: string; +//// skill?: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////function foo1({ name: nameA = "" }: Robot = { }) { +//// console.log(nameA); +////} +////function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +//// console.log(nameB); +////} +////function foo3({ name = "" }: Robot = {}) { +//// console.log(name); +////} +////foo1(robotA); +////foo1({ name: "Edger", skill: "cutting edges" }); +////foo2(robotA); +////foo2({ name: "Edger", skill: "cutting edges" }); +////foo3(robotA); +////foo3({ name: "Edger", skill: "cutting edges" }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts new file mode 100644 index 00000000000..311b49c3f95 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts @@ -0,0 +1,22 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var { name: nameA } = robotA; +////var { name: nameB, skill: skillB } = robotB; +////var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts new file mode 100644 index 00000000000..96dbd9d2ff6 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts @@ -0,0 +1,30 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var a: string, { name: nameA } = robotA; +////var b: string, { name: nameB, skill: skillB } = robotB; +////var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +//// +////var { name: nameA } = robotA, a = hello; +////var { name: nameB, skill: skillB } = robotB, b = " hello"; +////var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +//// +////var a = hello, { name: nameA } = robotA, a1= "hello"; +////var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +////var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..eb4e3e17027 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts @@ -0,0 +1,15 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////let [, nameA] = robotA; +////let [numberB] = robotB; +////let [numberA2, nameA2, skillA2] = robotA; +////let [numberC2] = [3, "edging", "Trimming edges"]; +////let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +////let [numberA3, ...robotAInfo] = robotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts new file mode 100644 index 00000000000..265dae90ab9 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts @@ -0,0 +1,19 @@ +/// + +////declare var console: { +//// log(msg: string): void; +////} +////type MultiSkilledRobot = [string, [string, string]]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let [, skillA] = multiRobotA; +////let [nameMB] = multiRobotB; +////let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +//// +////let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +////let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +//// +////let [...multiRobotAInfo] = multiRobotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..78b0646661e --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,15 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////let [, nameA = "noName"] = robotA; +////let [numberB = -1] = robotB; +////let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +////let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +////let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +////let [numberA3 = -1, ...robotAInfo] = robotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..ac25165696c --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,14 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type MultiSkilledRobot = [string, string[]]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +////let [nameMB = "noName" ] = multiRobotB; +////let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +////let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +////let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts new file mode 100644 index 00000000000..0e28887a4c3 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts @@ -0,0 +1,22 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var { name: nameA = "" } = robotA; +////var { name: nameB = "", skill: skillB = "" } = robotB; +////var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..4656fd5c417 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts @@ -0,0 +1,26 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +//// +////var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +////var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +////var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +//// +////if (nameB == nameB) { +//// console.log(nameC); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts new file mode 100644 index 00000000000..282e91a57ce --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts @@ -0,0 +1,43 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +//// +////var { +//// skills: { +//// primary: primaryA = "noSkill", +//// secondary: secondaryA = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = robotA; +////var { +//// name: nameB = "noNameSpecified", +//// skills: { +//// primary: primaryB = "noSkill", +//// secondary: secondaryB = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = robotB; +////var { +//// name: nameC = "noNameSpecified", +//// skills: { +//// primary: primaryB = "noSkill", +//// secondary: secondaryB = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +//// +////if (nameB == nameB) { +//// console.log(nameC); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/forIn.ts b/tests/cases/fourslash/forIn.ts index e24e161d96b..855d35917c1 100644 --- a/tests/cases/fourslash/forIn.ts +++ b/tests/cases/fourslash/forIn.ts @@ -5,4 +5,4 @@ goTo.marker(); -verify.quickInfoIs('var p: any', ""); +verify.quickInfoIs('var p: string', ""); diff --git a/tests/cases/fourslash/formatDocumentWithTrivia.ts b/tests/cases/fourslash/formatDocumentWithTrivia.ts new file mode 100644 index 00000000000..d51677be81d --- /dev/null +++ b/tests/cases/fourslash/formatDocumentWithTrivia.ts @@ -0,0 +1,51 @@ +/// + +//// +////// whitespace below +//// +////// whitespace above +//// +////let x; +//// +////// abc +//// +////let y; +//// +////// whitespace above again +//// +////while (true) { +//// while (true) { +//// } +//// +//// // whitespace above +////} +//// +////// whitespace above again +//// +//// + +format.document(); + +verify.currentFileContentIs(` +// whitespace below + +// whitespace above + +let x; + +// abc + +let y; + +// whitespace above again + +while (true) { + while (true) { + } + + // whitespace above +} + +// whitespace above again + +`); diff --git a/tests/cases/fourslash/formatSelectionWithTrivia2.ts b/tests/cases/fourslash/formatSelectionWithTrivia2.ts new file mode 100644 index 00000000000..06b43009a22 --- /dev/null +++ b/tests/cases/fourslash/formatSelectionWithTrivia2.ts @@ -0,0 +1,10 @@ +/// + +/////*begin*/; +//// +/////*end*/ +//// + +format.selection('begin', 'end'); + +verify.currentFileContentIs(";\n\n\n "); diff --git a/tests/cases/fourslash/formatTemplateLiteral.ts b/tests/cases/fourslash/formatTemplateLiteral.ts index 68f2c8c9469..a10f8dba8f2 100644 --- a/tests/cases/fourslash/formatTemplateLiteral.ts +++ b/tests/cases/fourslash/formatTemplateLiteral.ts @@ -32,9 +32,9 @@ verify.currentLineContentIs("let w = `bar${3}`;"); goTo.marker("5"); verify.currentLineContentIs(" `template`;"); goTo.marker("6"); -verify.currentLineContentIs("String.raw `foo`;"); +verify.currentLineContentIs("String.raw`foo`;"); goTo.marker("7"); -verify.currentLineContentIs("String.raw `bar${3}`;"); +verify.currentLineContentIs("String.raw`bar${3}`;"); goTo.marker("spaceInside"); verify.currentLineContentIs('`Write ${JSON.stringify("")} and ${(765)} and ${346}`;'); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingInExpressionsInTsx.ts b/tests/cases/fourslash/formattingInExpressionsInTsx.ts new file mode 100644 index 00000000000..f02a5a5b291 --- /dev/null +++ b/tests/cases/fourslash/formattingInExpressionsInTsx.ts @@ -0,0 +1,14 @@ +/// + +// @Filename: test.tsx +////import * as React from "react"; +////
+////
+ +goTo.marker("1"); +edit.insert(";"); +verify.currentLineContentIs(" return true;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingJsxElements.ts b/tests/cases/fourslash/formattingJsxElements.ts index fd4ccc504a4..fbe4bb5d29e 100644 --- a/tests/cases/fourslash/formattingJsxElements.ts +++ b/tests/cases/fourslash/formattingJsxElements.ts @@ -9,7 +9,7 @@ ////
//// ) ////} -//// +//// ////function foo1() { //// return ( ////
@@ -45,8 +45,26 @@ //// class3= {/*5*/ //// }/>/*6*/ //// ) +////} +//// +////(function () { +//// return
/*danglingBracketAutoformat*/ +////
/*closingTagAutoformat*/ +////}) +//// +////let h5 =
+/////*childJsxElementAutoformat*/ +/////*childJsxElementIndent*/ +/////*grandchildJsxElementAutoformat*/ +/////*containedClosingTagAutoformat*/ +////
format.document(); goTo.marker("autoformat"); @@ -83,3 +101,28 @@ goTo.marker("5"); verify.currentLineContentIs(' class3= {'); goTo.marker("6"); verify.currentLineContentIs(' }/>'); + + +goTo.marker("attrAutoformat"); +verify.currentLineContentIs(' className=""'); +goTo.marker("attrIndent"); +verify.indentationIs(8); +goTo.marker("expressionAutoformat"); +verify.currentLineContentIs(' "abc" + "cde"'); +goTo.marker("expressionIndent"); +verify.indentationIs(12); + +goTo.marker("danglingBracketAutoformat") +// TODO: verify.currentLineContentIs(" >"); +verify.currentLineContentIs(" >"); +goTo.marker("closingTagAutoformat"); +verify.currentLineContentIs("
"); + +goTo.marker("childJsxElementAutoformat"); +verify.currentLineContentIs(" "); +goTo.marker("childJsxElementIndent"); +verify.indentationIs(8); +goTo.marker("grandchildJsxElementAutoformat"); +verify.currentLineContentIs(" "); +goTo.marker("containedClosingTagAutoformat"); +verify.currentLineContentIs(" "); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOptionsChange.ts b/tests/cases/fourslash/formattingOptionsChange.ts index cdd8f61a215..f266a8e96c1 100644 --- a/tests/cases/fourslash/formattingOptionsChange.ts +++ b/tests/cases/fourslash/formattingOptionsChange.ts @@ -1,24 +1,26 @@ /// -/////*InsertSpaceAfterCommaDelimiter*/[1,2, 3]; +/////*InsertSpaceAfterCommaDelimiter*/[1,2, 3];[ 72 , ]; /////*InsertSpaceAfterSemicolonInForStatements*/for (i = 0;i; i++); /////*InsertSpaceBeforeAndAfterBinaryOperators*/1+2- 3 /////*InsertSpaceAfterKeywordsInControlFlowStatements*/if (true) { } /////*InsertSpaceAfterFunctionKeywordForAnonymousFunctions*/(function () { }) /////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis*/(1 ) -/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,] +/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,]; +/////*InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces*/`${1}`;`${ 1 }` /////*PlaceOpenBraceOnNewLineForFunctions*/class foo { ////} /////*PlaceOpenBraceOnNewLineForControlBlocks*/if (true) { ////} -runTest("InsertSpaceAfterCommaDelimiter", "[1, 2, 3];", "[1,2,3];"); +runTest("InsertSpaceAfterCommaDelimiter", "[1, 2, 3];[72,];", "[1,2,3];[72,];"); runTest("InsertSpaceAfterSemicolonInForStatements", "for (i = 0; i; i++);", "for (i = 0;i;i++);"); runTest("InsertSpaceBeforeAndAfterBinaryOperators", "1 + 2 - 3", "1+2-3"); runTest("InsertSpaceAfterKeywordsInControlFlowStatements", "if (true) { }", "if(true) { }"); runTest("InsertSpaceAfterFunctionKeywordForAnonymousFunctions", "(function () { })", "(function() { })"); runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis", " ( 1 )", " (1)"); -runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ]", "[1];[];[];[, ]"); +runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ];", "[1];[];[];[,];"); +runTest("InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces", "`${ 1 }`; `${ 1 }`", "`${1}`; `${1}`"); runTest("PlaceOpenBraceOnNewLineForFunctions", "class foo", "class foo {"); runTest("PlaceOpenBraceOnNewLineForControlBlocks", "if ( true )", "if ( true ) {"); diff --git a/tests/cases/fourslash/formattingTemplates.ts b/tests/cases/fourslash/formattingTemplates.ts index c7decd10316..c759376335d 100644 --- a/tests/cases/fourslash/formattingTemplates.ts +++ b/tests/cases/fourslash/formattingTemplates.ts @@ -5,8 +5,8 @@ goTo.marker("1"); edit.insert(";"); -verify.currentLineContentIs("String.call `${123}`;"); +verify.currentLineContentIs("String.call`${123}`;"); goTo.marker("2"); edit.insert(";"); -verify.currentLineContentIs("String.call `${123} ${456}`;"); \ No newline at end of file +verify.currentLineContentIs("String.call`${123} ${456}`;"); \ No newline at end of file diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index dd443e942cf..b69a757f01e 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -81,6 +81,7 @@ declare namespace FourSlashInterface { InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; [s: string]: boolean | number | string; @@ -337,6 +338,36 @@ declare namespace FourSlashInterface { text: string; textSpan?: TextSpan; }; + function jsxOpenTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxCloseTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxSelfClosingTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxAttribute(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxText(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxAttributeStringLiteralValue(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; } } declare function verifyOperationIsCancelled(f: any): void; diff --git a/tests/cases/fourslash/syntacticClassificationsJsx1.ts b/tests/cases/fourslash/syntacticClassificationsJsx1.ts new file mode 100644 index 00000000000..e9de07c759b --- /dev/null +++ b/tests/cases/fourslash/syntacticClassificationsJsx1.ts @@ -0,0 +1,27 @@ +/// + +// @Filename: file1.tsx +////let x =
+//// some jsx text +////
; +//// +////let y = + +const c = classification; +verify.syntacticClassificationsAre( + c.keyword("let"), c.identifier("x"), c.operator("="), + c.punctuation("<"), + c.jsxOpenTagName("div"), + c.jsxAttribute("a"), c.operator("="), c.jsxAttributeStringLiteralValue(`"some-value"`), + c.jsxAttribute("b"), c.operator("="), c.punctuation("{"), c.numericLiteral("1"), c.punctuation("}"), + c.punctuation(">"), + c.jsxText(` + some jsx text +`), + c.punctuation("<"), c.punctuation("/"), c.jsxCloseTagName("div"), c.punctuation(">"), c.punctuation(";"), + c.keyword("let"), c.identifier("y"), c.operator("="), + c.punctuation("<"), + c.jsxSelfClosingTagName("element"), + c.jsxAttribute("attr"), c.operator("="), c.jsxAttributeStringLiteralValue(`"123"`), + c.punctuation("/"), c.punctuation(">") +) \ No newline at end of file diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts new file mode 100644 index 00000000000..54a0b61879f --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts @@ -0,0 +1,14 @@ +/// + +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: { ONE: string; TWO: number; } +//// } +//// } +//// var x1 =
+ +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: { ONE: string; TWO: number; } +//// } +//// } +//// var x1 =
+////

Hello world +//// + +goTo.marker("1"); +verify.memberListCount(1); +verify.completionListContains('div'); + +goTo.marker("2"); +verify.memberListCount(1); +verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts new file mode 100644 index 00000000000..742009b487e --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts @@ -0,0 +1,8 @@ +/// + +//@Filename: file.tsx +//// var x1 =
+ +//@Filename: file.tsx +//// var x1 =
+////

Hello world +//// + +goTo.marker("1"); +verify.memberListCount(1); +verify.completionListContains('div'); + +goTo.marker("2"); +verify.memberListCount(1); +verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts new file mode 100644 index 00000000000..1b745f6e418 --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts @@ -0,0 +1,7 @@ +/// + +//@Filename: file.tsx +//// var x = + +//@Filename: file.tsx +//// var x1 = +//// class MyElement {} +//// var z = + +goTo.marker("1"); +verify.quickInfoIs("any", undefined); + +goTo.marker("2"); +verify.quickInfoIs("any", undefined);; + +goTo.marker("3"); +verify.quickInfoIs("class MyElement", undefined);; + +goTo.marker("4"); +verify.quickInfoIs("class MyElement", undefined);; \ No newline at end of file diff --git a/tests/cases/fourslash/tsxQuickInfo2.ts b/tests/cases/fourslash/tsxQuickInfo2.ts new file mode 100644 index 00000000000..0eb7a5100c4 --- /dev/null +++ b/tests/cases/fourslash/tsxQuickInfo2.ts @@ -0,0 +1,24 @@ +/// + +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: any +//// } +//// } +//// var x1 = +//// class MyElement {} +//// var z = + +goTo.marker("1"); +verify.quickInfoIs("(property) JSX.IntrinsicElements.div: any", undefined); + +goTo.marker("2"); +verify.quickInfoIs("(property) JSX.IntrinsicElements.div: any", undefined);; + +goTo.marker("3"); +verify.quickInfoIs("class MyElement", undefined);; + +goTo.marker("4"); +verify.quickInfoIs("class MyElement", undefined);; \ No newline at end of file diff --git a/tests/cases/unittests/moduleResolution.ts b/tests/cases/unittests/moduleResolution.ts index 5b924650401..81d7c5f8b2e 100644 --- a/tests/cases/unittests/moduleResolution.ts +++ b/tests/cases/unittests/moduleResolution.ts @@ -26,15 +26,36 @@ module ts { content?: string } - function createModuleResolutionHost(...files: File[]): ModuleResolutionHost { + function createModuleResolutionHost(hasDirectoryExists: boolean, ...files: File[]): ModuleResolutionHost { let map = arrayToMap(files, f => f.name); - return { fileExists, readFile }; - - function fileExists(path: string): boolean { - return hasProperty(map, path); + if (hasDirectoryExists) { + const directories: Map = {}; + for (const f of files) { + let name = getDirectoryPath(f.name); + while (true) { + directories[name] = name; + let baseName = getDirectoryPath(name); + if (baseName === name) { + break; + } + name = baseName; + } + } + return { + readFile, + directoryExists: path => { + return hasProperty(directories, path); + }, + fileExists: path => { + assert.isTrue(hasProperty(directories, getDirectoryPath(path)), "'fileExists' request in non-existing directory"); + return hasProperty(map, path); + } + } + } + else { + return { readFile, fileExists: path => hasProperty(map, path), }; } - function readFile(path: string): string { return hasProperty(map, path) ? map[path].content : undefined; } @@ -51,9 +72,14 @@ module ts { function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void { for (let ext of supportedTypeScriptExtensions) { + test(ext, /*hasDirectoryExists*/ false); + test(ext, /*hasDirectoryExists*/ true); + } + + function test(ext: string, hasDirectoryExists: boolean) { let containingFile = { name: containingFileName } let moduleFile = { name: moduleFileNameNoExt + ext } - let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); + let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile)); assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); @@ -69,6 +95,7 @@ module ts { } assert.deepEqual(resolution.failedLookupLocations, failedLookupLocations); + } } @@ -89,14 +116,19 @@ module ts { }); function testLoadingFromPackageJson(containingFileName: string, packageJsonFileName: string, fieldRef: string, moduleFileName: string, moduleName: string): void { - let containingFile = { name: containingFileName }; - let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) }; - let moduleFile = { name: moduleFileName }; - let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile)); - assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); - assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); - // expect three failed lookup location - attempt to load module as file with all supported extensions - assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length); + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); + + function test(hasDirectoryExists: boolean) { + let containingFile = { name: containingFileName }; + let packageJson = { name: packageJsonFileName, content: JSON.stringify({ "typings": fieldRef }) }; + let moduleFile = { name: moduleFileName }; + let resolution = nodeModuleNameResolver(moduleName, containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile)); + assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); + assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); + // expect three failed lookup location - attempt to load module as file with all supported extensions + assert.equal(resolution.failedLookupLocations.length, supportedTypeScriptExtensions.length); + } } it("module name as directory - load from 'typings'", () => { @@ -107,16 +139,21 @@ module ts { }); function testTypingsIgnored(typings: any): void { - let containingFile = { name: "/a/b.ts" }; - let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) }; - let moduleFile = { name: "/a/b.d.ts" }; + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); - let indexPath = "/node_modules/b/index.d.ts"; - let indexFile = { name: indexPath } + function test(hasDirectoryExists: boolean) { + let containingFile = { name: "/a/b.ts" }; + let packageJson = { name: "/node_modules/b/package.json", content: JSON.stringify({ "typings": typings }) }; + let moduleFile = { name: "/a/b.d.ts" }; - let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, moduleFile, indexFile)); + let indexPath = "/node_modules/b/index.d.ts"; + let indexFile = { name: indexPath } - assert.equal(resolution.resolvedModule.resolvedFileName, indexPath); + let resolution = nodeModuleNameResolver("b", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, moduleFile, indexFile)); + + assert.equal(resolution.resolvedModule.resolvedFileName, indexPath); + } } it("module name as directory - handle invalid 'typings'", () => { @@ -128,89 +165,110 @@ module ts { }); it("module name as directory - load index.d.ts", () => { - let containingFile = { name: "/a/b/c.ts" }; - let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) }; - let indexFile = { name: "/a/b/foo/index.d.ts" }; - let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(containingFile, packageJson, indexFile)); - assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name); - assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); - assert.deepEqual(resolution.failedLookupLocations, [ - "/a/b/foo.ts", - "/a/b/foo.tsx", - "/a/b/foo.d.ts", - "/a/b/foo/index.ts", - "/a/b/foo/index.tsx", - ]); + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); + + function test(hasDirectoryExists: boolean) { + let containingFile = { name: "/a/b/c.ts" }; + let packageJson = { name: "/a/b/foo/package.json", content: JSON.stringify({ main: "/c/d" }) }; + let indexFile = { name: "/a/b/foo/index.d.ts" }; + let resolution = nodeModuleNameResolver("./foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, packageJson, indexFile)); + assert.equal(resolution.resolvedModule.resolvedFileName, indexFile.name); + assert.equal(!!resolution.resolvedModule.isExternalLibraryImport, false); + assert.deepEqual(resolution.failedLookupLocations, [ + "/a/b/foo.ts", + "/a/b/foo.tsx", + "/a/b/foo.d.ts", + "/a/b/foo/index.ts", + "/a/b/foo/index.tsx", + ]); + } }); }); describe("Node module resolution - non-relative paths", () => { it("load module as file - ts files not loaded", () => { - let containingFile = { name: "/a/b/c/d/e.ts" }; - let moduleFile = { name: "/a/b/node_modules/foo.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); - assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); - assert.deepEqual(resolution.failedLookupLocations, [ - "/a/b/c/d/node_modules/foo.ts", - "/a/b/c/d/node_modules/foo.tsx", - "/a/b/c/d/node_modules/foo.d.ts", - "/a/b/c/d/node_modules/foo/package.json", - "/a/b/c/d/node_modules/foo/index.ts", - "/a/b/c/d/node_modules/foo/index.tsx", - "/a/b/c/d/node_modules/foo/index.d.ts", - "/a/b/c/node_modules/foo.ts", - "/a/b/c/node_modules/foo.tsx", - "/a/b/c/node_modules/foo.d.ts", - "/a/b/c/node_modules/foo/package.json", - "/a/b/c/node_modules/foo/index.ts", - "/a/b/c/node_modules/foo/index.tsx", - "/a/b/c/node_modules/foo/index.d.ts", - ]) + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); + + function test(hasDirectoryExists: boolean) { + let containingFile = { name: "/a/b/c/d/e.ts" }; + let moduleFile = { name: "/a/b/node_modules/foo.ts" }; + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile)); + assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); + assert.deepEqual(resolution.failedLookupLocations, [ + "/a/b/c/d/node_modules/foo.ts", + "/a/b/c/d/node_modules/foo.tsx", + "/a/b/c/d/node_modules/foo.d.ts", + "/a/b/c/d/node_modules/foo/package.json", + "/a/b/c/d/node_modules/foo/index.ts", + "/a/b/c/d/node_modules/foo/index.tsx", + "/a/b/c/d/node_modules/foo/index.d.ts", + "/a/b/c/node_modules/foo.ts", + "/a/b/c/node_modules/foo.tsx", + "/a/b/c/node_modules/foo.d.ts", + "/a/b/c/node_modules/foo/package.json", + "/a/b/c/node_modules/foo/index.ts", + "/a/b/c/node_modules/foo/index.tsx", + "/a/b/c/node_modules/foo/index.d.ts", + ]) + } }); it("load module as file", () => { - let containingFile = { name: "/a/b/c/d/e.ts" }; - let moduleFile = { name: "/a/b/node_modules/foo.d.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); - assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); - assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); + + function test(hasDirectoryExists: boolean) { + let containingFile = { name: "/a/b/c/d/e.ts" }; + let moduleFile = { name: "/a/b/node_modules/foo.d.ts" }; + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile)); + assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); + assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); + } }); it("load module as directory", () => { - let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" }; - let moduleFile = { name: "/a/node_modules/foo/index.d.ts" }; - let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(containingFile, moduleFile)); - assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); - assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); - assert.deepEqual(resolution.failedLookupLocations, [ - "/a/node_modules/b/c/node_modules/d/node_modules/foo.ts", - "/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx", - "/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts", - "/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json", - "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts", - "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx", - "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts", - "/a/node_modules/b/c/node_modules/foo.ts", - "/a/node_modules/b/c/node_modules/foo.tsx", - "/a/node_modules/b/c/node_modules/foo.d.ts", - "/a/node_modules/b/c/node_modules/foo/package.json", - "/a/node_modules/b/c/node_modules/foo/index.ts", - "/a/node_modules/b/c/node_modules/foo/index.tsx", - "/a/node_modules/b/c/node_modules/foo/index.d.ts", - "/a/node_modules/b/node_modules/foo.ts", - "/a/node_modules/b/node_modules/foo.tsx", - "/a/node_modules/b/node_modules/foo.d.ts", - "/a/node_modules/b/node_modules/foo/package.json", - "/a/node_modules/b/node_modules/foo/index.ts", - "/a/node_modules/b/node_modules/foo/index.tsx", - "/a/node_modules/b/node_modules/foo/index.d.ts", - "/a/node_modules/foo.ts", - "/a/node_modules/foo.tsx", - "/a/node_modules/foo.d.ts", - "/a/node_modules/foo/package.json", - "/a/node_modules/foo/index.ts", - "/a/node_modules/foo/index.tsx" - ]); + test(/*hasDirectoryExists*/ false); + test(/*hasDirectoryExists*/ true); + + function test(hasDirectoryExists: boolean) { + let containingFile = { name: "/a/node_modules/b/c/node_modules/d/e.ts" }; + let moduleFile = { name: "/a/node_modules/foo/index.d.ts" }; + let resolution = nodeModuleNameResolver("foo", containingFile.name, {}, createModuleResolutionHost(hasDirectoryExists, containingFile, moduleFile)); + assert.equal(resolution.resolvedModule.resolvedFileName, moduleFile.name); + assert.equal(resolution.resolvedModule.isExternalLibraryImport, true); + assert.deepEqual(resolution.failedLookupLocations, [ + "/a/node_modules/b/c/node_modules/d/node_modules/foo.ts", + "/a/node_modules/b/c/node_modules/d/node_modules/foo.tsx", + "/a/node_modules/b/c/node_modules/d/node_modules/foo.d.ts", + "/a/node_modules/b/c/node_modules/d/node_modules/foo/package.json", + "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.ts", + "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.tsx", + "/a/node_modules/b/c/node_modules/d/node_modules/foo/index.d.ts", + "/a/node_modules/b/c/node_modules/foo.ts", + "/a/node_modules/b/c/node_modules/foo.tsx", + "/a/node_modules/b/c/node_modules/foo.d.ts", + "/a/node_modules/b/c/node_modules/foo/package.json", + "/a/node_modules/b/c/node_modules/foo/index.ts", + "/a/node_modules/b/c/node_modules/foo/index.tsx", + "/a/node_modules/b/c/node_modules/foo/index.d.ts", + "/a/node_modules/b/node_modules/foo.ts", + "/a/node_modules/b/node_modules/foo.tsx", + "/a/node_modules/b/node_modules/foo.d.ts", + "/a/node_modules/b/node_modules/foo/package.json", + "/a/node_modules/b/node_modules/foo/index.ts", + "/a/node_modules/b/node_modules/foo/index.tsx", + "/a/node_modules/b/node_modules/foo/index.d.ts", + "/a/node_modules/foo.ts", + "/a/node_modules/foo.tsx", + "/a/node_modules/foo.d.ts", + "/a/node_modules/foo/package.json", + "/a/node_modules/foo/index.ts", + "/a/node_modules/foo/index.tsx" + ]); + + } }); }); @@ -400,4 +458,21 @@ import b = require("./moduleB.ts"); test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /* useCaseSensitiveFileNames */ false, ["moduleD.ts"], []); }) }); + + function notImplemented(name: string): () => any { + return () => assert(`${name} is not implemented and should not be called`); + } + + describe("ModuleResolutionHost.directoryExists", () => { + it("No 'fileExists' calls if containing directory is missing", () => { + const host: ModuleResolutionHost = { + readFile: notImplemented("readFile"), + fileExists: notImplemented("fileExists"), + directoryExists: _ => false + }; + + const result = resolveModuleName("someName", "/a/b/c/d", { moduleResolution: ModuleResolutionKind.NodeJs }, host); + assert(!result.resolvedModule); + }); + }); } \ No newline at end of file diff --git a/tslint.json b/tslint.json index 71efb21ad7b..2d2e42d4383 100644 --- a/tslint.json +++ b/tslint.json @@ -42,6 +42,7 @@ "boolean-trivia": true, "type-operator-spacing": true, "prefer-const": true, - "no-in-operator": true + "no-in-operator": true, + "no-increment-decrement": true } }

completion list at "1" will contain "div" with type any + const tagName = (location.parent.parent).openingElement.tagName; + entries.push({ + name: (tagName).text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } } getCompletionEntriesFromSymbols(symbols, entries); @@ -4438,7 +4466,7 @@ namespace ts { const typeChecker = program.getTypeChecker(); const symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { // Try getting just type at this position and show switch (node.kind) { case SyntaxKind.Identifier: @@ -6573,6 +6601,9 @@ namespace ts { case ClassificationType.jsxOpenTagName: return ClassificationTypeNames.jsxOpenTagName; case ClassificationType.jsxCloseTagName: return ClassificationTypeNames.jsxCloseTagName; case ClassificationType.jsxSelfClosingTagName: return ClassificationTypeNames.jsxSelfClosingTagName; + case ClassificationType.jsxAttribute: return ClassificationTypeNames.jsxAttribute; + case ClassificationType.jsxText: return ClassificationTypeNames.jsxText; + case ClassificationType.jsxAttributeStringLiteralValue: return ClassificationTypeNames.jsxAttributeStringLiteralValue; } } @@ -6781,12 +6812,12 @@ namespace ts { } } - function classifyToken(token: Node): void { + function classifyTokenOrJsxText(token: Node): void { if (nodeIsMissing(token)) { return; } - const tokenStart = classifyLeadingTriviaAndGetTokenStart(token); + const tokenStart = token.kind === SyntaxKind.JsxText ? token.pos : classifyLeadingTriviaAndGetTokenStart(token); const tokenWidth = token.end - tokenStart; Debug.assert(tokenWidth >= 0); @@ -6822,7 +6853,8 @@ namespace ts { // the '=' in a variable declaration is special cased here. if (token.parent.kind === SyntaxKind.VariableDeclaration || token.parent.kind === SyntaxKind.PropertyDeclaration || - token.parent.kind === SyntaxKind.Parameter) { + token.parent.kind === SyntaxKind.Parameter || + token.parent.kind === SyntaxKind.JsxAttribute) { return ClassificationType.operator; } } @@ -6841,7 +6873,7 @@ namespace ts { return ClassificationType.numericLiteral; } else if (tokenKind === SyntaxKind.StringLiteral || tokenKind === SyntaxKind.StringLiteralType) { - return ClassificationType.stringLiteral; + return token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral; } else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { // TODO: we should get another classification type for these literals. @@ -6851,6 +6883,9 @@ namespace ts { // TODO (drosen): we should *also* get another classification type for these literals. return ClassificationType.stringLiteral; } + else if (tokenKind === SyntaxKind.JsxText) { + return ClassificationType.jsxText; + } else if (tokenKind === SyntaxKind.Identifier) { if (token) { switch (token.parent.kind) { @@ -6902,9 +6937,12 @@ namespace ts { return ClassificationType.jsxSelfClosingTagName; } return; + case SyntaxKind.JsxAttribute: + if ((token.parent).name === token) { + return ClassificationType.jsxAttribute; + } } } - return ClassificationType.identifier; } } @@ -6921,8 +6959,8 @@ namespace ts { const children = element.getChildren(sourceFile); for (let i = 0, n = children.length; i < n; i++) { const child = children[i]; - if (isToken(child)) { - classifyToken(child); + if (isToken(child) || child.kind === SyntaxKind.JsxText) { + classifyTokenOrJsxText(child); } else { // Recurse into our child nodes. diff --git a/src/services/shims.ts b/src/services/shims.ts index 6b656ea2738..3dc28763b17 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -16,7 +16,11 @@ /// /* @internal */ -var debugObjectHost = (this); +let debugObjectHost = (this); + +// We need to use 'null' to interface with the managed side. +/* tslint:disable:no-null */ +/* tslint:disable:no-in-operator */ /* @internal */ namespace ts { @@ -60,8 +64,9 @@ namespace ts { getNewLine?(): string; getProjectVersion?(): string; useCaseSensitiveFileNames?(): boolean; - + getModuleResolutionsForFile?(fileName: string): string; + directoryExists(directoryName: string): boolean; } /** Public interface of the the of a config service shim instance.*/ @@ -233,8 +238,6 @@ namespace ts { } class ScriptSnapshotShimAdapter implements IScriptSnapshot { - private lineStartPositions: number[] = null; - constructor(private scriptSnapshotShim: ScriptSnapshotShim) { } @@ -247,14 +250,14 @@ namespace ts { } public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { - var oldSnapshotShim = oldSnapshot; - var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); + const oldSnapshotShim = oldSnapshot; + const encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); // TODO: should this be '==='? if (encoded == null) { return null; } - var decoded: { span: { start: number; length: number; }; newLength: number; } = JSON.parse(encoded); + const decoded: { span: { start: number; length: number; }; newLength: number; } = JSON.parse(encoded); return createTextChangeRange( createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength); } @@ -272,21 +275,25 @@ namespace ts { private files: string[]; private loggingEnabled = false; private tracingEnabled = false; - + public resolveModuleNames: (moduleName: string[], containingFile: string) => ResolvedModule[]; - + public directoryExists: (directoryName: string) => boolean; + constructor(private shimHost: LanguageServiceShimHost) { // if shimHost is a COM object then property check will become method call with no arguments. // 'in' does not have this effect. if ("getModuleResolutionsForFile" in this.shimHost) { this.resolveModuleNames = (moduleNames: string[], containingFile: string) => { - let resolutionsInFile = >JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile)); + const resolutionsInFile = >JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile)); return map(moduleNames, name => { const result = lookUp(resolutionsInFile, name); return result ? { resolvedFileName: result } : undefined; }); }; } + if ("directoryExists" in this.shimHost) { + this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName); + } } public log(s: string): void { @@ -319,7 +326,7 @@ namespace ts { } public getCompilationSettings(): CompilerOptions { - var settingsJson = this.shimHost.getCompilationSettings(); + const settingsJson = this.shimHost.getCompilationSettings(); // TODO: should this be '==='? if (settingsJson == null || settingsJson == "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); @@ -328,17 +335,12 @@ namespace ts { } public getScriptFileNames(): string[] { - var encoded = this.shimHost.getScriptFileNames(); + const encoded = this.shimHost.getScriptFileNames(); return this.files = JSON.parse(encoded); } public getScriptSnapshot(fileName: string): IScriptSnapshot { - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - if (this.files && this.files.indexOf(fileName) < 0) { - return undefined; - } - var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); + const scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); } @@ -347,7 +349,7 @@ namespace ts { } public getLocalizedDiagnosticMessages(): any { - var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); + const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { return null; } @@ -362,7 +364,7 @@ namespace ts { } public getCancellationToken(): HostCancellationToken { - var hostCancellationToken = this.shimHost.getCancellationToken(); + const hostCancellationToken = this.shimHost.getCancellationToken(); return new ThrottledCancellationToken(hostCancellationToken); } @@ -371,14 +373,7 @@ namespace ts { } public getDefaultLibFileName(options: CompilerOptions): string { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - try { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - catch (e) { - return ""; - } + return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); } } @@ -393,8 +388,8 @@ namespace ts { } public isCancellationRequested(): boolean { - var time = Date.now(); - var duration = Math.abs(time - this.lastCancellationCheckTime); + const time = Date.now(); + const duration = Math.abs(time - this.lastCancellationCheckTime); if (duration > 10) { // Check no more than once every 10 ms. this.lastCancellationCheckTime = time; @@ -405,52 +400,48 @@ namespace ts { } } - export class CoreServicesShimHostAdapter implements ParseConfigHost { + export class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost { + + public directoryExists: (directoryName: string) => boolean; constructor(private shimHost: CoreServicesShimHost) { + if ("directoryExists" in this.shimHost) { + this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName); + } } public readDirectory(rootDir: string, extension: string, exclude: string[]): string[] { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - // Also consider removing the optional designation for - // the exclude param at this time. - var encoded: string; - try { - encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); - } - catch (e) { - encoded = this.shimHost.readDirectory(rootDir, extension); - } + const encoded = this.shimHost.readDirectory(rootDir, extension, JSON.stringify(exclude)); return JSON.parse(encoded); } - + public fileExists(fileName: string): boolean { return this.shimHost.fileExists(fileName); } - + public readFile(fileName: string): string { return this.shimHost.readFile(fileName); } } function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any, logPerformance: boolean): any { + let start: number; if (logPerformance) { logger.log(actionDescription); - var start = Date.now(); + start = Date.now(); } - var result = action(); + const result = action(); if (logPerformance) { - var end = Date.now(); - logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { - var str = result; + const end = Date.now(); + logger.log(`${actionDescription} completed in ${end - start} msec`); + if (typeof result === "string") { + let str = result; if (str.length > 128) { str = str.substring(0, 128) + "..."; } - logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); + logger.log(` result.length=${str.length}, result='${JSON.stringify(str)}'`); } } @@ -459,8 +450,8 @@ namespace ts { function forwardJSONCall(logger: Logger, actionDescription: string, action: () => any, logPerformance: boolean): string { try { - var result = simpleForwardCall(logger, actionDescription, action, logPerformance); - return JSON.stringify({ result: result }); + const result = simpleForwardCall(logger, actionDescription, action, logPerformance); + return JSON.stringify({ result }); } catch (err) { if (err instanceof OperationCanceledException) { @@ -481,7 +472,7 @@ namespace ts { } } - export function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): { message: string; start: number; length: number; category: string; code: number; } []{ + export function realizeDiagnostics(diagnostics: Diagnostic[], newLine: string): { message: string; start: number; length: number; category: string; code: number; }[] { return diagnostics.map(d => realizeDiagnostic(d, newLine)); } @@ -540,10 +531,9 @@ namespace ts { */ public refresh(throwOnError: boolean): void { this.forwardJSONCall( - "refresh(" + throwOnError + ")", - () => { - return null; - }); + `refresh(${throwOnError})`, + () => null + ); } public cleanupSemanticCache(): void { @@ -555,63 +545,57 @@ namespace ts { }); } - private realizeDiagnostics(diagnostics: Diagnostic[]): { message: string; start: number; length: number; category: string; }[]{ - var newLine = getNewLineOrDefaultFromHost(this.host); + private realizeDiagnostics(diagnostics: Diagnostic[]): { message: string; start: number; length: number; category: string; }[] { + const newLine = getNewLineOrDefaultFromHost(this.host); return ts.realizeDiagnostics(diagnostics, newLine); } public getSyntacticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( - "getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", - () => { - var classifications = this.languageService.getSyntacticClassifications(fileName, createTextSpan(start, length)); - return classifications; - }); + `getSyntacticClassifications('${fileName}', ${start}, ${length})`, + () => this.languageService.getSyntacticClassifications(fileName, createTextSpan(start, length)) + ); } public getSemanticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( - "getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", - () => { - var classifications = this.languageService.getSemanticClassifications(fileName, createTextSpan(start, length)); - return classifications; - }); + `getSemanticClassifications('${fileName}', ${start}, ${length})`, + () => this.languageService.getSemanticClassifications(fileName, createTextSpan(start, length)) + ); } public getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( - "getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", - () => { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start, length))); - }); + `getEncodedSyntacticClassifications('${fileName}', ${start}, ${length})`, + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + () => convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start, length))) + ); } public getEncodedSemanticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( - "getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", - () => { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start, length))); - }); + `getEncodedSemanticClassifications('${fileName}', ${start}, ${length})`, + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + () => convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start, length))) + ); } public getSyntacticDiagnostics(fileName: string): string { return this.forwardJSONCall( - "getSyntacticDiagnostics('" + fileName + "')", + `getSyntacticDiagnostics('${fileName}')`, () => { - var diagnostics = this.languageService.getSyntacticDiagnostics(fileName); + const diagnostics = this.languageService.getSyntacticDiagnostics(fileName); return this.realizeDiagnostics(diagnostics); }); } public getSemanticDiagnostics(fileName: string): string { return this.forwardJSONCall( - "getSemanticDiagnostics('" + fileName + "')", + `getSemanticDiagnostics('${fileName}')`, () => { - var diagnostics = this.languageService.getSemanticDiagnostics(fileName); + const diagnostics = this.languageService.getSemanticDiagnostics(fileName); return this.realizeDiagnostics(diagnostics); }); } @@ -620,7 +604,7 @@ namespace ts { return this.forwardJSONCall( "getCompilerOptionsDiagnostics()", () => { - var diagnostics = this.languageService.getCompilerOptionsDiagnostics(); + const diagnostics = this.languageService.getCompilerOptionsDiagnostics(); return this.realizeDiagnostics(diagnostics); }); } @@ -633,11 +617,9 @@ namespace ts { */ public getQuickInfoAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getQuickInfoAtPosition('" + fileName + "', " + position + ")", - () => { - var quickInfo = this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); + `getQuickInfoAtPosition('${fileName}', ${position})`, + () => this.languageService.getQuickInfoAtPosition(fileName, position) + ); } @@ -649,11 +631,9 @@ namespace ts { */ public getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string { return this.forwardJSONCall( - "getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", - () => { - var spanInfo = this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); + `getNameOrDottedNameSpan('${fileName}', ${startPos}, ${endPos})`, + () => this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos) + ); } /** @@ -662,22 +642,18 @@ namespace ts { */ public getBreakpointStatementAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", - () => { - var spanInfo = this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); + `getBreakpointStatementAtPosition('${fileName}', ${position})`, + () => this.languageService.getBreakpointStatementAtPosition(fileName, position) + ); } /// SIGNATUREHELP public getSignatureHelpItems(fileName: string, position: number): string { return this.forwardJSONCall( - "getSignatureHelpItems('" + fileName + "', " + position + ")", - () => { - var signatureInfo = this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); + `getSignatureHelpItems('${fileName}', ${position})`, + () => this.languageService.getSignatureHelpItems(fileName, position) + ); } /// GOTO DEFINITION @@ -688,10 +664,9 @@ namespace ts { */ public getDefinitionAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getDefinitionAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getDefinitionAtPosition(fileName, position); - }); + `getDefinitionAtPosition('${fileName}', ${position})`, + () => this.languageService.getDefinitionAtPosition(fileName, position) + ); } /// GOTO Type @@ -702,44 +677,39 @@ namespace ts { */ public getTypeDefinitionAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getTypeDefinitionAtPosition(fileName, position); - }); + `getTypeDefinitionAtPosition('${fileName}', ${position})`, + () => this.languageService.getTypeDefinitionAtPosition(fileName, position) + ); } public getRenameInfo(fileName: string, position: number): string { return this.forwardJSONCall( - "getRenameInfo('" + fileName + "', " + position + ")", - () => { - return this.languageService.getRenameInfo(fileName, position); - }); + `getRenameInfo('${fileName}', ${position})`, + () => this.languageService.getRenameInfo(fileName, position) + ); } public findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string { return this.forwardJSONCall( - "findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", - () => { - return this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); + `findRenameLocations('${fileName}', ${position}, ${findInStrings}, ${findInComments})`, + () => this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments) + ); } /// GET BRACE MATCHING public getBraceMatchingAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getBraceMatchingAtPosition('" + fileName + "', " + position + ")", - () => { - var textRanges = this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); + `getBraceMatchingAtPosition('${fileName}', ${position})`, + () => this.languageService.getBraceMatchingAtPosition(fileName, position) + ); } /// GET SMART INDENT public getIndentationAtPosition(fileName: string, position: number, options: string /*Services.EditorOptions*/): string { return this.forwardJSONCall( - "getIndentationAtPosition('" + fileName + "', " + position + ")", + `getIndentationAtPosition('${fileName}', ${position})`, () => { - var localOptions: EditorOptions = JSON.parse(options); + const localOptions: EditorOptions = JSON.parse(options); return this.languageService.getIndentationAtPosition(fileName, position, localOptions); }); } @@ -748,35 +718,32 @@ namespace ts { public getReferencesAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getReferencesAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getReferencesAtPosition(fileName, position); - }); + `getReferencesAtPosition('${fileName}', ${position})`, + () => this.languageService.getReferencesAtPosition(fileName, position) + ); } public findReferences(fileName: string, position: number): string { return this.forwardJSONCall( - "findReferences('" + fileName + "', " + position + ")", - () => { - return this.languageService.findReferences(fileName, position); - }); + `findReferences('${fileName}', ${position})`, + () => this.languageService.findReferences(fileName, position) + ); } public getOccurrencesAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getOccurrencesAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getOccurrencesAtPosition(fileName, position); - }); + `getOccurrencesAtPosition('${fileName}', ${position})`, + () => this.languageService.getOccurrencesAtPosition(fileName, position) + ); } public getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string { return this.forwardJSONCall( - "getDocumentHighlights('" + fileName + "', " + position + ")", + `getDocumentHighlights('${fileName}', ${position})`, () => { - var results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + const results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); // workaround for VS document higlighting issue - keep only items from the initial file - let normalizedName = normalizeSlashes(fileName).toLowerCase(); + const normalizedName = normalizeSlashes(fileName).toLowerCase(); return filter(results, r => normalizeSlashes(r.fileName).toLowerCase() === normalizedName); }); } @@ -790,56 +757,49 @@ namespace ts { */ public getCompletionsAtPosition(fileName: string, position: number) { return this.forwardJSONCall( - "getCompletionsAtPosition('" + fileName + "', " + position + ")", - () => { - var completion = this.languageService.getCompletionsAtPosition(fileName, position); - return completion; - }); + `getCompletionsAtPosition('${fileName}', ${position})`, + () => this.languageService.getCompletionsAtPosition(fileName, position) + ); } /** Get a string based representation of a completion list entry details */ public getCompletionEntryDetails(fileName: string, position: number, entryName: string) { return this.forwardJSONCall( - "getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", - () => { - var details = this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); + `getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`, + () => this.languageService.getCompletionEntryDetails(fileName, position, entryName) + ); } public getFormattingEditsForRange(fileName: string, start: number, end: number, options: string/*Services.FormatCodeOptions*/): string { return this.forwardJSONCall( - "getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", + `getFormattingEditsForRange('${fileName}', ${start}, ${end})`, () => { - var localOptions: ts.FormatCodeOptions = JSON.parse(options); - var edits = this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; + const localOptions: ts.FormatCodeOptions = JSON.parse(options); + return this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); }); } public getFormattingEditsForDocument(fileName: string, options: string/*Services.FormatCodeOptions*/): string { return this.forwardJSONCall( - "getFormattingEditsForDocument('" + fileName + "')", + `getFormattingEditsForDocument('${fileName}')`, () => { - var localOptions: ts.FormatCodeOptions = JSON.parse(options); - var edits = this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; + const localOptions: ts.FormatCodeOptions = JSON.parse(options); + return this.languageService.getFormattingEditsForDocument(fileName, localOptions); }); } public getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string/*Services.FormatCodeOptions*/): string { return this.forwardJSONCall( - "getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", + `getFormattingEditsAfterKeystroke('${fileName}', ${position}, '${key}')`, () => { - var localOptions: ts.FormatCodeOptions = JSON.parse(options); - var edits = this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; + const localOptions: ts.FormatCodeOptions = JSON.parse(options); + return this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); }); } public getDocCommentTemplateAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", + `getDocCommentTemplateAtPosition('${fileName}', ${position})`, () => this.languageService.getDocCommentTemplateAtPosition(fileName, position) ); } @@ -849,51 +809,38 @@ namespace ts { /** Return a list of symbols that are interesting to navigate to */ public getNavigateToItems(searchValue: string, maxResultCount?: number): string { return this.forwardJSONCall( - "getNavigateToItems('" + searchValue + "', " + maxResultCount+ ")", - () => { - var items = this.languageService.getNavigateToItems(searchValue, maxResultCount); - return items; - }); + `getNavigateToItems('${searchValue}', ${maxResultCount})`, + () => this.languageService.getNavigateToItems(searchValue, maxResultCount) + ); } public getNavigationBarItems(fileName: string): string { return this.forwardJSONCall( - "getNavigationBarItems('" + fileName + "')", - () => { - var items = this.languageService.getNavigationBarItems(fileName); - return items; - }); + `getNavigationBarItems('${fileName}')`, + () => this.languageService.getNavigationBarItems(fileName) + ); } public getOutliningSpans(fileName: string): string { return this.forwardJSONCall( - "getOutliningSpans('" + fileName + "')", - () => { - var items = this.languageService.getOutliningSpans(fileName); - return items; - }); + `getOutliningSpans('${fileName}')`, + () => this.languageService.getOutliningSpans(fileName) + ); } public getTodoComments(fileName: string, descriptors: string): string { return this.forwardJSONCall( - "getTodoComments('" + fileName + "')", - () => { - var items = this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); + `getTodoComments('${fileName}')`, + () => this.languageService.getTodoComments(fileName, JSON.parse(descriptors)) + ); } /// Emit public getEmitOutput(fileName: string): string { return this.forwardJSONCall( - "getEmitOutput('" + fileName + "')", - () => { - var output = this.languageService.getEmitOutput(fileName); - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - (output).emitOutputStatus = output.emitSkipped ? 1 : 0; - return output; - }); + `getEmitOutput('${fileName}')`, + () => this.languageService.getEmitOutput(fileName) + ); } } @@ -918,12 +865,11 @@ namespace ts { /// COLORIZATION public getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): string { - var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - var items = classification.entries; - var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; + const classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); + let result = ""; + for (const item of classification.entries) { + result += item.length + "\n"; + result += item.classification + "\n"; } result += classification.finalLexState; return result; @@ -940,16 +886,16 @@ namespace ts { private forwardJSONCall(actionDescription: string, action: () => any): any { return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); } - + public resolveModuleName(fileName: string, moduleName: string, compilerOptionsJson: string): string { return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => { - let compilerOptions = JSON.parse(compilerOptionsJson); + const compilerOptions = JSON.parse(compilerOptionsJson); const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host); return { - resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName: undefined, + resolvedFileName: result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined, failedLookupLocations: result.failedLookupLocations }; - }); + }); } public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string { @@ -957,8 +903,8 @@ namespace ts { "getPreProcessedFileInfo('" + fileName + "')", () => { // for now treat files as JavaScript - var result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); - var convertResult = { + const result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); + const convertResult = { referencedFiles: [], importedFiles: [], ambientExternalModules: result.ambientExternalModules, @@ -986,26 +932,26 @@ namespace ts { public getTSConfigFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string { return this.forwardJSONCall( - "getTSConfigFileInfo('" + fileName + "')", + `getTSConfigFileInfo('${fileName}')`, () => { - let text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); + const text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - let result = parseConfigFileTextToJson(fileName, text); + const result = parseConfigFileTextToJson(fileName, text); if (result.error) { return { options: {}, files: [], - errors: [realizeDiagnostic(result.error, '\r\n')] + errors: [realizeDiagnostic(result.error, "\r\n")] }; } - var configFile = parseJsonConfigFileContent(result.config, this.host, getDirectoryPath(normalizeSlashes(fileName))); + const configFile = parseJsonConfigFileContent(result.config, this.host, getDirectoryPath(normalizeSlashes(fileName))); return { options: configFile.options, files: configFile.fileNames, - errors: realizeDiagnostics(configFile.errors, '\r\n') + errors: realizeDiagnostics(configFile.errors, "\r\n") }; }); } @@ -1013,9 +959,8 @@ namespace ts { public getDefaultCompilationSettings(): string { return this.forwardJSONCall( "getDefaultCompilationSettings()", - () => { - return getDefaultCompilerOptions(); - }); + () => getDefaultCompilerOptions() + ); } } @@ -1035,8 +980,8 @@ namespace ts { if (this.documentRegistry === undefined) { this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); } - var hostAdapter = new LanguageServiceShimHostAdapter(host); - var languageService = createLanguageService(hostAdapter, this.documentRegistry); + const hostAdapter = new LanguageServiceShimHostAdapter(host); + const languageService = createLanguageService(hostAdapter, this.documentRegistry); return new LanguageServiceShimObject(this, host, languageService); } catch (err) { @@ -1057,7 +1002,7 @@ namespace ts { public createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim { try { - var adapter = new CoreServicesShimHostAdapter(host); + const adapter = new CoreServicesShimHostAdapter(host); return new CoreServicesShimObject(this, host, adapter); } catch (err) { @@ -1077,7 +1022,7 @@ namespace ts { } public unregisterShim(shim: Shim): void { - for (var i = 0, n = this._shims.length; i < n; i++) { + for (let i = 0, n = this._shims.length; i < n; i++) { if (this._shims[i] === shim) { delete this._shims[i]; return; @@ -1096,12 +1041,21 @@ namespace ts { } } +/* tslint:enable:no-in-operator */ +/* tslint:enable:no-null */ + /// TODO: this is used by VS, clean this up on both sides of the interface /* @internal */ -module TypeScript.Services { - export var TypeScriptServicesFactory = ts.TypeScriptServicesFactory; +namespace TypeScript.Services { + export const TypeScriptServicesFactory = ts.TypeScriptServicesFactory; } +/* tslint:disable:no-unused-variable */ +// 'toolsVersion' gets consumed by the managed side, so it's not unused. +// TODO: it should be moved into a namespace though. + /* @internal */ -const toolsVersion = "1.6"; +const toolsVersion = "1.8"; + +/* tslint:enable:no-unused-variable */ \ No newline at end of file diff --git a/src/services/utilities.ts b/src/services/utilities.ts index b3b4ec31a02..afdc85fffd8 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -608,6 +608,36 @@ namespace ts { } return true; } + + export function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node) { + if (node.kind === SyntaxKind.ArrayLiteralExpression || + node.kind === SyntaxKind.ObjectLiteralExpression) { + // [a,b,c] from: + // [a, b, c] = someExpression; + if (node.parent.kind === SyntaxKind.BinaryExpression && + (node.parent).left === node && + (node.parent).operatorToken.kind === SyntaxKind.EqualsToken) { + return true; + } + + // [a, b, c] from: + // for([a, b, c] of expression) + if (node.parent.kind === SyntaxKind.ForOfStatement && + (node.parent).initializer === node) { + return true; + } + + // [a, b, c] of + // [x, [a, b, c] ] = someExpression + // or + // {x, a: {a, b, c} } = someExpression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === SyntaxKind.PropertyAssignment ? node.parent.parent : node.parent)) { + return true; + } + } + + return false; + } } // Display-part writer helpers diff --git a/tests/baselines/reference/ES5For-of1.js.map b/tests/baselines/reference/ES5For-of1.js.map index 568ac1987e7..bd729517462 100644 --- a/tests/baselines/reference/ES5For-of1.js.map +++ b/tests/baselines/reference/ES5For-of1.js.map @@ -1,2 +1,2 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.sourcemap.txt b/tests/baselines/reference/ES5For-of1.sourcemap.txt index 7bdd7edfa13..5ae1084df25 100644 --- a/tests/baselines/reference/ES5For-of1.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of1.ts 12> 'c' 13> ] 14> -15> var v +15> ['a', 'b', 'c'] 16> -17> var v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of1.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of13.js.map b/tests/baselines/reference/ES5For-of13.js.map index 5ff54bb8816..3fa2bd27348 100644 --- a/tests/baselines/reference/ES5For-of13.js.map +++ b/tests/baselines/reference/ES5For-of13.js.map @@ -1,2 +1,2 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.sourcemap.txt b/tests/baselines/reference/ES5For-of13.sourcemap.txt index c3a188e7221..410560ac78e 100644 --- a/tests/baselines/reference/ES5For-of13.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of13.ts 12> 'c' 13> ] 14> -15> let v +15> ['a', 'b', 'c'] 16> -17> let v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of13.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of25.js.map b/tests/baselines/reference/ES5For-of25.js.map index 1c4d8c2101f..5ccc838a488 100644 --- a/tests/baselines/reference/ES5For-of25.js.map +++ b/tests/baselines/reference/ES5For-of25.js.map @@ -1,2 +1,2 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAV,eAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC,CAAC;IAAX,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.sourcemap.txt b/tests/baselines/reference/ES5For-of25.sourcemap.txt index 453eef4ee46..765aa707701 100644 --- a/tests/baselines/reference/ES5For-of25.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25.sourcemap.txt @@ -69,9 +69,9 @@ sourceFile:ES5For-of25.ts 6 > 7 > a 8 > -9 > var v +9 > a 10> -11> var v of a +11> a 12> ) 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) @@ -80,9 +80,9 @@ sourceFile:ES5For-of25.ts 5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) 6 >Emitted(2, 18) Source(2, 15) + SourceIndex(0) 7 >Emitted(2, 25) Source(2, 16) + SourceIndex(0) -8 >Emitted(2, 27) Source(2, 6) + SourceIndex(0) -9 >Emitted(2, 42) Source(2, 11) + SourceIndex(0) -10>Emitted(2, 44) Source(2, 6) + SourceIndex(0) +8 >Emitted(2, 27) Source(2, 15) + SourceIndex(0) +9 >Emitted(2, 42) Source(2, 16) + SourceIndex(0) +10>Emitted(2, 44) Source(2, 15) + SourceIndex(0) 11>Emitted(2, 48) Source(2, 16) + SourceIndex(0) 12>Emitted(2, 49) Source(2, 17) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of26.js.map b/tests/baselines/reference/ES5For-of26.js.map index 704a3a24f2a..9dcebf97134 100644 --- a/tests/baselines/reference/ES5For-of26.js.map +++ b/tests/baselines/reference/ES5For-of26.js.map @@ -1,2 +1,2 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM,CAAC;IAA7B,eAAkB,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.sourcemap.txt b/tests/baselines/reference/ES5For-of26.sourcemap.txt index c9942b1e861..00a1cc55f37 100644 --- a/tests/baselines/reference/ES5For-of26.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26.sourcemap.txt @@ -38,9 +38,9 @@ sourceFile:ES5For-of26.ts 10> 3 11> ] 12> -13> var [a = 0, b = 1] +13> [2, 3] 14> -15> var [a = 0, b = 1] of [2, 3] +15> [2, 3] 16> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -53,50 +53,50 @@ sourceFile:ES5For-of26.ts 9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) 10>Emitted(1, 28) Source(1, 33) + SourceIndex(0) 11>Emitted(1, 29) Source(1, 34) + SourceIndex(0) -12>Emitted(1, 31) Source(1, 6) + SourceIndex(0) -13>Emitted(1, 45) Source(1, 24) + SourceIndex(0) -14>Emitted(1, 47) Source(1, 6) + SourceIndex(0) +12>Emitted(1, 31) Source(1, 28) + SourceIndex(0) +13>Emitted(1, 45) Source(1, 34) + SourceIndex(0) +14>Emitted(1, 47) Source(1, 28) + SourceIndex(0) 15>Emitted(1, 51) Source(1, 34) + SourceIndex(0) 16>Emitted(1, 52) Source(1, 35) + SourceIndex(0) --- >>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; 1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^ -5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^ -9 > ^ -10> ^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> -2 > var [ -3 > a -4 > = -5 > 0 -6 > , -7 > b -8 > = -9 > 1 -10> ] +2 > var [a = 0, b = 1] +3 > +4 > a = 0 +5 > +6 > a = 0 +7 > , +8 > b = 1 +9 > +10> b = 1 1->Emitted(2, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) -3 >Emitted(2, 35) Source(1, 12) + SourceIndex(0) -4 >Emitted(2, 54) Source(1, 15) + SourceIndex(0) -5 >Emitted(2, 55) Source(1, 16) + SourceIndex(0) -6 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) -7 >Emitted(2, 75) Source(1, 19) + SourceIndex(0) -8 >Emitted(2, 94) Source(1, 22) + SourceIndex(0) -9 >Emitted(2, 95) Source(1, 23) + SourceIndex(0) -10>Emitted(2, 100) Source(1, 24) + SourceIndex(0) +2 >Emitted(2, 20) Source(1, 24) + SourceIndex(0) +3 >Emitted(2, 22) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 32) Source(1, 16) + SourceIndex(0) +5 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) +6 >Emitted(2, 60) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 62) Source(1, 18) + SourceIndex(0) +8 >Emitted(2, 72) Source(1, 23) + SourceIndex(0) +9 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) +10>Emitted(2, 100) Source(1, 23) + SourceIndex(0) --- >>> a; 1 >^^^^ 2 > ^ 3 > ^ 4 > ^-> -1 > of [2, 3]) { +1 >] of [2, 3]) { > 2 > a 3 > ; diff --git a/tests/baselines/reference/ES5For-of3.js.map b/tests/baselines/reference/ES5For-of3.js.map index 7454e1ca85d..5a91ff28e9c 100644 --- a/tests/baselines/reference/ES5For-of3.js.map +++ b/tests/baselines/reference/ES5For-of3.js.map @@ -1,2 +1,2 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.sourcemap.txt b/tests/baselines/reference/ES5For-of3.sourcemap.txt index dd0bca37b68..1c728f5df67 100644 --- a/tests/baselines/reference/ES5For-of3.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of3.ts 12> 'c' 13> ] 14> -15> var v +15> ['a', 'b', 'c'] 16> -17> var v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of3.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map index f4e62e46e18..3a1497eadcd 100644 --- a/tests/baselines/reference/ES5For-of8.js.map +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -1,2 +1,2 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAA1B,cAAO,EAAP,IAA0B,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt index 7a87dbf3998..dbfce707ca6 100644 --- a/tests/baselines/reference/ES5For-of8.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -88,9 +88,9 @@ sourceFile:ES5For-of8.ts 12> 'c' 13> ] 14> -15> foo().x +15> ['a', 'b', 'c'] 16> -17> foo().x of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) 2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) @@ -105,9 +105,9 @@ sourceFile:ES5For-of8.ts 11>Emitted(4, 34) Source(4, 28) + SourceIndex(0) 12>Emitted(4, 37) Source(4, 31) + SourceIndex(0) 13>Emitted(4, 38) Source(4, 32) + SourceIndex(0) -14>Emitted(4, 40) Source(4, 6) + SourceIndex(0) -15>Emitted(4, 54) Source(4, 13) + SourceIndex(0) -16>Emitted(4, 56) Source(4, 6) + SourceIndex(0) +14>Emitted(4, 40) Source(4, 17) + SourceIndex(0) +15>Emitted(4, 54) Source(4, 32) + SourceIndex(0) +16>Emitted(4, 56) Source(4, 17) + SourceIndex(0) 17>Emitted(4, 60) Source(4, 32) + SourceIndex(0) 18>Emitted(4, 61) Source(4, 33) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt index 31e5e867fc9..6027d07bab9 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2661: Invalid module name in augmentation, module 'ext' cannot be found. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2662: Invalid module name in augmentation, module 'ext' cannot be found. tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'. @@ -9,7 +9,7 @@ tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): err declare module "ext" { ~~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'ext' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'ext' cannot be found. export class C { } } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index 7a35b628fba..3ef9ca5f495 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,5): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,5): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -6,7 +6,7 @@ tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): module M { export declare module "M" { } ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt index 3a4e28e41e9..db6ebb318fd 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,1): error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2661: Invalid module name in augmentation, module 'M' cannot be found. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,1): error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2662: Invalid module name in augmentation, module 'M' cannot be found. ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (2 errors) ==== export declare module "M" { } ~~~~~~ -!!! error TS2665: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +!!! error TS2666: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~ -!!! error TS2661: Invalid module name in augmentation, module 'M' cannot be found. \ No newline at end of file +!!! error TS2662: Invalid module name in augmentation, module 'M' cannot be found. \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline new file mode 100644 index 00000000000..923e0cced09 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline @@ -0,0 +1,1005 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (186 to 207) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 226) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (227 to 228) SpanInfo: {"start":227,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (229 to 292) SpanInfo: {"start":229,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (293 to 366) SpanInfo: {"start":293,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 393) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (394 to 417) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 486) SpanInfo: undefined +-------------------------------- +16 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 522) SpanInfo: undefined +-------------------------------- +17 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (523 to 593) SpanInfo: undefined +-------------------------------- +18 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (594 to 696) SpanInfo: undefined +-------------------------------- +19 >let i: number; + + ~~~~~~~~~~~~~~~ => Pos: (697 to 711) SpanInfo: undefined +-------------------------------- +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 735) SpanInfo: {"start":720,"length":5} + >nameA + >:=> (line 20, col 8) to (line 20, col 13) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (736 to 742) SpanInfo: {"start":737,"length":5} + >i = 0 + >:=> (line 20, col 25) to (line 20, col 30) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (743 to 749) SpanInfo: {"start":744,"length":5} + >i < 1 + >:=> (line 20, col 32) to (line 20, col 37) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (750 to 757) SpanInfo: {"start":751,"length":3} + >i++ + >:=> (line 20, col 39) to (line 20, col 42) +-------------------------------- +21 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (758 to 781) SpanInfo: {"start":762,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +22 >} + + ~~ => Pos: (782 to 783) SpanInfo: {"start":762,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (784 to 811) SpanInfo: {"start":792,"length":5} + >nameA + >:=> (line 23, col 8) to (line 23, col 13) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (812 to 818) SpanInfo: {"start":813,"length":5} + >i = 0 + >:=> (line 23, col 29) to (line 23, col 34) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (819 to 825) SpanInfo: {"start":820,"length":5} + >i < 1 + >:=> (line 23, col 36) to (line 23, col 41) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (826 to 833) SpanInfo: {"start":827,"length":3} + >i++ + >:=> (line 23, col 43) to (line 23, col 46) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (834 to 857) SpanInfo: {"start":838,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (858 to 859) SpanInfo: {"start":838,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (860 to 903) SpanInfo: {"start":868,"length":5} + >nameA + >:=> (line 26, col 8) to (line 26, col 13) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (904 to 910) SpanInfo: {"start":905,"length":5} + >i = 0 + >:=> (line 26, col 45) to (line 26, col 50) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (911 to 917) SpanInfo: {"start":912,"length":5} + >i < 1 + >:=> (line 26, col 52) to (line 26, col 57) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (918 to 925) SpanInfo: {"start":919,"length":3} + >i++ + >:=> (line 26, col 59) to (line 26, col 62) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (926 to 949) SpanInfo: {"start":930,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (950 to 951) SpanInfo: {"start":930,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (952 to 974) SpanInfo: {"start":961,"length":13} + >primarySkillA + >:=> (line 29, col 9) to (line 29, col 22) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (975 to 991) SpanInfo: {"start":976,"length":15} + >secondarySkillA + >:=> (line 29, col 24) to (line 29, col 39) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (992 to 1007) SpanInfo: {"start":960,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 29, col 8) to (line 29, col 40) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1008 to 1014) SpanInfo: {"start":1009,"length":5} + >i = 0 + >:=> (line 29, col 57) to (line 29, col 62) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1015 to 1021) SpanInfo: {"start":1016,"length":5} + >i < 1 + >:=> (line 29, col 64) to (line 29, col 69) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1022 to 1029) SpanInfo: {"start":1023,"length":3} + >i++ + >:=> (line 29, col 71) to (line 29, col 74) +-------------------------------- +30 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1030 to 1061) SpanInfo: {"start":1034,"length":26} + >console.log(primarySkillA) + >:=> (line 30, col 4) to (line 30, col 30) +-------------------------------- +31 >} + + ~~ => Pos: (1062 to 1063) SpanInfo: {"start":1034,"length":26} + >console.log(primarySkillA) + >:=> (line 30, col 4) to (line 30, col 30) +-------------------------------- +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1064 to 1086) SpanInfo: {"start":1073,"length":13} + >primarySkillA + >:=> (line 32, col 9) to (line 32, col 22) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1087 to 1103) SpanInfo: {"start":1088,"length":15} + >secondarySkillA + >:=> (line 32, col 24) to (line 32, col 39) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (1104 to 1123) SpanInfo: {"start":1072,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 32, col 8) to (line 32, col 40) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1124 to 1130) SpanInfo: {"start":1125,"length":5} + >i = 0 + >:=> (line 32, col 61) to (line 32, col 66) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1131 to 1137) SpanInfo: {"start":1132,"length":5} + >i < 1 + >:=> (line 32, col 68) to (line 32, col 73) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1138 to 1145) SpanInfo: {"start":1139,"length":3} + >i++ + >:=> (line 32, col 75) to (line 32, col 78) +-------------------------------- +33 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1146 to 1177) SpanInfo: {"start":1150,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +34 >} + + ~~ => Pos: (1178 to 1179) SpanInfo: {"start":1150,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1180 to 1202) SpanInfo: {"start":1189,"length":13} + >primarySkillA + >:=> (line 35, col 9) to (line 35, col 22) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1203 to 1219) SpanInfo: {"start":1204,"length":15} + >secondarySkillA + >:=> (line 35, col 24) to (line 35, col 39) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1220 to 1259) SpanInfo: {"start":1188,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 35, col 8) to (line 35, col 40) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1260 to 1266) SpanInfo: {"start":1261,"length":5} + >i = 0 + >:=> (line 35, col 81) to (line 35, col 86) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1267 to 1273) SpanInfo: {"start":1268,"length":5} + >i < 1 + >:=> (line 35, col 88) to (line 35, col 93) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1274 to 1281) SpanInfo: {"start":1275,"length":3} + >i++ + >:=> (line 35, col 95) to (line 35, col 98) +-------------------------------- +36 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1282 to 1313) SpanInfo: {"start":1286,"length":26} + >console.log(primarySkillA) + >:=> (line 36, col 4) to (line 36, col 30) +-------------------------------- +37 >} + + ~~ => Pos: (1314 to 1315) SpanInfo: {"start":1286,"length":26} + >console.log(primarySkillA) + >:=> (line 36, col 4) to (line 36, col 30) +-------------------------------- +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1316 to 1339) SpanInfo: {"start":1322,"length":7} + >numberB + >:=> (line 38, col 6) to (line 38, col 13) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1340 to 1346) SpanInfo: {"start":1341,"length":5} + >i = 0 + >:=> (line 38, col 25) to (line 38, col 30) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1347 to 1353) SpanInfo: {"start":1348,"length":5} + >i < 1 + >:=> (line 38, col 32) to (line 38, col 37) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1354 to 1361) SpanInfo: {"start":1355,"length":3} + >i++ + >:=> (line 38, col 39) to (line 38, col 42) +-------------------------------- +39 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1362 to 1387) SpanInfo: {"start":1366,"length":20} + >console.log(numberB) + >:=> (line 39, col 4) to (line 39, col 24) +-------------------------------- +40 >} + + ~~ => Pos: (1388 to 1389) SpanInfo: {"start":1366,"length":20} + >console.log(numberB) + >:=> (line 39, col 4) to (line 39, col 24) +-------------------------------- +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1390 to 1417) SpanInfo: {"start":1396,"length":7} + >numberB + >:=> (line 41, col 6) to (line 41, col 13) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1418 to 1424) SpanInfo: {"start":1419,"length":5} + >i = 0 + >:=> (line 41, col 29) to (line 41, col 34) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1425 to 1431) SpanInfo: {"start":1426,"length":5} + >i < 1 + >:=> (line 41, col 36) to (line 41, col 41) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1432 to 1439) SpanInfo: {"start":1433,"length":3} + >i++ + >:=> (line 41, col 43) to (line 41, col 46) +-------------------------------- +42 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1440 to 1465) SpanInfo: {"start":1444,"length":20} + >console.log(numberB) + >:=> (line 42, col 4) to (line 42, col 24) +-------------------------------- +43 >} + + ~~ => Pos: (1466 to 1467) SpanInfo: {"start":1444,"length":20} + >console.log(numberB) + >:=> (line 42, col 4) to (line 42, col 24) +-------------------------------- +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1468 to 1511) SpanInfo: {"start":1474,"length":7} + >numberB + >:=> (line 44, col 6) to (line 44, col 13) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1512 to 1518) SpanInfo: {"start":1513,"length":5} + >i = 0 + >:=> (line 44, col 45) to (line 44, col 50) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1519 to 1525) SpanInfo: {"start":1520,"length":5} + >i < 1 + >:=> (line 44, col 52) to (line 44, col 57) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1526 to 1533) SpanInfo: {"start":1527,"length":3} + >i++ + >:=> (line 44, col 59) to (line 44, col 62) +-------------------------------- +45 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1534 to 1559) SpanInfo: {"start":1538,"length":20} + >console.log(numberB) + >:=> (line 45, col 4) to (line 45, col 24) +-------------------------------- +46 >} + + ~~ => Pos: (1560 to 1561) SpanInfo: {"start":1538,"length":20} + >console.log(numberB) + >:=> (line 45, col 4) to (line 45, col 24) +-------------------------------- +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1562 to 1588) SpanInfo: {"start":1568,"length":5} + >nameB + >:=> (line 47, col 6) to (line 47, col 11) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1589 to 1595) SpanInfo: {"start":1590,"length":5} + >i = 0 + >:=> (line 47, col 28) to (line 47, col 33) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1596 to 1602) SpanInfo: {"start":1597,"length":5} + >i < 1 + >:=> (line 47, col 35) to (line 47, col 40) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1603 to 1610) SpanInfo: {"start":1604,"length":3} + >i++ + >:=> (line 47, col 42) to (line 47, col 45) +-------------------------------- +48 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1611 to 1634) SpanInfo: {"start":1615,"length":18} + >console.log(nameB) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +49 >} + + ~~ => Pos: (1635 to 1636) SpanInfo: {"start":1615,"length":18} + >console.log(nameB) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1637 to 1667) SpanInfo: {"start":1643,"length":5} + >nameB + >:=> (line 50, col 6) to (line 50, col 11) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1668 to 1674) SpanInfo: {"start":1669,"length":5} + >i = 0 + >:=> (line 50, col 32) to (line 50, col 37) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1675 to 1681) SpanInfo: {"start":1676,"length":5} + >i < 1 + >:=> (line 50, col 39) to (line 50, col 44) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1682 to 1689) SpanInfo: {"start":1683,"length":3} + >i++ + >:=> (line 50, col 46) to (line 50, col 49) +-------------------------------- +51 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1690 to 1713) SpanInfo: {"start":1694,"length":18} + >console.log(nameB) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + + ~~ => Pos: (1714 to 1715) SpanInfo: {"start":1694,"length":18} + >console.log(nameB) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1716 to 1766) SpanInfo: {"start":1722,"length":5} + >nameB + >:=> (line 53, col 6) to (line 53, col 11) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1767 to 1773) SpanInfo: {"start":1768,"length":5} + >i = 0 + >:=> (line 53, col 52) to (line 53, col 57) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1774 to 1780) SpanInfo: {"start":1775,"length":5} + >i < 1 + >:=> (line 53, col 59) to (line 53, col 64) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1781 to 1788) SpanInfo: {"start":1782,"length":3} + >i++ + >:=> (line 53, col 66) to (line 53, col 69) +-------------------------------- +54 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1789 to 1812) SpanInfo: {"start":1793,"length":18} + >console.log(nameB) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +55 >} + + ~~ => Pos: (1813 to 1814) SpanInfo: {"start":1793,"length":18} + >console.log(nameB) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1815 to 1829) SpanInfo: {"start":1821,"length":8} + >numberA2 + >:=> (line 56, col 6) to (line 56, col 14) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1830 to 1837) SpanInfo: {"start":1831,"length":6} + >nameA2 + >:=> (line 56, col 16) to (line 56, col 22) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1838 to 1856) SpanInfo: {"start":1839,"length":7} + >skillA2 + >:=> (line 56, col 24) to (line 56, col 31) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1857 to 1863) SpanInfo: {"start":1858,"length":5} + >i = 0 + >:=> (line 56, col 43) to (line 56, col 48) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1864 to 1870) SpanInfo: {"start":1865,"length":5} + >i < 1 + >:=> (line 56, col 50) to (line 56, col 55) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1871 to 1878) SpanInfo: {"start":1872,"length":3} + >i++ + >:=> (line 56, col 57) to (line 56, col 60) +-------------------------------- +57 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1879 to 1903) SpanInfo: {"start":1883,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +58 >} + + ~~ => Pos: (1904 to 1905) SpanInfo: {"start":1883,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1906 to 1920) SpanInfo: {"start":1912,"length":8} + >numberA2 + >:=> (line 59, col 6) to (line 59, col 14) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1921 to 1928) SpanInfo: {"start":1922,"length":6} + >nameA2 + >:=> (line 59, col 16) to (line 59, col 22) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1929 to 1951) SpanInfo: {"start":1930,"length":7} + >skillA2 + >:=> (line 59, col 24) to (line 59, col 31) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1952 to 1958) SpanInfo: {"start":1953,"length":5} + >i = 0 + >:=> (line 59, col 47) to (line 59, col 52) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1959 to 1965) SpanInfo: {"start":1960,"length":5} + >i < 1 + >:=> (line 59, col 54) to (line 59, col 59) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1966 to 1973) SpanInfo: {"start":1967,"length":3} + >i++ + >:=> (line 59, col 61) to (line 59, col 64) +-------------------------------- +60 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1974 to 1998) SpanInfo: {"start":1978,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +61 >} + + ~~ => Pos: (1999 to 2000) SpanInfo: {"start":1978,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2001 to 2015) SpanInfo: {"start":2007,"length":8} + >numberA2 + >:=> (line 62, col 6) to (line 62, col 14) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2016 to 2023) SpanInfo: {"start":2017,"length":6} + >nameA2 + >:=> (line 62, col 16) to (line 62, col 22) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2024 to 2062) SpanInfo: {"start":2025,"length":7} + >skillA2 + >:=> (line 62, col 24) to (line 62, col 31) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2063 to 2069) SpanInfo: {"start":2064,"length":5} + >i = 0 + >:=> (line 62, col 63) to (line 62, col 68) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2070 to 2076) SpanInfo: {"start":2071,"length":5} + >i < 1 + >:=> (line 62, col 70) to (line 62, col 75) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2077 to 2084) SpanInfo: {"start":2078,"length":3} + >i++ + >:=> (line 62, col 77) to (line 62, col 80) +-------------------------------- +63 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2085 to 2109) SpanInfo: {"start":2089,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +64 >} + + ~~ => Pos: (2110 to 2111) SpanInfo: {"start":2089,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2112 to 2124) SpanInfo: {"start":2118,"length":6} + >nameMA + >:=> (line 65, col 6) to (line 65, col 12) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2125 to 2140) SpanInfo: {"start":2127,"length":13} + >primarySkillA + >:=> (line 65, col 15) to (line 65, col 28) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2141 to 2157) SpanInfo: {"start":2142,"length":15} + >secondarySkillA + >:=> (line 65, col 30) to (line 65, col 45) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (2158 to 2173) SpanInfo: {"start":2126,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 65, col 14) to (line 65, col 46) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2174 to 2180) SpanInfo: {"start":2175,"length":5} + >i = 0 + >:=> (line 65, col 63) to (line 65, col 68) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2181 to 2187) SpanInfo: {"start":2182,"length":5} + >i < 1 + >:=> (line 65, col 70) to (line 65, col 75) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2188 to 2195) SpanInfo: {"start":2189,"length":3} + >i++ + >:=> (line 65, col 77) to (line 65, col 80) +-------------------------------- +66 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2196 to 2220) SpanInfo: {"start":2200,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (2221 to 2222) SpanInfo: {"start":2200,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2223 to 2235) SpanInfo: {"start":2229,"length":6} + >nameMA + >:=> (line 68, col 6) to (line 68, col 12) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2236 to 2251) SpanInfo: {"start":2238,"length":13} + >primarySkillA + >:=> (line 68, col 15) to (line 68, col 28) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2252 to 2268) SpanInfo: {"start":2253,"length":15} + >secondarySkillA + >:=> (line 68, col 30) to (line 68, col 45) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (2269 to 2288) SpanInfo: {"start":2237,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 68, col 14) to (line 68, col 46) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2289 to 2295) SpanInfo: {"start":2290,"length":5} + >i = 0 + >:=> (line 68, col 67) to (line 68, col 72) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2296 to 2302) SpanInfo: {"start":2297,"length":5} + >i < 1 + >:=> (line 68, col 74) to (line 68, col 79) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2303 to 2310) SpanInfo: {"start":2304,"length":3} + >i++ + >:=> (line 68, col 81) to (line 68, col 84) +-------------------------------- +69 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2311 to 2335) SpanInfo: {"start":2315,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2336 to 2337) SpanInfo: {"start":2315,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2338 to 2350) SpanInfo: {"start":2344,"length":6} + >nameMA + >:=> (line 71, col 6) to (line 71, col 12) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2351 to 2366) SpanInfo: {"start":2353,"length":13} + >primarySkillA + >:=> (line 71, col 15) to (line 71, col 28) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2367 to 2383) SpanInfo: {"start":2368,"length":15} + >secondarySkillA + >:=> (line 71, col 30) to (line 71, col 45) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2384 to 2423) SpanInfo: {"start":2352,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 71, col 14) to (line 71, col 46) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2424 to 2430) SpanInfo: {"start":2425,"length":5} + >i = 0 + >:=> (line 71, col 87) to (line 71, col 92) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2431 to 2437) SpanInfo: {"start":2432,"length":5} + >i < 1 + >:=> (line 71, col 94) to (line 71, col 99) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2438 to 2445) SpanInfo: {"start":2439,"length":3} + >i++ + >:=> (line 71, col 101) to (line 71, col 104) +-------------------------------- +72 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2446 to 2470) SpanInfo: {"start":2450,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2471 to 2472) SpanInfo: {"start":2450,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2473 to 2487) SpanInfo: {"start":2479,"length":8} + >numberA3 + >:=> (line 74, col 6) to (line 74, col 14) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2488 to 2512) SpanInfo: {"start":2489,"length":13} + >...robotAInfo + >:=> (line 74, col 16) to (line 74, col 29) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2513 to 2519) SpanInfo: {"start":2514,"length":5} + >i = 0 + >:=> (line 74, col 41) to (line 74, col 46) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2520 to 2526) SpanInfo: {"start":2521,"length":5} + >i < 1 + >:=> (line 74, col 48) to (line 74, col 53) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2527 to 2534) SpanInfo: {"start":2528,"length":3} + >i++ + >:=> (line 74, col 55) to (line 74, col 58) +-------------------------------- +75 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2535 to 2561) SpanInfo: {"start":2539,"length":21} + >console.log(numberA3) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +76 >} + + ~~ => Pos: (2562 to 2563) SpanInfo: {"start":2539,"length":21} + >console.log(numberA3) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2564 to 2578) SpanInfo: {"start":2570,"length":8} + >numberA3 + >:=> (line 77, col 6) to (line 77, col 14) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2579 to 2607) SpanInfo: {"start":2580,"length":13} + >...robotAInfo + >:=> (line 77, col 16) to (line 77, col 29) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2608 to 2614) SpanInfo: {"start":2609,"length":5} + >i = 0 + >:=> (line 77, col 45) to (line 77, col 50) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2615 to 2621) SpanInfo: {"start":2616,"length":5} + >i < 1 + >:=> (line 77, col 52) to (line 77, col 57) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2622 to 2629) SpanInfo: {"start":2623,"length":3} + >i++ + >:=> (line 77, col 59) to (line 77, col 62) +-------------------------------- +78 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2630 to 2656) SpanInfo: {"start":2634,"length":21} + >console.log(numberA3) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +79 >} + + ~~ => Pos: (2657 to 2658) SpanInfo: {"start":2634,"length":21} + >console.log(numberA3) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2659 to 2673) SpanInfo: {"start":2665,"length":8} + >numberA3 + >:=> (line 80, col 6) to (line 80, col 14) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2674 to 2725) SpanInfo: {"start":2675,"length":13} + >...robotAInfo + >:=> (line 80, col 16) to (line 80, col 29) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2726 to 2732) SpanInfo: {"start":2727,"length":5} + >i = 0 + >:=> (line 80, col 68) to (line 80, col 73) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2733 to 2739) SpanInfo: {"start":2734,"length":5} + >i < 1 + >:=> (line 80, col 75) to (line 80, col 80) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2740 to 2747) SpanInfo: {"start":2741,"length":3} + >i++ + >:=> (line 80, col 82) to (line 80, col 85) +-------------------------------- +81 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2748 to 2774) SpanInfo: {"start":2752,"length":21} + >console.log(numberA3) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +82 >} + + ~~ => Pos: (2775 to 2776) SpanInfo: {"start":2752,"length":21} + >console.log(numberA3) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2777 to 2816) SpanInfo: {"start":2783,"length":18} + >...multiRobotAInfo + >:=> (line 83, col 6) to (line 83, col 24) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2817 to 2823) SpanInfo: {"start":2818,"length":5} + >i = 0 + >:=> (line 83, col 41) to (line 83, col 46) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2824 to 2830) SpanInfo: {"start":2825,"length":5} + >i < 1 + >:=> (line 83, col 48) to (line 83, col 53) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2831 to 2838) SpanInfo: {"start":2832,"length":3} + >i++ + >:=> (line 83, col 55) to (line 83, col 58) +-------------------------------- +84 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2839 to 2872) SpanInfo: {"start":2843,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 84, col 4) to (line 84, col 32) +-------------------------------- +85 >} + + ~~ => Pos: (2873 to 2874) SpanInfo: {"start":2843,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 84, col 4) to (line 84, col 32) +-------------------------------- +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2875 to 2918) SpanInfo: {"start":2881,"length":18} + >...multiRobotAInfo + >:=> (line 86, col 6) to (line 86, col 24) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2919 to 2925) SpanInfo: {"start":2920,"length":5} + >i = 0 + >:=> (line 86, col 45) to (line 86, col 50) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2926 to 2932) SpanInfo: {"start":2927,"length":5} + >i < 1 + >:=> (line 86, col 52) to (line 86, col 57) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2933 to 2940) SpanInfo: {"start":2934,"length":3} + >i++ + >:=> (line 86, col 59) to (line 86, col 62) +-------------------------------- +87 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2941 to 2974) SpanInfo: {"start":2945,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 87, col 4) to (line 87, col 32) +-------------------------------- +88 >} + + ~~ => Pos: (2975 to 2976) SpanInfo: {"start":2945,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 87, col 4) to (line 87, col 32) +-------------------------------- +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2977 to 3059) SpanInfo: {"start":2983,"length":18} + >...multiRobotAInfo + >:=> (line 89, col 6) to (line 89, col 24) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3060 to 3066) SpanInfo: {"start":3061,"length":5} + >i = 0 + >:=> (line 89, col 84) to (line 89, col 89) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3067 to 3073) SpanInfo: {"start":3068,"length":5} + >i < 1 + >:=> (line 89, col 91) to (line 89, col 96) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3074 to 3081) SpanInfo: {"start":3075,"length":3} + >i++ + >:=> (line 89, col 98) to (line 89, col 101) +-------------------------------- +90 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3082 to 3115) SpanInfo: {"start":3086,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 90, col 4) to (line 90, col 32) +-------------------------------- +91 >} + ~ => Pos: (3116 to 3116) SpanInfo: {"start":3086,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 90, col 4) to (line 90, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..56894ce9a9a --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,1008 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (186 to 207) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 226) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (227 to 228) SpanInfo: {"start":227,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (229 to 292) SpanInfo: {"start":229,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (293 to 366) SpanInfo: {"start":293,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 393) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (394 to 417) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 486) SpanInfo: undefined +-------------------------------- +16 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 522) SpanInfo: undefined +-------------------------------- +17 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (523 to 593) SpanInfo: undefined +-------------------------------- +18 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (594 to 696) SpanInfo: undefined +-------------------------------- +19 >let i: number; + + ~~~~~~~~~~~~~~~ => Pos: (697 to 711) SpanInfo: undefined +-------------------------------- +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 744) SpanInfo: {"start":720,"length":14} + >nameA = "name" + >:=> (line 20, col 8) to (line 20, col 22) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (745 to 751) SpanInfo: {"start":746,"length":5} + >i = 0 + >:=> (line 20, col 34) to (line 20, col 39) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (752 to 758) SpanInfo: {"start":753,"length":5} + >i < 1 + >:=> (line 20, col 41) to (line 20, col 46) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (759 to 766) SpanInfo: {"start":760,"length":3} + >i++ + >:=> (line 20, col 48) to (line 20, col 51) +-------------------------------- +21 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (767 to 790) SpanInfo: {"start":771,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +22 >} + + ~~ => Pos: (791 to 792) SpanInfo: {"start":771,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (793 to 829) SpanInfo: {"start":801,"length":14} + >nameA = "name" + >:=> (line 23, col 8) to (line 23, col 22) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (830 to 836) SpanInfo: {"start":831,"length":5} + >i = 0 + >:=> (line 23, col 38) to (line 23, col 43) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (837 to 843) SpanInfo: {"start":838,"length":5} + >i < 1 + >:=> (line 23, col 45) to (line 23, col 50) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (844 to 851) SpanInfo: {"start":845,"length":3} + >i++ + >:=> (line 23, col 52) to (line 23, col 55) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (852 to 875) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (876 to 877) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (878 to 930) SpanInfo: {"start":886,"length":14} + >nameA = "name" + >:=> (line 26, col 8) to (line 26, col 22) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (931 to 937) SpanInfo: {"start":932,"length":5} + >i = 0 + >:=> (line 26, col 54) to (line 26, col 59) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (938 to 944) SpanInfo: {"start":939,"length":5} + >i < 1 + >:=> (line 26, col 61) to (line 26, col 66) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (945 to 952) SpanInfo: {"start":946,"length":3} + >i++ + >:=> (line 26, col 68) to (line 26, col 71) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (953 to 976) SpanInfo: {"start":957,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (977 to 978) SpanInfo: {"start":957,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ([, [ + + ~~~~~~~~~~ => Pos: (979 to 988) SpanInfo: {"start":993,"length":25} + >primarySkillA = "primary" + >:=> (line 30, col 4) to (line 30, col 29) +-------------------------------- +30 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (989 to 1019) SpanInfo: {"start":993,"length":25} + >primarySkillA = "primary" + >:=> (line 30, col 4) to (line 30, col 29) +-------------------------------- +31 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1020 to 1053) SpanInfo: {"start":1024,"length":29} + >secondarySkillA = "secondary" + >:=> (line 31, col 4) to (line 31, col 33) +-------------------------------- +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1054 to 1073) SpanInfo: {"start":1024,"length":29} + >secondarySkillA = "secondary" + >:=> (line 31, col 4) to (line 31, col 33) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (1074 to 1089) SpanInfo: {"start":987,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 29, col 8) to (line 32, col 20) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1090 to 1096) SpanInfo: {"start":1091,"length":5} + >i = 0 + >:=> (line 32, col 37) to (line 32, col 42) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1097 to 1103) SpanInfo: {"start":1098,"length":5} + >i < 1 + >:=> (line 32, col 44) to (line 32, col 49) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1104 to 1111) SpanInfo: {"start":1105,"length":3} + >i++ + >:=> (line 32, col 51) to (line 32, col 54) +-------------------------------- +33 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1112 to 1143) SpanInfo: {"start":1116,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +34 >} + + ~~ => Pos: (1144 to 1145) SpanInfo: {"start":1116,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +35 >for ([, [ + + ~~~~~~~~~~ => Pos: (1146 to 1155) SpanInfo: {"start":1160,"length":25} + >primarySkillA = "primary" + >:=> (line 36, col 4) to (line 36, col 29) +-------------------------------- +36 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1156 to 1186) SpanInfo: {"start":1160,"length":25} + >primarySkillA = "primary" + >:=> (line 36, col 4) to (line 36, col 29) +-------------------------------- +37 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1187 to 1220) SpanInfo: {"start":1191,"length":29} + >secondarySkillA = "secondary" + >:=> (line 37, col 4) to (line 37, col 33) +-------------------------------- +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1221 to 1240) SpanInfo: {"start":1191,"length":29} + >secondarySkillA = "secondary" + >:=> (line 37, col 4) to (line 37, col 33) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1241 to 1260) SpanInfo: {"start":1154,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 35, col 8) to (line 38, col 20) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1261 to 1267) SpanInfo: {"start":1262,"length":5} + >i = 0 + >:=> (line 38, col 41) to (line 38, col 46) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1268 to 1274) SpanInfo: {"start":1269,"length":5} + >i < 1 + >:=> (line 38, col 48) to (line 38, col 53) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1275 to 1282) SpanInfo: {"start":1276,"length":3} + >i++ + >:=> (line 38, col 55) to (line 38, col 58) +-------------------------------- +39 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1283 to 1314) SpanInfo: {"start":1287,"length":26} + >console.log(primarySkillA) + >:=> (line 39, col 4) to (line 39, col 30) +-------------------------------- +40 >} + + ~~ => Pos: (1315 to 1316) SpanInfo: {"start":1287,"length":26} + >console.log(primarySkillA) + >:=> (line 39, col 4) to (line 39, col 30) +-------------------------------- +41 >for ([, [ + + ~~~~~~~~~~ => Pos: (1317 to 1326) SpanInfo: {"start":1331,"length":25} + >primarySkillA = "primary" + >:=> (line 42, col 4) to (line 42, col 29) +-------------------------------- +42 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1327 to 1357) SpanInfo: {"start":1331,"length":25} + >primarySkillA = "primary" + >:=> (line 42, col 4) to (line 42, col 29) +-------------------------------- +43 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1358 to 1391) SpanInfo: {"start":1362,"length":29} + >secondarySkillA = "secondary" + >:=> (line 43, col 4) to (line 43, col 33) +-------------------------------- +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1392 to 1411) SpanInfo: {"start":1362,"length":29} + >secondarySkillA = "secondary" + >:=> (line 43, col 4) to (line 43, col 33) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1412 to 1451) SpanInfo: {"start":1325,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 41, col 8) to (line 44, col 20) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1452 to 1458) SpanInfo: {"start":1453,"length":5} + >i = 0 + >:=> (line 44, col 61) to (line 44, col 66) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1459 to 1465) SpanInfo: {"start":1460,"length":5} + >i < 1 + >:=> (line 44, col 68) to (line 44, col 73) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1466 to 1473) SpanInfo: {"start":1467,"length":3} + >i++ + >:=> (line 44, col 75) to (line 44, col 78) +-------------------------------- +45 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1474 to 1505) SpanInfo: {"start":1478,"length":26} + >console.log(primarySkillA) + >:=> (line 45, col 4) to (line 45, col 30) +-------------------------------- +46 >} + + ~~ => Pos: (1506 to 1507) SpanInfo: {"start":1478,"length":26} + >console.log(primarySkillA) + >:=> (line 45, col 4) to (line 45, col 30) +-------------------------------- +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1508 to 1536) SpanInfo: {"start":1514,"length":12} + >numberB = -1 + >:=> (line 47, col 6) to (line 47, col 18) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1537 to 1543) SpanInfo: {"start":1538,"length":5} + >i = 0 + >:=> (line 47, col 30) to (line 47, col 35) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1544 to 1550) SpanInfo: {"start":1545,"length":5} + >i < 1 + >:=> (line 47, col 37) to (line 47, col 42) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1551 to 1558) SpanInfo: {"start":1552,"length":3} + >i++ + >:=> (line 47, col 44) to (line 47, col 47) +-------------------------------- +48 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1559 to 1584) SpanInfo: {"start":1563,"length":20} + >console.log(numberB) + >:=> (line 48, col 4) to (line 48, col 24) +-------------------------------- +49 >} + + ~~ => Pos: (1585 to 1586) SpanInfo: {"start":1563,"length":20} + >console.log(numberB) + >:=> (line 48, col 4) to (line 48, col 24) +-------------------------------- +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1587 to 1619) SpanInfo: {"start":1593,"length":12} + >numberB = -1 + >:=> (line 50, col 6) to (line 50, col 18) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1620 to 1626) SpanInfo: {"start":1621,"length":5} + >i = 0 + >:=> (line 50, col 34) to (line 50, col 39) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1627 to 1633) SpanInfo: {"start":1628,"length":5} + >i < 1 + >:=> (line 50, col 41) to (line 50, col 46) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1634 to 1641) SpanInfo: {"start":1635,"length":3} + >i++ + >:=> (line 50, col 48) to (line 50, col 51) +-------------------------------- +51 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1642 to 1667) SpanInfo: {"start":1646,"length":20} + >console.log(numberB) + >:=> (line 51, col 4) to (line 51, col 24) +-------------------------------- +52 >} + + ~~ => Pos: (1668 to 1669) SpanInfo: {"start":1646,"length":20} + >console.log(numberB) + >:=> (line 51, col 4) to (line 51, col 24) +-------------------------------- +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1670 to 1718) SpanInfo: {"start":1676,"length":12} + >numberB = -1 + >:=> (line 53, col 6) to (line 53, col 18) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1719 to 1725) SpanInfo: {"start":1720,"length":5} + >i = 0 + >:=> (line 53, col 50) to (line 53, col 55) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1726 to 1732) SpanInfo: {"start":1727,"length":5} + >i < 1 + >:=> (line 53, col 57) to (line 53, col 62) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1733 to 1740) SpanInfo: {"start":1734,"length":3} + >i++ + >:=> (line 53, col 64) to (line 53, col 67) +-------------------------------- +54 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1741 to 1766) SpanInfo: {"start":1745,"length":20} + >console.log(numberB) + >:=> (line 54, col 4) to (line 54, col 24) +-------------------------------- +55 >} + + ~~ => Pos: (1767 to 1768) SpanInfo: {"start":1745,"length":20} + >console.log(numberB) + >:=> (line 54, col 4) to (line 54, col 24) +-------------------------------- +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1769 to 1804) SpanInfo: {"start":1775,"length":14} + >nameB = "name" + >:=> (line 56, col 6) to (line 56, col 20) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1805 to 1811) SpanInfo: {"start":1806,"length":5} + >i = 0 + >:=> (line 56, col 37) to (line 56, col 42) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1812 to 1818) SpanInfo: {"start":1813,"length":5} + >i < 1 + >:=> (line 56, col 44) to (line 56, col 49) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1819 to 1826) SpanInfo: {"start":1820,"length":3} + >i++ + >:=> (line 56, col 51) to (line 56, col 54) +-------------------------------- +57 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1827 to 1850) SpanInfo: {"start":1831,"length":18} + >console.log(nameB) + >:=> (line 57, col 4) to (line 57, col 22) +-------------------------------- +58 >} + + ~~ => Pos: (1851 to 1852) SpanInfo: {"start":1831,"length":18} + >console.log(nameB) + >:=> (line 57, col 4) to (line 57, col 22) +-------------------------------- +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1853 to 1892) SpanInfo: {"start":1859,"length":14} + >nameB = "name" + >:=> (line 59, col 6) to (line 59, col 20) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1893 to 1899) SpanInfo: {"start":1894,"length":5} + >i = 0 + >:=> (line 59, col 41) to (line 59, col 46) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1900 to 1906) SpanInfo: {"start":1901,"length":5} + >i < 1 + >:=> (line 59, col 48) to (line 59, col 53) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1907 to 1914) SpanInfo: {"start":1908,"length":3} + >i++ + >:=> (line 59, col 55) to (line 59, col 58) +-------------------------------- +60 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1915 to 1938) SpanInfo: {"start":1919,"length":18} + >console.log(nameB) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + + ~~ => Pos: (1939 to 1940) SpanInfo: {"start":1919,"length":18} + >console.log(nameB) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1941 to 2000) SpanInfo: {"start":1947,"length":14} + >nameB = "name" + >:=> (line 62, col 6) to (line 62, col 20) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2001 to 2007) SpanInfo: {"start":2002,"length":5} + >i = 0 + >:=> (line 62, col 61) to (line 62, col 66) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2008 to 2014) SpanInfo: {"start":2009,"length":5} + >i < 1 + >:=> (line 62, col 68) to (line 62, col 73) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2015 to 2022) SpanInfo: {"start":2016,"length":3} + >i++ + >:=> (line 62, col 75) to (line 62, col 78) +-------------------------------- +63 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2023 to 2046) SpanInfo: {"start":2027,"length":18} + >console.log(nameB) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (2047 to 2048) SpanInfo: {"start":2027,"length":18} + >console.log(nameB) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2049 to 2068) SpanInfo: {"start":2055,"length":13} + >numberA2 = -1 + >:=> (line 65, col 6) to (line 65, col 19) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2069 to 2085) SpanInfo: {"start":2070,"length":15} + >nameA2 = "name" + >:=> (line 65, col 21) to (line 65, col 36) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2086 to 2114) SpanInfo: {"start":2087,"length":17} + >skillA2 = "skill" + >:=> (line 65, col 38) to (line 65, col 55) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2115 to 2121) SpanInfo: {"start":2116,"length":5} + >i = 0 + >:=> (line 65, col 67) to (line 65, col 72) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2122 to 2128) SpanInfo: {"start":2123,"length":5} + >i < 1 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2129 to 2136) SpanInfo: {"start":2130,"length":3} + >i++ + >:=> (line 65, col 81) to (line 65, col 84) +-------------------------------- +66 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2137 to 2161) SpanInfo: {"start":2141,"length":19} + >console.log(nameA2) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (2162 to 2163) SpanInfo: {"start":2141,"length":19} + >console.log(nameA2) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2164 to 2183) SpanInfo: {"start":2170,"length":13} + >numberA2 = -1 + >:=> (line 68, col 6) to (line 68, col 19) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2184 to 2200) SpanInfo: {"start":2185,"length":15} + >nameA2 = "name" + >:=> (line 68, col 21) to (line 68, col 36) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2201 to 2233) SpanInfo: {"start":2202,"length":17} + >skillA2 = "skill" + >:=> (line 68, col 38) to (line 68, col 55) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2234 to 2240) SpanInfo: {"start":2235,"length":5} + >i = 0 + >:=> (line 68, col 71) to (line 68, col 76) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2241 to 2247) SpanInfo: {"start":2242,"length":5} + >i < 1 + >:=> (line 68, col 78) to (line 68, col 83) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2248 to 2255) SpanInfo: {"start":2249,"length":3} + >i++ + >:=> (line 68, col 85) to (line 68, col 88) +-------------------------------- +69 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2256 to 2280) SpanInfo: {"start":2260,"length":19} + >console.log(nameA2) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2281 to 2282) SpanInfo: {"start":2260,"length":19} + >console.log(nameA2) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2283 to 2302) SpanInfo: {"start":2289,"length":13} + >numberA2 = -1 + >:=> (line 71, col 6) to (line 71, col 19) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2303 to 2319) SpanInfo: {"start":2304,"length":15} + >nameA2 = "name" + >:=> (line 71, col 21) to (line 71, col 36) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2320 to 2368) SpanInfo: {"start":2321,"length":17} + >skillA2 = "skill" + >:=> (line 71, col 38) to (line 71, col 55) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2369 to 2375) SpanInfo: {"start":2370,"length":5} + >i = 0 + >:=> (line 71, col 87) to (line 71, col 92) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2376 to 2382) SpanInfo: {"start":2377,"length":5} + >i < 1 + >:=> (line 71, col 94) to (line 71, col 99) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2383 to 2390) SpanInfo: {"start":2384,"length":3} + >i++ + >:=> (line 71, col 101) to (line 71, col 104) +-------------------------------- +72 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2391 to 2415) SpanInfo: {"start":2395,"length":19} + >console.log(nameA2) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2416 to 2417) SpanInfo: {"start":2395,"length":19} + >console.log(nameA2) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2418 to 2442) SpanInfo: {"start":2424,"length":17} + >nameMA = "noName" + >:=> (line 74, col 6) to (line 74, col 23) +-------------------------------- +75 > [ + + ~~~~~~~~~~ => Pos: (2443 to 2452) SpanInfo: {"start":2465,"length":25} + >primarySkillA = "primary" + >:=> (line 76, col 12) to (line 76, col 37) +-------------------------------- +76 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2491) SpanInfo: {"start":2465,"length":25} + >primarySkillA = "primary" + >:=> (line 76, col 12) to (line 76, col 37) +-------------------------------- +77 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2492 to 2533) SpanInfo: {"start":2504,"length":29} + >secondarySkillA = "secondary" + >:=> (line 77, col 12) to (line 77, col 41) +-------------------------------- +78 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2534 to 2562) SpanInfo: {"start":2504,"length":29} + >secondarySkillA = "secondary" + >:=> (line 77, col 12) to (line 77, col 41) +-------------------------------- +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2563 to 2582) SpanInfo: {"start":2451,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 75, col 8) to (line 78, col 28) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2583 to 2589) SpanInfo: {"start":2584,"length":5} + >i = 0 + >:=> (line 79, col 21) to (line 79, col 26) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2590 to 2596) SpanInfo: {"start":2591,"length":5} + >i < 1 + >:=> (line 79, col 28) to (line 79, col 33) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2597 to 2604) SpanInfo: {"start":2598,"length":3} + >i++ + >:=> (line 79, col 35) to (line 79, col 38) +-------------------------------- +80 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2605 to 2629) SpanInfo: {"start":2609,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +81 >} + + ~~ => Pos: (2630 to 2631) SpanInfo: {"start":2609,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +82 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2632 to 2656) SpanInfo: {"start":2638,"length":17} + >nameMA = "noName" + >:=> (line 82, col 6) to (line 82, col 23) +-------------------------------- +83 > [ + + ~~~~~~ => Pos: (2657 to 2662) SpanInfo: {"start":2671,"length":25} + >primarySkillA = "primary" + >:=> (line 84, col 8) to (line 84, col 33) +-------------------------------- +84 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2663 to 2697) SpanInfo: {"start":2671,"length":25} + >primarySkillA = "primary" + >:=> (line 84, col 8) to (line 84, col 33) +-------------------------------- +85 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2698 to 2735) SpanInfo: {"start":2706,"length":29} + >secondarySkillA = "secondary" + >:=> (line 85, col 8) to (line 85, col 37) +-------------------------------- +86 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2736 to 2760) SpanInfo: {"start":2706,"length":29} + >secondarySkillA = "secondary" + >:=> (line 85, col 8) to (line 85, col 37) +-------------------------------- +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2761 to 2780) SpanInfo: {"start":2661,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 83, col 4) to (line 86, col 24) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2781 to 2787) SpanInfo: {"start":2782,"length":5} + >i = 0 + >:=> (line 87, col 21) to (line 87, col 26) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2788 to 2794) SpanInfo: {"start":2789,"length":5} + >i < 1 + >:=> (line 87, col 28) to (line 87, col 33) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2795 to 2802) SpanInfo: {"start":2796,"length":3} + >i++ + >:=> (line 87, col 35) to (line 87, col 38) +-------------------------------- +88 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2803 to 2827) SpanInfo: {"start":2807,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +89 >} + + ~~ => Pos: (2828 to 2829) SpanInfo: {"start":2807,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +90 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2830 to 2854) SpanInfo: {"start":2836,"length":17} + >nameMA = "noName" + >:=> (line 90, col 6) to (line 90, col 23) +-------------------------------- +91 > [ + + ~~~~~~ => Pos: (2855 to 2860) SpanInfo: {"start":2869,"length":25} + >primarySkillA = "primary" + >:=> (line 92, col 8) to (line 92, col 33) +-------------------------------- +92 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2861 to 2895) SpanInfo: {"start":2869,"length":25} + >primarySkillA = "primary" + >:=> (line 92, col 8) to (line 92, col 33) +-------------------------------- +93 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2896 to 2933) SpanInfo: {"start":2904,"length":29} + >secondarySkillA = "secondary" + >:=> (line 93, col 8) to (line 93, col 37) +-------------------------------- +94 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2934 to 2958) SpanInfo: {"start":2904,"length":29} + >secondarySkillA = "secondary" + >:=> (line 93, col 8) to (line 93, col 37) +-------------------------------- +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2959 to 2998) SpanInfo: {"start":2859,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 91, col 4) to (line 94, col 24) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2999 to 3005) SpanInfo: {"start":3000,"length":5} + >i = 0 + >:=> (line 95, col 41) to (line 95, col 46) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3006 to 3012) SpanInfo: {"start":3007,"length":5} + >i < 1 + >:=> (line 95, col 48) to (line 95, col 53) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3013 to 3020) SpanInfo: {"start":3014,"length":3} + >i++ + >:=> (line 95, col 55) to (line 95, col 58) +-------------------------------- +96 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3021 to 3045) SpanInfo: {"start":3025,"length":19} + >console.log(nameMA) + >:=> (line 96, col 4) to (line 96, col 23) +-------------------------------- +97 >} + + ~~ => Pos: (3046 to 3047) SpanInfo: {"start":3025,"length":19} + >console.log(nameMA) + >:=> (line 96, col 4) to (line 96, col 23) +-------------------------------- +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3048 to 3067) SpanInfo: {"start":3054,"length":13} + >numberA3 = -1 + >:=> (line 98, col 6) to (line 98, col 19) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3068 to 3092) SpanInfo: {"start":3069,"length":13} + >...robotAInfo + >:=> (line 98, col 21) to (line 98, col 34) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3093 to 3099) SpanInfo: {"start":3094,"length":5} + >i = 0 + >:=> (line 98, col 46) to (line 98, col 51) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3100 to 3106) SpanInfo: {"start":3101,"length":5} + >i < 1 + >:=> (line 98, col 53) to (line 98, col 58) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3107 to 3114) SpanInfo: {"start":3108,"length":3} + >i++ + >:=> (line 98, col 60) to (line 98, col 63) +-------------------------------- +99 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3115 to 3141) SpanInfo: {"start":3119,"length":21} + >console.log(numberA3) + >:=> (line 99, col 4) to (line 99, col 25) +-------------------------------- +100>} + + ~~ => Pos: (3142 to 3143) SpanInfo: {"start":3119,"length":21} + >console.log(numberA3) + >:=> (line 99, col 4) to (line 99, col 25) +-------------------------------- +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3144 to 3163) SpanInfo: {"start":3150,"length":13} + >numberA3 = -1 + >:=> (line 101, col 6) to (line 101, col 19) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3164 to 3192) SpanInfo: {"start":3165,"length":13} + >...robotAInfo + >:=> (line 101, col 21) to (line 101, col 34) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3193 to 3199) SpanInfo: {"start":3194,"length":5} + >i = 0 + >:=> (line 101, col 50) to (line 101, col 55) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3200 to 3206) SpanInfo: {"start":3201,"length":5} + >i < 1 + >:=> (line 101, col 57) to (line 101, col 62) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3207 to 3214) SpanInfo: {"start":3208,"length":3} + >i++ + >:=> (line 101, col 64) to (line 101, col 67) +-------------------------------- +102> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3215 to 3241) SpanInfo: {"start":3219,"length":21} + >console.log(numberA3) + >:=> (line 102, col 4) to (line 102, col 25) +-------------------------------- +103>} + + ~~ => Pos: (3242 to 3243) SpanInfo: {"start":3219,"length":21} + >console.log(numberA3) + >:=> (line 102, col 4) to (line 102, col 25) +-------------------------------- +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3244 to 3263) SpanInfo: {"start":3250,"length":13} + >numberA3 = -1 + >:=> (line 104, col 6) to (line 104, col 19) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3264 to 3315) SpanInfo: {"start":3265,"length":13} + >...robotAInfo + >:=> (line 104, col 21) to (line 104, col 34) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3316 to 3322) SpanInfo: {"start":3317,"length":5} + >i = 0 + >:=> (line 104, col 73) to (line 104, col 78) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3323 to 3329) SpanInfo: {"start":3324,"length":5} + >i < 1 + >:=> (line 104, col 80) to (line 104, col 85) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3330 to 3337) SpanInfo: {"start":3331,"length":3} + >i++ + >:=> (line 104, col 87) to (line 104, col 90) +-------------------------------- +105> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3338 to 3364) SpanInfo: {"start":3342,"length":21} + >console.log(numberA3) + >:=> (line 105, col 4) to (line 105, col 25) +-------------------------------- +106>} + ~ => Pos: (3365 to 3365) SpanInfo: {"start":3342,"length":21} + >console.log(numberA3) + >:=> (line 105, col 4) to (line 105, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline new file mode 100644 index 00000000000..c318d875ddf --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline @@ -0,0 +1,1171 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 277) SpanInfo: {"start":223,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (278 to 375) SpanInfo: {"start":278,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (376 to 397) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (398 to 415) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (416 to 417) SpanInfo: {"start":416,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (418 to 444) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (445 to 467) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (468 to 469) SpanInfo: {"start":468,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (470 to 553) SpanInfo: undefined +-------------------------------- +24 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (554 to 622) SpanInfo: undefined +-------------------------------- +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (623 to 651) SpanInfo: {"start":630,"length":11} + >name: nameA + >:=> (line 25, col 7) to (line 25, col 18) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (652 to 658) SpanInfo: {"start":653,"length":5} + >i = 0 + >:=> (line 25, col 30) to (line 25, col 35) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (659 to 665) SpanInfo: {"start":660,"length":5} + >i < 1 + >:=> (line 25, col 37) to (line 25, col 42) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (666 to 673) SpanInfo: {"start":667,"length":3} + >i++ + >:=> (line 25, col 44) to (line 25, col 47) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (674 to 697) SpanInfo: {"start":678,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (698 to 699) SpanInfo: {"start":678,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (700 to 733) SpanInfo: {"start":707,"length":11} + >name: nameA + >:=> (line 28, col 7) to (line 28, col 18) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (734 to 740) SpanInfo: {"start":735,"length":5} + >i = 0 + >:=> (line 28, col 35) to (line 28, col 40) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (741 to 747) SpanInfo: {"start":742,"length":5} + >i < 1 + >:=> (line 28, col 42) to (line 28, col 47) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (748 to 755) SpanInfo: {"start":749,"length":3} + >i++ + >:=> (line 28, col 49) to (line 28, col 52) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 779) SpanInfo: {"start":760,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (780 to 781) SpanInfo: {"start":760,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (782 to 850) SpanInfo: {"start":789,"length":11} + >name: nameA + >:=> (line 31, col 7) to (line 31, col 18) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (851 to 857) SpanInfo: {"start":852,"length":5} + >i = 0 + >:=> (line 31, col 70) to (line 31, col 75) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (858 to 864) SpanInfo: {"start":859,"length":5} + >i < 1 + >:=> (line 31, col 77) to (line 31, col 82) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (865 to 872) SpanInfo: {"start":866,"length":3} + >i++ + >:=> (line 31, col 84) to (line 31, col 87) +-------------------------------- +32 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 896) SpanInfo: {"start":877,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +33 >} + + ~~ => Pos: (897 to 898) SpanInfo: {"start":877,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (899 to 912) SpanInfo: {"start":906,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 34, col 7) to (line 34, col 59) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (913 to 933) SpanInfo: {"start":916,"length":17} + >primary: primaryA + >:=> (line 34, col 17) to (line 34, col 34) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (934 to 957) SpanInfo: {"start":935,"length":21} + >secondary: secondaryA + >:=> (line 34, col 36) to (line 34, col 57) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (958 to 973) SpanInfo: {"start":906,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 34, col 7) to (line 34, col 59) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (974 to 980) SpanInfo: {"start":975,"length":5} + >i = 0 + >:=> (line 34, col 76) to (line 34, col 81) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (981 to 987) SpanInfo: {"start":982,"length":5} + >i < 1 + >:=> (line 34, col 83) to (line 34, col 88) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (988 to 995) SpanInfo: {"start":989,"length":3} + >i++ + >:=> (line 34, col 90) to (line 34, col 93) +-------------------------------- +35 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (996 to 1022) SpanInfo: {"start":1000,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +36 >} + + ~~ => Pos: (1023 to 1024) SpanInfo: {"start":1000,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1025 to 1038) SpanInfo: {"start":1032,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 37, col 7) to (line 37, col 59) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1039 to 1059) SpanInfo: {"start":1042,"length":17} + >primary: primaryA + >:=> (line 37, col 17) to (line 37, col 34) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1060 to 1083) SpanInfo: {"start":1061,"length":21} + >secondary: secondaryA + >:=> (line 37, col 36) to (line 37, col 57) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1084 to 1104) SpanInfo: {"start":1032,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 37, col 7) to (line 37, col 59) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1105 to 1111) SpanInfo: {"start":1106,"length":5} + >i = 0 + >:=> (line 37, col 81) to (line 37, col 86) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1112 to 1118) SpanInfo: {"start":1113,"length":5} + >i < 1 + >:=> (line 37, col 88) to (line 37, col 93) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1119 to 1126) SpanInfo: {"start":1120,"length":3} + >i++ + >:=> (line 37, col 95) to (line 37, col 98) +-------------------------------- +38 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1127 to 1153) SpanInfo: {"start":1131,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +39 >} + + ~~ => Pos: (1154 to 1155) SpanInfo: {"start":1131,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~ => Pos: (1156 to 1169) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1170 to 1190) SpanInfo: {"start":1173,"length":17} + >primary: primaryA + >:=> (line 40, col 17) to (line 40, col 34) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1191 to 1214) SpanInfo: {"start":1192,"length":21} + >secondary: secondaryA + >:=> (line 40, col 36) to (line 40, col 57) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1215 to 1219) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +-------------------------------- +41 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1220 to 1310) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +-------------------------------- +42 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1311 to 1320) SpanInfo: {"start":1315,"length":5} + >i = 0 + >:=> (line 42, col 4) to (line 42, col 9) +42 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1321 to 1327) SpanInfo: {"start":1322,"length":5} + >i < 1 + >:=> (line 42, col 11) to (line 42, col 16) +42 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1328 to 1335) SpanInfo: {"start":1329,"length":3} + >i++ + >:=> (line 42, col 18) to (line 42, col 21) +-------------------------------- +43 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1336 to 1362) SpanInfo: {"start":1340,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +44 >} + + ~~ => Pos: (1363 to 1364) SpanInfo: {"start":1340,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1365 to 1386) SpanInfo: {"start":1372,"length":4} + >name + >:=> (line 45, col 7) to (line 45, col 11) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1387 to 1393) SpanInfo: {"start":1388,"length":5} + >i = 0 + >:=> (line 45, col 23) to (line 45, col 28) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1394 to 1400) SpanInfo: {"start":1395,"length":5} + >i < 1 + >:=> (line 45, col 30) to (line 45, col 35) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1401 to 1408) SpanInfo: {"start":1402,"length":3} + >i++ + >:=> (line 45, col 37) to (line 45, col 40) +-------------------------------- +46 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1409 to 1432) SpanInfo: {"start":1413,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1433 to 1434) SpanInfo: {"start":1413,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1435 to 1461) SpanInfo: {"start":1442,"length":4} + >name + >:=> (line 48, col 7) to (line 48, col 11) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1462 to 1468) SpanInfo: {"start":1463,"length":5} + >i = 0 + >:=> (line 48, col 28) to (line 48, col 33) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1469 to 1475) SpanInfo: {"start":1470,"length":5} + >i < 1 + >:=> (line 48, col 35) to (line 48, col 40) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1476 to 1483) SpanInfo: {"start":1477,"length":3} + >i++ + >:=> (line 48, col 42) to (line 48, col 45) +-------------------------------- +49 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1484 to 1507) SpanInfo: {"start":1488,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1508 to 1509) SpanInfo: {"start":1488,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1510 to 1571) SpanInfo: {"start":1517,"length":4} + >name + >:=> (line 51, col 7) to (line 51, col 11) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1572 to 1578) SpanInfo: {"start":1573,"length":5} + >i = 0 + >:=> (line 51, col 63) to (line 51, col 68) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1579 to 1585) SpanInfo: {"start":1580,"length":5} + >i < 1 + >:=> (line 51, col 70) to (line 51, col 75) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1586 to 1593) SpanInfo: {"start":1587,"length":3} + >i++ + >:=> (line 51, col 77) to (line 51, col 80) +-------------------------------- +52 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1594 to 1617) SpanInfo: {"start":1598,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1618 to 1619) SpanInfo: {"start":1598,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1620 to 1633) SpanInfo: {"start":1627,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (1634 to 1644) SpanInfo: {"start":1637,"length":7} + >primary + >:=> (line 54, col 17) to (line 54, col 24) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (1645 to 1656) SpanInfo: {"start":1646,"length":9} + >secondary + >:=> (line 54, col 26) to (line 54, col 35) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1657 to 1672) SpanInfo: {"start":1627,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1673 to 1679) SpanInfo: {"start":1674,"length":5} + >i = 0 + >:=> (line 54, col 54) to (line 54, col 59) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1680 to 1686) SpanInfo: {"start":1681,"length":5} + >i < 1 + >:=> (line 54, col 61) to (line 54, col 66) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1687 to 1694) SpanInfo: {"start":1688,"length":3} + >i++ + >:=> (line 54, col 68) to (line 54, col 71) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1695 to 1721) SpanInfo: {"start":1699,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1722 to 1723) SpanInfo: {"start":1699,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1724 to 1737) SpanInfo: {"start":1731,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (1738 to 1748) SpanInfo: {"start":1741,"length":7} + >primary + >:=> (line 57, col 17) to (line 57, col 24) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (1749 to 1760) SpanInfo: {"start":1750,"length":9} + >secondary + >:=> (line 57, col 26) to (line 57, col 35) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1761 to 1781) SpanInfo: {"start":1731,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1782 to 1788) SpanInfo: {"start":1783,"length":5} + >i = 0 + >:=> (line 57, col 59) to (line 57, col 64) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1789 to 1795) SpanInfo: {"start":1790,"length":5} + >i < 1 + >:=> (line 57, col 66) to (line 57, col 71) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1796 to 1803) SpanInfo: {"start":1797,"length":3} + >i++ + >:=> (line 57, col 73) to (line 57, col 76) +-------------------------------- +58 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1804 to 1830) SpanInfo: {"start":1808,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +59 >} + + ~~ => Pos: (1831 to 1832) SpanInfo: {"start":1808,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~~~~ => Pos: (1833 to 1846) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~ => Pos: (1847 to 1857) SpanInfo: {"start":1850,"length":7} + >primary + >:=> (line 60, col 17) to (line 60, col 24) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (1858 to 1869) SpanInfo: {"start":1859,"length":9} + >secondary + >:=> (line 60, col 26) to (line 60, col 35) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~ => Pos: (1870 to 1874) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +-------------------------------- +61 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1875 to 1965) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +-------------------------------- +62 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1966 to 1975) SpanInfo: {"start":1970,"length":5} + >i = 0 + >:=> (line 62, col 4) to (line 62, col 9) +62 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1976 to 1982) SpanInfo: {"start":1977,"length":5} + >i < 1 + >:=> (line 62, col 11) to (line 62, col 16) +62 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1983 to 1990) SpanInfo: {"start":1984,"length":3} + >i++ + >:=> (line 62, col 18) to (line 62, col 21) +-------------------------------- +63 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1991 to 2017) SpanInfo: {"start":1995,"length":21} + >console.log(primaryA) + >:=> (line 63, col 4) to (line 63, col 25) +-------------------------------- +64 >} + + ~~ => Pos: (2018 to 2019) SpanInfo: {"start":1995,"length":21} + >console.log(primaryA) + >:=> (line 63, col 4) to (line 63, col 25) +-------------------------------- +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2020 to 2038) SpanInfo: {"start":2027,"length":11} + >name: nameA + >:=> (line 65, col 7) to (line 65, col 18) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2039 to 2063) SpanInfo: {"start":2040,"length":13} + >skill: skillA + >:=> (line 65, col 20) to (line 65, col 33) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2064 to 2070) SpanInfo: {"start":2065,"length":5} + >i = 0 + >:=> (line 65, col 45) to (line 65, col 50) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2071 to 2077) SpanInfo: {"start":2072,"length":5} + >i < 1 + >:=> (line 65, col 52) to (line 65, col 57) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2078 to 2085) SpanInfo: {"start":2079,"length":3} + >i++ + >:=> (line 65, col 59) to (line 65, col 62) +-------------------------------- +66 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2086 to 2109) SpanInfo: {"start":2090,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +67 >} + + ~~ => Pos: (2110 to 2111) SpanInfo: {"start":2090,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2112 to 2130) SpanInfo: {"start":2119,"length":11} + >name: nameA + >:=> (line 68, col 7) to (line 68, col 18) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2131 to 2160) SpanInfo: {"start":2132,"length":13} + >skill: skillA + >:=> (line 68, col 20) to (line 68, col 33) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2161 to 2167) SpanInfo: {"start":2162,"length":5} + >i = 0 + >:=> (line 68, col 50) to (line 68, col 55) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2168 to 2174) SpanInfo: {"start":2169,"length":5} + >i < 1 + >:=> (line 68, col 57) to (line 68, col 62) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2175 to 2182) SpanInfo: {"start":2176,"length":3} + >i++ + >:=> (line 68, col 64) to (line 68, col 67) +-------------------------------- +69 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2183 to 2206) SpanInfo: {"start":2187,"length":18} + >console.log(nameA) + >:=> (line 69, col 4) to (line 69, col 22) +-------------------------------- +70 >} + + ~~ => Pos: (2207 to 2208) SpanInfo: {"start":2187,"length":18} + >console.log(nameA) + >:=> (line 69, col 4) to (line 69, col 22) +-------------------------------- +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2209 to 2227) SpanInfo: {"start":2216,"length":11} + >name: nameA + >:=> (line 71, col 7) to (line 71, col 18) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2228 to 2292) SpanInfo: {"start":2229,"length":13} + >skill: skillA + >:=> (line 71, col 20) to (line 71, col 33) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2293 to 2299) SpanInfo: {"start":2294,"length":5} + >i = 0 + >:=> (line 71, col 85) to (line 71, col 90) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2300 to 2306) SpanInfo: {"start":2301,"length":5} + >i < 1 + >:=> (line 71, col 92) to (line 71, col 97) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2307 to 2314) SpanInfo: {"start":2308,"length":3} + >i++ + >:=> (line 71, col 99) to (line 71, col 102) +-------------------------------- +72 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2315 to 2338) SpanInfo: {"start":2319,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +73 >} + + ~~ => Pos: (2339 to 2340) SpanInfo: {"start":2319,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2341 to 2359) SpanInfo: {"start":2348,"length":11} + >name: nameA + >:=> (line 74, col 7) to (line 74, col 18) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2360 to 2367) SpanInfo: {"start":2361,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 74, col 20) to (line 74, col 72) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2368 to 2388) SpanInfo: {"start":2371,"length":17} + >primary: primaryA + >:=> (line 74, col 30) to (line 74, col 47) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2389 to 2412) SpanInfo: {"start":2390,"length":21} + >secondary: secondaryA + >:=> (line 74, col 49) to (line 74, col 70) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (2413 to 2428) SpanInfo: {"start":2361,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 74, col 20) to (line 74, col 72) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2429 to 2435) SpanInfo: {"start":2430,"length":5} + >i = 0 + >:=> (line 74, col 89) to (line 74, col 94) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2436 to 2442) SpanInfo: {"start":2437,"length":5} + >i < 1 + >:=> (line 74, col 96) to (line 74, col 101) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2443 to 2450) SpanInfo: {"start":2444,"length":3} + >i++ + >:=> (line 74, col 103) to (line 74, col 106) +-------------------------------- +75 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2451 to 2477) SpanInfo: {"start":2455,"length":21} + >console.log(primaryA) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +76 >} + + ~~ => Pos: (2478 to 2479) SpanInfo: {"start":2455,"length":21} + >console.log(primaryA) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2480 to 2498) SpanInfo: {"start":2487,"length":11} + >name: nameA + >:=> (line 77, col 7) to (line 77, col 18) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2499 to 2506) SpanInfo: {"start":2500,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 77, col 20) to (line 77, col 72) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2507 to 2527) SpanInfo: {"start":2510,"length":17} + >primary: primaryA + >:=> (line 77, col 30) to (line 77, col 47) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2528 to 2551) SpanInfo: {"start":2529,"length":21} + >secondary: secondaryA + >:=> (line 77, col 49) to (line 77, col 70) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2552 to 2572) SpanInfo: {"start":2500,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 77, col 20) to (line 77, col 72) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2573 to 2579) SpanInfo: {"start":2574,"length":5} + >i = 0 + >:=> (line 77, col 94) to (line 77, col 99) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2580 to 2586) SpanInfo: {"start":2581,"length":5} + >i < 1 + >:=> (line 77, col 101) to (line 77, col 106) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2587 to 2594) SpanInfo: {"start":2588,"length":3} + >i++ + >:=> (line 77, col 108) to (line 77, col 111) +-------------------------------- +78 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2595 to 2621) SpanInfo: {"start":2599,"length":21} + >console.log(primaryA) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +79 >} + + ~~ => Pos: (2622 to 2623) SpanInfo: {"start":2599,"length":21} + >console.log(primaryA) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2624 to 2642) SpanInfo: {"start":2631,"length":11} + >name: nameA + >:=> (line 80, col 7) to (line 80, col 18) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~ => Pos: (2643 to 2650) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2651 to 2671) SpanInfo: {"start":2654,"length":17} + >primary: primaryA + >:=> (line 80, col 30) to (line 80, col 47) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2672 to 2695) SpanInfo: {"start":2673,"length":21} + >secondary: secondaryA + >:=> (line 80, col 49) to (line 80, col 70) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (2696 to 2700) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +-------------------------------- +81 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2701 to 2791) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +-------------------------------- +82 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2792 to 2801) SpanInfo: {"start":2796,"length":5} + >i = 0 + >:=> (line 82, col 4) to (line 82, col 9) +82 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2802 to 2808) SpanInfo: {"start":2803,"length":5} + >i < 1 + >:=> (line 82, col 11) to (line 82, col 16) +82 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2809 to 2816) SpanInfo: {"start":2810,"length":3} + >i++ + >:=> (line 82, col 18) to (line 82, col 21) +-------------------------------- +83 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2817 to 2843) SpanInfo: {"start":2821,"length":21} + >console.log(primaryA) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +84 >} + + ~~ => Pos: (2844 to 2845) SpanInfo: {"start":2821,"length":21} + >console.log(primaryA) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (2846 to 2857) SpanInfo: {"start":2853,"length":4} + >name + >:=> (line 85, col 7) to (line 85, col 11) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2858 to 2874) SpanInfo: {"start":2859,"length":5} + >skill + >:=> (line 85, col 13) to (line 85, col 18) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2875 to 2881) SpanInfo: {"start":2876,"length":5} + >i = 0 + >:=> (line 85, col 30) to (line 85, col 35) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2882 to 2888) SpanInfo: {"start":2883,"length":5} + >i < 1 + >:=> (line 85, col 37) to (line 85, col 42) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2889 to 2896) SpanInfo: {"start":2890,"length":3} + >i++ + >:=> (line 85, col 44) to (line 85, col 47) +-------------------------------- +86 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2897 to 2920) SpanInfo: {"start":2901,"length":18} + >console.log(nameA) + >:=> (line 86, col 4) to (line 86, col 22) +-------------------------------- +87 >} + + ~~ => Pos: (2921 to 2922) SpanInfo: {"start":2901,"length":18} + >console.log(nameA) + >:=> (line 86, col 4) to (line 86, col 22) +-------------------------------- +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (2923 to 2934) SpanInfo: {"start":2930,"length":4} + >name + >:=> (line 88, col 7) to (line 88, col 11) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2935 to 2956) SpanInfo: {"start":2936,"length":5} + >skill + >:=> (line 88, col 13) to (line 88, col 18) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2957 to 2963) SpanInfo: {"start":2958,"length":5} + >i = 0 + >:=> (line 88, col 35) to (line 88, col 40) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2964 to 2970) SpanInfo: {"start":2965,"length":5} + >i < 1 + >:=> (line 88, col 42) to (line 88, col 47) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2971 to 2978) SpanInfo: {"start":2972,"length":3} + >i++ + >:=> (line 88, col 49) to (line 88, col 52) +-------------------------------- +89 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2979 to 3002) SpanInfo: {"start":2983,"length":18} + >console.log(nameA) + >:=> (line 89, col 4) to (line 89, col 22) +-------------------------------- +90 >} + + ~~ => Pos: (3003 to 3004) SpanInfo: {"start":2983,"length":18} + >console.log(nameA) + >:=> (line 89, col 4) to (line 89, col 22) +-------------------------------- +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3005 to 3016) SpanInfo: {"start":3012,"length":4} + >name + >:=> (line 91, col 7) to (line 91, col 11) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3017 to 3073) SpanInfo: {"start":3018,"length":5} + >skill + >:=> (line 91, col 13) to (line 91, col 18) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3074 to 3080) SpanInfo: {"start":3075,"length":5} + >i = 0 + >:=> (line 91, col 70) to (line 91, col 75) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3081 to 3087) SpanInfo: {"start":3082,"length":5} + >i < 1 + >:=> (line 91, col 77) to (line 91, col 82) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3088 to 3095) SpanInfo: {"start":3089,"length":3} + >i++ + >:=> (line 91, col 84) to (line 91, col 87) +-------------------------------- +92 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3096 to 3119) SpanInfo: {"start":3100,"length":18} + >console.log(nameA) + >:=> (line 92, col 4) to (line 92, col 22) +-------------------------------- +93 >} + + ~~ => Pos: (3120 to 3121) SpanInfo: {"start":3100,"length":18} + >console.log(nameA) + >:=> (line 92, col 4) to (line 92, col 22) +-------------------------------- +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3122 to 3133) SpanInfo: {"start":3129,"length":4} + >name + >:=> (line 94, col 7) to (line 94, col 11) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3134 to 3141) SpanInfo: {"start":3135,"length":30} + >skills: { primary, secondary } + >:=> (line 94, col 13) to (line 94, col 43) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (3142 to 3152) SpanInfo: {"start":3145,"length":7} + >primary + >:=> (line 94, col 23) to (line 94, col 30) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3153 to 3164) SpanInfo: {"start":3154,"length":9} + >secondary + >:=> (line 94, col 32) to (line 94, col 41) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (3165 to 3180) SpanInfo: {"start":3135,"length":30} + >skills: { primary, secondary } + >:=> (line 94, col 13) to (line 94, col 43) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3181 to 3187) SpanInfo: {"start":3182,"length":5} + >i = 0 + >:=> (line 94, col 60) to (line 94, col 65) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3188 to 3194) SpanInfo: {"start":3189,"length":5} + >i < 1 + >:=> (line 94, col 67) to (line 94, col 72) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3195 to 3202) SpanInfo: {"start":3196,"length":3} + >i++ + >:=> (line 94, col 74) to (line 94, col 77) +-------------------------------- +95 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3203 to 3229) SpanInfo: {"start":3207,"length":21} + >console.log(primaryA) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (3230 to 3231) SpanInfo: {"start":3207,"length":21} + >console.log(primaryA) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3232 to 3243) SpanInfo: {"start":3239,"length":4} + >name + >:=> (line 97, col 7) to (line 97, col 11) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3244 to 3251) SpanInfo: {"start":3245,"length":30} + >skills: { primary, secondary } + >:=> (line 97, col 13) to (line 97, col 43) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (3252 to 3262) SpanInfo: {"start":3255,"length":7} + >primary + >:=> (line 97, col 23) to (line 97, col 30) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3263 to 3274) SpanInfo: {"start":3264,"length":9} + >secondary + >:=> (line 97, col 32) to (line 97, col 41) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (3275 to 3295) SpanInfo: {"start":3245,"length":30} + >skills: { primary, secondary } + >:=> (line 97, col 13) to (line 97, col 43) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3296 to 3302) SpanInfo: {"start":3297,"length":5} + >i = 0 + >:=> (line 97, col 65) to (line 97, col 70) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3303 to 3309) SpanInfo: {"start":3304,"length":5} + >i < 1 + >:=> (line 97, col 72) to (line 97, col 77) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3310 to 3317) SpanInfo: {"start":3311,"length":3} + >i++ + >:=> (line 97, col 79) to (line 97, col 82) +-------------------------------- +98 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3318 to 3344) SpanInfo: {"start":3322,"length":21} + >console.log(primaryA) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (3345 to 3346) SpanInfo: {"start":3322,"length":21} + >console.log(primaryA) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (3347 to 3358) SpanInfo: {"start":3354,"length":4} + >name + >:=> (line 100, col 7) to (line 100, col 11) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~ => Pos: (3359 to 3366) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~ => Pos: (3367 to 3377) SpanInfo: {"start":3370,"length":7} + >primary + >:=> (line 100, col 23) to (line 100, col 30) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (3378 to 3389) SpanInfo: {"start":3379,"length":9} + >secondary + >:=> (line 100, col 32) to (line 100, col 41) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~=> Pos: (3390 to 3394) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +-------------------------------- +101> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3395 to 3485) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +-------------------------------- +102> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (3486 to 3495) SpanInfo: {"start":3490,"length":5} + >i = 0 + >:=> (line 102, col 4) to (line 102, col 9) +102> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3496 to 3502) SpanInfo: {"start":3497,"length":5} + >i < 1 + >:=> (line 102, col 11) to (line 102, col 16) +102> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3503 to 3510) SpanInfo: {"start":3504,"length":3} + >i++ + >:=> (line 102, col 18) to (line 102, col 21) +-------------------------------- +103> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3511 to 3537) SpanInfo: {"start":3515,"length":21} + >console.log(primaryA) + >:=> (line 103, col 4) to (line 103, col 25) +-------------------------------- +104>} + ~ => Pos: (3538 to 3538) SpanInfo: {"start":3515,"length":21} + >console.log(primaryA) + >:=> (line 103, col 4) to (line 103, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..daf4f8a0d84 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,1483 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 279) SpanInfo: {"start":225,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (280 to 377) SpanInfo: {"start":280,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 399) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (400 to 417) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (420 to 446) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (447 to 469) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (470 to 471) SpanInfo: {"start":470,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (472 to 555) SpanInfo: undefined +-------------------------------- +24 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (556 to 624) SpanInfo: undefined +-------------------------------- +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (625 to 663) SpanInfo: {"start":631,"length":22} + >name: nameA = "noName" + >:=> (line 25, col 6) to (line 25, col 28) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (664 to 670) SpanInfo: {"start":665,"length":5} + >i = 0 + >:=> (line 25, col 40) to (line 25, col 45) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (671 to 677) SpanInfo: {"start":672,"length":5} + >i < 1 + >:=> (line 25, col 47) to (line 25, col 52) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (678 to 685) SpanInfo: {"start":679,"length":3} + >i++ + >:=> (line 25, col 54) to (line 25, col 57) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (686 to 709) SpanInfo: {"start":690,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (710 to 711) SpanInfo: {"start":690,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 755) SpanInfo: {"start":718,"length":22} + >name: nameA = "noName" + >:=> (line 28, col 6) to (line 28, col 28) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (756 to 762) SpanInfo: {"start":757,"length":5} + >i = 0 + >:=> (line 28, col 45) to (line 28, col 50) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (763 to 769) SpanInfo: {"start":764,"length":5} + >i < 1 + >:=> (line 28, col 52) to (line 28, col 57) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (770 to 777) SpanInfo: {"start":771,"length":3} + >i++ + >:=> (line 28, col 59) to (line 28, col 62) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (778 to 801) SpanInfo: {"start":782,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (802 to 803) SpanInfo: {"start":782,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (804 to 882) SpanInfo: {"start":810,"length":22} + >name: nameA = "noName" + >:=> (line 31, col 6) to (line 31, col 28) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (883 to 889) SpanInfo: {"start":884,"length":5} + >i = 0 + >:=> (line 31, col 80) to (line 31, col 85) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (890 to 896) SpanInfo: {"start":891,"length":5} + >i < 1 + >:=> (line 31, col 87) to (line 31, col 92) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (897 to 904) SpanInfo: {"start":898,"length":3} + >i++ + >:=> (line 31, col 94) to (line 31, col 97) +-------------------------------- +32 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (905 to 928) SpanInfo: {"start":909,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +33 >} + + ~~ => Pos: (929 to 930) SpanInfo: {"start":909,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +34 >for ({ + + ~~~~~~~ => Pos: (931 to 937) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +-------------------------------- +35 > skills: { + + ~~~~~~~~~~~ => Pos: (938 to 948) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +35 > skills: { + + ~~~ => Pos: (949 to 951) SpanInfo: {"start":960,"length":29} + >primary: primaryA = "primary" + >:=> (line 36, col 8) to (line 36, col 37) +-------------------------------- +36 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (952 to 990) SpanInfo: {"start":960,"length":29} + >primary: primaryA = "primary" + >:=> (line 36, col 8) to (line 36, col 37) +-------------------------------- +37 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (991 to 1034) SpanInfo: {"start":999,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 8) to (line 37, col 43) +-------------------------------- +38 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1035 to 1081) SpanInfo: {"start":999,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 8) to (line 37, col 43) +-------------------------------- +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1082 to 1096) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1097 to 1103) SpanInfo: {"start":1098,"length":5} + >i = 0 + >:=> (line 39, col 16) to (line 39, col 21) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1104 to 1110) SpanInfo: {"start":1105,"length":5} + >i < 1 + >:=> (line 39, col 23) to (line 39, col 28) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1111 to 1118) SpanInfo: {"start":1112,"length":3} + >i++ + >:=> (line 39, col 30) to (line 39, col 33) +-------------------------------- +40 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1119 to 1145) SpanInfo: {"start":1123,"length":21} + >console.log(primaryA) + >:=> (line 40, col 4) to (line 40, col 25) +-------------------------------- +41 >} + + ~~ => Pos: (1146 to 1147) SpanInfo: {"start":1123,"length":21} + >console.log(primaryA) + >:=> (line 40, col 4) to (line 40, col 25) +-------------------------------- +42 >for ({ + + ~~~~~~~ => Pos: (1148 to 1154) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +-------------------------------- +43 > skills: { + + ~~~~~~~~~~~ => Pos: (1155 to 1165) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +43 > skills: { + + ~~~ => Pos: (1166 to 1168) SpanInfo: {"start":1177,"length":29} + >primary: primaryA = "primary" + >:=> (line 44, col 8) to (line 44, col 37) +-------------------------------- +44 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1169 to 1207) SpanInfo: {"start":1177,"length":29} + >primary: primaryA = "primary" + >:=> (line 44, col 8) to (line 44, col 37) +-------------------------------- +45 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1208 to 1251) SpanInfo: {"start":1216,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 45, col 8) to (line 45, col 43) +-------------------------------- +46 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1252 to 1298) SpanInfo: {"start":1216,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 45, col 8) to (line 45, col 43) +-------------------------------- +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1299 to 1318) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1319 to 1325) SpanInfo: {"start":1320,"length":5} + >i = 0 + >:=> (line 47, col 21) to (line 47, col 26) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1326 to 1332) SpanInfo: {"start":1327,"length":5} + >i < 1 + >:=> (line 47, col 28) to (line 47, col 33) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1333 to 1340) SpanInfo: {"start":1334,"length":3} + >i++ + >:=> (line 47, col 35) to (line 47, col 38) +-------------------------------- +48 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1341 to 1367) SpanInfo: {"start":1345,"length":21} + >console.log(primaryA) + >:=> (line 48, col 4) to (line 48, col 25) +-------------------------------- +49 >} + + ~~ => Pos: (1368 to 1369) SpanInfo: {"start":1345,"length":21} + >console.log(primaryA) + >:=> (line 48, col 4) to (line 48, col 25) +-------------------------------- +50 >for ({ + + ~~~~~~~ => Pos: (1370 to 1376) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +-------------------------------- +51 > skills: { + + ~~~~~~~~~~~ => Pos: (1377 to 1387) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +51 > skills: { + + ~~~ => Pos: (1388 to 1390) SpanInfo: {"start":1399,"length":29} + >primary: primaryA = "primary" + >:=> (line 52, col 8) to (line 52, col 37) +-------------------------------- +52 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1391 to 1429) SpanInfo: {"start":1399,"length":29} + >primary: primaryA = "primary" + >:=> (line 52, col 8) to (line 52, col 37) +-------------------------------- +53 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1430 to 1473) SpanInfo: {"start":1438,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 53, col 8) to (line 53, col 43) +-------------------------------- +54 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1474 to 1520) SpanInfo: {"start":1438,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 53, col 8) to (line 53, col 43) +-------------------------------- +55 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1521 to 1611) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +-------------------------------- +56 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1612 to 1621) SpanInfo: {"start":1616,"length":5} + >i = 0 + >:=> (line 56, col 4) to (line 56, col 9) +56 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1622 to 1628) SpanInfo: {"start":1623,"length":5} + >i < 1 + >:=> (line 56, col 11) to (line 56, col 16) +56 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1629 to 1636) SpanInfo: {"start":1630,"length":3} + >i++ + >:=> (line 56, col 18) to (line 56, col 21) +-------------------------------- +57 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1637 to 1663) SpanInfo: {"start":1641,"length":21} + >console.log(primaryA) + >:=> (line 57, col 4) to (line 57, col 25) +-------------------------------- +58 >} + + ~~ => Pos: (1664 to 1665) SpanInfo: {"start":1641,"length":21} + >console.log(primaryA) + >:=> (line 57, col 4) to (line 57, col 25) +-------------------------------- +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1666 to 1698) SpanInfo: {"start":1673,"length":15} + >name = "noName" + >:=> (line 59, col 7) to (line 59, col 22) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1699 to 1705) SpanInfo: {"start":1700,"length":5} + >i = 0 + >:=> (line 59, col 34) to (line 59, col 39) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1706 to 1712) SpanInfo: {"start":1707,"length":5} + >i < 1 + >:=> (line 59, col 41) to (line 59, col 46) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1713 to 1720) SpanInfo: {"start":1714,"length":3} + >i++ + >:=> (line 59, col 48) to (line 59, col 51) +-------------------------------- +60 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1721 to 1744) SpanInfo: {"start":1725,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + + ~~ => Pos: (1745 to 1746) SpanInfo: {"start":1725,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1747 to 1784) SpanInfo: {"start":1754,"length":15} + >name = "noName" + >:=> (line 62, col 7) to (line 62, col 22) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1785 to 1791) SpanInfo: {"start":1786,"length":5} + >i = 0 + >:=> (line 62, col 39) to (line 62, col 44) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1792 to 1798) SpanInfo: {"start":1793,"length":5} + >i < 1 + >:=> (line 62, col 46) to (line 62, col 51) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1799 to 1806) SpanInfo: {"start":1800,"length":3} + >i++ + >:=> (line 62, col 53) to (line 62, col 56) +-------------------------------- +63 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1807 to 1830) SpanInfo: {"start":1811,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (1831 to 1832) SpanInfo: {"start":1811,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1833 to 1905) SpanInfo: {"start":1840,"length":15} + >name = "noName" + >:=> (line 65, col 7) to (line 65, col 22) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1906 to 1912) SpanInfo: {"start":1907,"length":5} + >i = 0 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1913 to 1919) SpanInfo: {"start":1914,"length":5} + >i < 1 + >:=> (line 65, col 81) to (line 65, col 86) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1920 to 1927) SpanInfo: {"start":1921,"length":3} + >i++ + >:=> (line 65, col 88) to (line 65, col 91) +-------------------------------- +66 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1928 to 1951) SpanInfo: {"start":1932,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +67 >} + + ~~ => Pos: (1952 to 1953) SpanInfo: {"start":1932,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +68 >for ({ + + ~~~~~~~ => Pos: (1954 to 1960) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +-------------------------------- +69 > skills: { + + ~~~~~~~~~~~ => Pos: (1961 to 1971) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +69 > skills: { + + ~~~ => Pos: (1972 to 1974) SpanInfo: {"start":1983,"length":19} + >primary = "primary" + >:=> (line 70, col 8) to (line 70, col 27) +-------------------------------- +70 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1975 to 2003) SpanInfo: {"start":1983,"length":19} + >primary = "primary" + >:=> (line 70, col 8) to (line 70, col 27) +-------------------------------- +71 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2004 to 2035) SpanInfo: {"start":2012,"length":23} + >secondary = "secondary" + >:=> (line 71, col 8) to (line 71, col 31) +-------------------------------- +72 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2036 to 2082) SpanInfo: {"start":2012,"length":23} + >secondary = "secondary" + >:=> (line 71, col 8) to (line 71, col 31) +-------------------------------- +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2083 to 2097) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2098 to 2104) SpanInfo: {"start":2099,"length":5} + >i = 0 + >:=> (line 73, col 16) to (line 73, col 21) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2105 to 2111) SpanInfo: {"start":2106,"length":5} + >i < 1 + >:=> (line 73, col 23) to (line 73, col 28) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2112 to 2119) SpanInfo: {"start":2113,"length":3} + >i++ + >:=> (line 73, col 30) to (line 73, col 33) +-------------------------------- +74 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2120 to 2146) SpanInfo: {"start":2124,"length":21} + >console.log(primaryA) + >:=> (line 74, col 4) to (line 74, col 25) +-------------------------------- +75 >} + + ~~ => Pos: (2147 to 2148) SpanInfo: {"start":2124,"length":21} + >console.log(primaryA) + >:=> (line 74, col 4) to (line 74, col 25) +-------------------------------- +76 >for ({ + + ~~~~~~~ => Pos: (2149 to 2155) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +-------------------------------- +77 > skills: { + + ~~~~~~~~~~~ => Pos: (2156 to 2166) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +77 > skills: { + + ~~~ => Pos: (2167 to 2169) SpanInfo: {"start":2178,"length":19} + >primary = "primary" + >:=> (line 78, col 8) to (line 78, col 27) +-------------------------------- +78 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2170 to 2198) SpanInfo: {"start":2178,"length":19} + >primary = "primary" + >:=> (line 78, col 8) to (line 78, col 27) +-------------------------------- +79 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2199 to 2230) SpanInfo: {"start":2207,"length":23} + >secondary = "secondary" + >:=> (line 79, col 8) to (line 79, col 31) +-------------------------------- +80 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2231 to 2277) SpanInfo: {"start":2207,"length":23} + >secondary = "secondary" + >:=> (line 79, col 8) to (line 79, col 31) +-------------------------------- +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2278 to 2297) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2298 to 2304) SpanInfo: {"start":2299,"length":5} + >i = 0 + >:=> (line 81, col 21) to (line 81, col 26) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2305 to 2311) SpanInfo: {"start":2306,"length":5} + >i < 1 + >:=> (line 81, col 28) to (line 81, col 33) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2312 to 2319) SpanInfo: {"start":2313,"length":3} + >i++ + >:=> (line 81, col 35) to (line 81, col 38) +-------------------------------- +82 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2320 to 2346) SpanInfo: {"start":2324,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2347 to 2348) SpanInfo: {"start":2324,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for ({ + + ~~~~~~~ => Pos: (2349 to 2355) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +-------------------------------- +85 > skills: { + + ~~~~~~~~~~~ => Pos: (2356 to 2366) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +85 > skills: { + + ~~~ => Pos: (2367 to 2369) SpanInfo: {"start":2378,"length":19} + >primary = "primary" + >:=> (line 86, col 8) to (line 86, col 27) +-------------------------------- +86 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2370 to 2398) SpanInfo: {"start":2378,"length":19} + >primary = "primary" + >:=> (line 86, col 8) to (line 86, col 27) +-------------------------------- +87 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2399 to 2430) SpanInfo: {"start":2407,"length":23} + >secondary = "secondary" + >:=> (line 87, col 8) to (line 87, col 31) +-------------------------------- +88 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2431 to 2477) SpanInfo: {"start":2407,"length":23} + >secondary = "secondary" + >:=> (line 87, col 8) to (line 87, col 31) +-------------------------------- +89 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2478 to 2568) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +-------------------------------- +90 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2569 to 2578) SpanInfo: {"start":2573,"length":5} + >i = 0 + >:=> (line 90, col 4) to (line 90, col 9) +90 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2579 to 2585) SpanInfo: {"start":2580,"length":5} + >i < 1 + >:=> (line 90, col 11) to (line 90, col 16) +90 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2586 to 2593) SpanInfo: {"start":2587,"length":3} + >i++ + >:=> (line 90, col 18) to (line 90, col 21) +-------------------------------- +91 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2594 to 2620) SpanInfo: {"start":2598,"length":21} + >console.log(primaryA) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +92 >} + + ~~ => Pos: (2621 to 2622) SpanInfo: {"start":2598,"length":21} + >console.log(primaryA) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2623 to 2651) SpanInfo: {"start":2629,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 6) to (line 93, col 28) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2652 to 2686) SpanInfo: {"start":2653,"length":23} + >skill: skillA = "skill" + >:=> (line 93, col 30) to (line 93, col 53) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2687 to 2693) SpanInfo: {"start":2688,"length":5} + >i = 0 + >:=> (line 93, col 65) to (line 93, col 70) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2694 to 2700) SpanInfo: {"start":2695,"length":5} + >i < 1 + >:=> (line 93, col 72) to (line 93, col 77) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2701 to 2708) SpanInfo: {"start":2702,"length":3} + >i++ + >:=> (line 93, col 79) to (line 93, col 82) +-------------------------------- +94 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2709 to 2732) SpanInfo: {"start":2713,"length":18} + >console.log(nameA) + >:=> (line 94, col 4) to (line 94, col 22) +-------------------------------- +95 >} + + ~~ => Pos: (2733 to 2734) SpanInfo: {"start":2713,"length":18} + >console.log(nameA) + >:=> (line 94, col 4) to (line 94, col 22) +-------------------------------- +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2735 to 2763) SpanInfo: {"start":2741,"length":22} + >name: nameA = "noName" + >:=> (line 96, col 6) to (line 96, col 28) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2764 to 2803) SpanInfo: {"start":2765,"length":23} + >skill: skillA = "skill" + >:=> (line 96, col 30) to (line 96, col 53) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2804 to 2810) SpanInfo: {"start":2805,"length":5} + >i = 0 + >:=> (line 96, col 70) to (line 96, col 75) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2811 to 2817) SpanInfo: {"start":2812,"length":5} + >i < 1 + >:=> (line 96, col 77) to (line 96, col 82) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2818 to 2825) SpanInfo: {"start":2819,"length":3} + >i++ + >:=> (line 96, col 84) to (line 96, col 87) +-------------------------------- +97 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2826 to 2849) SpanInfo: {"start":2830,"length":18} + >console.log(nameA) + >:=> (line 97, col 4) to (line 97, col 22) +-------------------------------- +98 >} + + ~~ => Pos: (2850 to 2851) SpanInfo: {"start":2830,"length":18} + >console.log(nameA) + >:=> (line 97, col 4) to (line 97, col 22) +-------------------------------- +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2852 to 2880) SpanInfo: {"start":2858,"length":22} + >name: nameA = "noName" + >:=> (line 99, col 6) to (line 99, col 28) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2881 to 2955) SpanInfo: {"start":2882,"length":23} + >skill: skillA = "skill" + >:=> (line 99, col 30) to (line 99, col 53) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2956 to 2962) SpanInfo: {"start":2957,"length":5} + >i = 0 + >:=> (line 99, col 105) to (line 99, col 110) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2963 to 2969) SpanInfo: {"start":2964,"length":5} + >i < 1 + >:=> (line 99, col 112) to (line 99, col 117) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2970 to 2977) SpanInfo: {"start":2971,"length":3} + >i++ + >:=> (line 99, col 119) to (line 99, col 122) +-------------------------------- +100> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2978 to 3001) SpanInfo: {"start":2982,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +101>} + + ~~ => Pos: (3002 to 3003) SpanInfo: {"start":2982,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +102>for ({ + + ~~~~~~~ => Pos: (3004 to 3010) SpanInfo: {"start":3015,"length":22} + >name: nameA = "noName" + >:=> (line 103, col 4) to (line 103, col 26) +-------------------------------- +103> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3011 to 3038) SpanInfo: {"start":3015,"length":22} + >name: nameA = "noName" + >:=> (line 103, col 4) to (line 103, col 26) +-------------------------------- +104> skills: { + + ~~~~~~~~~~~ => Pos: (3039 to 3049) SpanInfo: {"start":3043,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 104, col 4) to (line 107, col 46) +104> skills: { + + ~~~ => Pos: (3050 to 3052) SpanInfo: {"start":3061,"length":29} + >primary: primaryA = "primary" + >:=> (line 105, col 8) to (line 105, col 37) +-------------------------------- +105> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3053 to 3091) SpanInfo: {"start":3061,"length":29} + >primary: primaryA = "primary" + >:=> (line 105, col 8) to (line 105, col 37) +-------------------------------- +106> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3092 to 3135) SpanInfo: {"start":3100,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 106, col 8) to (line 106, col 43) +-------------------------------- +107> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3136 to 3182) SpanInfo: {"start":3100,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 106, col 8) to (line 106, col 43) +-------------------------------- +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (3183 to 3197) SpanInfo: {"start":3043,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 104, col 4) to (line 107, col 46) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3198 to 3204) SpanInfo: {"start":3199,"length":5} + >i = 0 + >:=> (line 108, col 16) to (line 108, col 21) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3205 to 3211) SpanInfo: {"start":3206,"length":5} + >i < 1 + >:=> (line 108, col 23) to (line 108, col 28) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3212 to 3219) SpanInfo: {"start":3213,"length":3} + >i++ + >:=> (line 108, col 30) to (line 108, col 33) +-------------------------------- +109> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3220 to 3246) SpanInfo: {"start":3224,"length":21} + >console.log(primaryA) + >:=> (line 109, col 4) to (line 109, col 25) +-------------------------------- +110>} + + ~~ => Pos: (3247 to 3248) SpanInfo: {"start":3224,"length":21} + >console.log(primaryA) + >:=> (line 109, col 4) to (line 109, col 25) +-------------------------------- +111>for ({ + + ~~~~~~~ => Pos: (3249 to 3255) SpanInfo: {"start":3260,"length":22} + >name: nameA = "noName" + >:=> (line 112, col 4) to (line 112, col 26) +-------------------------------- +112> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3256 to 3283) SpanInfo: {"start":3260,"length":22} + >name: nameA = "noName" + >:=> (line 112, col 4) to (line 112, col 26) +-------------------------------- +113> skills: { + + ~~~~~~~~~~~ => Pos: (3284 to 3294) SpanInfo: {"start":3288,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 113, col 4) to (line 116, col 46) +113> skills: { + + ~~~ => Pos: (3295 to 3297) SpanInfo: {"start":3306,"length":29} + >primary: primaryA = "primary" + >:=> (line 114, col 8) to (line 114, col 37) +-------------------------------- +114> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3298 to 3336) SpanInfo: {"start":3306,"length":29} + >primary: primaryA = "primary" + >:=> (line 114, col 8) to (line 114, col 37) +-------------------------------- +115> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3337 to 3380) SpanInfo: {"start":3345,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 115, col 8) to (line 115, col 43) +-------------------------------- +116> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3381 to 3427) SpanInfo: {"start":3345,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 115, col 8) to (line 115, col 43) +-------------------------------- +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3428 to 3447) SpanInfo: {"start":3288,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 113, col 4) to (line 116, col 46) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3448 to 3454) SpanInfo: {"start":3449,"length":5} + >i = 0 + >:=> (line 117, col 21) to (line 117, col 26) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3455 to 3461) SpanInfo: {"start":3456,"length":5} + >i < 1 + >:=> (line 117, col 28) to (line 117, col 33) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3462 to 3469) SpanInfo: {"start":3463,"length":3} + >i++ + >:=> (line 117, col 35) to (line 117, col 38) +-------------------------------- +118> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3470 to 3496) SpanInfo: {"start":3474,"length":21} + >console.log(primaryA) + >:=> (line 118, col 4) to (line 118, col 25) +-------------------------------- +119>} + + ~~ => Pos: (3497 to 3498) SpanInfo: {"start":3474,"length":21} + >console.log(primaryA) + >:=> (line 118, col 4) to (line 118, col 25) +-------------------------------- +120>for ({ + + ~~~~~~~ => Pos: (3499 to 3505) SpanInfo: {"start":3510,"length":22} + >name: nameA = "noName" + >:=> (line 121, col 4) to (line 121, col 26) +-------------------------------- +121> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3506 to 3533) SpanInfo: {"start":3510,"length":22} + >name: nameA = "noName" + >:=> (line 121, col 4) to (line 121, col 26) +-------------------------------- +122> skills: { + + ~~~~~~~~~~~ => Pos: (3534 to 3544) SpanInfo: {"start":3538,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 122, col 4) to (line 125, col 46) +122> skills: { + + ~~~ => Pos: (3545 to 3547) SpanInfo: {"start":3556,"length":29} + >primary: primaryA = "primary" + >:=> (line 123, col 8) to (line 123, col 37) +-------------------------------- +123> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3548 to 3586) SpanInfo: {"start":3556,"length":29} + >primary: primaryA = "primary" + >:=> (line 123, col 8) to (line 123, col 37) +-------------------------------- +124> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3587 to 3630) SpanInfo: {"start":3595,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 124, col 8) to (line 124, col 43) +-------------------------------- +125> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3631 to 3677) SpanInfo: {"start":3595,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 124, col 8) to (line 124, col 43) +-------------------------------- +126>} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3678 to 3768) SpanInfo: {"start":3538,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 122, col 4) to (line 125, col 46) +-------------------------------- +127> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (3769 to 3778) SpanInfo: {"start":3773,"length":5} + >i = 0 + >:=> (line 127, col 4) to (line 127, col 9) +127> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3779 to 3785) SpanInfo: {"start":3780,"length":5} + >i < 1 + >:=> (line 127, col 11) to (line 127, col 16) +127> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3786 to 3793) SpanInfo: {"start":3787,"length":3} + >i++ + >:=> (line 127, col 18) to (line 127, col 21) +-------------------------------- +128> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3794 to 3820) SpanInfo: {"start":3798,"length":21} + >console.log(primaryA) + >:=> (line 128, col 4) to (line 128, col 25) +-------------------------------- +129>} + + ~~ => Pos: (3821 to 3822) SpanInfo: {"start":3798,"length":21} + >console.log(primaryA) + >:=> (line 128, col 4) to (line 128, col 25) +-------------------------------- +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3823 to 3845) SpanInfo: {"start":3830,"length":15} + >name = "noName" + >:=> (line 130, col 7) to (line 130, col 22) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3846 to 3872) SpanInfo: {"start":3847,"length":15} + >skill = "skill" + >:=> (line 130, col 24) to (line 130, col 39) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3873 to 3879) SpanInfo: {"start":3874,"length":5} + >i = 0 + >:=> (line 130, col 51) to (line 130, col 56) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3880 to 3886) SpanInfo: {"start":3881,"length":5} + >i < 1 + >:=> (line 130, col 58) to (line 130, col 63) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3887 to 3894) SpanInfo: {"start":3888,"length":3} + >i++ + >:=> (line 130, col 65) to (line 130, col 68) +-------------------------------- +131> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3895 to 3918) SpanInfo: {"start":3899,"length":18} + >console.log(nameA) + >:=> (line 131, col 4) to (line 131, col 22) +-------------------------------- +132>} + + ~~ => Pos: (3919 to 3920) SpanInfo: {"start":3899,"length":18} + >console.log(nameA) + >:=> (line 131, col 4) to (line 131, col 22) +-------------------------------- +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3921 to 3943) SpanInfo: {"start":3928,"length":15} + >name = "noName" + >:=> (line 133, col 7) to (line 133, col 22) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3944 to 3975) SpanInfo: {"start":3945,"length":15} + >skill = "skill" + >:=> (line 133, col 24) to (line 133, col 39) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3976 to 3982) SpanInfo: {"start":3977,"length":5} + >i = 0 + >:=> (line 133, col 56) to (line 133, col 61) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3983 to 3989) SpanInfo: {"start":3984,"length":5} + >i < 1 + >:=> (line 133, col 63) to (line 133, col 68) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3990 to 3997) SpanInfo: {"start":3991,"length":3} + >i++ + >:=> (line 133, col 70) to (line 133, col 73) +-------------------------------- +134> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3998 to 4021) SpanInfo: {"start":4002,"length":18} + >console.log(nameA) + >:=> (line 134, col 4) to (line 134, col 22) +-------------------------------- +135>} + + ~~ => Pos: (4022 to 4023) SpanInfo: {"start":4002,"length":18} + >console.log(nameA) + >:=> (line 134, col 4) to (line 134, col 22) +-------------------------------- +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4024 to 4046) SpanInfo: {"start":4031,"length":15} + >name = "noName" + >:=> (line 136, col 7) to (line 136, col 22) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4047 to 4113) SpanInfo: {"start":4048,"length":15} + >skill = "skill" + >:=> (line 136, col 24) to (line 136, col 39) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (4114 to 4120) SpanInfo: {"start":4115,"length":5} + >i = 0 + >:=> (line 136, col 91) to (line 136, col 96) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (4121 to 4127) SpanInfo: {"start":4122,"length":5} + >i < 1 + >:=> (line 136, col 98) to (line 136, col 103) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (4128 to 4135) SpanInfo: {"start":4129,"length":3} + >i++ + >:=> (line 136, col 105) to (line 136, col 108) +-------------------------------- +137> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4136 to 4159) SpanInfo: {"start":4140,"length":18} + >console.log(nameA) + >:=> (line 137, col 4) to (line 137, col 22) +-------------------------------- +138>} + + ~~ => Pos: (4160 to 4161) SpanInfo: {"start":4140,"length":18} + >console.log(nameA) + >:=> (line 137, col 4) to (line 137, col 22) +-------------------------------- +139>for ({ + + ~~~~~~~ => Pos: (4162 to 4168) SpanInfo: {"start":4173,"length":15} + >name = "noName" + >:=> (line 140, col 4) to (line 140, col 19) +-------------------------------- +140> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4169 to 4189) SpanInfo: {"start":4173,"length":15} + >name = "noName" + >:=> (line 140, col 4) to (line 140, col 19) +-------------------------------- +141> skills: { + + ~~~~~~~~~~~ => Pos: (4190 to 4200) SpanInfo: {"start":4194,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 141, col 4) to (line 144, col 46) +141> skills: { + + ~~~ => Pos: (4201 to 4203) SpanInfo: {"start":4212,"length":19} + >primary = "primary" + >:=> (line 142, col 8) to (line 142, col 27) +-------------------------------- +142> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4204 to 4232) SpanInfo: {"start":4212,"length":19} + >primary = "primary" + >:=> (line 142, col 8) to (line 142, col 27) +-------------------------------- +143> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4233 to 4264) SpanInfo: {"start":4241,"length":23} + >secondary = "secondary" + >:=> (line 143, col 8) to (line 143, col 31) +-------------------------------- +144> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4265 to 4311) SpanInfo: {"start":4241,"length":23} + >secondary = "secondary" + >:=> (line 143, col 8) to (line 143, col 31) +-------------------------------- +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (4312 to 4326) SpanInfo: {"start":4194,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 141, col 4) to (line 144, col 46) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4327 to 4333) SpanInfo: {"start":4328,"length":5} + >i = 0 + >:=> (line 145, col 16) to (line 145, col 21) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4334 to 4340) SpanInfo: {"start":4335,"length":5} + >i < 1 + >:=> (line 145, col 23) to (line 145, col 28) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4341 to 4348) SpanInfo: {"start":4342,"length":3} + >i++ + >:=> (line 145, col 30) to (line 145, col 33) +-------------------------------- +146> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4349 to 4375) SpanInfo: {"start":4353,"length":21} + >console.log(primaryA) + >:=> (line 146, col 4) to (line 146, col 25) +-------------------------------- +147>} + + ~~ => Pos: (4376 to 4377) SpanInfo: {"start":4353,"length":21} + >console.log(primaryA) + >:=> (line 146, col 4) to (line 146, col 25) +-------------------------------- +148>for ({ + + ~~~~~~~ => Pos: (4378 to 4384) SpanInfo: {"start":4389,"length":15} + >name = "noName" + >:=> (line 149, col 4) to (line 149, col 19) +-------------------------------- +149> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4385 to 4405) SpanInfo: {"start":4389,"length":15} + >name = "noName" + >:=> (line 149, col 4) to (line 149, col 19) +-------------------------------- +150> skills: { + + ~~~~~~~~~~~ => Pos: (4406 to 4416) SpanInfo: {"start":4410,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 150, col 4) to (line 153, col 46) +150> skills: { + + ~~~ => Pos: (4417 to 4419) SpanInfo: {"start":4428,"length":19} + >primary = "primary" + >:=> (line 151, col 8) to (line 151, col 27) +-------------------------------- +151> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4420 to 4448) SpanInfo: {"start":4428,"length":19} + >primary = "primary" + >:=> (line 151, col 8) to (line 151, col 27) +-------------------------------- +152> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4449 to 4480) SpanInfo: {"start":4457,"length":23} + >secondary = "secondary" + >:=> (line 152, col 8) to (line 152, col 31) +-------------------------------- +153> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4481 to 4527) SpanInfo: {"start":4457,"length":23} + >secondary = "secondary" + >:=> (line 152, col 8) to (line 152, col 31) +-------------------------------- +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (4528 to 4547) SpanInfo: {"start":4410,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 150, col 4) to (line 153, col 46) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4548 to 4554) SpanInfo: {"start":4549,"length":5} + >i = 0 + >:=> (line 154, col 21) to (line 154, col 26) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4555 to 4561) SpanInfo: {"start":4556,"length":5} + >i < 1 + >:=> (line 154, col 28) to (line 154, col 33) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4562 to 4569) SpanInfo: {"start":4563,"length":3} + >i++ + >:=> (line 154, col 35) to (line 154, col 38) +-------------------------------- +155> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4570 to 4596) SpanInfo: {"start":4574,"length":21} + >console.log(primaryA) + >:=> (line 155, col 4) to (line 155, col 25) +-------------------------------- +156>} + + ~~ => Pos: (4597 to 4598) SpanInfo: {"start":4574,"length":21} + >console.log(primaryA) + >:=> (line 155, col 4) to (line 155, col 25) +-------------------------------- +157>for ({ + + ~~~~~~~ => Pos: (4599 to 4605) SpanInfo: {"start":4610,"length":15} + >name = "noName" + >:=> (line 158, col 4) to (line 158, col 19) +-------------------------------- +158> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4606 to 4626) SpanInfo: {"start":4610,"length":15} + >name = "noName" + >:=> (line 158, col 4) to (line 158, col 19) +-------------------------------- +159> skills: { + + ~~~~~~~~~~~ => Pos: (4627 to 4637) SpanInfo: {"start":4631,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 159, col 4) to (line 162, col 46) +159> skills: { + + ~~~ => Pos: (4638 to 4640) SpanInfo: {"start":4649,"length":19} + >primary = "primary" + >:=> (line 160, col 8) to (line 160, col 27) +-------------------------------- +160> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4641 to 4669) SpanInfo: {"start":4649,"length":19} + >primary = "primary" + >:=> (line 160, col 8) to (line 160, col 27) +-------------------------------- +161> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4670 to 4701) SpanInfo: {"start":4678,"length":23} + >secondary = "secondary" + >:=> (line 161, col 8) to (line 161, col 31) +-------------------------------- +162> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4702 to 4748) SpanInfo: {"start":4678,"length":23} + >secondary = "secondary" + >:=> (line 161, col 8) to (line 161, col 31) +-------------------------------- +163>} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4749 to 4839) SpanInfo: {"start":4631,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 159, col 4) to (line 162, col 46) +-------------------------------- +164> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (4840 to 4849) SpanInfo: {"start":4844,"length":5} + >i = 0 + >:=> (line 164, col 4) to (line 164, col 9) +164> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4850 to 4856) SpanInfo: {"start":4851,"length":5} + >i < 1 + >:=> (line 164, col 11) to (line 164, col 16) +164> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4857 to 4864) SpanInfo: {"start":4858,"length":3} + >i++ + >:=> (line 164, col 18) to (line 164, col 21) +-------------------------------- +165> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4865 to 4891) SpanInfo: {"start":4869,"length":21} + >console.log(primaryA) + >:=> (line 165, col 4) to (line 165, col 25) +-------------------------------- +166>} + ~ => Pos: (4892 to 4892) SpanInfo: {"start":4869,"length":21} + >console.log(primaryA) + >:=> (line 165, col 4) to (line 165, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline new file mode 100644 index 00000000000..16f6039031e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline @@ -0,0 +1,779 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (547 to 613) SpanInfo: undefined +-------------------------------- +19 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (614 to 649) SpanInfo: undefined +-------------------------------- +20 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (650 to 720) SpanInfo: undefined +-------------------------------- +21 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (721 to 823) SpanInfo: undefined +-------------------------------- +22 >for ([, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (824 to 837) SpanInfo: {"start":832,"length":5} + >nameA + >:=> (line 22, col 8) to (line 22, col 13) +22 >for ([, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (838 to 851) SpanInfo: {"start":842,"length":6} + >robots + >:=> (line 22, col 18) to (line 22, col 24) +-------------------------------- +23 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (852 to 875) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +24 >} + + ~~ => Pos: (876 to 877) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +25 >for ([, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (878 to 891) SpanInfo: {"start":886,"length":5} + >nameA + >:=> (line 25, col 8) to (line 25, col 13) +25 >for ([, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (892 to 910) SpanInfo: {"start":896,"length":11} + >getRobots() + >:=> (line 25, col 18) to (line 25, col 29) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (911 to 934) SpanInfo: {"start":915,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (935 to 936) SpanInfo: {"start":915,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ([, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~ => Pos: (937 to 950) SpanInfo: {"start":945,"length":5} + >nameA + >:=> (line 28, col 8) to (line 28, col 13) +28 >for ([, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (951 to 974) SpanInfo: {"start":955,"length":16} + >[robotA, robotB] + >:=> (line 28, col 18) to (line 28, col 34) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (975 to 998) SpanInfo: {"start":979,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (999 to 1000) SpanInfo: {"start":979,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1001 to 1023) SpanInfo: {"start":1010,"length":13} + >primarySkillA + >:=> (line 31, col 9) to (line 31, col 22) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1024 to 1040) SpanInfo: {"start":1025,"length":15} + >secondarySkillA + >:=> (line 31, col 24) to (line 31, col 39) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~ => Pos: (1041 to 1041) SpanInfo: {"start":1009,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 31, col 8) to (line 31, col 40) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1042 to 1060) SpanInfo: {"start":1046,"length":11} + >multiRobots + >:=> (line 31, col 45) to (line 31, col 56) +-------------------------------- +32 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1061 to 1092) SpanInfo: {"start":1065,"length":26} + >console.log(primarySkillA) + >:=> (line 32, col 4) to (line 32, col 30) +-------------------------------- +33 >} + + ~~ => Pos: (1093 to 1094) SpanInfo: {"start":1065,"length":26} + >console.log(primarySkillA) + >:=> (line 32, col 4) to (line 32, col 30) +-------------------------------- +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1095 to 1117) SpanInfo: {"start":1104,"length":13} + >primarySkillA + >:=> (line 34, col 9) to (line 34, col 22) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1118 to 1134) SpanInfo: {"start":1119,"length":15} + >secondarySkillA + >:=> (line 34, col 24) to (line 34, col 39) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~ => Pos: (1135 to 1135) SpanInfo: {"start":1103,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 34, col 8) to (line 34, col 40) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1136 to 1159) SpanInfo: {"start":1140,"length":16} + >getMultiRobots() + >:=> (line 34, col 45) to (line 34, col 61) +-------------------------------- +35 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1160 to 1191) SpanInfo: {"start":1164,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +36 >} + + ~~ => Pos: (1192 to 1193) SpanInfo: {"start":1164,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1194 to 1216) SpanInfo: {"start":1203,"length":13} + >primarySkillA + >:=> (line 37, col 9) to (line 37, col 22) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1217 to 1233) SpanInfo: {"start":1218,"length":15} + >secondarySkillA + >:=> (line 37, col 24) to (line 37, col 39) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1234 to 1234) SpanInfo: {"start":1202,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 37, col 8) to (line 37, col 40) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1235 to 1268) SpanInfo: {"start":1239,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 37, col 45) to (line 37, col 71) +-------------------------------- +38 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1269 to 1300) SpanInfo: {"start":1273,"length":26} + >console.log(primarySkillA) + >:=> (line 38, col 4) to (line 38, col 30) +-------------------------------- +39 >} + + ~~ => Pos: (1301 to 1302) SpanInfo: {"start":1273,"length":26} + >console.log(primarySkillA) + >:=> (line 38, col 4) to (line 38, col 30) +-------------------------------- +40 >for ([numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1303 to 1316) SpanInfo: {"start":1309,"length":7} + >numberB + >:=> (line 40, col 6) to (line 40, col 13) +40 >for ([numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1317 to 1330) SpanInfo: {"start":1321,"length":6} + >robots + >:=> (line 40, col 18) to (line 40, col 24) +-------------------------------- +41 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1331 to 1356) SpanInfo: {"start":1335,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +42 >} + + ~~ => Pos: (1357 to 1358) SpanInfo: {"start":1335,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +43 >for ([numberB] of getRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1359 to 1372) SpanInfo: {"start":1365,"length":7} + >numberB + >:=> (line 43, col 6) to (line 43, col 13) +43 >for ([numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1373 to 1391) SpanInfo: {"start":1377,"length":11} + >getRobots() + >:=> (line 43, col 18) to (line 43, col 29) +-------------------------------- +44 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1392 to 1417) SpanInfo: {"start":1396,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +45 >} + + ~~ => Pos: (1418 to 1419) SpanInfo: {"start":1396,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +46 >for ([numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~ => Pos: (1420 to 1433) SpanInfo: {"start":1426,"length":7} + >numberB + >:=> (line 46, col 6) to (line 46, col 13) +46 >for ([numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1434 to 1457) SpanInfo: {"start":1438,"length":16} + >[robotA, robotB] + >:=> (line 46, col 18) to (line 46, col 34) +-------------------------------- +47 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1458 to 1483) SpanInfo: {"start":1462,"length":20} + >console.log(numberB) + >:=> (line 47, col 4) to (line 47, col 24) +-------------------------------- +48 >} + + ~~ => Pos: (1484 to 1485) SpanInfo: {"start":1462,"length":20} + >console.log(numberB) + >:=> (line 47, col 4) to (line 47, col 24) +-------------------------------- +49 >for ([nameB] of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (1486 to 1497) SpanInfo: {"start":1492,"length":5} + >nameB + >:=> (line 49, col 6) to (line 49, col 11) +49 >for ([nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1498 to 1516) SpanInfo: {"start":1502,"length":11} + >multiRobots + >:=> (line 49, col 16) to (line 49, col 27) +-------------------------------- +50 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1517 to 1540) SpanInfo: {"start":1521,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1541 to 1542) SpanInfo: {"start":1521,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for ([nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (1543 to 1554) SpanInfo: {"start":1549,"length":5} + >nameB + >:=> (line 52, col 6) to (line 52, col 11) +52 >for ([nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1555 to 1578) SpanInfo: {"start":1559,"length":16} + >getMultiRobots() + >:=> (line 52, col 16) to (line 52, col 32) +-------------------------------- +53 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1579 to 1602) SpanInfo: {"start":1583,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1603 to 1604) SpanInfo: {"start":1583,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for ([nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~ => Pos: (1605 to 1616) SpanInfo: {"start":1611,"length":5} + >nameB + >:=> (line 55, col 6) to (line 55, col 11) +55 >for ([nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1617 to 1650) SpanInfo: {"start":1621,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 55, col 16) to (line 55, col 42) +-------------------------------- +56 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1651 to 1674) SpanInfo: {"start":1655,"length":18} + >console.log(nameB) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (1675 to 1676) SpanInfo: {"start":1655,"length":18} + >console.log(nameB) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (1677 to 1691) SpanInfo: {"start":1683,"length":8} + >numberA2 + >:=> (line 58, col 6) to (line 58, col 14) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~ => Pos: (1692 to 1699) SpanInfo: {"start":1693,"length":6} + >nameA2 + >:=> (line 58, col 16) to (line 58, col 22) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~ => Pos: (1700 to 1708) SpanInfo: {"start":1701,"length":7} + >skillA2 + >:=> (line 58, col 24) to (line 58, col 31) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1709 to 1722) SpanInfo: {"start":1713,"length":6} + >robots + >:=> (line 58, col 36) to (line 58, col 42) +-------------------------------- +59 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1723 to 1747) SpanInfo: {"start":1727,"length":19} + >console.log(nameA2) + >:=> (line 59, col 4) to (line 59, col 23) +-------------------------------- +60 >} + + ~~ => Pos: (1748 to 1749) SpanInfo: {"start":1727,"length":19} + >console.log(nameA2) + >:=> (line 59, col 4) to (line 59, col 23) +-------------------------------- +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (1750 to 1764) SpanInfo: {"start":1756,"length":8} + >numberA2 + >:=> (line 61, col 6) to (line 61, col 14) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~ => Pos: (1765 to 1772) SpanInfo: {"start":1766,"length":6} + >nameA2 + >:=> (line 61, col 16) to (line 61, col 22) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~ => Pos: (1773 to 1781) SpanInfo: {"start":1774,"length":7} + >skillA2 + >:=> (line 61, col 24) to (line 61, col 31) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1782 to 1800) SpanInfo: {"start":1786,"length":11} + >getRobots() + >:=> (line 61, col 36) to (line 61, col 47) +-------------------------------- +62 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1801 to 1825) SpanInfo: {"start":1805,"length":19} + >console.log(nameA2) + >:=> (line 62, col 4) to (line 62, col 23) +-------------------------------- +63 >} + + ~~ => Pos: (1826 to 1827) SpanInfo: {"start":1805,"length":19} + >console.log(nameA2) + >:=> (line 62, col 4) to (line 62, col 23) +-------------------------------- +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (1828 to 1842) SpanInfo: {"start":1834,"length":8} + >numberA2 + >:=> (line 64, col 6) to (line 64, col 14) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~ => Pos: (1843 to 1850) SpanInfo: {"start":1844,"length":6} + >nameA2 + >:=> (line 64, col 16) to (line 64, col 22) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~ => Pos: (1851 to 1859) SpanInfo: {"start":1852,"length":7} + >skillA2 + >:=> (line 64, col 24) to (line 64, col 31) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1860 to 1883) SpanInfo: {"start":1864,"length":16} + >[robotA, robotB] + >:=> (line 64, col 36) to (line 64, col 52) +-------------------------------- +65 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1884 to 1908) SpanInfo: {"start":1888,"length":19} + >console.log(nameA2) + >:=> (line 65, col 4) to (line 65, col 23) +-------------------------------- +66 >} + + ~~ => Pos: (1909 to 1910) SpanInfo: {"start":1888,"length":19} + >console.log(nameA2) + >:=> (line 65, col 4) to (line 65, col 23) +-------------------------------- +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~ => Pos: (1911 to 1923) SpanInfo: {"start":1917,"length":6} + >nameMA + >:=> (line 67, col 6) to (line 67, col 12) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1924 to 1939) SpanInfo: {"start":1926,"length":13} + >primarySkillA + >:=> (line 67, col 15) to (line 67, col 28) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1940 to 1956) SpanInfo: {"start":1941,"length":15} + >secondarySkillA + >:=> (line 67, col 30) to (line 67, col 45) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~=> Pos: (1957 to 1957) SpanInfo: {"start":1925,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 67, col 14) to (line 67, col 46) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1958 to 1976) SpanInfo: {"start":1962,"length":11} + >multiRobots + >:=> (line 67, col 51) to (line 67, col 62) +-------------------------------- +68 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1977 to 2001) SpanInfo: {"start":1981,"length":19} + >console.log(nameMA) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +69 >} + + ~~ => Pos: (2002 to 2003) SpanInfo: {"start":1981,"length":19} + >console.log(nameMA) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~ => Pos: (2004 to 2016) SpanInfo: {"start":2010,"length":6} + >nameMA + >:=> (line 70, col 6) to (line 70, col 12) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (2017 to 2032) SpanInfo: {"start":2019,"length":13} + >primarySkillA + >:=> (line 70, col 15) to (line 70, col 28) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2033 to 2049) SpanInfo: {"start":2034,"length":15} + >secondarySkillA + >:=> (line 70, col 30) to (line 70, col 45) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~=> Pos: (2050 to 2050) SpanInfo: {"start":2018,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 70, col 14) to (line 70, col 46) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2051 to 2074) SpanInfo: {"start":2055,"length":16} + >getMultiRobots() + >:=> (line 70, col 51) to (line 70, col 67) +-------------------------------- +71 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2075 to 2099) SpanInfo: {"start":2079,"length":19} + >console.log(nameMA) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +72 >} + + ~~ => Pos: (2100 to 2101) SpanInfo: {"start":2079,"length":19} + >console.log(nameMA) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~ => Pos: (2102 to 2114) SpanInfo: {"start":2108,"length":6} + >nameMA + >:=> (line 73, col 6) to (line 73, col 12) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (2115 to 2130) SpanInfo: {"start":2117,"length":13} + >primarySkillA + >:=> (line 73, col 15) to (line 73, col 28) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2131 to 2147) SpanInfo: {"start":2132,"length":15} + >secondarySkillA + >:=> (line 73, col 30) to (line 73, col 45) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~=> Pos: (2148 to 2148) SpanInfo: {"start":2116,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 73, col 14) to (line 73, col 46) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2149 to 2182) SpanInfo: {"start":2153,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 73, col 51) to (line 73, col 77) +-------------------------------- +74 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2183 to 2207) SpanInfo: {"start":2187,"length":19} + >console.log(nameMA) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +75 >} + + ~~ => Pos: (2208 to 2209) SpanInfo: {"start":2187,"length":19} + >console.log(nameMA) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2210 to 2224) SpanInfo: {"start":2216,"length":8} + >numberA3 + >:=> (line 76, col 6) to (line 76, col 14) +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2225 to 2239) SpanInfo: {"start":2226,"length":13} + >...robotAInfo + >:=> (line 76, col 16) to (line 76, col 29) +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (2240 to 2253) SpanInfo: {"start":2244,"length":6} + >robots + >:=> (line 76, col 34) to (line 76, col 40) +-------------------------------- +77 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2254 to 2280) SpanInfo: {"start":2258,"length":21} + >console.log(numberA3) + >:=> (line 77, col 4) to (line 77, col 25) +-------------------------------- +78 >} + + ~~ => Pos: (2281 to 2282) SpanInfo: {"start":2258,"length":21} + >console.log(numberA3) + >:=> (line 77, col 4) to (line 77, col 25) +-------------------------------- +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2283 to 2297) SpanInfo: {"start":2289,"length":8} + >numberA3 + >:=> (line 79, col 6) to (line 79, col 14) +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2298 to 2312) SpanInfo: {"start":2299,"length":13} + >...robotAInfo + >:=> (line 79, col 16) to (line 79, col 29) +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2313 to 2331) SpanInfo: {"start":2317,"length":11} + >getRobots() + >:=> (line 79, col 34) to (line 79, col 45) +-------------------------------- +80 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2332 to 2358) SpanInfo: {"start":2336,"length":21} + >console.log(numberA3) + >:=> (line 80, col 4) to (line 80, col 25) +-------------------------------- +81 >} + + ~~ => Pos: (2359 to 2360) SpanInfo: {"start":2336,"length":21} + >console.log(numberA3) + >:=> (line 80, col 4) to (line 80, col 25) +-------------------------------- +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2361 to 2375) SpanInfo: {"start":2367,"length":8} + >numberA3 + >:=> (line 82, col 6) to (line 82, col 14) +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2376 to 2390) SpanInfo: {"start":2377,"length":13} + >...robotAInfo + >:=> (line 82, col 16) to (line 82, col 29) +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2391 to 2414) SpanInfo: {"start":2395,"length":16} + >[robotA, robotB] + >:=> (line 82, col 34) to (line 82, col 50) +-------------------------------- +83 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2415 to 2441) SpanInfo: {"start":2419,"length":21} + >console.log(numberA3) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +84 >} + + ~~ => Pos: (2442 to 2443) SpanInfo: {"start":2419,"length":21} + >console.log(numberA3) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +85 >for ([...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2444 to 2468) SpanInfo: {"start":2450,"length":18} + >...multiRobotAInfo + >:=> (line 85, col 6) to (line 85, col 24) +85 >for ([...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2469 to 2487) SpanInfo: {"start":2473,"length":11} + >multiRobots + >:=> (line 85, col 29) to (line 85, col 40) +-------------------------------- +86 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2488 to 2521) SpanInfo: {"start":2492,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 86, col 4) to (line 86, col 32) +-------------------------------- +87 >} + + ~~ => Pos: (2522 to 2523) SpanInfo: {"start":2492,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 86, col 4) to (line 86, col 32) +-------------------------------- +88 >for ([...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2548) SpanInfo: {"start":2530,"length":18} + >...multiRobotAInfo + >:=> (line 88, col 6) to (line 88, col 24) +88 >for ([...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2549 to 2572) SpanInfo: {"start":2553,"length":16} + >getMultiRobots() + >:=> (line 88, col 29) to (line 88, col 45) +-------------------------------- +89 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2573 to 2606) SpanInfo: {"start":2577,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 89, col 4) to (line 89, col 32) +-------------------------------- +90 >} + + ~~ => Pos: (2607 to 2608) SpanInfo: {"start":2577,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 89, col 4) to (line 89, col 32) +-------------------------------- +91 >for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2609 to 2633) SpanInfo: {"start":2615,"length":18} + >...multiRobotAInfo + >:=> (line 91, col 6) to (line 91, col 24) +91 >for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2634 to 2667) SpanInfo: {"start":2638,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 91, col 29) to (line 91, col 55) +-------------------------------- +92 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2668 to 2701) SpanInfo: {"start":2672,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 92, col 4) to (line 92, col 32) +-------------------------------- +93 >} + ~ => Pos: (2702 to 2702) SpanInfo: {"start":2672,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 92, col 4) to (line 92, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..c7e2f005833 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,806 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (547 to 613) SpanInfo: undefined +-------------------------------- +19 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (614 to 649) SpanInfo: undefined +-------------------------------- +20 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (650 to 720) SpanInfo: undefined +-------------------------------- +21 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (721 to 823) SpanInfo: undefined +-------------------------------- +22 >for ([, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (824 to 848) SpanInfo: {"start":832,"length":16} + >nameA = "noName" + >:=> (line 22, col 8) to (line 22, col 24) +22 >for ([, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (849 to 862) SpanInfo: {"start":853,"length":6} + >robots + >:=> (line 22, col 29) to (line 22, col 35) +-------------------------------- +23 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (863 to 886) SpanInfo: {"start":867,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +24 >} + + ~~ => Pos: (887 to 888) SpanInfo: {"start":867,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +25 >for ([, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (889 to 913) SpanInfo: {"start":897,"length":16} + >nameA = "noName" + >:=> (line 25, col 8) to (line 25, col 24) +25 >for ([, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (914 to 932) SpanInfo: {"start":918,"length":11} + >getRobots() + >:=> (line 25, col 29) to (line 25, col 40) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (933 to 956) SpanInfo: {"start":937,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (957 to 958) SpanInfo: {"start":937,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ([, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (959 to 983) SpanInfo: {"start":967,"length":16} + >nameA = "noName" + >:=> (line 28, col 8) to (line 28, col 24) +28 >for ([, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (984 to 1007) SpanInfo: {"start":988,"length":16} + >[robotA, robotB] + >:=> (line 28, col 29) to (line 28, col 45) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1008 to 1031) SpanInfo: {"start":1012,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (1032 to 1033) SpanInfo: {"start":1012,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ([, [ + + ~~~~~~~~~~ => Pos: (1034 to 1043) SpanInfo: {"start":1048,"length":25} + >primarySkillA = "primary" + >:=> (line 32, col 4) to (line 32, col 29) +-------------------------------- +32 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1044 to 1074) SpanInfo: {"start":1048,"length":25} + >primarySkillA = "primary" + >:=> (line 32, col 4) to (line 32, col 29) +-------------------------------- +33 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1075 to 1108) SpanInfo: {"start":1079,"length":29} + >secondarySkillA = "secondary" + >:=> (line 33, col 4) to (line 33, col 33) +-------------------------------- +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1109 to 1132) SpanInfo: {"start":1079,"length":29} + >secondarySkillA = "secondary" + >:=> (line 33, col 4) to (line 33, col 33) +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (1133 to 1133) SpanInfo: {"start":1042,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 31, col 8) to (line 34, col 24) +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1134 to 1152) SpanInfo: {"start":1138,"length":11} + >multiRobots + >:=> (line 34, col 29) to (line 34, col 40) +-------------------------------- +35 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1153 to 1184) SpanInfo: {"start":1157,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +36 >} + + ~~ => Pos: (1185 to 1186) SpanInfo: {"start":1157,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +37 >for ([, [ + + ~~~~~~~~~~ => Pos: (1187 to 1196) SpanInfo: {"start":1201,"length":25} + >primarySkillA = "primary" + >:=> (line 38, col 4) to (line 38, col 29) +-------------------------------- +38 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1197 to 1227) SpanInfo: {"start":1201,"length":25} + >primarySkillA = "primary" + >:=> (line 38, col 4) to (line 38, col 29) +-------------------------------- +39 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1228 to 1261) SpanInfo: {"start":1232,"length":29} + >secondarySkillA = "secondary" + >:=> (line 39, col 4) to (line 39, col 33) +-------------------------------- +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1262 to 1285) SpanInfo: {"start":1232,"length":29} + >secondarySkillA = "secondary" + >:=> (line 39, col 4) to (line 39, col 33) +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (1286 to 1286) SpanInfo: {"start":1195,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 37, col 8) to (line 40, col 24) +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1287 to 1310) SpanInfo: {"start":1291,"length":16} + >getMultiRobots() + >:=> (line 40, col 29) to (line 40, col 45) +-------------------------------- +41 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1311 to 1342) SpanInfo: {"start":1315,"length":26} + >console.log(primarySkillA) + >:=> (line 41, col 4) to (line 41, col 30) +-------------------------------- +42 >} + + ~~ => Pos: (1343 to 1344) SpanInfo: {"start":1315,"length":26} + >console.log(primarySkillA) + >:=> (line 41, col 4) to (line 41, col 30) +-------------------------------- +43 >for ([, [ + + ~~~~~~~~~~ => Pos: (1345 to 1354) SpanInfo: {"start":1359,"length":25} + >primarySkillA = "primary" + >:=> (line 44, col 4) to (line 44, col 29) +-------------------------------- +44 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1355 to 1385) SpanInfo: {"start":1359,"length":25} + >primarySkillA = "primary" + >:=> (line 44, col 4) to (line 44, col 29) +-------------------------------- +45 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1386 to 1419) SpanInfo: {"start":1390,"length":29} + >secondarySkillA = "secondary" + >:=> (line 45, col 4) to (line 45, col 33) +-------------------------------- +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1420 to 1443) SpanInfo: {"start":1390,"length":29} + >secondarySkillA = "secondary" + >:=> (line 45, col 4) to (line 45, col 33) +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1444 to 1444) SpanInfo: {"start":1353,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 43, col 8) to (line 46, col 24) +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1445 to 1478) SpanInfo: {"start":1449,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 46, col 29) to (line 46, col 55) +-------------------------------- +47 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1479 to 1510) SpanInfo: {"start":1483,"length":26} + >console.log(primarySkillA) + >:=> (line 47, col 4) to (line 47, col 30) +-------------------------------- +48 >} + + ~~ => Pos: (1511 to 1512) SpanInfo: {"start":1483,"length":26} + >console.log(primarySkillA) + >:=> (line 47, col 4) to (line 47, col 30) +-------------------------------- +49 >for ([numberB = -1] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1513 to 1531) SpanInfo: {"start":1519,"length":12} + >numberB = -1 + >:=> (line 49, col 6) to (line 49, col 18) +49 >for ([numberB = -1] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1532 to 1545) SpanInfo: {"start":1536,"length":6} + >robots + >:=> (line 49, col 23) to (line 49, col 29) +-------------------------------- +50 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1546 to 1571) SpanInfo: {"start":1550,"length":20} + >console.log(numberB) + >:=> (line 50, col 4) to (line 50, col 24) +-------------------------------- +51 >} + + ~~ => Pos: (1572 to 1573) SpanInfo: {"start":1550,"length":20} + >console.log(numberB) + >:=> (line 50, col 4) to (line 50, col 24) +-------------------------------- +52 >for ([numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1574 to 1592) SpanInfo: {"start":1580,"length":12} + >numberB = -1 + >:=> (line 52, col 6) to (line 52, col 18) +52 >for ([numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1593 to 1611) SpanInfo: {"start":1597,"length":11} + >getRobots() + >:=> (line 52, col 23) to (line 52, col 34) +-------------------------------- +53 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1612 to 1637) SpanInfo: {"start":1616,"length":20} + >console.log(numberB) + >:=> (line 53, col 4) to (line 53, col 24) +-------------------------------- +54 >} + + ~~ => Pos: (1638 to 1639) SpanInfo: {"start":1616,"length":20} + >console.log(numberB) + >:=> (line 53, col 4) to (line 53, col 24) +-------------------------------- +55 >for ([numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1640 to 1658) SpanInfo: {"start":1646,"length":12} + >numberB = -1 + >:=> (line 55, col 6) to (line 55, col 18) +55 >for ([numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1659 to 1682) SpanInfo: {"start":1663,"length":16} + >[robotA, robotB] + >:=> (line 55, col 23) to (line 55, col 39) +-------------------------------- +56 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1683 to 1708) SpanInfo: {"start":1687,"length":20} + >console.log(numberB) + >:=> (line 56, col 4) to (line 56, col 24) +-------------------------------- +57 >} + + ~~ => Pos: (1709 to 1710) SpanInfo: {"start":1687,"length":20} + >console.log(numberB) + >:=> (line 56, col 4) to (line 56, col 24) +-------------------------------- +58 >for ([nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1711 to 1733) SpanInfo: {"start":1717,"length":16} + >nameB = "noName" + >:=> (line 58, col 6) to (line 58, col 22) +58 >for ([nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1734 to 1752) SpanInfo: {"start":1738,"length":11} + >multiRobots + >:=> (line 58, col 27) to (line 58, col 38) +-------------------------------- +59 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1753 to 1776) SpanInfo: {"start":1757,"length":18} + >console.log(nameB) + >:=> (line 59, col 4) to (line 59, col 22) +-------------------------------- +60 >} + + ~~ => Pos: (1777 to 1778) SpanInfo: {"start":1757,"length":18} + >console.log(nameB) + >:=> (line 59, col 4) to (line 59, col 22) +-------------------------------- +61 >for ([nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1779 to 1801) SpanInfo: {"start":1785,"length":16} + >nameB = "noName" + >:=> (line 61, col 6) to (line 61, col 22) +61 >for ([nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1802 to 1825) SpanInfo: {"start":1806,"length":16} + >getMultiRobots() + >:=> (line 61, col 27) to (line 61, col 43) +-------------------------------- +62 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1826 to 1849) SpanInfo: {"start":1830,"length":18} + >console.log(nameB) + >:=> (line 62, col 4) to (line 62, col 22) +-------------------------------- +63 >} + + ~~ => Pos: (1850 to 1851) SpanInfo: {"start":1830,"length":18} + >console.log(nameB) + >:=> (line 62, col 4) to (line 62, col 22) +-------------------------------- +64 >for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1852 to 1874) SpanInfo: {"start":1858,"length":16} + >nameB = "noName" + >:=> (line 64, col 6) to (line 64, col 22) +64 >for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1875 to 1908) SpanInfo: {"start":1879,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 64, col 27) to (line 64, col 53) +-------------------------------- +65 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1909 to 1932) SpanInfo: {"start":1913,"length":18} + >console.log(nameB) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +66 >} + + ~~ => Pos: (1933 to 1934) SpanInfo: {"start":1913,"length":18} + >console.log(nameB) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1935 to 1954) SpanInfo: {"start":1941,"length":13} + >numberA2 = -1 + >:=> (line 67, col 6) to (line 67, col 19) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1955 to 1973) SpanInfo: {"start":1956,"length":17} + >nameA2 = "noName" + >:=> (line 67, col 21) to (line 67, col 38) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1974 to 1992) SpanInfo: {"start":1975,"length":17} + >skillA2 = "skill" + >:=> (line 67, col 40) to (line 67, col 57) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1993 to 2006) SpanInfo: {"start":1997,"length":6} + >robots + >:=> (line 67, col 62) to (line 67, col 68) +-------------------------------- +68 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2007 to 2031) SpanInfo: {"start":2011,"length":19} + >console.log(nameA2) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +69 >} + + ~~ => Pos: (2032 to 2033) SpanInfo: {"start":2011,"length":19} + >console.log(nameA2) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2034 to 2053) SpanInfo: {"start":2040,"length":13} + >numberA2 = -1 + >:=> (line 70, col 6) to (line 70, col 19) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2054 to 2072) SpanInfo: {"start":2055,"length":17} + >nameA2 = "noName" + >:=> (line 70, col 21) to (line 70, col 38) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2073 to 2091) SpanInfo: {"start":2074,"length":17} + >skillA2 = "skill" + >:=> (line 70, col 40) to (line 70, col 57) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2092 to 2110) SpanInfo: {"start":2096,"length":11} + >getRobots() + >:=> (line 70, col 62) to (line 70, col 73) +-------------------------------- +71 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2111 to 2135) SpanInfo: {"start":2115,"length":19} + >console.log(nameA2) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +72 >} + + ~~ => Pos: (2136 to 2137) SpanInfo: {"start":2115,"length":19} + >console.log(nameA2) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2138 to 2157) SpanInfo: {"start":2144,"length":13} + >numberA2 = -1 + >:=> (line 73, col 6) to (line 73, col 19) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2158 to 2176) SpanInfo: {"start":2159,"length":17} + >nameA2 = "noName" + >:=> (line 73, col 21) to (line 73, col 38) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2177 to 2195) SpanInfo: {"start":2178,"length":17} + >skillA2 = "skill" + >:=> (line 73, col 40) to (line 73, col 57) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2196 to 2219) SpanInfo: {"start":2200,"length":16} + >[robotA, robotB] + >:=> (line 73, col 62) to (line 73, col 78) +-------------------------------- +74 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2220 to 2244) SpanInfo: {"start":2224,"length":19} + >console.log(nameA2) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +75 >} + + ~~ => Pos: (2245 to 2246) SpanInfo: {"start":2224,"length":19} + >console.log(nameA2) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +76 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2247 to 2270) SpanInfo: {"start":2253,"length":17} + >nameMA = "noName" + >:=> (line 76, col 6) to (line 76, col 23) +76 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2271 to 2273) SpanInfo: {"start":2278,"length":25} + >primarySkillA = "primary" + >:=> (line 77, col 4) to (line 77, col 29) +-------------------------------- +77 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2274 to 2304) SpanInfo: {"start":2278,"length":25} + >primarySkillA = "primary" + >:=> (line 77, col 4) to (line 77, col 29) +-------------------------------- +78 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2305 to 2338) SpanInfo: {"start":2309,"length":29} + >secondarySkillA = "secondary" + >:=> (line 78, col 4) to (line 78, col 33) +-------------------------------- +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2339 to 2362) SpanInfo: {"start":2309,"length":29} + >secondarySkillA = "secondary" + >:=> (line 78, col 4) to (line 78, col 33) +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (2363 to 2363) SpanInfo: {"start":2272,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 76, col 25) to (line 79, col 24) +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2364 to 2382) SpanInfo: {"start":2368,"length":11} + >multiRobots + >:=> (line 79, col 29) to (line 79, col 40) +-------------------------------- +80 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2383 to 2407) SpanInfo: {"start":2387,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +81 >} + + ~~ => Pos: (2408 to 2409) SpanInfo: {"start":2387,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +82 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2410 to 2433) SpanInfo: {"start":2416,"length":17} + >nameMA = "noName" + >:=> (line 82, col 6) to (line 82, col 23) +82 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2434 to 2436) SpanInfo: {"start":2441,"length":25} + >primarySkillA = "primary" + >:=> (line 83, col 4) to (line 83, col 29) +-------------------------------- +83 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2437 to 2467) SpanInfo: {"start":2441,"length":25} + >primarySkillA = "primary" + >:=> (line 83, col 4) to (line 83, col 29) +-------------------------------- +84 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2468 to 2501) SpanInfo: {"start":2472,"length":29} + >secondarySkillA = "secondary" + >:=> (line 84, col 4) to (line 84, col 33) +-------------------------------- +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2502 to 2525) SpanInfo: {"start":2472,"length":29} + >secondarySkillA = "secondary" + >:=> (line 84, col 4) to (line 84, col 33) +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (2526 to 2526) SpanInfo: {"start":2435,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 82, col 25) to (line 85, col 24) +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2527 to 2550) SpanInfo: {"start":2531,"length":16} + >getMultiRobots() + >:=> (line 85, col 29) to (line 85, col 45) +-------------------------------- +86 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2551 to 2575) SpanInfo: {"start":2555,"length":19} + >console.log(nameMA) + >:=> (line 86, col 4) to (line 86, col 23) +-------------------------------- +87 >} + + ~~ => Pos: (2576 to 2577) SpanInfo: {"start":2555,"length":19} + >console.log(nameMA) + >:=> (line 86, col 4) to (line 86, col 23) +-------------------------------- +88 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2578 to 2601) SpanInfo: {"start":2584,"length":17} + >nameMA = "noName" + >:=> (line 88, col 6) to (line 88, col 23) +88 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2602 to 2604) SpanInfo: {"start":2609,"length":25} + >primarySkillA = "primary" + >:=> (line 89, col 4) to (line 89, col 29) +-------------------------------- +89 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2605 to 2635) SpanInfo: {"start":2609,"length":25} + >primarySkillA = "primary" + >:=> (line 89, col 4) to (line 89, col 29) +-------------------------------- +90 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2636 to 2669) SpanInfo: {"start":2640,"length":29} + >secondarySkillA = "secondary" + >:=> (line 90, col 4) to (line 90, col 33) +-------------------------------- +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2670 to 2693) SpanInfo: {"start":2640,"length":29} + >secondarySkillA = "secondary" + >:=> (line 90, col 4) to (line 90, col 33) +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (2694 to 2694) SpanInfo: {"start":2603,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 88, col 25) to (line 91, col 24) +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2695 to 2728) SpanInfo: {"start":2699,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 91, col 29) to (line 91, col 55) +-------------------------------- +92 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2729 to 2753) SpanInfo: {"start":2733,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +93 >} + + ~~ => Pos: (2754 to 2755) SpanInfo: {"start":2733,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2756 to 2775) SpanInfo: {"start":2762,"length":13} + >numberA3 = -1 + >:=> (line 94, col 6) to (line 94, col 19) +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2776 to 2790) SpanInfo: {"start":2777,"length":13} + >...robotAInfo + >:=> (line 94, col 21) to (line 94, col 34) +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2791 to 2804) SpanInfo: {"start":2795,"length":6} + >robots + >:=> (line 94, col 39) to (line 94, col 45) +-------------------------------- +95 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2805 to 2831) SpanInfo: {"start":2809,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (2832 to 2833) SpanInfo: {"start":2809,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2834 to 2853) SpanInfo: {"start":2840,"length":13} + >numberA3 = -1 + >:=> (line 97, col 6) to (line 97, col 19) +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2854 to 2868) SpanInfo: {"start":2855,"length":13} + >...robotAInfo + >:=> (line 97, col 21) to (line 97, col 34) +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2869 to 2887) SpanInfo: {"start":2873,"length":11} + >getRobots() + >:=> (line 97, col 39) to (line 97, col 50) +-------------------------------- +98 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2888 to 2914) SpanInfo: {"start":2892,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (2915 to 2916) SpanInfo: {"start":2892,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2917 to 2936) SpanInfo: {"start":2923,"length":13} + >numberA3 = -1 + >:=> (line 100, col 6) to (line 100, col 19) +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2937 to 2951) SpanInfo: {"start":2938,"length":13} + >...robotAInfo + >:=> (line 100, col 21) to (line 100, col 34) +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2952 to 2975) SpanInfo: {"start":2956,"length":16} + >[robotA, robotB] + >:=> (line 100, col 39) to (line 100, col 55) +-------------------------------- +101> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2976 to 3002) SpanInfo: {"start":2980,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) +-------------------------------- +102>} + ~ => Pos: (3003 to 3003) SpanInfo: {"start":2980,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline new file mode 100644 index 00000000000..b303f33026a --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline @@ -0,0 +1,943 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (603 to 686) SpanInfo: undefined +-------------------------------- +25 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (687 to 755) SpanInfo: undefined +-------------------------------- +26 >for ({name: nameA } of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 774) SpanInfo: {"start":762,"length":11} + >name: nameA + >:=> (line 26, col 6) to (line 26, col 17) +26 >for ({name: nameA } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (775 to 788) SpanInfo: {"start":779,"length":6} + >robots + >:=> (line 26, col 23) to (line 26, col 29) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (789 to 812) SpanInfo: {"start":793,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (813 to 814) SpanInfo: {"start":793,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ({name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (815 to 833) SpanInfo: {"start":821,"length":11} + >name: nameA + >:=> (line 29, col 6) to (line 29, col 17) +29 >for ({name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (834 to 852) SpanInfo: {"start":838,"length":11} + >getRobots() + >:=> (line 29, col 23) to (line 29, col 34) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (853 to 876) SpanInfo: {"start":857,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (877 to 878) SpanInfo: {"start":857,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (879 to 897) SpanInfo: {"start":885,"length":11} + >name: nameA + >:=> (line 32, col 6) to (line 32, col 17) +32 >for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (898 to 981) SpanInfo: {"start":902,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 32, col 23) to (line 32, col 99) +-------------------------------- +33 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (982 to 1005) SpanInfo: {"start":986,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +34 >} + + ~~ => Pos: (1006 to 1007) SpanInfo: {"start":986,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~ => Pos: (1008 to 1021) SpanInfo: {"start":1015,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 7) to (line 35, col 59) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1022 to 1042) SpanInfo: {"start":1025,"length":17} + >primary: primaryA + >:=> (line 35, col 17) to (line 35, col 34) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1043 to 1066) SpanInfo: {"start":1044,"length":21} + >secondary: secondaryA + >:=> (line 35, col 36) to (line 35, col 57) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (1067 to 1068) SpanInfo: {"start":1015,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 7) to (line 35, col 59) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1069 to 1087) SpanInfo: {"start":1073,"length":11} + >multiRobots + >:=> (line 35, col 65) to (line 35, col 76) +-------------------------------- +36 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1088 to 1114) SpanInfo: {"start":1092,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +37 >} + + ~~ => Pos: (1115 to 1116) SpanInfo: {"start":1092,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1117 to 1130) SpanInfo: {"start":1124,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 7) to (line 38, col 59) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1131 to 1151) SpanInfo: {"start":1134,"length":17} + >primary: primaryA + >:=> (line 38, col 17) to (line 38, col 34) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1152 to 1175) SpanInfo: {"start":1153,"length":21} + >secondary: secondaryA + >:=> (line 38, col 36) to (line 38, col 57) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1176 to 1177) SpanInfo: {"start":1124,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 7) to (line 38, col 59) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1178 to 1201) SpanInfo: {"start":1182,"length":16} + >getMultiRobots() + >:=> (line 38, col 65) to (line 38, col 81) +-------------------------------- +39 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1202 to 1228) SpanInfo: {"start":1206,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +40 >} + + ~~ => Pos: (1229 to 1230) SpanInfo: {"start":1206,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~ => Pos: (1231 to 1244) SpanInfo: {"start":1238,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 41, col 7) to (line 41, col 59) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1245 to 1265) SpanInfo: {"start":1248,"length":17} + >primary: primaryA + >:=> (line 41, col 17) to (line 41, col 34) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1266 to 1289) SpanInfo: {"start":1267,"length":21} + >secondary: secondaryA + >:=> (line 41, col 36) to (line 41, col 57) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1290 to 1291) SpanInfo: {"start":1238,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 41, col 7) to (line 41, col 59) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1292 to 1365) SpanInfo: {"start":1296,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 41, col 65) to (line 42, col 78) +-------------------------------- +42 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1366 to 1447) SpanInfo: {"start":1296,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 41, col 65) to (line 42, col 78) +-------------------------------- +43 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1448 to 1474) SpanInfo: {"start":1452,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +44 >} + + ~~ => Pos: (1475 to 1476) SpanInfo: {"start":1452,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +45 >for ({name } of robots) { + + ~~~~~~~~~~~~ => Pos: (1477 to 1488) SpanInfo: {"start":1483,"length":4} + >name + >:=> (line 45, col 6) to (line 45, col 10) +45 >for ({name } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1489 to 1502) SpanInfo: {"start":1493,"length":6} + >robots + >:=> (line 45, col 16) to (line 45, col 22) +-------------------------------- +46 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1503 to 1526) SpanInfo: {"start":1507,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1527 to 1528) SpanInfo: {"start":1507,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for ({name } of getRobots()) { + + ~~~~~~~~~~~~ => Pos: (1529 to 1540) SpanInfo: {"start":1535,"length":4} + >name + >:=> (line 48, col 6) to (line 48, col 10) +48 >for ({name } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1541 to 1559) SpanInfo: {"start":1545,"length":11} + >getRobots() + >:=> (line 48, col 16) to (line 48, col 27) +-------------------------------- +49 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1560 to 1583) SpanInfo: {"start":1564,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1584 to 1585) SpanInfo: {"start":1564,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~ => Pos: (1586 to 1597) SpanInfo: {"start":1592,"length":4} + >name + >:=> (line 51, col 6) to (line 51, col 10) +51 >for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1598 to 1681) SpanInfo: {"start":1602,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 51, col 16) to (line 51, col 92) +-------------------------------- +52 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1682 to 1705) SpanInfo: {"start":1686,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1706 to 1707) SpanInfo: {"start":1686,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~ => Pos: (1708 to 1721) SpanInfo: {"start":1715,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (1722 to 1732) SpanInfo: {"start":1725,"length":7} + >primary + >:=> (line 54, col 17) to (line 54, col 24) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (1733 to 1744) SpanInfo: {"start":1734,"length":9} + >secondary + >:=> (line 54, col 26) to (line 54, col 35) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~ => Pos: (1745 to 1746) SpanInfo: {"start":1715,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1747 to 1765) SpanInfo: {"start":1751,"length":11} + >multiRobots + >:=> (line 54, col 43) to (line 54, col 54) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1766 to 1792) SpanInfo: {"start":1770,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1793 to 1794) SpanInfo: {"start":1770,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1795 to 1808) SpanInfo: {"start":1802,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (1809 to 1819) SpanInfo: {"start":1812,"length":7} + >primary + >:=> (line 57, col 17) to (line 57, col 24) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (1820 to 1831) SpanInfo: {"start":1821,"length":9} + >secondary + >:=> (line 57, col 26) to (line 57, col 35) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~ => Pos: (1832 to 1833) SpanInfo: {"start":1802,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1834 to 1857) SpanInfo: {"start":1838,"length":16} + >getMultiRobots() + >:=> (line 57, col 43) to (line 57, col 59) +-------------------------------- +58 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1858 to 1884) SpanInfo: {"start":1862,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +59 >} + + ~~ => Pos: (1885 to 1886) SpanInfo: {"start":1862,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~ => Pos: (1887 to 1900) SpanInfo: {"start":1894,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (1901 to 1911) SpanInfo: {"start":1904,"length":7} + >primary + >:=> (line 60, col 17) to (line 60, col 24) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~ => Pos: (1912 to 1923) SpanInfo: {"start":1913,"length":9} + >secondary + >:=> (line 60, col 26) to (line 60, col 35) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~ => Pos: (1924 to 1925) SpanInfo: {"start":1894,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1926 to 1999) SpanInfo: {"start":1930,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 60, col 43) to (line 61, col 78) +-------------------------------- +61 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2000 to 2081) SpanInfo: {"start":1930,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 60, col 43) to (line 61, col 78) +-------------------------------- +62 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2082 to 2108) SpanInfo: {"start":2086,"length":21} + >console.log(primaryA) + >:=> (line 62, col 4) to (line 62, col 25) +-------------------------------- +63 >} + + ~~ => Pos: (2109 to 2110) SpanInfo: {"start":2086,"length":21} + >console.log(primaryA) + >:=> (line 62, col 4) to (line 62, col 25) +-------------------------------- +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2111 to 2128) SpanInfo: {"start":2117,"length":11} + >name: nameA + >:=> (line 64, col 6) to (line 64, col 17) +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~ => Pos: (2129 to 2144) SpanInfo: {"start":2130,"length":13} + >skill: skillA + >:=> (line 64, col 19) to (line 64, col 32) +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2145 to 2158) SpanInfo: {"start":2149,"length":6} + >robots + >:=> (line 64, col 38) to (line 64, col 44) +-------------------------------- +65 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2159 to 2182) SpanInfo: {"start":2163,"length":18} + >console.log(nameA) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +66 >} + + ~~ => Pos: (2183 to 2184) SpanInfo: {"start":2163,"length":18} + >console.log(nameA) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2185 to 2202) SpanInfo: {"start":2191,"length":11} + >name: nameA + >:=> (line 67, col 6) to (line 67, col 17) +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (2203 to 2218) SpanInfo: {"start":2204,"length":13} + >skill: skillA + >:=> (line 67, col 19) to (line 67, col 32) +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2219 to 2237) SpanInfo: {"start":2223,"length":11} + >getRobots() + >:=> (line 67, col 38) to (line 67, col 49) +-------------------------------- +68 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2238 to 2261) SpanInfo: {"start":2242,"length":18} + >console.log(nameA) + >:=> (line 68, col 4) to (line 68, col 22) +-------------------------------- +69 >} + + ~~ => Pos: (2262 to 2263) SpanInfo: {"start":2242,"length":18} + >console.log(nameA) + >:=> (line 68, col 4) to (line 68, col 22) +-------------------------------- +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2264 to 2281) SpanInfo: {"start":2270,"length":11} + >name: nameA + >:=> (line 70, col 6) to (line 70, col 17) +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~ => Pos: (2282 to 2297) SpanInfo: {"start":2283,"length":13} + >skill: skillA + >:=> (line 70, col 19) to (line 70, col 32) +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2298 to 2381) SpanInfo: {"start":2302,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 70, col 38) to (line 70, col 114) +-------------------------------- +71 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2382 to 2405) SpanInfo: {"start":2386,"length":18} + >console.log(nameA) + >:=> (line 71, col 4) to (line 71, col 22) +-------------------------------- +72 >} + + ~~ => Pos: (2406 to 2407) SpanInfo: {"start":2386,"length":18} + >console.log(nameA) + >:=> (line 71, col 4) to (line 71, col 22) +-------------------------------- +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2408 to 2425) SpanInfo: {"start":2414,"length":11} + >name: nameA + >:=> (line 73, col 6) to (line 73, col 17) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~ => Pos: (2426 to 2433) SpanInfo: {"start":2427,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 73, col 19) to (line 73, col 71) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2434 to 2454) SpanInfo: {"start":2437,"length":17} + >primary: primaryA + >:=> (line 73, col 29) to (line 73, col 46) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2455 to 2478) SpanInfo: {"start":2456,"length":21} + >secondary: secondaryA + >:=> (line 73, col 48) to (line 73, col 69) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (2479 to 2480) SpanInfo: {"start":2427,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 73, col 19) to (line 73, col 71) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2481 to 2499) SpanInfo: {"start":2485,"length":11} + >multiRobots + >:=> (line 73, col 77) to (line 73, col 88) +-------------------------------- +74 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2500 to 2523) SpanInfo: {"start":2504,"length":18} + >console.log(nameA) + >:=> (line 74, col 4) to (line 74, col 22) +-------------------------------- +75 >} + + ~~ => Pos: (2524 to 2525) SpanInfo: {"start":2504,"length":18} + >console.log(nameA) + >:=> (line 74, col 4) to (line 74, col 22) +-------------------------------- +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2526 to 2543) SpanInfo: {"start":2532,"length":11} + >name: nameA + >:=> (line 76, col 6) to (line 76, col 17) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (2544 to 2551) SpanInfo: {"start":2545,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 76, col 19) to (line 76, col 71) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2552 to 2572) SpanInfo: {"start":2555,"length":17} + >primary: primaryA + >:=> (line 76, col 29) to (line 76, col 46) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2573 to 2596) SpanInfo: {"start":2574,"length":21} + >secondary: secondaryA + >:=> (line 76, col 48) to (line 76, col 69) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (2597 to 2598) SpanInfo: {"start":2545,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 76, col 19) to (line 76, col 71) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2599 to 2622) SpanInfo: {"start":2603,"length":16} + >getMultiRobots() + >:=> (line 76, col 77) to (line 76, col 93) +-------------------------------- +77 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2623 to 2646) SpanInfo: {"start":2627,"length":18} + >console.log(nameA) + >:=> (line 77, col 4) to (line 77, col 22) +-------------------------------- +78 >} + + ~~ => Pos: (2647 to 2648) SpanInfo: {"start":2627,"length":18} + >console.log(nameA) + >:=> (line 77, col 4) to (line 77, col 22) +-------------------------------- +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~ => Pos: (2649 to 2666) SpanInfo: {"start":2655,"length":11} + >name: nameA + >:=> (line 79, col 6) to (line 79, col 17) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (2667 to 2674) SpanInfo: {"start":2668,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 79, col 19) to (line 79, col 71) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2675 to 2695) SpanInfo: {"start":2678,"length":17} + >primary: primaryA + >:=> (line 79, col 29) to (line 79, col 46) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2696 to 2719) SpanInfo: {"start":2697,"length":21} + >secondary: secondaryA + >:=> (line 79, col 48) to (line 79, col 69) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (2720 to 2721) SpanInfo: {"start":2668,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 79, col 19) to (line 79, col 71) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2722 to 2795) SpanInfo: {"start":2726,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 77) to (line 80, col 78) +-------------------------------- +80 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2796 to 2877) SpanInfo: {"start":2726,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 77) to (line 80, col 78) +-------------------------------- +81 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2878 to 2901) SpanInfo: {"start":2882,"length":18} + >console.log(nameA) + >:=> (line 81, col 4) to (line 81, col 22) +-------------------------------- +82 >} + + ~~ => Pos: (2902 to 2903) SpanInfo: {"start":2882,"length":18} + >console.log(nameA) + >:=> (line 81, col 4) to (line 81, col 22) +-------------------------------- +83 >for ({name, skill } of robots) { + + ~~~~~~~~~~~ => Pos: (2904 to 2914) SpanInfo: {"start":2910,"length":4} + >name + >:=> (line 83, col 6) to (line 83, col 10) +83 >for ({name, skill } of robots) { + + ~~~~~~~~ => Pos: (2915 to 2922) SpanInfo: {"start":2916,"length":5} + >skill + >:=> (line 83, col 12) to (line 83, col 17) +83 >for ({name, skill } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (2923 to 2936) SpanInfo: {"start":2927,"length":6} + >robots + >:=> (line 83, col 23) to (line 83, col 29) +-------------------------------- +84 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2937 to 2960) SpanInfo: {"start":2941,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +85 >} + + ~~ => Pos: (2961 to 2962) SpanInfo: {"start":2941,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~~~~ => Pos: (2963 to 2973) SpanInfo: {"start":2969,"length":4} + >name + >:=> (line 86, col 6) to (line 86, col 10) +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~ => Pos: (2974 to 2981) SpanInfo: {"start":2975,"length":5} + >skill + >:=> (line 86, col 12) to (line 86, col 17) +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2982 to 3000) SpanInfo: {"start":2986,"length":11} + >getRobots() + >:=> (line 86, col 23) to (line 86, col 34) +-------------------------------- +87 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3001 to 3024) SpanInfo: {"start":3005,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +88 >} + + ~~ => Pos: (3025 to 3026) SpanInfo: {"start":3005,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~ => Pos: (3027 to 3037) SpanInfo: {"start":3033,"length":4} + >name + >:=> (line 89, col 6) to (line 89, col 10) +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~ => Pos: (3038 to 3045) SpanInfo: {"start":3039,"length":5} + >skill + >:=> (line 89, col 12) to (line 89, col 17) +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3046 to 3129) SpanInfo: {"start":3050,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 89, col 23) to (line 89, col 99) +-------------------------------- +90 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3130 to 3153) SpanInfo: {"start":3134,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +91 >} + + ~~ => Pos: (3154 to 3155) SpanInfo: {"start":3134,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (3156 to 3166) SpanInfo: {"start":3162,"length":4} + >name + >:=> (line 92, col 6) to (line 92, col 10) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~ => Pos: (3167 to 3174) SpanInfo: {"start":3168,"length":30} + >skills: { primary, secondary } + >:=> (line 92, col 12) to (line 92, col 42) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (3175 to 3185) SpanInfo: {"start":3178,"length":7} + >primary + >:=> (line 92, col 22) to (line 92, col 29) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (3186 to 3197) SpanInfo: {"start":3187,"length":9} + >secondary + >:=> (line 92, col 31) to (line 92, col 40) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~ => Pos: (3198 to 3199) SpanInfo: {"start":3168,"length":30} + >skills: { primary, secondary } + >:=> (line 92, col 12) to (line 92, col 42) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (3200 to 3218) SpanInfo: {"start":3204,"length":11} + >multiRobots + >:=> (line 92, col 48) to (line 92, col 59) +-------------------------------- +93 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3219 to 3242) SpanInfo: {"start":3223,"length":18} + >console.log(nameA) + >:=> (line 93, col 4) to (line 93, col 22) +-------------------------------- +94 >} + + ~~ => Pos: (3243 to 3244) SpanInfo: {"start":3223,"length":18} + >console.log(nameA) + >:=> (line 93, col 4) to (line 93, col 22) +-------------------------------- +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (3245 to 3255) SpanInfo: {"start":3251,"length":4} + >name + >:=> (line 95, col 6) to (line 95, col 10) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (3256 to 3263) SpanInfo: {"start":3257,"length":30} + >skills: { primary, secondary } + >:=> (line 95, col 12) to (line 95, col 42) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (3264 to 3274) SpanInfo: {"start":3267,"length":7} + >primary + >:=> (line 95, col 22) to (line 95, col 29) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (3275 to 3286) SpanInfo: {"start":3276,"length":9} + >secondary + >:=> (line 95, col 31) to (line 95, col 40) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~ => Pos: (3287 to 3288) SpanInfo: {"start":3257,"length":30} + >skills: { primary, secondary } + >:=> (line 95, col 12) to (line 95, col 42) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3289 to 3312) SpanInfo: {"start":3293,"length":16} + >getMultiRobots() + >:=> (line 95, col 48) to (line 95, col 64) +-------------------------------- +96 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3313 to 3336) SpanInfo: {"start":3317,"length":18} + >console.log(nameA) + >:=> (line 96, col 4) to (line 96, col 22) +-------------------------------- +97 >} + + ~~ => Pos: (3337 to 3338) SpanInfo: {"start":3317,"length":18} + >console.log(nameA) + >:=> (line 96, col 4) to (line 96, col 22) +-------------------------------- +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (3339 to 3349) SpanInfo: {"start":3345,"length":4} + >name + >:=> (line 98, col 6) to (line 98, col 10) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (3350 to 3357) SpanInfo: {"start":3351,"length":30} + >skills: { primary, secondary } + >:=> (line 98, col 12) to (line 98, col 42) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (3358 to 3368) SpanInfo: {"start":3361,"length":7} + >primary + >:=> (line 98, col 22) to (line 98, col 29) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~ => Pos: (3369 to 3380) SpanInfo: {"start":3370,"length":9} + >secondary + >:=> (line 98, col 31) to (line 98, col 40) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~ => Pos: (3381 to 3382) SpanInfo: {"start":3351,"length":30} + >skills: { primary, secondary } + >:=> (line 98, col 12) to (line 98, col 42) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3383 to 3456) SpanInfo: {"start":3387,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 98, col 48) to (line 99, col 78) +-------------------------------- +99 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3457 to 3538) SpanInfo: {"start":3387,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 98, col 48) to (line 99, col 78) +-------------------------------- +100> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3539 to 3562) SpanInfo: {"start":3543,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +101>} + ~ => Pos: (3563 to 3563) SpanInfo: {"start":3543,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..18a0ebdca34 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,1223 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (603 to 686) SpanInfo: undefined +-------------------------------- +25 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (687 to 755) SpanInfo: undefined +-------------------------------- +26 >for ({name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 785) SpanInfo: {"start":762,"length":22} + >name: nameA = "noName" + >:=> (line 26, col 6) to (line 26, col 28) +26 >for ({name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (786 to 799) SpanInfo: {"start":790,"length":6} + >robots + >:=> (line 26, col 34) to (line 26, col 40) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (800 to 823) SpanInfo: {"start":804,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (824 to 825) SpanInfo: {"start":804,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ({name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (826 to 855) SpanInfo: {"start":832,"length":22} + >name: nameA = "noName" + >:=> (line 29, col 6) to (line 29, col 28) +29 >for ({name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (856 to 874) SpanInfo: {"start":860,"length":11} + >getRobots() + >:=> (line 29, col 34) to (line 29, col 45) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (875 to 898) SpanInfo: {"start":879,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (899 to 900) SpanInfo: {"start":879,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (901 to 930) SpanInfo: {"start":907,"length":22} + >name: nameA = "noName" + >:=> (line 32, col 6) to (line 32, col 28) +32 >for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (931 to 1014) SpanInfo: {"start":935,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 32, col 34) to (line 32, col 110) +-------------------------------- +33 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1015 to 1038) SpanInfo: {"start":1019,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +34 >} + + ~~ => Pos: (1039 to 1040) SpanInfo: {"start":1019,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1041 to 1054) SpanInfo: {"start":1048,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 35, col 7) to (line 36, col 48) +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1055 to 1087) SpanInfo: {"start":1058,"length":29} + >primary: primaryA = "primary" + >:=> (line 35, col 17) to (line 35, col 46) +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1088 to 1128) SpanInfo: {"start":1089,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 48) to (line 35, col 83) +-------------------------------- +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1129 to 1176) SpanInfo: {"start":1089,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 48) to (line 35, col 83) +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~=> Pos: (1177 to 1178) SpanInfo: {"start":1048,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 35, col 7) to (line 36, col 48) +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1179 to 1197) SpanInfo: {"start":1183,"length":11} + >multiRobots + >:=> (line 36, col 54) to (line 36, col 65) +-------------------------------- +37 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1198 to 1224) SpanInfo: {"start":1202,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +38 >} + + ~~ => Pos: (1225 to 1226) SpanInfo: {"start":1202,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1227 to 1240) SpanInfo: {"start":1234,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 39, col 7) to (line 40, col 48) +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1241 to 1273) SpanInfo: {"start":1244,"length":29} + >primary: primaryA = "primary" + >:=> (line 39, col 17) to (line 39, col 46) +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1274 to 1314) SpanInfo: {"start":1275,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 39, col 48) to (line 39, col 83) +-------------------------------- +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1315 to 1362) SpanInfo: {"start":1275,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 39, col 48) to (line 39, col 83) +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~=> Pos: (1363 to 1364) SpanInfo: {"start":1234,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 39, col 7) to (line 40, col 48) +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1365 to 1388) SpanInfo: {"start":1369,"length":16} + >getMultiRobots() + >:=> (line 40, col 54) to (line 40, col 70) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1389 to 1415) SpanInfo: {"start":1393,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1416 to 1417) SpanInfo: {"start":1393,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1418 to 1431) SpanInfo: {"start":1425,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 43, col 7) to (line 44, col 48) +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1432 to 1464) SpanInfo: {"start":1435,"length":29} + >primary: primaryA = "primary" + >:=> (line 43, col 17) to (line 43, col 46) +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1465 to 1505) SpanInfo: {"start":1466,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 48) to (line 43, col 83) +-------------------------------- +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1506 to 1553) SpanInfo: {"start":1466,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 48) to (line 43, col 83) +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~=> Pos: (1554 to 1555) SpanInfo: {"start":1425,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 43, col 7) to (line 44, col 48) +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~=> Pos: (1556 to 1559) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +45 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1560 to 1647) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +46 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1648 to 1733) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +47 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1734 to 1760) SpanInfo: {"start":1738,"length":21} + >console.log(primaryA) + >:=> (line 47, col 4) to (line 47, col 25) +-------------------------------- +48 >} + + ~~ => Pos: (1761 to 1762) SpanInfo: {"start":1738,"length":21} + >console.log(primaryA) + >:=> (line 47, col 4) to (line 47, col 25) +-------------------------------- +49 >for ({ name = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1763 to 1786) SpanInfo: {"start":1770,"length":15} + >name = "noName" + >:=> (line 49, col 7) to (line 49, col 22) +49 >for ({ name = "noName" } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1787 to 1800) SpanInfo: {"start":1791,"length":6} + >robots + >:=> (line 49, col 28) to (line 49, col 34) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1801 to 1824) SpanInfo: {"start":1805,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1825 to 1826) SpanInfo: {"start":1805,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for ({ name = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1827 to 1850) SpanInfo: {"start":1834,"length":15} + >name = "noName" + >:=> (line 52, col 7) to (line 52, col 22) +52 >for ({ name = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1851 to 1869) SpanInfo: {"start":1855,"length":11} + >getRobots() + >:=> (line 52, col 28) to (line 52, col 39) +-------------------------------- +53 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1870 to 1893) SpanInfo: {"start":1874,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1894 to 1895) SpanInfo: {"start":1874,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1896 to 1919) SpanInfo: {"start":1903,"length":15} + >name = "noName" + >:=> (line 55, col 7) to (line 55, col 22) +55 >for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1920 to 2003) SpanInfo: {"start":1924,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 55, col 28) to (line 55, col 104) +-------------------------------- +56 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2004 to 2027) SpanInfo: {"start":2008,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (2028 to 2029) SpanInfo: {"start":2008,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for ({ + + ~~~~~~~ => Pos: (2030 to 2036) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +-------------------------------- +59 > skills: { + + ~~~~~~~~~~~ => Pos: (2037 to 2047) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +59 > skills: { + + ~~~ => Pos: (2048 to 2050) SpanInfo: {"start":2059,"length":19} + >primary = "primary" + >:=> (line 60, col 8) to (line 60, col 27) +-------------------------------- +60 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2051 to 2079) SpanInfo: {"start":2059,"length":19} + >primary = "primary" + >:=> (line 60, col 8) to (line 60, col 27) +-------------------------------- +61 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2080 to 2111) SpanInfo: {"start":2088,"length":23} + >secondary = "secondary" + >:=> (line 61, col 8) to (line 61, col 31) +-------------------------------- +62 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2112 to 2164) SpanInfo: {"start":2088,"length":23} + >secondary = "secondary" + >:=> (line 61, col 8) to (line 61, col 31) +-------------------------------- +63 >} of multiRobots) { + + ~ => Pos: (2165 to 2165) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +63 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2166 to 2184) SpanInfo: {"start":2170,"length":11} + >multiRobots + >:=> (line 63, col 5) to (line 63, col 16) +-------------------------------- +64 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2185 to 2211) SpanInfo: {"start":2189,"length":21} + >console.log(primaryA) + >:=> (line 64, col 4) to (line 64, col 25) +-------------------------------- +65 >} + + ~~ => Pos: (2212 to 2213) SpanInfo: {"start":2189,"length":21} + >console.log(primaryA) + >:=> (line 64, col 4) to (line 64, col 25) +-------------------------------- +66 >for ({ + + ~~~~~~~ => Pos: (2214 to 2220) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +-------------------------------- +67 > skills: { + + ~~~~~~~~~~~ => Pos: (2221 to 2231) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +67 > skills: { + + ~~~ => Pos: (2232 to 2234) SpanInfo: {"start":2243,"length":19} + >primary = "primary" + >:=> (line 68, col 8) to (line 68, col 27) +-------------------------------- +68 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2235 to 2263) SpanInfo: {"start":2243,"length":19} + >primary = "primary" + >:=> (line 68, col 8) to (line 68, col 27) +-------------------------------- +69 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2264 to 2295) SpanInfo: {"start":2272,"length":23} + >secondary = "secondary" + >:=> (line 69, col 8) to (line 69, col 31) +-------------------------------- +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2296 to 2348) SpanInfo: {"start":2272,"length":23} + >secondary = "secondary" + >:=> (line 69, col 8) to (line 69, col 31) +-------------------------------- +71 >} of getMultiRobots()) { + + ~ => Pos: (2349 to 2349) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +71 >} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2350 to 2373) SpanInfo: {"start":2354,"length":16} + >getMultiRobots() + >:=> (line 71, col 5) to (line 71, col 21) +-------------------------------- +72 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2374 to 2400) SpanInfo: {"start":2378,"length":21} + >console.log(primaryA) + >:=> (line 72, col 4) to (line 72, col 25) +-------------------------------- +73 >} + + ~~ => Pos: (2401 to 2402) SpanInfo: {"start":2378,"length":21} + >console.log(primaryA) + >:=> (line 72, col 4) to (line 72, col 25) +-------------------------------- +74 >for ({ + + ~~~~~~~ => Pos: (2403 to 2409) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +-------------------------------- +75 > skills: { + + ~~~~~~~~~~~ => Pos: (2410 to 2420) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +75 > skills: { + + ~~~ => Pos: (2421 to 2423) SpanInfo: {"start":2432,"length":19} + >primary = "primary" + >:=> (line 76, col 8) to (line 76, col 27) +-------------------------------- +76 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2452) SpanInfo: {"start":2432,"length":19} + >primary = "primary" + >:=> (line 76, col 8) to (line 76, col 27) +-------------------------------- +77 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2484) SpanInfo: {"start":2461,"length":23} + >secondary = "secondary" + >:=> (line 77, col 8) to (line 77, col 31) +-------------------------------- +78 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2485 to 2537) SpanInfo: {"start":2461,"length":23} + >secondary = "secondary" + >:=> (line 77, col 8) to (line 77, col 31) +-------------------------------- +79 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (2538 to 2538) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +79 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2539 to 2612) SpanInfo: {"start":2543,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 5) to (line 80, col 78) +-------------------------------- +80 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2613 to 2694) SpanInfo: {"start":2543,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 5) to (line 80, col 78) +-------------------------------- +81 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2695 to 2721) SpanInfo: {"start":2699,"length":21} + >console.log(primaryA) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +82 >} + + ~~ => Pos: (2722 to 2723) SpanInfo: {"start":2699,"length":21} + >console.log(primaryA) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2724 to 2752) SpanInfo: {"start":2730,"length":22} + >name: nameA = "noName" + >:=> (line 83, col 6) to (line 83, col 28) +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2753 to 2780) SpanInfo: {"start":2754,"length":25} + >skill: skillA = "noSkill" + >:=> (line 83, col 30) to (line 83, col 55) +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2781 to 2794) SpanInfo: {"start":2785,"length":6} + >robots + >:=> (line 83, col 61) to (line 83, col 67) +-------------------------------- +84 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2795 to 2818) SpanInfo: {"start":2799,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +85 >} + + ~~ => Pos: (2819 to 2820) SpanInfo: {"start":2799,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2821 to 2849) SpanInfo: {"start":2827,"length":22} + >name: nameA = "noName" + >:=> (line 86, col 6) to (line 86, col 28) +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2850 to 2878) SpanInfo: {"start":2851,"length":25} + >skill: skillA = "noSkill" + >:=> (line 86, col 30) to (line 86, col 55) +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2879 to 2897) SpanInfo: {"start":2883,"length":11} + >getRobots() + >:=> (line 86, col 62) to (line 86, col 73) +-------------------------------- +87 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2898 to 2921) SpanInfo: {"start":2902,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +88 >} + + ~~ => Pos: (2922 to 2923) SpanInfo: {"start":2902,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2924 to 2952) SpanInfo: {"start":2930,"length":22} + >name: nameA = "noName" + >:=> (line 89, col 6) to (line 89, col 28) +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2953 to 2981) SpanInfo: {"start":2954,"length":25} + >skill: skillA = "noSkill" + >:=> (line 89, col 30) to (line 89, col 55) +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2982 to 3065) SpanInfo: {"start":2986,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 89, col 62) to (line 89, col 138) +-------------------------------- +90 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3066 to 3089) SpanInfo: {"start":3070,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +91 >} + + ~~ => Pos: (3090 to 3091) SpanInfo: {"start":3070,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +92 >for ({ + + ~~~~~~~ => Pos: (3092 to 3098) SpanInfo: {"start":3103,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 4) to (line 93, col 26) +-------------------------------- +93 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3099 to 3126) SpanInfo: {"start":3103,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 4) to (line 93, col 26) +-------------------------------- +94 > skills: { + + ~~~~~~~~~~~ => Pos: (3127 to 3137) SpanInfo: {"start":3131,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 94, col 4) to (line 97, col 52) +94 > skills: { + + ~~~ => Pos: (3138 to 3140) SpanInfo: {"start":3149,"length":29} + >primary: primaryA = "primary" + >:=> (line 95, col 8) to (line 95, col 37) +-------------------------------- +95 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3141 to 3179) SpanInfo: {"start":3149,"length":29} + >primary: primaryA = "primary" + >:=> (line 95, col 8) to (line 95, col 37) +-------------------------------- +96 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3180 to 3223) SpanInfo: {"start":3188,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 96, col 8) to (line 96, col 43) +-------------------------------- +97 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3224 to 3276) SpanInfo: {"start":3188,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 96, col 8) to (line 96, col 43) +-------------------------------- +98 >} of multiRobots) { + + ~ => Pos: (3277 to 3277) SpanInfo: {"start":3131,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 94, col 4) to (line 97, col 52) +98 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (3278 to 3296) SpanInfo: {"start":3282,"length":11} + >multiRobots + >:=> (line 98, col 5) to (line 98, col 16) +-------------------------------- +99 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3297 to 3320) SpanInfo: {"start":3301,"length":18} + >console.log(nameA) + >:=> (line 99, col 4) to (line 99, col 22) +-------------------------------- +100>} + + ~~ => Pos: (3321 to 3322) SpanInfo: {"start":3301,"length":18} + >console.log(nameA) + >:=> (line 99, col 4) to (line 99, col 22) +-------------------------------- +101>for ({ + + ~~~~~~~ => Pos: (3323 to 3329) SpanInfo: {"start":3334,"length":22} + >name: nameA = "noName" + >:=> (line 102, col 4) to (line 102, col 26) +-------------------------------- +102> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3330 to 3357) SpanInfo: {"start":3334,"length":22} + >name: nameA = "noName" + >:=> (line 102, col 4) to (line 102, col 26) +-------------------------------- +103> skills: { + + ~~~~~~~~~~~ => Pos: (3358 to 3368) SpanInfo: {"start":3362,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 103, col 4) to (line 106, col 52) +103> skills: { + + ~~~ => Pos: (3369 to 3371) SpanInfo: {"start":3380,"length":29} + >primary: primaryA = "primary" + >:=> (line 104, col 8) to (line 104, col 37) +-------------------------------- +104> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3372 to 3410) SpanInfo: {"start":3380,"length":29} + >primary: primaryA = "primary" + >:=> (line 104, col 8) to (line 104, col 37) +-------------------------------- +105> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3411 to 3454) SpanInfo: {"start":3419,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 105, col 8) to (line 105, col 43) +-------------------------------- +106> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3455 to 3507) SpanInfo: {"start":3419,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 105, col 8) to (line 105, col 43) +-------------------------------- +107>} of getMultiRobots()) { + + ~ => Pos: (3508 to 3508) SpanInfo: {"start":3362,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 103, col 4) to (line 106, col 52) +107>} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3509 to 3532) SpanInfo: {"start":3513,"length":16} + >getMultiRobots() + >:=> (line 107, col 5) to (line 107, col 21) +-------------------------------- +108> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3533 to 3556) SpanInfo: {"start":3537,"length":18} + >console.log(nameA) + >:=> (line 108, col 4) to (line 108, col 22) +-------------------------------- +109>} + + ~~ => Pos: (3557 to 3558) SpanInfo: {"start":3537,"length":18} + >console.log(nameA) + >:=> (line 108, col 4) to (line 108, col 22) +-------------------------------- +110>for ({ + + ~~~~~~~ => Pos: (3559 to 3565) SpanInfo: {"start":3570,"length":22} + >name: nameA = "noName" + >:=> (line 111, col 4) to (line 111, col 26) +-------------------------------- +111> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3566 to 3593) SpanInfo: {"start":3570,"length":22} + >name: nameA = "noName" + >:=> (line 111, col 4) to (line 111, col 26) +-------------------------------- +112> skills: { + + ~~~~~~~~~~~ => Pos: (3594 to 3604) SpanInfo: {"start":3598,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 112, col 4) to (line 115, col 52) +112> skills: { + + ~~~ => Pos: (3605 to 3607) SpanInfo: {"start":3616,"length":29} + >primary: primaryA = "primary" + >:=> (line 113, col 8) to (line 113, col 37) +-------------------------------- +113> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3608 to 3646) SpanInfo: {"start":3616,"length":29} + >primary: primaryA = "primary" + >:=> (line 113, col 8) to (line 113, col 37) +-------------------------------- +114> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3647 to 3690) SpanInfo: {"start":3655,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 114, col 8) to (line 114, col 43) +-------------------------------- +115> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3691 to 3743) SpanInfo: {"start":3655,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 114, col 8) to (line 114, col 43) +-------------------------------- +116>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (3744 to 3744) SpanInfo: {"start":3598,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 112, col 4) to (line 115, col 52) +116>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3745 to 3832) SpanInfo: {"start":3749,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 116, col 5) to (line 117, col 78) +-------------------------------- +117> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3833 to 3914) SpanInfo: {"start":3749,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 116, col 5) to (line 117, col 78) +-------------------------------- +118> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3915 to 3938) SpanInfo: {"start":3919,"length":18} + >console.log(nameA) + >:=> (line 118, col 4) to (line 118, col 22) +-------------------------------- +119>} + + ~~ => Pos: (3939 to 3940) SpanInfo: {"start":3919,"length":18} + >console.log(nameA) + >:=> (line 118, col 4) to (line 118, col 22) +-------------------------------- +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3941 to 3963) SpanInfo: {"start":3948,"length":15} + >name = "noName" + >:=> (line 120, col 7) to (line 120, col 22) +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (3964 to 3984) SpanInfo: {"start":3965,"length":18} + >skill = "noSkill" + >:=> (line 120, col 24) to (line 120, col 42) +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (3985 to 3998) SpanInfo: {"start":3989,"length":6} + >robots + >:=> (line 120, col 48) to (line 120, col 54) +-------------------------------- +121> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3999 to 4022) SpanInfo: {"start":4003,"length":18} + >console.log(nameA) + >:=> (line 121, col 4) to (line 121, col 22) +-------------------------------- +122>} + + ~~ => Pos: (4023 to 4024) SpanInfo: {"start":4003,"length":18} + >console.log(nameA) + >:=> (line 121, col 4) to (line 121, col 22) +-------------------------------- +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4025 to 4047) SpanInfo: {"start":4032,"length":15} + >name = "noName" + >:=> (line 123, col 7) to (line 123, col 22) +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4048 to 4068) SpanInfo: {"start":4049,"length":17} + >skill = "noSkill" + >:=> (line 123, col 24) to (line 123, col 41) +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (4069 to 4087) SpanInfo: {"start":4073,"length":11} + >getRobots() + >:=> (line 123, col 48) to (line 123, col 59) +-------------------------------- +124> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4088 to 4111) SpanInfo: {"start":4092,"length":18} + >console.log(nameA) + >:=> (line 124, col 4) to (line 124, col 22) +-------------------------------- +125>} + + ~~ => Pos: (4112 to 4113) SpanInfo: {"start":4092,"length":18} + >console.log(nameA) + >:=> (line 124, col 4) to (line 124, col 22) +-------------------------------- +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4114 to 4136) SpanInfo: {"start":4121,"length":15} + >name = "noName" + >:=> (line 126, col 7) to (line 126, col 22) +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4137 to 4157) SpanInfo: {"start":4138,"length":18} + >skill = "noSkill" + >:=> (line 126, col 24) to (line 126, col 42) +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4158 to 4241) SpanInfo: {"start":4162,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 126, col 48) to (line 126, col 124) +-------------------------------- +127> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4242 to 4265) SpanInfo: {"start":4246,"length":18} + >console.log(nameA) + >:=> (line 127, col 4) to (line 127, col 22) +-------------------------------- +128>} + + ~~ => Pos: (4266 to 4267) SpanInfo: {"start":4246,"length":18} + >console.log(nameA) + >:=> (line 127, col 4) to (line 127, col 22) +-------------------------------- +129>for ({ + + ~~~~~~~ => Pos: (4268 to 4274) SpanInfo: {"start":4279,"length":15} + >name = "noName" + >:=> (line 130, col 4) to (line 130, col 19) +-------------------------------- +130> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4275 to 4295) SpanInfo: {"start":4279,"length":15} + >name = "noName" + >:=> (line 130, col 4) to (line 130, col 19) +-------------------------------- +131> skills: { + + ~~~~~~~~~~~ => Pos: (4296 to 4306) SpanInfo: {"start":4300,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 131, col 4) to (line 134, col 52) +131> skills: { + + ~~~ => Pos: (4307 to 4309) SpanInfo: {"start":4318,"length":19} + >primary = "primary" + >:=> (line 132, col 8) to (line 132, col 27) +-------------------------------- +132> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4310 to 4338) SpanInfo: {"start":4318,"length":19} + >primary = "primary" + >:=> (line 132, col 8) to (line 132, col 27) +-------------------------------- +133> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4339 to 4370) SpanInfo: {"start":4347,"length":23} + >secondary = "secondary" + >:=> (line 133, col 8) to (line 133, col 31) +-------------------------------- +134> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4371 to 4423) SpanInfo: {"start":4347,"length":23} + >secondary = "secondary" + >:=> (line 133, col 8) to (line 133, col 31) +-------------------------------- +135>} of multiRobots) { + + ~ => Pos: (4424 to 4424) SpanInfo: {"start":4300,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 131, col 4) to (line 134, col 52) +135>} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (4425 to 4443) SpanInfo: {"start":4429,"length":11} + >multiRobots + >:=> (line 135, col 5) to (line 135, col 16) +-------------------------------- +136> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4444 to 4467) SpanInfo: {"start":4448,"length":18} + >console.log(nameA) + >:=> (line 136, col 4) to (line 136, col 22) +-------------------------------- +137>} + + ~~ => Pos: (4468 to 4469) SpanInfo: {"start":4448,"length":18} + >console.log(nameA) + >:=> (line 136, col 4) to (line 136, col 22) +-------------------------------- +138>for ({ + + ~~~~~~~ => Pos: (4470 to 4476) SpanInfo: {"start":4481,"length":15} + >name = "noName" + >:=> (line 139, col 4) to (line 139, col 19) +-------------------------------- +139> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4477 to 4497) SpanInfo: {"start":4481,"length":15} + >name = "noName" + >:=> (line 139, col 4) to (line 139, col 19) +-------------------------------- +140> skills: { + + ~~~~~~~~~~~ => Pos: (4498 to 4508) SpanInfo: {"start":4502,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 140, col 4) to (line 143, col 52) +140> skills: { + + ~~~ => Pos: (4509 to 4511) SpanInfo: {"start":4520,"length":19} + >primary = "primary" + >:=> (line 141, col 8) to (line 141, col 27) +-------------------------------- +141> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4512 to 4540) SpanInfo: {"start":4520,"length":19} + >primary = "primary" + >:=> (line 141, col 8) to (line 141, col 27) +-------------------------------- +142> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4541 to 4572) SpanInfo: {"start":4549,"length":23} + >secondary = "secondary" + >:=> (line 142, col 8) to (line 142, col 31) +-------------------------------- +143> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4573 to 4625) SpanInfo: {"start":4549,"length":23} + >secondary = "secondary" + >:=> (line 142, col 8) to (line 142, col 31) +-------------------------------- +144>} of getMultiRobots()) { + + ~ => Pos: (4626 to 4626) SpanInfo: {"start":4502,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 140, col 4) to (line 143, col 52) +144>} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4627 to 4650) SpanInfo: {"start":4631,"length":16} + >getMultiRobots() + >:=> (line 144, col 5) to (line 144, col 21) +-------------------------------- +145> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4651 to 4674) SpanInfo: {"start":4655,"length":18} + >console.log(nameA) + >:=> (line 145, col 4) to (line 145, col 22) +-------------------------------- +146>} + + ~~ => Pos: (4675 to 4676) SpanInfo: {"start":4655,"length":18} + >console.log(nameA) + >:=> (line 145, col 4) to (line 145, col 22) +-------------------------------- +147>for ({ + + ~~~~~~~ => Pos: (4677 to 4683) SpanInfo: {"start":4688,"length":15} + >name = "noName" + >:=> (line 148, col 4) to (line 148, col 19) +-------------------------------- +148> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4684 to 4704) SpanInfo: {"start":4688,"length":15} + >name = "noName" + >:=> (line 148, col 4) to (line 148, col 19) +-------------------------------- +149> skills: { + + ~~~~~~~~~~~ => Pos: (4705 to 4715) SpanInfo: {"start":4709,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 149, col 4) to (line 152, col 52) +149> skills: { + + ~~~ => Pos: (4716 to 4718) SpanInfo: {"start":4727,"length":19} + >primary = "primary" + >:=> (line 150, col 8) to (line 150, col 27) +-------------------------------- +150> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4719 to 4747) SpanInfo: {"start":4727,"length":19} + >primary = "primary" + >:=> (line 150, col 8) to (line 150, col 27) +-------------------------------- +151> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4748 to 4779) SpanInfo: {"start":4756,"length":23} + >secondary = "secondary" + >:=> (line 151, col 8) to (line 151, col 31) +-------------------------------- +152> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4780 to 4832) SpanInfo: {"start":4756,"length":23} + >secondary = "secondary" + >:=> (line 151, col 8) to (line 151, col 31) +-------------------------------- +153>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (4833 to 4833) SpanInfo: {"start":4709,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 149, col 4) to (line 152, col 52) +153>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4834 to 4907) SpanInfo: {"start":4838,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 153, col 5) to (line 154, col 78) +-------------------------------- +154> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4908 to 4989) SpanInfo: {"start":4838,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 153, col 5) to (line 154, col 78) +-------------------------------- +155> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4990 to 5013) SpanInfo: {"start":4994,"length":18} + >console.log(nameA) + >:=> (line 155, col 4) to (line 155, col 22) +-------------------------------- +156>} + ~ => Pos: (5014 to 5014) SpanInfo: {"start":4994,"length":18} + >console.log(nameA) + >:=> (line 155, col 4) to (line 155, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline new file mode 100644 index 00000000000..87bf1b5a179 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline @@ -0,0 +1,365 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (142 to 142) SpanInfo: undefined +-------------------------------- +7 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (143 to 186) SpanInfo: {"start":143,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 234) SpanInfo: {"start":187,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 8, col 0) to (line 8, col 46) +-------------------------------- +9 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (235 to 298) SpanInfo: {"start":235,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 9, col 0) to (line 9, col 62) +-------------------------------- +10 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (299 to 372) SpanInfo: {"start":299,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 10, col 0) to (line 10, col 72) +-------------------------------- +11 > + + ~ => Pos: (373 to 373) SpanInfo: undefined +-------------------------------- +12 >let nameA: string, numberB: number, nameB: string, skillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (374 to 440) SpanInfo: undefined +-------------------------------- +13 >let robotAInfo: (number | string)[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (441 to 477) SpanInfo: undefined +-------------------------------- +14 > + + ~ => Pos: (478 to 478) SpanInfo: undefined +-------------------------------- +15 >let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (479 to 577) SpanInfo: undefined +-------------------------------- +16 >let multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (578 to 629) SpanInfo: undefined +-------------------------------- +17 > + + ~ => Pos: (630 to 630) SpanInfo: undefined +-------------------------------- +18 >[, nameA] = robotA; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (631 to 650) SpanInfo: {"start":634,"length":5} + >nameA + >:=> (line 18, col 3) to (line 18, col 8) +-------------------------------- +19 >[, nameB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (651 to 675) SpanInfo: {"start":654,"length":5} + >nameB + >:=> (line 19, col 3) to (line 19, col 8) +-------------------------------- +20 >[, nameB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (676 to 715) SpanInfo: {"start":679,"length":5} + >nameB + >:=> (line 20, col 3) to (line 20, col 8) +-------------------------------- +21 >[, multiSkillB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (716 to 746) SpanInfo: {"start":719,"length":11} + >multiSkillB + >:=> (line 21, col 3) to (line 21, col 14) +-------------------------------- +22 >[, multiSkillB] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (747 to 782) SpanInfo: {"start":750,"length":11} + >multiSkillB + >:=> (line 22, col 3) to (line 22, col 14) +-------------------------------- +23 >[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (783 to 835) SpanInfo: {"start":786,"length":11} + >multiSkillB + >:=> (line 23, col 3) to (line 23, col 14) +-------------------------------- +24 > + + ~ => Pos: (836 to 836) SpanInfo: undefined +-------------------------------- +25 >[numberB] = robotB; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (837 to 856) SpanInfo: {"start":838,"length":7} + >numberB + >:=> (line 25, col 1) to (line 25, col 8) +-------------------------------- +26 >[numberB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (857 to 881) SpanInfo: {"start":858,"length":7} + >numberB + >:=> (line 26, col 1) to (line 26, col 8) +-------------------------------- +27 >[numberB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (882 to 921) SpanInfo: {"start":883,"length":7} + >numberB + >:=> (line 27, col 1) to (line 27, col 8) +-------------------------------- +28 >[nameMB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (922 to 945) SpanInfo: {"start":923,"length":6} + >nameMB + >:=> (line 28, col 1) to (line 28, col 7) +-------------------------------- +29 >[nameMB] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (946 to 974) SpanInfo: {"start":947,"length":6} + >nameMB + >:=> (line 29, col 1) to (line 29, col 7) +-------------------------------- +30 >[nameMB] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (975 to 1022) SpanInfo: {"start":976,"length":6} + >nameMB + >:=> (line 30, col 1) to (line 30, col 7) +-------------------------------- +31 > + + ~ => Pos: (1023 to 1023) SpanInfo: undefined +-------------------------------- +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~~~ => Pos: (1024 to 1032) SpanInfo: {"start":1025,"length":7} + >numberB + >:=> (line 32, col 1) to (line 32, col 8) +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~ => Pos: (1033 to 1039) SpanInfo: {"start":1034,"length":5} + >nameB + >:=> (line 32, col 10) to (line 32, col 15) +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1040 to 1058) SpanInfo: {"start":1041,"length":6} + >skillB + >:=> (line 32, col 17) to (line 32, col 23) +-------------------------------- +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~~~ => Pos: (1059 to 1067) SpanInfo: {"start":1060,"length":7} + >numberB + >:=> (line 33, col 1) to (line 33, col 8) +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~ => Pos: (1068 to 1074) SpanInfo: {"start":1069,"length":5} + >nameB + >:=> (line 33, col 10) to (line 33, col 15) +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1075 to 1098) SpanInfo: {"start":1076,"length":6} + >skillB + >:=> (line 33, col 17) to (line 33, col 23) +-------------------------------- +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~ => Pos: (1099 to 1107) SpanInfo: {"start":1100,"length":7} + >numberB + >:=> (line 34, col 1) to (line 34, col 8) +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~ => Pos: (1108 to 1114) SpanInfo: {"start":1109,"length":5} + >nameB + >:=> (line 34, col 10) to (line 34, col 15) +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1115 to 1153) SpanInfo: {"start":1116,"length":6} + >skillB + >:=> (line 34, col 17) to (line 34, col 23) +-------------------------------- +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~ => Pos: (1154 to 1161) SpanInfo: {"start":1155,"length":6} + >nameMB + >:=> (line 35, col 1) to (line 35, col 7) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~ => Pos: (1162 to 1177) SpanInfo: {"start":1164,"length":13} + >primarySkillB + >:=> (line 35, col 10) to (line 35, col 23) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~~ => Pos: (1178 to 1194) SpanInfo: {"start":1179,"length":15} + >secondarySkillB + >:=> (line 35, col 25) to (line 35, col 40) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~~=> Pos: (1195 to 1211) SpanInfo: {"start":1163,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 35, col 9) to (line 35, col 41) +-------------------------------- +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~ => Pos: (1212 to 1219) SpanInfo: {"start":1213,"length":6} + >nameMB + >:=> (line 36, col 1) to (line 36, col 7) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~ => Pos: (1220 to 1235) SpanInfo: {"start":1222,"length":13} + >primarySkillB + >:=> (line 36, col 10) to (line 36, col 23) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~ => Pos: (1236 to 1252) SpanInfo: {"start":1237,"length":15} + >secondarySkillB + >:=> (line 36, col 25) to (line 36, col 40) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1253 to 1274) SpanInfo: {"start":1221,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 36, col 9) to (line 36, col 41) +-------------------------------- +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~ => Pos: (1275 to 1282) SpanInfo: {"start":1276,"length":6} + >nameMB + >:=> (line 37, col 1) to (line 37, col 7) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~ => Pos: (1283 to 1298) SpanInfo: {"start":1285,"length":13} + >primarySkillB + >:=> (line 37, col 10) to (line 37, col 23) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~ => Pos: (1299 to 1315) SpanInfo: {"start":1300,"length":15} + >secondarySkillB + >:=> (line 37, col 25) to (line 37, col 40) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1316 to 1356) SpanInfo: {"start":1284,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 37, col 9) to (line 37, col 41) +-------------------------------- +38 > + + ~ => Pos: (1357 to 1357) SpanInfo: undefined +-------------------------------- +39 >[numberB, ...robotAInfo] = robotB; + + ~~~~~~~~~ => Pos: (1358 to 1366) SpanInfo: {"start":1359,"length":7} + >numberB + >:=> (line 39, col 1) to (line 39, col 8) +39 >[numberB, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1367 to 1392) SpanInfo: {"start":1368,"length":13} + >...robotAInfo + >:=> (line 39, col 10) to (line 39, col 23) +-------------------------------- +40 >[numberB, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~ => Pos: (1393 to 1401) SpanInfo: {"start":1394,"length":7} + >numberB + >:=> (line 40, col 1) to (line 40, col 8) +40 >[numberB, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1402 to 1432) SpanInfo: {"start":1403,"length":13} + >...robotAInfo + >:=> (line 40, col 10) to (line 40, col 23) +-------------------------------- +41 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~ => Pos: (1433 to 1441) SpanInfo: {"start":1434,"length":7} + >numberB + >:=> (line 41, col 1) to (line 41, col 8) +41 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1442 to 1494) SpanInfo: {"start":1443,"length":13} + >...robotAInfo + >:=> (line 41, col 10) to (line 41, col 23) +-------------------------------- +42 >[...multiRobotAInfo] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1495 to 1530) SpanInfo: {"start":1496,"length":18} + >...multiRobotAInfo + >:=> (line 42, col 1) to (line 42, col 19) +-------------------------------- +43 >[...multiRobotAInfo] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1531 to 1571) SpanInfo: {"start":1532,"length":18} + >...multiRobotAInfo + >:=> (line 43, col 1) to (line 43, col 19) +-------------------------------- +44 >[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1572 to 1631) SpanInfo: {"start":1573,"length":18} + >...multiRobotAInfo + >:=> (line 44, col 1) to (line 44, col 19) +-------------------------------- +45 > + + ~ => Pos: (1632 to 1632) SpanInfo: undefined +-------------------------------- +46 >function getRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1633 to 1655) SpanInfo: {"start":1660,"length":13} + >return robotB + >:=> (line 47, col 4) to (line 47, col 17) +-------------------------------- +47 > return robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1656 to 1674) SpanInfo: {"start":1660,"length":13} + >return robotB + >:=> (line 47, col 4) to (line 47, col 17) +-------------------------------- +48 >} + + ~~ => Pos: (1675 to 1676) SpanInfo: {"start":1675,"length":1} + >} + >:=> (line 48, col 0) to (line 48, col 1) +-------------------------------- +49 > + + ~ => Pos: (1677 to 1677) SpanInfo: undefined +-------------------------------- +50 >function getMultiRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1678 to 1705) SpanInfo: {"start":1710,"length":18} + >return multiRobotB + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +51 > return multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1706 to 1729) SpanInfo: {"start":1710,"length":18} + >return multiRobotB + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + ~ => Pos: (1730 to 1730) SpanInfo: {"start":1730,"length":1} + >} + >:=> (line 52, col 0) to (line 52, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..7169d67bfef --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,353 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 133) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (134 to 134) SpanInfo: undefined +-------------------------------- +7 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (135 to 178) SpanInfo: {"start":135,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (179 to 226) SpanInfo: {"start":179,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 8, col 0) to (line 8, col 46) +-------------------------------- +9 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (227 to 290) SpanInfo: {"start":227,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 9, col 0) to (line 9, col 62) +-------------------------------- +10 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (291 to 364) SpanInfo: {"start":291,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 10, col 0) to (line 10, col 72) +-------------------------------- +11 > + + ~ => Pos: (365 to 365) SpanInfo: undefined +-------------------------------- +12 >let nameA: string, numberB: number, nameB: string, skillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (366 to 432) SpanInfo: undefined +-------------------------------- +13 >let robotAInfo: (number | string)[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (433 to 469) SpanInfo: undefined +-------------------------------- +14 > + + ~ => Pos: (470 to 470) SpanInfo: undefined +-------------------------------- +15 >let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (471 to 561) SpanInfo: undefined +-------------------------------- +16 >let multiRobotAInfo: (string | string[])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (562 to 605) SpanInfo: undefined +-------------------------------- +17 > + + ~ => Pos: (606 to 606) SpanInfo: undefined +-------------------------------- +18 >[, nameA = "helloNoName"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (607 to 642) SpanInfo: {"start":610,"length":21} + >nameA = "helloNoName" + >:=> (line 18, col 3) to (line 18, col 24) +-------------------------------- +19 >[, nameB = "helloNoName"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (643 to 683) SpanInfo: {"start":646,"length":21} + >nameB = "helloNoName" + >:=> (line 19, col 3) to (line 19, col 24) +-------------------------------- +20 >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (684 to 739) SpanInfo: {"start":687,"length":21} + >nameB = "helloNoName" + >:=> (line 20, col 3) to (line 20, col 24) +-------------------------------- +21 >[, multiSkillB = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (740 to 775) SpanInfo: {"start":743,"length":16} + >multiSkillB = [] + >:=> (line 21, col 3) to (line 21, col 19) +-------------------------------- +22 >[, multiSkillB = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (776 to 816) SpanInfo: {"start":779,"length":16} + >multiSkillB = [] + >:=> (line 22, col 3) to (line 22, col 19) +-------------------------------- +23 >[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (817 to 874) SpanInfo: {"start":820,"length":16} + >multiSkillB = [] + >:=> (line 23, col 3) to (line 23, col 19) +-------------------------------- +24 > + + ~ => Pos: (875 to 875) SpanInfo: undefined +-------------------------------- +25 >[numberB = -1] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (876 to 900) SpanInfo: {"start":877,"length":12} + >numberB = -1 + >:=> (line 25, col 1) to (line 25, col 13) +-------------------------------- +26 >[numberB = -1] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (901 to 930) SpanInfo: {"start":902,"length":12} + >numberB = -1 + >:=> (line 26, col 1) to (line 26, col 13) +-------------------------------- +27 >[numberB = -1] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (931 to 975) SpanInfo: {"start":932,"length":12} + >numberB = -1 + >:=> (line 27, col 1) to (line 27, col 13) +-------------------------------- +28 >[nameMB = "helloNoName"] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (976 to 1015) SpanInfo: {"start":977,"length":22} + >nameMB = "helloNoName" + >:=> (line 28, col 1) to (line 28, col 23) +-------------------------------- +29 >[nameMB = "helloNoName"] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1016 to 1060) SpanInfo: {"start":1017,"length":22} + >nameMB = "helloNoName" + >:=> (line 29, col 1) to (line 29, col 23) +-------------------------------- +30 >[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1061 to 1124) SpanInfo: {"start":1062,"length":22} + >nameMB = "helloNoName" + >:=> (line 30, col 1) to (line 30, col 23) +-------------------------------- +31 > + + ~ => Pos: (1125 to 1125) SpanInfo: undefined +-------------------------------- +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~ => Pos: (1126 to 1139) SpanInfo: {"start":1127,"length":12} + >numberB = -1 + >:=> (line 32, col 1) to (line 32, col 13) +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1140 to 1162) SpanInfo: {"start":1141,"length":21} + >nameB = "helloNoName" + >:=> (line 32, col 15) to (line 32, col 36) +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1163 to 1193) SpanInfo: {"start":1164,"length":18} + >skillB = "noSkill" + >:=> (line 32, col 38) to (line 32, col 56) +-------------------------------- +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~ => Pos: (1194 to 1207) SpanInfo: {"start":1195,"length":12} + >numberB = -1 + >:=> (line 33, col 1) to (line 33, col 13) +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1208 to 1230) SpanInfo: {"start":1209,"length":21} + >nameB = "helloNoName" + >:=> (line 33, col 15) to (line 33, col 36) +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1231 to 1266) SpanInfo: {"start":1232,"length":18} + >skillB = "noSkill" + >:=> (line 33, col 38) to (line 33, col 56) +-------------------------------- +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~ => Pos: (1267 to 1280) SpanInfo: {"start":1268,"length":12} + >numberB = -1 + >:=> (line 34, col 1) to (line 34, col 13) +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1281 to 1303) SpanInfo: {"start":1282,"length":21} + >nameB = "helloNoName" + >:=> (line 34, col 15) to (line 34, col 36) +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1304 to 1354) SpanInfo: {"start":1305,"length":18} + >skillB = "noSkill" + >:=> (line 34, col 38) to (line 34, col 56) +-------------------------------- +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1355 to 1378) SpanInfo: {"start":1356,"length":22} + >nameMB = "helloNoName" + >:=> (line 35, col 1) to (line 35, col 23) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1379 to 1406) SpanInfo: {"start":1381,"length":25} + >primarySkillB = "noSkill" + >:=> (line 35, col 26) to (line 35, col 51) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1407 to 1440) SpanInfo: {"start":1408,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 35, col 53) to (line 35, col 80) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~=> Pos: (1441 to 1457) SpanInfo: {"start":1380,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 35, col 25) to (line 35, col 86) +-------------------------------- +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1458 to 1481) SpanInfo: {"start":1459,"length":22} + >nameMB = "helloNoName" + >:=> (line 36, col 1) to (line 36, col 23) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1482 to 1509) SpanInfo: {"start":1484,"length":25} + >primarySkillB = "noSkill" + >:=> (line 36, col 26) to (line 36, col 51) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1510 to 1543) SpanInfo: {"start":1511,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 36, col 53) to (line 36, col 80) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1544 to 1565) SpanInfo: {"start":1483,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 36, col 25) to (line 36, col 86) +-------------------------------- +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1566 to 1589) SpanInfo: {"start":1567,"length":22} + >nameMB = "helloNoName" + >:=> (line 37, col 1) to (line 37, col 23) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1590 to 1617) SpanInfo: {"start":1592,"length":25} + >primarySkillB = "noSkill" + >:=> (line 37, col 26) to (line 37, col 51) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1618 to 1651) SpanInfo: {"start":1619,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 37, col 53) to (line 37, col 80) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~=> Pos: (1652 to 1655) SpanInfo: {"start":1591,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 37, col 25) to (line 37, col 86) +-------------------------------- +38 > ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1656 to 1696) SpanInfo: {"start":1591,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 37, col 25) to (line 37, col 86) +-------------------------------- +39 > + + ~ => Pos: (1697 to 1697) SpanInfo: undefined +-------------------------------- +40 >[numberB = -1, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~ => Pos: (1698 to 1711) SpanInfo: {"start":1699,"length":12} + >numberB = -1 + >:=> (line 40, col 1) to (line 40, col 13) +40 >[numberB = -1, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1712 to 1737) SpanInfo: {"start":1713,"length":13} + >...robotAInfo + >:=> (line 40, col 15) to (line 40, col 28) +-------------------------------- +41 >[numberB = -1, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~ => Pos: (1738 to 1751) SpanInfo: {"start":1739,"length":12} + >numberB = -1 + >:=> (line 41, col 1) to (line 41, col 13) +41 >[numberB = -1, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1752 to 1782) SpanInfo: {"start":1753,"length":13} + >...robotAInfo + >:=> (line 41, col 15) to (line 41, col 28) +-------------------------------- +42 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~ => Pos: (1783 to 1796) SpanInfo: {"start":1784,"length":12} + >numberB = -1 + >:=> (line 42, col 1) to (line 42, col 13) +42 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1797 to 1849) SpanInfo: {"start":1798,"length":13} + >...robotAInfo + >:=> (line 42, col 15) to (line 42, col 28) +-------------------------------- +43 > + + ~ => Pos: (1850 to 1850) SpanInfo: undefined +-------------------------------- +44 >function getRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1851 to 1873) SpanInfo: {"start":1878,"length":13} + >return robotB + >:=> (line 45, col 4) to (line 45, col 17) +-------------------------------- +45 > return robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1874 to 1892) SpanInfo: {"start":1878,"length":13} + >return robotB + >:=> (line 45, col 4) to (line 45, col 17) +-------------------------------- +46 >} + + ~~ => Pos: (1893 to 1894) SpanInfo: {"start":1893,"length":1} + >} + >:=> (line 46, col 0) to (line 46, col 1) +-------------------------------- +47 > + + ~ => Pos: (1895 to 1895) SpanInfo: undefined +-------------------------------- +48 >function getMultiRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1896 to 1923) SpanInfo: {"start":1928,"length":18} + >return multiRobotB + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +49 > return multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1924 to 1947) SpanInfo: {"start":1928,"length":18} + >return multiRobotB + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + ~ => Pos: (1948 to 1948) SpanInfo: {"start":1948,"length":1} + >} + >:=> (line 50, col 0) to (line 50, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline new file mode 100644 index 00000000000..9a65a6f2e95 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline @@ -0,0 +1,1024 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (142 to 142) SpanInfo: undefined +-------------------------------- +7 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (143 to 186) SpanInfo: {"start":143,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 208) SpanInfo: {"start":213,"length":13} + >return robotA + >:=> (line 9, col 4) to (line 9, col 17) +-------------------------------- +9 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (209 to 227) SpanInfo: {"start":213,"length":13} + >return robotA + >:=> (line 9, col 4) to (line 9, col 17) +-------------------------------- +10 >} + + ~~ => Pos: (228 to 229) SpanInfo: {"start":228,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 > + + ~ => Pos: (230 to 230) SpanInfo: undefined +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (231 to 294) SpanInfo: {"start":231,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (295 to 368) SpanInfo: {"start":295,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (369 to 395) SpanInfo: {"start":400,"length":18} + >return multiRobotA + >:=> (line 15, col 4) to (line 15, col 22) +-------------------------------- +15 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (396 to 419) SpanInfo: {"start":400,"length":18} + >return multiRobotA + >:=> (line 15, col 4) to (line 15, col 22) +-------------------------------- +16 >} + + ~~ => Pos: (420 to 421) SpanInfo: {"start":420,"length":1} + >} + >:=> (line 16, col 0) to (line 16, col 1) +-------------------------------- +17 > + + ~ => Pos: (422 to 422) SpanInfo: undefined +-------------------------------- +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (423 to 450) SpanInfo: {"start":435,"length":5} + >nameA + >:=> (line 18, col 12) to (line 18, col 17) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (451 to 457) SpanInfo: {"start":452,"length":5} + >i = 0 + >:=> (line 18, col 29) to (line 18, col 34) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (458 to 464) SpanInfo: {"start":459,"length":5} + >i < 1 + >:=> (line 18, col 36) to (line 18, col 41) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (465 to 472) SpanInfo: {"start":466,"length":3} + >i++ + >:=> (line 18, col 43) to (line 18, col 46) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (473 to 496) SpanInfo: {"start":477,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (497 to 498) SpanInfo: {"start":477,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (499 to 530) SpanInfo: {"start":511,"length":5} + >nameA + >:=> (line 21, col 12) to (line 21, col 17) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (531 to 537) SpanInfo: {"start":532,"length":5} + >i = 0 + >:=> (line 21, col 33) to (line 21, col 38) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (538 to 544) SpanInfo: {"start":539,"length":5} + >i < 1 + >:=> (line 21, col 40) to (line 21, col 45) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (545 to 552) SpanInfo: {"start":546,"length":3} + >i++ + >:=> (line 21, col 47) to (line 21, col 50) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (553 to 576) SpanInfo: {"start":557,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (577 to 578) SpanInfo: {"start":557,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (579 to 626) SpanInfo: {"start":591,"length":5} + >nameA + >:=> (line 24, col 12) to (line 24, col 17) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (627 to 633) SpanInfo: {"start":628,"length":5} + >i = 0 + >:=> (line 24, col 49) to (line 24, col 54) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (634 to 640) SpanInfo: {"start":635,"length":5} + >i < 1 + >:=> (line 24, col 56) to (line 24, col 61) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (641 to 648) SpanInfo: {"start":642,"length":3} + >i++ + >:=> (line 24, col 63) to (line 24, col 66) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (649 to 672) SpanInfo: {"start":653,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (673 to 674) SpanInfo: {"start":653,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (675 to 685) SpanInfo: {"start":687,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (686 to 701) SpanInfo: {"start":688,"length":13} + >primarySkillA + >:=> (line 27, col 13) to (line 27, col 26) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (702 to 718) SpanInfo: {"start":703,"length":15} + >secondarySkillA + >:=> (line 27, col 28) to (line 27, col 43) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (719 to 734) SpanInfo: {"start":687,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (735 to 741) SpanInfo: {"start":736,"length":5} + >i = 0 + >:=> (line 27, col 61) to (line 27, col 66) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (742 to 748) SpanInfo: {"start":743,"length":5} + >i < 1 + >:=> (line 27, col 68) to (line 27, col 73) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (749 to 756) SpanInfo: {"start":750,"length":3} + >i++ + >:=> (line 27, col 75) to (line 27, col 78) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (757 to 788) SpanInfo: {"start":761,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (789 to 790) SpanInfo: {"start":761,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (791 to 801) SpanInfo: {"start":803,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (802 to 817) SpanInfo: {"start":804,"length":13} + >primarySkillA + >:=> (line 30, col 13) to (line 30, col 26) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (818 to 834) SpanInfo: {"start":819,"length":15} + >secondarySkillA + >:=> (line 30, col 28) to (line 30, col 43) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (835 to 854) SpanInfo: {"start":803,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (855 to 861) SpanInfo: {"start":856,"length":5} + >i = 0 + >:=> (line 30, col 65) to (line 30, col 70) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (862 to 868) SpanInfo: {"start":863,"length":5} + >i < 1 + >:=> (line 30, col 72) to (line 30, col 77) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (869 to 876) SpanInfo: {"start":870,"length":3} + >i++ + >:=> (line 30, col 79) to (line 30, col 82) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (877 to 908) SpanInfo: {"start":881,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (909 to 910) SpanInfo: {"start":881,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (911 to 921) SpanInfo: {"start":923,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (922 to 937) SpanInfo: {"start":924,"length":13} + >primarySkillA + >:=> (line 33, col 13) to (line 33, col 26) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (938 to 954) SpanInfo: {"start":939,"length":15} + >secondarySkillA + >:=> (line 33, col 28) to (line 33, col 43) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (955 to 994) SpanInfo: {"start":923,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (995 to 1001) SpanInfo: {"start":996,"length":5} + >i = 0 + >:=> (line 33, col 85) to (line 33, col 90) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1002 to 1008) SpanInfo: {"start":1003,"length":5} + >i < 1 + >:=> (line 33, col 92) to (line 33, col 97) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1009 to 1016) SpanInfo: {"start":1010,"length":3} + >i++ + >:=> (line 33, col 99) to (line 33, col 102) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1017 to 1048) SpanInfo: {"start":1021,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1049 to 1050) SpanInfo: {"start":1021,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 > + + ~ => Pos: (1051 to 1051) SpanInfo: undefined +-------------------------------- +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1052 to 1079) SpanInfo: {"start":1062,"length":7} + >numberB + >:=> (line 37, col 10) to (line 37, col 17) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1080 to 1086) SpanInfo: {"start":1081,"length":5} + >i = 0 + >:=> (line 37, col 29) to (line 37, col 34) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1087 to 1093) SpanInfo: {"start":1088,"length":5} + >i < 1 + >:=> (line 37, col 36) to (line 37, col 41) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1094 to 1101) SpanInfo: {"start":1095,"length":3} + >i++ + >:=> (line 37, col 43) to (line 37, col 46) +-------------------------------- +38 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1102 to 1127) SpanInfo: {"start":1106,"length":20} + >console.log(numberB) + >:=> (line 38, col 4) to (line 38, col 24) +-------------------------------- +39 >} + + ~~ => Pos: (1128 to 1129) SpanInfo: {"start":1106,"length":20} + >console.log(numberB) + >:=> (line 38, col 4) to (line 38, col 24) +-------------------------------- +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1130 to 1161) SpanInfo: {"start":1140,"length":7} + >numberB + >:=> (line 40, col 10) to (line 40, col 17) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1162 to 1168) SpanInfo: {"start":1163,"length":5} + >i = 0 + >:=> (line 40, col 33) to (line 40, col 38) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1169 to 1175) SpanInfo: {"start":1170,"length":5} + >i < 1 + >:=> (line 40, col 40) to (line 40, col 45) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1176 to 1183) SpanInfo: {"start":1177,"length":3} + >i++ + >:=> (line 40, col 47) to (line 40, col 50) +-------------------------------- +41 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1184 to 1209) SpanInfo: {"start":1188,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +42 >} + + ~~ => Pos: (1210 to 1211) SpanInfo: {"start":1188,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1212 to 1259) SpanInfo: {"start":1222,"length":7} + >numberB + >:=> (line 43, col 10) to (line 43, col 17) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1260 to 1266) SpanInfo: {"start":1261,"length":5} + >i = 0 + >:=> (line 43, col 49) to (line 43, col 54) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1267 to 1273) SpanInfo: {"start":1268,"length":5} + >i < 1 + >:=> (line 43, col 56) to (line 43, col 61) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1274 to 1281) SpanInfo: {"start":1275,"length":3} + >i++ + >:=> (line 43, col 63) to (line 43, col 66) +-------------------------------- +44 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1282 to 1307) SpanInfo: {"start":1286,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +45 >} + + ~~ => Pos: (1308 to 1309) SpanInfo: {"start":1286,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1310 to 1340) SpanInfo: {"start":1320,"length":5} + >nameB + >:=> (line 46, col 10) to (line 46, col 15) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1341 to 1347) SpanInfo: {"start":1342,"length":5} + >i = 0 + >:=> (line 46, col 32) to (line 46, col 37) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1348 to 1354) SpanInfo: {"start":1349,"length":5} + >i < 1 + >:=> (line 46, col 39) to (line 46, col 44) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1355 to 1362) SpanInfo: {"start":1356,"length":3} + >i++ + >:=> (line 46, col 46) to (line 46, col 49) +-------------------------------- +47 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1363 to 1386) SpanInfo: {"start":1367,"length":18} + >console.log(nameB) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1387 to 1388) SpanInfo: {"start":1367,"length":18} + >console.log(nameB) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1389 to 1423) SpanInfo: {"start":1399,"length":5} + >nameB + >:=> (line 49, col 10) to (line 49, col 15) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1424 to 1430) SpanInfo: {"start":1425,"length":5} + >i = 0 + >:=> (line 49, col 36) to (line 49, col 41) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1431 to 1437) SpanInfo: {"start":1432,"length":5} + >i < 1 + >:=> (line 49, col 43) to (line 49, col 48) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1438 to 1445) SpanInfo: {"start":1439,"length":3} + >i++ + >:=> (line 49, col 50) to (line 49, col 53) +-------------------------------- +50 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1446 to 1469) SpanInfo: {"start":1450,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1470 to 1471) SpanInfo: {"start":1450,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1472 to 1526) SpanInfo: {"start":1482,"length":5} + >nameB + >:=> (line 52, col 10) to (line 52, col 15) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1527 to 1533) SpanInfo: {"start":1528,"length":5} + >i = 0 + >:=> (line 52, col 56) to (line 52, col 61) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1534 to 1540) SpanInfo: {"start":1535,"length":5} + >i < 1 + >:=> (line 52, col 63) to (line 52, col 68) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1541 to 1548) SpanInfo: {"start":1542,"length":3} + >i++ + >:=> (line 52, col 70) to (line 52, col 73) +-------------------------------- +53 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1549 to 1572) SpanInfo: {"start":1553,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1573 to 1574) SpanInfo: {"start":1553,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 > + + ~ => Pos: (1575 to 1575) SpanInfo: undefined +-------------------------------- +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1576 to 1594) SpanInfo: {"start":1586,"length":8} + >numberA2 + >:=> (line 56, col 10) to (line 56, col 18) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1595 to 1602) SpanInfo: {"start":1596,"length":6} + >nameA2 + >:=> (line 56, col 20) to (line 56, col 26) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1603 to 1621) SpanInfo: {"start":1604,"length":7} + >skillA2 + >:=> (line 56, col 28) to (line 56, col 35) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1622 to 1628) SpanInfo: {"start":1623,"length":5} + >i = 0 + >:=> (line 56, col 47) to (line 56, col 52) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1629 to 1635) SpanInfo: {"start":1630,"length":5} + >i < 1 + >:=> (line 56, col 54) to (line 56, col 59) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1636 to 1643) SpanInfo: {"start":1637,"length":3} + >i++ + >:=> (line 56, col 61) to (line 56, col 64) +-------------------------------- +57 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1644 to 1668) SpanInfo: {"start":1648,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +58 >} + + ~~ => Pos: (1669 to 1670) SpanInfo: {"start":1648,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1671 to 1689) SpanInfo: {"start":1681,"length":8} + >numberA2 + >:=> (line 59, col 10) to (line 59, col 18) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1690 to 1697) SpanInfo: {"start":1691,"length":6} + >nameA2 + >:=> (line 59, col 20) to (line 59, col 26) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1698 to 1720) SpanInfo: {"start":1699,"length":7} + >skillA2 + >:=> (line 59, col 28) to (line 59, col 35) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1721 to 1727) SpanInfo: {"start":1722,"length":5} + >i = 0 + >:=> (line 59, col 51) to (line 59, col 56) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1728 to 1734) SpanInfo: {"start":1729,"length":5} + >i < 1 + >:=> (line 59, col 58) to (line 59, col 63) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1735 to 1742) SpanInfo: {"start":1736,"length":3} + >i++ + >:=> (line 59, col 65) to (line 59, col 68) +-------------------------------- +60 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1743 to 1767) SpanInfo: {"start":1747,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +61 >} + + ~~ => Pos: (1768 to 1769) SpanInfo: {"start":1747,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1770 to 1788) SpanInfo: {"start":1780,"length":8} + >numberA2 + >:=> (line 62, col 10) to (line 62, col 18) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1789 to 1796) SpanInfo: {"start":1790,"length":6} + >nameA2 + >:=> (line 62, col 20) to (line 62, col 26) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1797 to 1835) SpanInfo: {"start":1798,"length":7} + >skillA2 + >:=> (line 62, col 28) to (line 62, col 35) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1836 to 1842) SpanInfo: {"start":1837,"length":5} + >i = 0 + >:=> (line 62, col 67) to (line 62, col 72) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1843 to 1849) SpanInfo: {"start":1844,"length":5} + >i < 1 + >:=> (line 62, col 74) to (line 62, col 79) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1850 to 1857) SpanInfo: {"start":1851,"length":3} + >i++ + >:=> (line 62, col 81) to (line 62, col 84) +-------------------------------- +63 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1858 to 1882) SpanInfo: {"start":1862,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +64 >} + + ~~ => Pos: (1883 to 1884) SpanInfo: {"start":1862,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1885 to 1901) SpanInfo: {"start":1895,"length":6} + >nameMA + >:=> (line 65, col 10) to (line 65, col 16) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (1902 to 1917) SpanInfo: {"start":1904,"length":13} + >primarySkillA + >:=> (line 65, col 19) to (line 65, col 32) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1918 to 1934) SpanInfo: {"start":1919,"length":15} + >secondarySkillA + >:=> (line 65, col 34) to (line 65, col 49) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1935 to 1950) SpanInfo: {"start":1903,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 65, col 18) to (line 65, col 50) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1951 to 1957) SpanInfo: {"start":1952,"length":5} + >i = 0 + >:=> (line 65, col 67) to (line 65, col 72) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1958 to 1964) SpanInfo: {"start":1959,"length":5} + >i < 1 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1965 to 1972) SpanInfo: {"start":1966,"length":3} + >i++ + >:=> (line 65, col 81) to (line 65, col 84) +-------------------------------- +66 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1973 to 1997) SpanInfo: {"start":1977,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (1998 to 1999) SpanInfo: {"start":1977,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2000 to 2016) SpanInfo: {"start":2010,"length":6} + >nameMA + >:=> (line 68, col 10) to (line 68, col 16) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2017 to 2032) SpanInfo: {"start":2019,"length":13} + >primarySkillA + >:=> (line 68, col 19) to (line 68, col 32) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2033 to 2049) SpanInfo: {"start":2034,"length":15} + >secondarySkillA + >:=> (line 68, col 34) to (line 68, col 49) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (2050 to 2069) SpanInfo: {"start":2018,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 68, col 18) to (line 68, col 50) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2070 to 2076) SpanInfo: {"start":2071,"length":5} + >i = 0 + >:=> (line 68, col 71) to (line 68, col 76) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2077 to 2083) SpanInfo: {"start":2078,"length":5} + >i < 1 + >:=> (line 68, col 78) to (line 68, col 83) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2084 to 2091) SpanInfo: {"start":2085,"length":3} + >i++ + >:=> (line 68, col 85) to (line 68, col 88) +-------------------------------- +69 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2092 to 2116) SpanInfo: {"start":2096,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2117 to 2118) SpanInfo: {"start":2096,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2119 to 2135) SpanInfo: {"start":2129,"length":6} + >nameMA + >:=> (line 71, col 10) to (line 71, col 16) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2136 to 2151) SpanInfo: {"start":2138,"length":13} + >primarySkillA + >:=> (line 71, col 19) to (line 71, col 32) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2152 to 2168) SpanInfo: {"start":2153,"length":15} + >secondarySkillA + >:=> (line 71, col 34) to (line 71, col 49) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2169 to 2208) SpanInfo: {"start":2137,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 71, col 18) to (line 71, col 50) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2209 to 2215) SpanInfo: {"start":2210,"length":5} + >i = 0 + >:=> (line 71, col 91) to (line 71, col 96) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2216 to 2222) SpanInfo: {"start":2217,"length":5} + >i < 1 + >:=> (line 71, col 98) to (line 71, col 103) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2223 to 2230) SpanInfo: {"start":2224,"length":3} + >i++ + >:=> (line 71, col 105) to (line 71, col 108) +-------------------------------- +72 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2231 to 2255) SpanInfo: {"start":2235,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2256 to 2257) SpanInfo: {"start":2235,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 > + + ~ => Pos: (2258 to 2258) SpanInfo: undefined +-------------------------------- +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2277) SpanInfo: {"start":2269,"length":8} + >numberA3 + >:=> (line 75, col 10) to (line 75, col 18) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2278 to 2302) SpanInfo: {"start":2279,"length":13} + >...robotAInfo + >:=> (line 75, col 20) to (line 75, col 33) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2303 to 2309) SpanInfo: {"start":2304,"length":5} + >i = 0 + >:=> (line 75, col 45) to (line 75, col 50) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2310 to 2316) SpanInfo: {"start":2311,"length":5} + >i < 1 + >:=> (line 75, col 52) to (line 75, col 57) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2317 to 2324) SpanInfo: {"start":2318,"length":3} + >i++ + >:=> (line 75, col 59) to (line 75, col 62) +-------------------------------- +76 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2325 to 2351) SpanInfo: {"start":2329,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +77 >} + + ~~ => Pos: (2352 to 2353) SpanInfo: {"start":2329,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2354 to 2372) SpanInfo: {"start":2364,"length":8} + >numberA3 + >:=> (line 78, col 10) to (line 78, col 18) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2373 to 2401) SpanInfo: {"start":2374,"length":13} + >...robotAInfo + >:=> (line 78, col 20) to (line 78, col 33) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2402 to 2408) SpanInfo: {"start":2403,"length":5} + >i = 0 + >:=> (line 78, col 49) to (line 78, col 54) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2409 to 2415) SpanInfo: {"start":2410,"length":5} + >i < 1 + >:=> (line 78, col 56) to (line 78, col 61) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2416 to 2423) SpanInfo: {"start":2417,"length":3} + >i++ + >:=> (line 78, col 63) to (line 78, col 66) +-------------------------------- +79 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2450) SpanInfo: {"start":2428,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +80 >} + + ~~ => Pos: (2451 to 2452) SpanInfo: {"start":2428,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2471) SpanInfo: {"start":2463,"length":8} + >numberA3 + >:=> (line 81, col 10) to (line 81, col 18) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2472 to 2516) SpanInfo: {"start":2473,"length":13} + >...robotAInfo + >:=> (line 81, col 20) to (line 81, col 33) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2517 to 2523) SpanInfo: {"start":2518,"length":5} + >i = 0 + >:=> (line 81, col 65) to (line 81, col 70) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2524 to 2530) SpanInfo: {"start":2525,"length":5} + >i < 1 + >:=> (line 81, col 72) to (line 81, col 77) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2531 to 2538) SpanInfo: {"start":2532,"length":3} + >i++ + >:=> (line 81, col 79) to (line 81, col 82) +-------------------------------- +82 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2539 to 2565) SpanInfo: {"start":2543,"length":21} + >console.log(numberA3) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2566 to 2567) SpanInfo: {"start":2543,"length":21} + >console.log(numberA3) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2568 to 2611) SpanInfo: {"start":2578,"length":18} + >...multiRobotAInfo + >:=> (line 84, col 10) to (line 84, col 28) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2612 to 2618) SpanInfo: {"start":2613,"length":5} + >i = 0 + >:=> (line 84, col 45) to (line 84, col 50) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2619 to 2625) SpanInfo: {"start":2620,"length":5} + >i < 1 + >:=> (line 84, col 52) to (line 84, col 57) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2626 to 2633) SpanInfo: {"start":2627,"length":3} + >i++ + >:=> (line 84, col 59) to (line 84, col 62) +-------------------------------- +85 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2634 to 2667) SpanInfo: {"start":2638,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +86 >} + + ~~ => Pos: (2668 to 2669) SpanInfo: {"start":2638,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2670 to 2717) SpanInfo: {"start":2680,"length":18} + >...multiRobotAInfo + >:=> (line 87, col 10) to (line 87, col 28) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2718 to 2724) SpanInfo: {"start":2719,"length":5} + >i = 0 + >:=> (line 87, col 49) to (line 87, col 54) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2725 to 2731) SpanInfo: {"start":2726,"length":5} + >i < 1 + >:=> (line 87, col 56) to (line 87, col 61) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2732 to 2739) SpanInfo: {"start":2733,"length":3} + >i++ + >:=> (line 87, col 63) to (line 87, col 66) +-------------------------------- +88 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2740 to 2773) SpanInfo: {"start":2744,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +89 >} + + ~~ => Pos: (2774 to 2775) SpanInfo: {"start":2744,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2776 to 2843) SpanInfo: {"start":2786,"length":18} + >...multiRobotAInfo + >:=> (line 90, col 10) to (line 90, col 28) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2844 to 2850) SpanInfo: {"start":2845,"length":5} + >i = 0 + >:=> (line 90, col 69) to (line 90, col 74) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2851 to 2857) SpanInfo: {"start":2852,"length":5} + >i < 1 + >:=> (line 90, col 76) to (line 90, col 81) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2858 to 2865) SpanInfo: {"start":2859,"length":3} + >i++ + >:=> (line 90, col 83) to (line 90, col 86) +-------------------------------- +91 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2866 to 2899) SpanInfo: {"start":2870,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 91, col 4) to (line 91, col 32) +-------------------------------- +92 >} + ~ => Pos: (2900 to 2900) SpanInfo: {"start":2870,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 91, col 4) to (line 91, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..78fc1b42b2f --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,1042 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 133) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (134 to 177) SpanInfo: {"start":134,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (178 to 199) SpanInfo: {"start":204,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (200 to 218) SpanInfo: {"start":204,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (219 to 220) SpanInfo: {"start":219,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (221 to 284) SpanInfo: {"start":221,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (285 to 358) SpanInfo: {"start":285,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (359 to 385) SpanInfo: {"start":390,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (386 to 409) SpanInfo: {"start":390,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (410 to 411) SpanInfo: {"start":410,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (412 to 447) SpanInfo: {"start":424,"length":13} + >nameA ="name" + >:=> (line 15, col 12) to (line 15, col 25) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (448 to 454) SpanInfo: {"start":449,"length":5} + >i = 0 + >:=> (line 15, col 37) to (line 15, col 42) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (455 to 461) SpanInfo: {"start":456,"length":5} + >i < 1 + >:=> (line 15, col 44) to (line 15, col 49) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (462 to 469) SpanInfo: {"start":463,"length":3} + >i++ + >:=> (line 15, col 51) to (line 15, col 54) +-------------------------------- +16 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (470 to 493) SpanInfo: {"start":474,"length":18} + >console.log(nameA) + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (494 to 495) SpanInfo: {"start":474,"length":18} + >console.log(nameA) + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (496 to 536) SpanInfo: {"start":508,"length":14} + >nameA = "name" + >:=> (line 18, col 12) to (line 18, col 26) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (537 to 543) SpanInfo: {"start":538,"length":5} + >i = 0 + >:=> (line 18, col 42) to (line 18, col 47) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (544 to 550) SpanInfo: {"start":545,"length":5} + >i < 1 + >:=> (line 18, col 49) to (line 18, col 54) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (551 to 558) SpanInfo: {"start":552,"length":3} + >i++ + >:=> (line 18, col 56) to (line 18, col 59) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (559 to 582) SpanInfo: {"start":563,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (583 to 584) SpanInfo: {"start":563,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (585 to 641) SpanInfo: {"start":597,"length":14} + >nameA = "name" + >:=> (line 21, col 12) to (line 21, col 26) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (642 to 648) SpanInfo: {"start":643,"length":5} + >i = 0 + >:=> (line 21, col 58) to (line 21, col 63) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (649 to 655) SpanInfo: {"start":650,"length":5} + >i < 1 + >:=> (line 21, col 65) to (line 21, col 70) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (656 to 663) SpanInfo: {"start":657,"length":3} + >i++ + >:=> (line 21, col 72) to (line 21, col 75) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (664 to 687) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (688 to 689) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (690 to 700) SpanInfo: {"start":702,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 24, col 12) to (line 27, col 20) +24 >for (let [, [ + + ~~~ => Pos: (701 to 703) SpanInfo: {"start":708,"length":25} + >primarySkillA = "primary" + >:=> (line 25, col 4) to (line 25, col 29) +-------------------------------- +25 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (704 to 734) SpanInfo: {"start":708,"length":25} + >primarySkillA = "primary" + >:=> (line 25, col 4) to (line 25, col 29) +-------------------------------- +26 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (735 to 768) SpanInfo: {"start":739,"length":29} + >secondarySkillA = "secondary" + >:=> (line 26, col 4) to (line 26, col 33) +-------------------------------- +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~ => Pos: (769 to 769) SpanInfo: {"start":739,"length":29} + >secondarySkillA = "secondary" + >:=> (line 26, col 4) to (line 26, col 33) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (770 to 804) SpanInfo: {"start":702,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 24, col 12) to (line 27, col 20) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (805 to 811) SpanInfo: {"start":806,"length":5} + >i = 0 + >:=> (line 27, col 37) to (line 27, col 42) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (812 to 818) SpanInfo: {"start":813,"length":5} + >i < 1 + >:=> (line 27, col 44) to (line 27, col 49) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (819 to 826) SpanInfo: {"start":820,"length":3} + >i++ + >:=> (line 27, col 51) to (line 27, col 54) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (827 to 858) SpanInfo: {"start":831,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (859 to 860) SpanInfo: {"start":831,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (861 to 871) SpanInfo: {"start":873,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 30, col 12) to (line 33, col 20) +30 >for (let [, [ + + ~~~ => Pos: (872 to 874) SpanInfo: {"start":879,"length":25} + >primarySkillA = "primary" + >:=> (line 31, col 4) to (line 31, col 29) +-------------------------------- +31 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (875 to 905) SpanInfo: {"start":879,"length":25} + >primarySkillA = "primary" + >:=> (line 31, col 4) to (line 31, col 29) +-------------------------------- +32 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (906 to 939) SpanInfo: {"start":910,"length":29} + >secondarySkillA = "secondary" + >:=> (line 32, col 4) to (line 32, col 33) +-------------------------------- +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~ => Pos: (940 to 940) SpanInfo: {"start":910,"length":29} + >secondarySkillA = "secondary" + >:=> (line 32, col 4) to (line 32, col 33) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (941 to 979) SpanInfo: {"start":873,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 30, col 12) to (line 33, col 20) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (980 to 986) SpanInfo: {"start":981,"length":5} + >i = 0 + >:=> (line 33, col 41) to (line 33, col 46) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (987 to 993) SpanInfo: {"start":988,"length":5} + >i < 1 + >:=> (line 33, col 48) to (line 33, col 53) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (994 to 1001) SpanInfo: {"start":995,"length":3} + >i++ + >:=> (line 33, col 55) to (line 33, col 58) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1002 to 1033) SpanInfo: {"start":1006,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1034 to 1035) SpanInfo: {"start":1006,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (1036 to 1046) SpanInfo: {"start":1048,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 36, col 12) to (line 39, col 20) +36 >for (let [, [ + + ~~~ => Pos: (1047 to 1049) SpanInfo: {"start":1054,"length":25} + >primarySkillA = "primary" + >:=> (line 37, col 4) to (line 37, col 29) +-------------------------------- +37 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1050 to 1080) SpanInfo: {"start":1054,"length":25} + >primarySkillA = "primary" + >:=> (line 37, col 4) to (line 37, col 29) +-------------------------------- +38 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1081 to 1114) SpanInfo: {"start":1085,"length":29} + >secondarySkillA = "secondary" + >:=> (line 38, col 4) to (line 38, col 33) +-------------------------------- +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~ => Pos: (1115 to 1115) SpanInfo: {"start":1085,"length":29} + >secondarySkillA = "secondary" + >:=> (line 38, col 4) to (line 38, col 33) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1116 to 1174) SpanInfo: {"start":1048,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 36, col 12) to (line 39, col 20) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1175 to 1181) SpanInfo: {"start":1176,"length":5} + >i = 0 + >:=> (line 39, col 61) to (line 39, col 66) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1182 to 1188) SpanInfo: {"start":1183,"length":5} + >i < 1 + >:=> (line 39, col 68) to (line 39, col 73) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1189 to 1196) SpanInfo: {"start":1190,"length":3} + >i++ + >:=> (line 39, col 75) to (line 39, col 78) +-------------------------------- +40 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1197 to 1228) SpanInfo: {"start":1201,"length":26} + >console.log(primarySkillA) + >:=> (line 40, col 4) to (line 40, col 30) +-------------------------------- +41 >} + + ~~ => Pos: (1229 to 1230) SpanInfo: {"start":1201,"length":26} + >console.log(primarySkillA) + >:=> (line 40, col 4) to (line 40, col 30) +-------------------------------- +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1231 to 1263) SpanInfo: {"start":1241,"length":12} + >numberB = -1 + >:=> (line 42, col 10) to (line 42, col 22) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1264 to 1270) SpanInfo: {"start":1265,"length":5} + >i = 0 + >:=> (line 42, col 34) to (line 42, col 39) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1271 to 1277) SpanInfo: {"start":1272,"length":5} + >i < 1 + >:=> (line 42, col 41) to (line 42, col 46) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1278 to 1285) SpanInfo: {"start":1279,"length":3} + >i++ + >:=> (line 42, col 48) to (line 42, col 51) +-------------------------------- +43 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1286 to 1311) SpanInfo: {"start":1290,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +44 >} + + ~~ => Pos: (1312 to 1313) SpanInfo: {"start":1290,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1314 to 1350) SpanInfo: {"start":1324,"length":12} + >numberB = -1 + >:=> (line 45, col 10) to (line 45, col 22) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1351 to 1357) SpanInfo: {"start":1352,"length":5} + >i = 0 + >:=> (line 45, col 38) to (line 45, col 43) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1358 to 1364) SpanInfo: {"start":1359,"length":5} + >i < 1 + >:=> (line 45, col 45) to (line 45, col 50) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1365 to 1372) SpanInfo: {"start":1366,"length":3} + >i++ + >:=> (line 45, col 52) to (line 45, col 55) +-------------------------------- +46 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1373 to 1398) SpanInfo: {"start":1377,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +47 >} + + ~~ => Pos: (1399 to 1400) SpanInfo: {"start":1377,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1401 to 1453) SpanInfo: {"start":1411,"length":12} + >numberB = -1 + >:=> (line 48, col 10) to (line 48, col 22) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1454 to 1460) SpanInfo: {"start":1455,"length":5} + >i = 0 + >:=> (line 48, col 54) to (line 48, col 59) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1461 to 1467) SpanInfo: {"start":1462,"length":5} + >i < 1 + >:=> (line 48, col 61) to (line 48, col 66) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1468 to 1475) SpanInfo: {"start":1469,"length":3} + >i++ + >:=> (line 48, col 68) to (line 48, col 71) +-------------------------------- +49 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1476 to 1501) SpanInfo: {"start":1480,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +50 >} + + ~~ => Pos: (1502 to 1503) SpanInfo: {"start":1480,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1504 to 1543) SpanInfo: {"start":1514,"length":14} + >nameB = "name" + >:=> (line 51, col 10) to (line 51, col 24) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1544 to 1550) SpanInfo: {"start":1545,"length":5} + >i = 0 + >:=> (line 51, col 41) to (line 51, col 46) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1551 to 1557) SpanInfo: {"start":1552,"length":5} + >i < 1 + >:=> (line 51, col 48) to (line 51, col 53) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1558 to 1565) SpanInfo: {"start":1559,"length":3} + >i++ + >:=> (line 51, col 55) to (line 51, col 58) +-------------------------------- +52 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1566 to 1589) SpanInfo: {"start":1570,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1590 to 1591) SpanInfo: {"start":1570,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1592 to 1635) SpanInfo: {"start":1602,"length":14} + >nameB = "name" + >:=> (line 54, col 10) to (line 54, col 24) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1636 to 1642) SpanInfo: {"start":1637,"length":5} + >i = 0 + >:=> (line 54, col 45) to (line 54, col 50) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1643 to 1649) SpanInfo: {"start":1644,"length":5} + >i < 1 + >:=> (line 54, col 52) to (line 54, col 57) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1650 to 1657) SpanInfo: {"start":1651,"length":3} + >i++ + >:=> (line 54, col 59) to (line 54, col 62) +-------------------------------- +55 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1658 to 1681) SpanInfo: {"start":1662,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +56 >} + + ~~ => Pos: (1682 to 1683) SpanInfo: {"start":1662,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1684 to 1747) SpanInfo: {"start":1694,"length":14} + >nameB = "name" + >:=> (line 57, col 10) to (line 57, col 24) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1748 to 1754) SpanInfo: {"start":1749,"length":5} + >i = 0 + >:=> (line 57, col 65) to (line 57, col 70) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1755 to 1761) SpanInfo: {"start":1756,"length":5} + >i < 1 + >:=> (line 57, col 72) to (line 57, col 77) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1762 to 1769) SpanInfo: {"start":1763,"length":3} + >i++ + >:=> (line 57, col 79) to (line 57, col 82) +-------------------------------- +58 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1770 to 1793) SpanInfo: {"start":1774,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1794 to 1795) SpanInfo: {"start":1774,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1796 to 1819) SpanInfo: {"start":1806,"length":13} + >numberA2 = -1 + >:=> (line 60, col 10) to (line 60, col 23) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1820 to 1836) SpanInfo: {"start":1821,"length":15} + >nameA2 = "name" + >:=> (line 60, col 25) to (line 60, col 40) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1837 to 1865) SpanInfo: {"start":1838,"length":17} + >skillA2 = "skill" + >:=> (line 60, col 42) to (line 60, col 59) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1866 to 1872) SpanInfo: {"start":1867,"length":5} + >i = 0 + >:=> (line 60, col 71) to (line 60, col 76) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1873 to 1879) SpanInfo: {"start":1874,"length":5} + >i < 1 + >:=> (line 60, col 78) to (line 60, col 83) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1880 to 1887) SpanInfo: {"start":1881,"length":3} + >i++ + >:=> (line 60, col 85) to (line 60, col 88) +-------------------------------- +61 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1888 to 1912) SpanInfo: {"start":1892,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +62 >} + + ~~ => Pos: (1913 to 1914) SpanInfo: {"start":1892,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1915 to 1938) SpanInfo: {"start":1925,"length":13} + >numberA2 = -1 + >:=> (line 63, col 10) to (line 63, col 23) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1939 to 1955) SpanInfo: {"start":1940,"length":15} + >nameA2 = "name" + >:=> (line 63, col 25) to (line 63, col 40) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1956 to 1988) SpanInfo: {"start":1957,"length":17} + >skillA2 = "skill" + >:=> (line 63, col 42) to (line 63, col 59) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1989 to 1995) SpanInfo: {"start":1990,"length":5} + >i = 0 + >:=> (line 63, col 75) to (line 63, col 80) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1996 to 2002) SpanInfo: {"start":1997,"length":5} + >i < 1 + >:=> (line 63, col 82) to (line 63, col 87) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2003 to 2010) SpanInfo: {"start":2004,"length":3} + >i++ + >:=> (line 63, col 89) to (line 63, col 92) +-------------------------------- +64 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2011 to 2035) SpanInfo: {"start":2015,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (2036 to 2037) SpanInfo: {"start":2015,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2038 to 2061) SpanInfo: {"start":2048,"length":13} + >numberA2 = -1 + >:=> (line 66, col 10) to (line 66, col 23) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2062 to 2078) SpanInfo: {"start":2063,"length":15} + >nameA2 = "name" + >:=> (line 66, col 25) to (line 66, col 40) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2079 to 2127) SpanInfo: {"start":2080,"length":17} + >skillA2 = "skill" + >:=> (line 66, col 42) to (line 66, col 59) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2128 to 2134) SpanInfo: {"start":2129,"length":5} + >i = 0 + >:=> (line 66, col 91) to (line 66, col 96) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2135 to 2141) SpanInfo: {"start":2136,"length":5} + >i < 1 + >:=> (line 66, col 98) to (line 66, col 103) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2142 to 2149) SpanInfo: {"start":2143,"length":3} + >i++ + >:=> (line 66, col 105) to (line 66, col 108) +-------------------------------- +67 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2150 to 2174) SpanInfo: {"start":2154,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (2175 to 2176) SpanInfo: {"start":2154,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let + + ~~~~~~~~~ => Pos: (2177 to 2185) SpanInfo: {"start":2191,"length":17} + >nameMA = "noName" + >:=> (line 70, col 5) to (line 70, col 22) +-------------------------------- +70 > [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2186 to 2209) SpanInfo: {"start":2191,"length":17} + >nameMA = "noName" + >:=> (line 70, col 5) to (line 70, col 22) +-------------------------------- +71 > [ + + ~~~~~~~~~~ => Pos: (2210 to 2219) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 72, col 12) to (line 72, col 37) +-------------------------------- +72 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2220 to 2258) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 72, col 12) to (line 72, col 37) +-------------------------------- +73 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2300) SpanInfo: {"start":2271,"length":29} + >secondarySkillA = "secondary" + >:=> (line 73, col 12) to (line 73, col 41) +-------------------------------- +74 > ] = ["none", "none"] + + ~~~~~~~~~ => Pos: (2301 to 2309) SpanInfo: {"start":2271,"length":29} + >secondarySkillA = "secondary" + >:=> (line 73, col 12) to (line 73, col 41) +74 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2310 to 2329) SpanInfo: {"start":2218,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 71, col 8) to (line 74, col 28) +-------------------------------- +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2330 to 2349) SpanInfo: {"start":2218,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 71, col 8) to (line 74, col 28) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2350 to 2356) SpanInfo: {"start":2351,"length":5} + >i = 0 + >:=> (line 75, col 21) to (line 75, col 26) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2357 to 2363) SpanInfo: {"start":2358,"length":5} + >i < 1 + >:=> (line 75, col 28) to (line 75, col 33) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2364 to 2371) SpanInfo: {"start":2365,"length":3} + >i++ + >:=> (line 75, col 35) to (line 75, col 38) +-------------------------------- +76 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2372 to 2396) SpanInfo: {"start":2376,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +77 >} + + ~~ => Pos: (2397 to 2398) SpanInfo: {"start":2376,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +78 >for (let [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2399 to 2427) SpanInfo: {"start":2409,"length":17} + >nameMA = "noName" + >:=> (line 78, col 10) to (line 78, col 27) +-------------------------------- +79 > [ + + ~~~~~~ => Pos: (2428 to 2433) SpanInfo: {"start":2442,"length":25} + >primarySkillA = "primary" + >:=> (line 80, col 8) to (line 80, col 33) +-------------------------------- +80 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2434 to 2468) SpanInfo: {"start":2442,"length":25} + >primarySkillA = "primary" + >:=> (line 80, col 8) to (line 80, col 33) +-------------------------------- +81 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2469 to 2506) SpanInfo: {"start":2477,"length":29} + >secondarySkillA = "secondary" + >:=> (line 81, col 8) to (line 81, col 37) +-------------------------------- +82 > ] = ["none", "none"] + + ~~~~~ => Pos: (2507 to 2511) SpanInfo: {"start":2477,"length":29} + >secondarySkillA = "secondary" + >:=> (line 81, col 8) to (line 81, col 37) +82 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2512 to 2531) SpanInfo: {"start":2432,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 79, col 4) to (line 82, col 24) +-------------------------------- +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (2532 to 2552) SpanInfo: {"start":2432,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 79, col 4) to (line 82, col 24) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2553 to 2559) SpanInfo: {"start":2554,"length":5} + >i = 0 + >:=> (line 83, col 22) to (line 83, col 27) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2560 to 2566) SpanInfo: {"start":2561,"length":5} + >i < 1 + >:=> (line 83, col 29) to (line 83, col 34) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2567 to 2574) SpanInfo: {"start":2568,"length":3} + >i++ + >:=> (line 83, col 36) to (line 83, col 39) +-------------------------------- +84 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2575 to 2599) SpanInfo: {"start":2579,"length":19} + >console.log(nameMA) + >:=> (line 84, col 4) to (line 84, col 23) +-------------------------------- +85 >} + + ~~ => Pos: (2600 to 2601) SpanInfo: {"start":2579,"length":19} + >console.log(nameMA) + >:=> (line 84, col 4) to (line 84, col 23) +-------------------------------- +86 >for (let [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2602 to 2630) SpanInfo: {"start":2612,"length":17} + >nameMA = "noName" + >:=> (line 86, col 10) to (line 86, col 27) +-------------------------------- +87 > [ + + ~~~~~~ => Pos: (2631 to 2636) SpanInfo: {"start":2645,"length":25} + >primarySkillA = "primary" + >:=> (line 88, col 8) to (line 88, col 33) +-------------------------------- +88 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2637 to 2671) SpanInfo: {"start":2645,"length":25} + >primarySkillA = "primary" + >:=> (line 88, col 8) to (line 88, col 33) +-------------------------------- +89 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2672 to 2709) SpanInfo: {"start":2680,"length":29} + >secondarySkillA = "secondary" + >:=> (line 89, col 8) to (line 89, col 37) +-------------------------------- +90 > ] = ["none", "none"] + + ~~~~~ => Pos: (2710 to 2714) SpanInfo: {"start":2680,"length":29} + >secondarySkillA = "secondary" + >:=> (line 89, col 8) to (line 89, col 37) +90 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2715 to 2734) SpanInfo: {"start":2635,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 87, col 4) to (line 90, col 24) +-------------------------------- +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2735 to 2775) SpanInfo: {"start":2635,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 87, col 4) to (line 90, col 24) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2776 to 2782) SpanInfo: {"start":2777,"length":5} + >i = 0 + >:=> (line 91, col 42) to (line 91, col 47) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2783 to 2789) SpanInfo: {"start":2784,"length":5} + >i < 1 + >:=> (line 91, col 49) to (line 91, col 54) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2790 to 2797) SpanInfo: {"start":2791,"length":3} + >i++ + >:=> (line 91, col 56) to (line 91, col 59) +-------------------------------- +92 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2798 to 2822) SpanInfo: {"start":2802,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +93 >} + + ~~ => Pos: (2823 to 2824) SpanInfo: {"start":2802,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2825 to 2848) SpanInfo: {"start":2835,"length":13} + >numberA3 = -1 + >:=> (line 94, col 10) to (line 94, col 23) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2849 to 2873) SpanInfo: {"start":2850,"length":13} + >...robotAInfo + >:=> (line 94, col 25) to (line 94, col 38) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2874 to 2880) SpanInfo: {"start":2875,"length":5} + >i = 0 + >:=> (line 94, col 50) to (line 94, col 55) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2881 to 2887) SpanInfo: {"start":2882,"length":5} + >i < 1 + >:=> (line 94, col 57) to (line 94, col 62) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2888 to 2895) SpanInfo: {"start":2889,"length":3} + >i++ + >:=> (line 94, col 64) to (line 94, col 67) +-------------------------------- +95 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2896 to 2922) SpanInfo: {"start":2900,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (2923 to 2924) SpanInfo: {"start":2900,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2925 to 2948) SpanInfo: {"start":2935,"length":13} + >numberA3 = -1 + >:=> (line 97, col 10) to (line 97, col 23) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2949 to 2977) SpanInfo: {"start":2950,"length":13} + >...robotAInfo + >:=> (line 97, col 25) to (line 97, col 38) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2978 to 2984) SpanInfo: {"start":2979,"length":5} + >i = 0 + >:=> (line 97, col 54) to (line 97, col 59) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2985 to 2991) SpanInfo: {"start":2986,"length":5} + >i < 1 + >:=> (line 97, col 61) to (line 97, col 66) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2992 to 2999) SpanInfo: {"start":2993,"length":3} + >i++ + >:=> (line 97, col 68) to (line 97, col 71) +-------------------------------- +98 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3000 to 3026) SpanInfo: {"start":3004,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (3027 to 3028) SpanInfo: {"start":3004,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3029 to 3052) SpanInfo: {"start":3039,"length":13} + >numberA3 = -1 + >:=> (line 100, col 10) to (line 100, col 23) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3053 to 3097) SpanInfo: {"start":3054,"length":13} + >...robotAInfo + >:=> (line 100, col 25) to (line 100, col 38) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3098 to 3104) SpanInfo: {"start":3099,"length":5} + >i = 0 + >:=> (line 100, col 70) to (line 100, col 75) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3105 to 3111) SpanInfo: {"start":3106,"length":5} + >i < 1 + >:=> (line 100, col 77) to (line 100, col 82) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3112 to 3119) SpanInfo: {"start":3113,"length":3} + >i++ + >:=> (line 100, col 84) to (line 100, col 87) +-------------------------------- +101> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3120 to 3146) SpanInfo: {"start":3124,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) +-------------------------------- +102>} + ~ => Pos: (3147 to 3147) SpanInfo: {"start":3124,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline new file mode 100644 index 00000000000..718799a8334 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline @@ -0,0 +1,633 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 277) SpanInfo: {"start":223,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (278 to 375) SpanInfo: {"start":278,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (376 to 397) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (398 to 415) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (416 to 417) SpanInfo: {"start":416,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (418 to 444) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (445 to 467) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (468 to 469) SpanInfo: {"start":468,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (470 to 501) SpanInfo: {"start":480,"length":11} + >name: nameA + >:=> (line 23, col 10) to (line 23, col 21) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (502 to 508) SpanInfo: {"start":503,"length":5} + >i = 0 + >:=> (line 23, col 33) to (line 23, col 38) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (509 to 515) SpanInfo: {"start":510,"length":5} + >i < 1 + >:=> (line 23, col 40) to (line 23, col 45) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (516 to 523) SpanInfo: {"start":517,"length":3} + >i++ + >:=> (line 23, col 47) to (line 23, col 50) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (524 to 547) SpanInfo: {"start":528,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (548 to 549) SpanInfo: {"start":528,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (550 to 586) SpanInfo: {"start":560,"length":11} + >name: nameA + >:=> (line 26, col 10) to (line 26, col 21) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (587 to 593) SpanInfo: {"start":588,"length":5} + >i = 0 + >:=> (line 26, col 38) to (line 26, col 43) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (594 to 600) SpanInfo: {"start":595,"length":5} + >i < 1 + >:=> (line 26, col 45) to (line 26, col 50) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (601 to 608) SpanInfo: {"start":602,"length":3} + >i++ + >:=> (line 26, col 52) to (line 26, col 55) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (609 to 632) SpanInfo: {"start":613,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (633 to 634) SpanInfo: {"start":613,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (635 to 706) SpanInfo: {"start":645,"length":11} + >name: nameA + >:=> (line 29, col 10) to (line 29, col 21) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (707 to 713) SpanInfo: {"start":708,"length":5} + >i = 0 + >:=> (line 29, col 73) to (line 29, col 78) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (714 to 720) SpanInfo: {"start":715,"length":5} + >i < 1 + >:=> (line 29, col 80) to (line 29, col 85) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (721 to 728) SpanInfo: {"start":722,"length":3} + >i++ + >:=> (line 29, col 87) to (line 29, col 90) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (729 to 752) SpanInfo: {"start":733,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (753 to 754) SpanInfo: {"start":733,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (755 to 772) SpanInfo: {"start":766,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 32, col 11) to (line 32, col 63) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (773 to 793) SpanInfo: {"start":776,"length":17} + >primary: primaryA + >:=> (line 32, col 21) to (line 32, col 38) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (794 to 817) SpanInfo: {"start":795,"length":21} + >secondary: secondaryA + >:=> (line 32, col 40) to (line 32, col 61) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (818 to 833) SpanInfo: {"start":766,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 32, col 11) to (line 32, col 63) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (834 to 840) SpanInfo: {"start":835,"length":5} + >i = 0 + >:=> (line 32, col 80) to (line 32, col 85) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (841 to 847) SpanInfo: {"start":842,"length":5} + >i < 1 + >:=> (line 32, col 87) to (line 32, col 92) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (848 to 855) SpanInfo: {"start":849,"length":3} + >i++ + >:=> (line 32, col 94) to (line 32, col 97) +-------------------------------- +33 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (856 to 882) SpanInfo: {"start":860,"length":21} + >console.log(primaryA) + >:=> (line 33, col 4) to (line 33, col 25) +-------------------------------- +34 >} + + ~~ => Pos: (883 to 884) SpanInfo: {"start":860,"length":21} + >console.log(primaryA) + >:=> (line 33, col 4) to (line 33, col 25) +-------------------------------- +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (885 to 902) SpanInfo: {"start":896,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 11) to (line 35, col 63) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (903 to 923) SpanInfo: {"start":906,"length":17} + >primary: primaryA + >:=> (line 35, col 21) to (line 35, col 38) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (924 to 947) SpanInfo: {"start":925,"length":21} + >secondary: secondaryA + >:=> (line 35, col 40) to (line 35, col 61) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (948 to 968) SpanInfo: {"start":896,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 11) to (line 35, col 63) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (969 to 975) SpanInfo: {"start":970,"length":5} + >i = 0 + >:=> (line 35, col 85) to (line 35, col 90) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (976 to 982) SpanInfo: {"start":977,"length":5} + >i < 1 + >:=> (line 35, col 92) to (line 35, col 97) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (983 to 990) SpanInfo: {"start":984,"length":3} + >i++ + >:=> (line 35, col 99) to (line 35, col 102) +-------------------------------- +36 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (991 to 1017) SpanInfo: {"start":995,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +37 >} + + ~~ => Pos: (1018 to 1019) SpanInfo: {"start":995,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1020 to 1037) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1038 to 1058) SpanInfo: {"start":1041,"length":17} + >primary: primaryA + >:=> (line 38, col 21) to (line 38, col 38) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1059 to 1082) SpanInfo: {"start":1060,"length":21} + >secondary: secondaryA + >:=> (line 38, col 40) to (line 38, col 61) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1083 to 1087) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +-------------------------------- +39 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1088 to 1178) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +-------------------------------- +40 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1179 to 1188) SpanInfo: {"start":1183,"length":5} + >i = 0 + >:=> (line 40, col 4) to (line 40, col 9) +40 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1189 to 1195) SpanInfo: {"start":1190,"length":5} + >i < 1 + >:=> (line 40, col 11) to (line 40, col 16) +40 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1196 to 1203) SpanInfo: {"start":1197,"length":3} + >i++ + >:=> (line 40, col 18) to (line 40, col 21) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1204 to 1230) SpanInfo: {"start":1208,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1231 to 1232) SpanInfo: {"start":1208,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1233 to 1254) SpanInfo: {"start":1243,"length":11} + >name: nameA + >:=> (line 43, col 10) to (line 43, col 21) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1255 to 1279) SpanInfo: {"start":1256,"length":13} + >skill: skillA + >:=> (line 43, col 23) to (line 43, col 36) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1280 to 1286) SpanInfo: {"start":1281,"length":5} + >i = 0 + >:=> (line 43, col 48) to (line 43, col 53) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1287 to 1293) SpanInfo: {"start":1288,"length":5} + >i < 1 + >:=> (line 43, col 55) to (line 43, col 60) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1294 to 1301) SpanInfo: {"start":1295,"length":3} + >i++ + >:=> (line 43, col 62) to (line 43, col 65) +-------------------------------- +44 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1302 to 1325) SpanInfo: {"start":1306,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +45 >} + + ~~ => Pos: (1326 to 1327) SpanInfo: {"start":1306,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1328 to 1349) SpanInfo: {"start":1338,"length":11} + >name: nameA + >:=> (line 46, col 10) to (line 46, col 21) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1350 to 1379) SpanInfo: {"start":1351,"length":13} + >skill: skillA + >:=> (line 46, col 23) to (line 46, col 36) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1380 to 1386) SpanInfo: {"start":1381,"length":5} + >i = 0 + >:=> (line 46, col 53) to (line 46, col 58) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1387 to 1393) SpanInfo: {"start":1388,"length":5} + >i < 1 + >:=> (line 46, col 60) to (line 46, col 65) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1394 to 1401) SpanInfo: {"start":1395,"length":3} + >i++ + >:=> (line 46, col 67) to (line 46, col 70) +-------------------------------- +47 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1402 to 1425) SpanInfo: {"start":1406,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1426 to 1427) SpanInfo: {"start":1406,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1428 to 1449) SpanInfo: {"start":1438,"length":11} + >name: nameA + >:=> (line 49, col 10) to (line 49, col 21) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1450 to 1514) SpanInfo: {"start":1451,"length":13} + >skill: skillA + >:=> (line 49, col 23) to (line 49, col 36) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1515 to 1521) SpanInfo: {"start":1516,"length":5} + >i = 0 + >:=> (line 49, col 88) to (line 49, col 93) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1522 to 1528) SpanInfo: {"start":1523,"length":5} + >i < 1 + >:=> (line 49, col 95) to (line 49, col 100) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1529 to 1536) SpanInfo: {"start":1530,"length":3} + >i++ + >:=> (line 49, col 102) to (line 49, col 105) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1537 to 1560) SpanInfo: {"start":1541,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1561 to 1562) SpanInfo: {"start":1541,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1563 to 1584) SpanInfo: {"start":1573,"length":11} + >name: nameA + >:=> (line 52, col 10) to (line 52, col 21) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1585 to 1592) SpanInfo: {"start":1586,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1593 to 1613) SpanInfo: {"start":1596,"length":17} + >primary: primaryA + >:=> (line 52, col 33) to (line 52, col 50) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1614 to 1637) SpanInfo: {"start":1615,"length":21} + >secondary: secondaryA + >:=> (line 52, col 52) to (line 52, col 73) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1638 to 1653) SpanInfo: {"start":1586,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1654 to 1660) SpanInfo: {"start":1655,"length":5} + >i = 0 + >:=> (line 52, col 92) to (line 52, col 97) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1661 to 1667) SpanInfo: {"start":1662,"length":5} + >i < 1 + >:=> (line 52, col 99) to (line 52, col 104) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1668 to 1675) SpanInfo: {"start":1669,"length":3} + >i++ + >:=> (line 52, col 106) to (line 52, col 109) +-------------------------------- +53 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1676 to 1702) SpanInfo: {"start":1680,"length":21} + >console.log(primaryA) + >:=> (line 53, col 4) to (line 53, col 25) +-------------------------------- +54 >} + + ~~ => Pos: (1703 to 1704) SpanInfo: {"start":1680,"length":21} + >console.log(primaryA) + >:=> (line 53, col 4) to (line 53, col 25) +-------------------------------- +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1705 to 1726) SpanInfo: {"start":1715,"length":11} + >name: nameA + >:=> (line 55, col 10) to (line 55, col 21) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1727 to 1734) SpanInfo: {"start":1728,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1735 to 1755) SpanInfo: {"start":1738,"length":17} + >primary: primaryA + >:=> (line 55, col 33) to (line 55, col 50) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1756 to 1779) SpanInfo: {"start":1757,"length":21} + >secondary: secondaryA + >:=> (line 55, col 52) to (line 55, col 73) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1780 to 1800) SpanInfo: {"start":1728,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1801 to 1807) SpanInfo: {"start":1802,"length":5} + >i = 0 + >:=> (line 55, col 97) to (line 55, col 102) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1808 to 1814) SpanInfo: {"start":1809,"length":5} + >i < 1 + >:=> (line 55, col 104) to (line 55, col 109) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1815 to 1822) SpanInfo: {"start":1816,"length":3} + >i++ + >:=> (line 55, col 111) to (line 55, col 114) +-------------------------------- +56 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1823 to 1849) SpanInfo: {"start":1827,"length":21} + >console.log(primaryA) + >:=> (line 56, col 4) to (line 56, col 25) +-------------------------------- +57 >} + + ~~ => Pos: (1850 to 1851) SpanInfo: {"start":1827,"length":21} + >console.log(primaryA) + >:=> (line 56, col 4) to (line 56, col 25) +-------------------------------- +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1852 to 1873) SpanInfo: {"start":1862,"length":11} + >name: nameA + >:=> (line 58, col 10) to (line 58, col 21) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~ => Pos: (1874 to 1881) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1882 to 1902) SpanInfo: {"start":1885,"length":17} + >primary: primaryA + >:=> (line 58, col 33) to (line 58, col 50) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1903 to 1926) SpanInfo: {"start":1904,"length":21} + >secondary: secondaryA + >:=> (line 58, col 52) to (line 58, col 73) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1927 to 1931) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +-------------------------------- +59 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1932 to 2022) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +-------------------------------- +60 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2023 to 2032) SpanInfo: {"start":2027,"length":5} + >i = 0 + >:=> (line 60, col 4) to (line 60, col 9) +60 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2033 to 2039) SpanInfo: {"start":2034,"length":5} + >i < 1 + >:=> (line 60, col 11) to (line 60, col 16) +60 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2040 to 2047) SpanInfo: {"start":2041,"length":3} + >i++ + >:=> (line 60, col 18) to (line 60, col 21) +-------------------------------- +61 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2048 to 2074) SpanInfo: {"start":2052,"length":21} + >console.log(primaryA) + >:=> (line 61, col 4) to (line 61, col 25) +-------------------------------- +62 >} + ~ => Pos: (2075 to 2075) SpanInfo: {"start":2052,"length":21} + >console.log(primaryA) + >:=> (line 61, col 4) to (line 61, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..54d9cbc0471 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,837 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 279) SpanInfo: {"start":225,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (280 to 377) SpanInfo: {"start":280,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 399) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (400 to 417) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (420 to 446) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (447 to 469) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (470 to 471) SpanInfo: {"start":470,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (472 to 513) SpanInfo: {"start":482,"length":21} + >name: nameA= "noName" + >:=> (line 23, col 10) to (line 23, col 31) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (514 to 520) SpanInfo: {"start":515,"length":5} + >i = 0 + >:=> (line 23, col 43) to (line 23, col 48) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (521 to 527) SpanInfo: {"start":522,"length":5} + >i < 1 + >:=> (line 23, col 50) to (line 23, col 55) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (528 to 535) SpanInfo: {"start":529,"length":3} + >i++ + >:=> (line 23, col 57) to (line 23, col 60) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (536 to 559) SpanInfo: {"start":540,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (560 to 561) SpanInfo: {"start":540,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (562 to 609) SpanInfo: {"start":572,"length":22} + >name: nameA = "noName" + >:=> (line 26, col 10) to (line 26, col 32) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (610 to 616) SpanInfo: {"start":611,"length":5} + >i = 0 + >:=> (line 26, col 49) to (line 26, col 54) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (617 to 623) SpanInfo: {"start":618,"length":5} + >i < 1 + >:=> (line 26, col 56) to (line 26, col 61) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (624 to 631) SpanInfo: {"start":625,"length":3} + >i++ + >:=> (line 26, col 63) to (line 26, col 66) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (632 to 655) SpanInfo: {"start":636,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (656 to 657) SpanInfo: {"start":636,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (658 to 740) SpanInfo: {"start":668,"length":22} + >name: nameA = "noName" + >:=> (line 29, col 10) to (line 29, col 32) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (741 to 747) SpanInfo: {"start":742,"length":5} + >i = 0 + >:=> (line 29, col 84) to (line 29, col 89) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (748 to 754) SpanInfo: {"start":749,"length":5} + >i < 1 + >:=> (line 29, col 91) to (line 29, col 96) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (755 to 762) SpanInfo: {"start":756,"length":3} + >i++ + >:=> (line 29, col 98) to (line 29, col 101) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (763 to 786) SpanInfo: {"start":767,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (787 to 788) SpanInfo: {"start":767,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for (let { + + ~~~~~~~~~~~ => Pos: (789 to 799) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +-------------------------------- +33 > skills: { + + ~~~~~~~~~~~ => Pos: (800 to 810) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +33 > skills: { + + ~~~ => Pos: (811 to 813) SpanInfo: {"start":822,"length":29} + >primary: primaryA = "primary" + >:=> (line 34, col 8) to (line 34, col 37) +-------------------------------- +34 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (814 to 852) SpanInfo: {"start":822,"length":29} + >primary: primaryA = "primary" + >:=> (line 34, col 8) to (line 34, col 37) +-------------------------------- +35 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (853 to 896) SpanInfo: {"start":861,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 8) to (line 35, col 43) +-------------------------------- +36 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (897 to 901) SpanInfo: {"start":861,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 8) to (line 35, col 43) +36 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (902 to 943) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +-------------------------------- +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (944 to 958) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (959 to 965) SpanInfo: {"start":960,"length":5} + >i = 0 + >:=> (line 37, col 16) to (line 37, col 21) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (966 to 972) SpanInfo: {"start":967,"length":5} + >i < 1 + >:=> (line 37, col 23) to (line 37, col 28) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (973 to 980) SpanInfo: {"start":974,"length":3} + >i++ + >:=> (line 37, col 30) to (line 37, col 33) +-------------------------------- +38 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (981 to 1007) SpanInfo: {"start":985,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +39 >} + + ~~ => Pos: (1008 to 1009) SpanInfo: {"start":985,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +40 >for (let { + + ~~~~~~~~~~~ => Pos: (1010 to 1020) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +-------------------------------- +41 > skills: { + + ~~~~~~~~~~~ => Pos: (1021 to 1031) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +41 > skills: { + + ~~~ => Pos: (1032 to 1034) SpanInfo: {"start":1043,"length":29} + >primary: primaryA = "primary" + >:=> (line 42, col 8) to (line 42, col 37) +-------------------------------- +42 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1035 to 1073) SpanInfo: {"start":1043,"length":29} + >primary: primaryA = "primary" + >:=> (line 42, col 8) to (line 42, col 37) +-------------------------------- +43 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1074 to 1117) SpanInfo: {"start":1082,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 8) to (line 43, col 43) +-------------------------------- +44 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (1118 to 1122) SpanInfo: {"start":1082,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 8) to (line 43, col 43) +44 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1123 to 1164) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +-------------------------------- +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1165 to 1184) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1185 to 1191) SpanInfo: {"start":1186,"length":5} + >i = 0 + >:=> (line 45, col 21) to (line 45, col 26) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1192 to 1198) SpanInfo: {"start":1193,"length":5} + >i < 1 + >:=> (line 45, col 28) to (line 45, col 33) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1199 to 1206) SpanInfo: {"start":1200,"length":3} + >i++ + >:=> (line 45, col 35) to (line 45, col 38) +-------------------------------- +46 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1207 to 1233) SpanInfo: {"start":1211,"length":21} + >console.log(primaryA) + >:=> (line 46, col 4) to (line 46, col 25) +-------------------------------- +47 >} + + ~~ => Pos: (1234 to 1235) SpanInfo: {"start":1211,"length":21} + >console.log(primaryA) + >:=> (line 46, col 4) to (line 46, col 25) +-------------------------------- +48 >for (let { + + ~~~~~~~~~~~ => Pos: (1236 to 1246) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +49 > skills: { + + ~~~~~~~~~~~ => Pos: (1247 to 1257) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +49 > skills: { + + ~~~ => Pos: (1258 to 1260) SpanInfo: {"start":1269,"length":29} + >primary: primaryA = "primary" + >:=> (line 50, col 8) to (line 50, col 37) +-------------------------------- +50 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1261 to 1299) SpanInfo: {"start":1269,"length":29} + >primary: primaryA = "primary" + >:=> (line 50, col 8) to (line 50, col 37) +-------------------------------- +51 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1300 to 1343) SpanInfo: {"start":1308,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 51, col 8) to (line 51, col 43) +-------------------------------- +52 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (1344 to 1348) SpanInfo: {"start":1308,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 51, col 8) to (line 51, col 43) +52 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1349 to 1390) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +53 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1391 to 1481) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +54 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1482 to 1491) SpanInfo: {"start":1486,"length":5} + >i = 0 + >:=> (line 54, col 4) to (line 54, col 9) +54 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1492 to 1498) SpanInfo: {"start":1493,"length":5} + >i < 1 + >:=> (line 54, col 11) to (line 54, col 16) +54 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1499 to 1506) SpanInfo: {"start":1500,"length":3} + >i++ + >:=> (line 54, col 18) to (line 54, col 21) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1507 to 1533) SpanInfo: {"start":1511,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1534 to 1535) SpanInfo: {"start":1511,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1536 to 1568) SpanInfo: {"start":1546,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 10) to (line 57, col 32) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1569 to 1603) SpanInfo: {"start":1570,"length":23} + >skill: skillA = "skill" + >:=> (line 57, col 34) to (line 57, col 57) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1604 to 1610) SpanInfo: {"start":1605,"length":5} + >i = 0 + >:=> (line 57, col 69) to (line 57, col 74) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1611 to 1617) SpanInfo: {"start":1612,"length":5} + >i < 1 + >:=> (line 57, col 76) to (line 57, col 81) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1618 to 1625) SpanInfo: {"start":1619,"length":3} + >i++ + >:=> (line 57, col 83) to (line 57, col 86) +-------------------------------- +58 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1626 to 1649) SpanInfo: {"start":1630,"length":18} + >console.log(nameA) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1650 to 1651) SpanInfo: {"start":1630,"length":18} + >console.log(nameA) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1652 to 1684) SpanInfo: {"start":1662,"length":22} + >name: nameA = "noName" + >:=> (line 60, col 10) to (line 60, col 32) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1685 to 1724) SpanInfo: {"start":1686,"length":23} + >skill: skillA = "skill" + >:=> (line 60, col 34) to (line 60, col 57) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1725 to 1731) SpanInfo: {"start":1726,"length":5} + >i = 0 + >:=> (line 60, col 74) to (line 60, col 79) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1732 to 1738) SpanInfo: {"start":1733,"length":5} + >i < 1 + >:=> (line 60, col 81) to (line 60, col 86) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1739 to 1746) SpanInfo: {"start":1740,"length":3} + >i++ + >:=> (line 60, col 88) to (line 60, col 91) +-------------------------------- +61 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1747 to 1770) SpanInfo: {"start":1751,"length":18} + >console.log(nameA) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +62 >} + + ~~ => Pos: (1771 to 1772) SpanInfo: {"start":1751,"length":18} + >console.log(nameA) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1773 to 1805) SpanInfo: {"start":1783,"length":22} + >name: nameA = "noName" + >:=> (line 63, col 10) to (line 63, col 32) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1806 to 1880) SpanInfo: {"start":1807,"length":23} + >skill: skillA = "skill" + >:=> (line 63, col 34) to (line 63, col 57) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1881 to 1887) SpanInfo: {"start":1882,"length":5} + >i = 0 + >:=> (line 63, col 109) to (line 63, col 114) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1888 to 1894) SpanInfo: {"start":1889,"length":5} + >i < 1 + >:=> (line 63, col 116) to (line 63, col 121) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1895 to 1902) SpanInfo: {"start":1896,"length":3} + >i++ + >:=> (line 63, col 123) to (line 63, col 126) +-------------------------------- +64 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1903 to 1926) SpanInfo: {"start":1907,"length":18} + >console.log(nameA) + >:=> (line 64, col 4) to (line 64, col 22) +-------------------------------- +65 >} + + ~~ => Pos: (1927 to 1928) SpanInfo: {"start":1907,"length":18} + >console.log(nameA) + >:=> (line 64, col 4) to (line 64, col 22) +-------------------------------- +66 >for (let { + + ~~~~~~~~~~~ => Pos: (1929 to 1939) SpanInfo: {"start":1944,"length":22} + >name: nameA = "noName" + >:=> (line 67, col 4) to (line 67, col 26) +-------------------------------- +67 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1940 to 1967) SpanInfo: {"start":1944,"length":22} + >name: nameA = "noName" + >:=> (line 67, col 4) to (line 67, col 26) +-------------------------------- +68 > skills: { + + ~~~~~~~~~~~ => Pos: (1968 to 1978) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +68 > skills: { + + ~~~ => Pos: (1979 to 1981) SpanInfo: {"start":1990,"length":29} + >primary: primaryA = "primary" + >:=> (line 69, col 8) to (line 69, col 37) +-------------------------------- +69 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1982 to 2020) SpanInfo: {"start":1990,"length":29} + >primary: primaryA = "primary" + >:=> (line 69, col 8) to (line 69, col 37) +-------------------------------- +70 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2021 to 2064) SpanInfo: {"start":2029,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 70, col 8) to (line 70, col 43) +-------------------------------- +71 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2065 to 2069) SpanInfo: {"start":2029,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 70, col 8) to (line 70, col 43) +71 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2070 to 2111) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +-------------------------------- +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2112 to 2126) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2127 to 2133) SpanInfo: {"start":2128,"length":5} + >i = 0 + >:=> (line 72, col 16) to (line 72, col 21) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2134 to 2140) SpanInfo: {"start":2135,"length":5} + >i < 1 + >:=> (line 72, col 23) to (line 72, col 28) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2141 to 2148) SpanInfo: {"start":2142,"length":3} + >i++ + >:=> (line 72, col 30) to (line 72, col 33) +-------------------------------- +73 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2149 to 2175) SpanInfo: {"start":2153,"length":21} + >console.log(primaryA) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +74 >} + + ~~ => Pos: (2176 to 2177) SpanInfo: {"start":2153,"length":21} + >console.log(primaryA) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +75 >for (let { + + ~~~~~~~~~~~ => Pos: (2178 to 2188) SpanInfo: {"start":2193,"length":22} + >name: nameA = "noName" + >:=> (line 76, col 4) to (line 76, col 26) +-------------------------------- +76 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2189 to 2216) SpanInfo: {"start":2193,"length":22} + >name: nameA = "noName" + >:=> (line 76, col 4) to (line 76, col 26) +-------------------------------- +77 > skills: { + + ~~~~~~~~~~~ => Pos: (2217 to 2227) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +77 > skills: { + + ~~~ => Pos: (2228 to 2230) SpanInfo: {"start":2239,"length":29} + >primary: primaryA = "primary" + >:=> (line 78, col 8) to (line 78, col 37) +-------------------------------- +78 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2231 to 2269) SpanInfo: {"start":2239,"length":29} + >primary: primaryA = "primary" + >:=> (line 78, col 8) to (line 78, col 37) +-------------------------------- +79 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2270 to 2313) SpanInfo: {"start":2278,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 79, col 8) to (line 79, col 43) +-------------------------------- +80 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2314 to 2318) SpanInfo: {"start":2278,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 79, col 8) to (line 79, col 43) +80 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2319 to 2360) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +-------------------------------- +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2361 to 2380) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2381 to 2387) SpanInfo: {"start":2382,"length":5} + >i = 0 + >:=> (line 81, col 21) to (line 81, col 26) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2388 to 2394) SpanInfo: {"start":2389,"length":5} + >i < 1 + >:=> (line 81, col 28) to (line 81, col 33) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2395 to 2402) SpanInfo: {"start":2396,"length":3} + >i++ + >:=> (line 81, col 35) to (line 81, col 38) +-------------------------------- +82 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2403 to 2429) SpanInfo: {"start":2407,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2430 to 2431) SpanInfo: {"start":2407,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for (let { + + ~~~~~~~~~~~ => Pos: (2432 to 2442) SpanInfo: {"start":2447,"length":22} + >name: nameA = "noName" + >:=> (line 85, col 4) to (line 85, col 26) +-------------------------------- +85 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2443 to 2470) SpanInfo: {"start":2447,"length":22} + >name: nameA = "noName" + >:=> (line 85, col 4) to (line 85, col 26) +-------------------------------- +86 > skills: { + + ~~~~~~~~~~~ => Pos: (2471 to 2481) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +86 > skills: { + + ~~~ => Pos: (2482 to 2484) SpanInfo: {"start":2493,"length":29} + >primary: primaryA = "primary" + >:=> (line 87, col 8) to (line 87, col 37) +-------------------------------- +87 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2485 to 2523) SpanInfo: {"start":2493,"length":29} + >primary: primaryA = "primary" + >:=> (line 87, col 8) to (line 87, col 37) +-------------------------------- +88 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2567) SpanInfo: {"start":2532,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 88, col 8) to (line 88, col 43) +-------------------------------- +89 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2568 to 2572) SpanInfo: {"start":2532,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 88, col 8) to (line 88, col 43) +89 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2573 to 2614) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +-------------------------------- +90 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2615 to 2705) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +-------------------------------- +91 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2706 to 2715) SpanInfo: {"start":2710,"length":5} + >i = 0 + >:=> (line 91, col 4) to (line 91, col 9) +91 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2716 to 2722) SpanInfo: {"start":2717,"length":5} + >i < 1 + >:=> (line 91, col 11) to (line 91, col 16) +91 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2723 to 2730) SpanInfo: {"start":2724,"length":3} + >i++ + >:=> (line 91, col 18) to (line 91, col 21) +-------------------------------- +92 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2731 to 2757) SpanInfo: {"start":2735,"length":21} + >console.log(primaryA) + >:=> (line 92, col 4) to (line 92, col 25) +-------------------------------- +93 >} + ~ => Pos: (2758 to 2758) SpanInfo: {"start":2735,"length":21} + >console.log(primaryA) + >:=> (line 92, col 4) to (line 92, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline new file mode 100644 index 00000000000..2d0cbda5d8d --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline @@ -0,0 +1,778 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >for (let [, nameA] of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (547 to 564) SpanInfo: {"start":559,"length":5} + >nameA + >:=> (line 18, col 12) to (line 18, col 17) +18 >for (let [, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (565 to 578) SpanInfo: {"start":569,"length":6} + >robots + >:=> (line 18, col 22) to (line 18, col 28) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (579 to 602) SpanInfo: {"start":583,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (603 to 604) SpanInfo: {"start":583,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (605 to 622) SpanInfo: {"start":617,"length":5} + >nameA + >:=> (line 21, col 12) to (line 21, col 17) +21 >for (let [, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (623 to 641) SpanInfo: {"start":627,"length":11} + >getRobots() + >:=> (line 21, col 22) to (line 21, col 33) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (642 to 665) SpanInfo: {"start":646,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (666 to 667) SpanInfo: {"start":646,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (668 to 685) SpanInfo: {"start":680,"length":5} + >nameA + >:=> (line 24, col 12) to (line 24, col 17) +24 >for (let [, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (686 to 709) SpanInfo: {"start":690,"length":16} + >[robotA, robotB] + >:=> (line 24, col 22) to (line 24, col 38) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (710 to 733) SpanInfo: {"start":714,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (734 to 735) SpanInfo: {"start":714,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~ => Pos: (736 to 746) SpanInfo: {"start":748,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (747 to 762) SpanInfo: {"start":749,"length":13} + >primarySkillA + >:=> (line 27, col 13) to (line 27, col 26) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (763 to 779) SpanInfo: {"start":764,"length":15} + >secondarySkillA + >:=> (line 27, col 28) to (line 27, col 43) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~ => Pos: (780 to 780) SpanInfo: {"start":748,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (781 to 799) SpanInfo: {"start":785,"length":11} + >multiRobots + >:=> (line 27, col 49) to (line 27, col 60) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (800 to 831) SpanInfo: {"start":804,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (832 to 833) SpanInfo: {"start":804,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (834 to 844) SpanInfo: {"start":846,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (845 to 860) SpanInfo: {"start":847,"length":13} + >primarySkillA + >:=> (line 30, col 13) to (line 30, col 26) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (861 to 877) SpanInfo: {"start":862,"length":15} + >secondarySkillA + >:=> (line 30, col 28) to (line 30, col 43) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~ => Pos: (878 to 878) SpanInfo: {"start":846,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (879 to 902) SpanInfo: {"start":883,"length":16} + >getMultiRobots() + >:=> (line 30, col 49) to (line 30, col 65) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (903 to 934) SpanInfo: {"start":907,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (935 to 936) SpanInfo: {"start":907,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~ => Pos: (937 to 947) SpanInfo: {"start":949,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (948 to 963) SpanInfo: {"start":950,"length":13} + >primarySkillA + >:=> (line 33, col 13) to (line 33, col 26) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (964 to 980) SpanInfo: {"start":965,"length":15} + >secondarySkillA + >:=> (line 33, col 28) to (line 33, col 43) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (981 to 981) SpanInfo: {"start":949,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (982 to 1015) SpanInfo: {"start":986,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 33, col 49) to (line 33, col 75) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1016 to 1047) SpanInfo: {"start":1020,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1048 to 1049) SpanInfo: {"start":1020,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 >for (let [numberB] of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1050 to 1067) SpanInfo: {"start":1060,"length":7} + >numberB + >:=> (line 36, col 10) to (line 36, col 17) +36 >for (let [numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1068 to 1081) SpanInfo: {"start":1072,"length":6} + >robots + >:=> (line 36, col 22) to (line 36, col 28) +-------------------------------- +37 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1082 to 1107) SpanInfo: {"start":1086,"length":20} + >console.log(numberB) + >:=> (line 37, col 4) to (line 37, col 24) +-------------------------------- +38 >} + + ~~ => Pos: (1108 to 1109) SpanInfo: {"start":1086,"length":20} + >console.log(numberB) + >:=> (line 37, col 4) to (line 37, col 24) +-------------------------------- +39 >for (let [numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1110 to 1127) SpanInfo: {"start":1120,"length":7} + >numberB + >:=> (line 39, col 10) to (line 39, col 17) +39 >for (let [numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1128 to 1146) SpanInfo: {"start":1132,"length":11} + >getRobots() + >:=> (line 39, col 22) to (line 39, col 33) +-------------------------------- +40 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1147 to 1172) SpanInfo: {"start":1151,"length":20} + >console.log(numberB) + >:=> (line 40, col 4) to (line 40, col 24) +-------------------------------- +41 >} + + ~~ => Pos: (1173 to 1174) SpanInfo: {"start":1151,"length":20} + >console.log(numberB) + >:=> (line 40, col 4) to (line 40, col 24) +-------------------------------- +42 >for (let [numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1175 to 1192) SpanInfo: {"start":1185,"length":7} + >numberB + >:=> (line 42, col 10) to (line 42, col 17) +42 >for (let [numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1193 to 1216) SpanInfo: {"start":1197,"length":16} + >[robotA, robotB] + >:=> (line 42, col 22) to (line 42, col 38) +-------------------------------- +43 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1217 to 1242) SpanInfo: {"start":1221,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +44 >} + + ~~ => Pos: (1243 to 1244) SpanInfo: {"start":1221,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +45 >for (let [nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1245 to 1260) SpanInfo: {"start":1255,"length":5} + >nameB + >:=> (line 45, col 10) to (line 45, col 15) +45 >for (let [nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1261 to 1279) SpanInfo: {"start":1265,"length":11} + >multiRobots + >:=> (line 45, col 20) to (line 45, col 31) +-------------------------------- +46 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1280 to 1303) SpanInfo: {"start":1284,"length":18} + >console.log(nameB) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1304 to 1305) SpanInfo: {"start":1284,"length":18} + >console.log(nameB) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for (let [nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1306 to 1321) SpanInfo: {"start":1316,"length":5} + >nameB + >:=> (line 48, col 10) to (line 48, col 15) +48 >for (let [nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1322 to 1345) SpanInfo: {"start":1326,"length":16} + >getMultiRobots() + >:=> (line 48, col 20) to (line 48, col 36) +-------------------------------- +49 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1346 to 1369) SpanInfo: {"start":1350,"length":18} + >console.log(nameB) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1370 to 1371) SpanInfo: {"start":1350,"length":18} + >console.log(nameB) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for (let [nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1372 to 1387) SpanInfo: {"start":1382,"length":5} + >nameB + >:=> (line 51, col 10) to (line 51, col 15) +51 >for (let [nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1388 to 1421) SpanInfo: {"start":1392,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 51, col 20) to (line 51, col 46) +-------------------------------- +52 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1422 to 1445) SpanInfo: {"start":1426,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1446 to 1447) SpanInfo: {"start":1426,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1448 to 1466) SpanInfo: {"start":1458,"length":8} + >numberA2 + >:=> (line 54, col 10) to (line 54, col 18) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~ => Pos: (1467 to 1474) SpanInfo: {"start":1468,"length":6} + >nameA2 + >:=> (line 54, col 20) to (line 54, col 26) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~ => Pos: (1475 to 1483) SpanInfo: {"start":1476,"length":7} + >skillA2 + >:=> (line 54, col 28) to (line 54, col 35) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1484 to 1497) SpanInfo: {"start":1488,"length":6} + >robots + >:=> (line 54, col 40) to (line 54, col 46) +-------------------------------- +55 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1498 to 1522) SpanInfo: {"start":1502,"length":19} + >console.log(nameA2) + >:=> (line 55, col 4) to (line 55, col 23) +-------------------------------- +56 >} + + ~~ => Pos: (1523 to 1524) SpanInfo: {"start":1502,"length":19} + >console.log(nameA2) + >:=> (line 55, col 4) to (line 55, col 23) +-------------------------------- +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1525 to 1543) SpanInfo: {"start":1535,"length":8} + >numberA2 + >:=> (line 57, col 10) to (line 57, col 18) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~ => Pos: (1544 to 1551) SpanInfo: {"start":1545,"length":6} + >nameA2 + >:=> (line 57, col 20) to (line 57, col 26) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~ => Pos: (1552 to 1560) SpanInfo: {"start":1553,"length":7} + >skillA2 + >:=> (line 57, col 28) to (line 57, col 35) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1561 to 1579) SpanInfo: {"start":1565,"length":11} + >getRobots() + >:=> (line 57, col 40) to (line 57, col 51) +-------------------------------- +58 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1580 to 1604) SpanInfo: {"start":1584,"length":19} + >console.log(nameA2) + >:=> (line 58, col 4) to (line 58, col 23) +-------------------------------- +59 >} + + ~~ => Pos: (1605 to 1606) SpanInfo: {"start":1584,"length":19} + >console.log(nameA2) + >:=> (line 58, col 4) to (line 58, col 23) +-------------------------------- +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1607 to 1625) SpanInfo: {"start":1617,"length":8} + >numberA2 + >:=> (line 60, col 10) to (line 60, col 18) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~ => Pos: (1626 to 1633) SpanInfo: {"start":1627,"length":6} + >nameA2 + >:=> (line 60, col 20) to (line 60, col 26) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~ => Pos: (1634 to 1642) SpanInfo: {"start":1635,"length":7} + >skillA2 + >:=> (line 60, col 28) to (line 60, col 35) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1643 to 1666) SpanInfo: {"start":1647,"length":16} + >[robotA, robotB] + >:=> (line 60, col 40) to (line 60, col 56) +-------------------------------- +61 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1667 to 1691) SpanInfo: {"start":1671,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +62 >} + + ~~ => Pos: (1692 to 1693) SpanInfo: {"start":1671,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1694 to 1710) SpanInfo: {"start":1704,"length":6} + >nameMA + >:=> (line 63, col 10) to (line 63, col 16) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1711 to 1726) SpanInfo: {"start":1713,"length":13} + >primarySkillA + >:=> (line 63, col 19) to (line 63, col 32) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1727 to 1743) SpanInfo: {"start":1728,"length":15} + >secondarySkillA + >:=> (line 63, col 34) to (line 63, col 49) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~=> Pos: (1744 to 1744) SpanInfo: {"start":1712,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 63, col 18) to (line 63, col 50) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1745 to 1763) SpanInfo: {"start":1749,"length":11} + >multiRobots + >:=> (line 63, col 55) to (line 63, col 66) +-------------------------------- +64 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1764 to 1788) SpanInfo: {"start":1768,"length":19} + >console.log(nameMA) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (1789 to 1790) SpanInfo: {"start":1768,"length":19} + >console.log(nameMA) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1791 to 1807) SpanInfo: {"start":1801,"length":6} + >nameMA + >:=> (line 66, col 10) to (line 66, col 16) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1808 to 1823) SpanInfo: {"start":1810,"length":13} + >primarySkillA + >:=> (line 66, col 19) to (line 66, col 32) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1824 to 1840) SpanInfo: {"start":1825,"length":15} + >secondarySkillA + >:=> (line 66, col 34) to (line 66, col 49) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~=> Pos: (1841 to 1841) SpanInfo: {"start":1809,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 66, col 18) to (line 66, col 50) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1842 to 1865) SpanInfo: {"start":1846,"length":16} + >getMultiRobots() + >:=> (line 66, col 55) to (line 66, col 71) +-------------------------------- +67 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1866 to 1890) SpanInfo: {"start":1870,"length":19} + >console.log(nameMA) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (1891 to 1892) SpanInfo: {"start":1870,"length":19} + >console.log(nameMA) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1893 to 1909) SpanInfo: {"start":1903,"length":6} + >nameMA + >:=> (line 69, col 10) to (line 69, col 16) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1910 to 1925) SpanInfo: {"start":1912,"length":13} + >primarySkillA + >:=> (line 69, col 19) to (line 69, col 32) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1926 to 1942) SpanInfo: {"start":1927,"length":15} + >secondarySkillA + >:=> (line 69, col 34) to (line 69, col 49) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~=> Pos: (1943 to 1943) SpanInfo: {"start":1911,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 69, col 18) to (line 69, col 50) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1944 to 1977) SpanInfo: {"start":1948,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 69, col 55) to (line 69, col 81) +-------------------------------- +70 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1978 to 2002) SpanInfo: {"start":1982,"length":19} + >console.log(nameMA) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +71 >} + + ~~ => Pos: (2003 to 2004) SpanInfo: {"start":1982,"length":19} + >console.log(nameMA) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2005 to 2023) SpanInfo: {"start":2015,"length":8} + >numberA3 + >:=> (line 72, col 10) to (line 72, col 18) +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2024 to 2038) SpanInfo: {"start":2025,"length":13} + >...robotAInfo + >:=> (line 72, col 20) to (line 72, col 33) +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2039 to 2052) SpanInfo: {"start":2043,"length":6} + >robots + >:=> (line 72, col 38) to (line 72, col 44) +-------------------------------- +73 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2053 to 2079) SpanInfo: {"start":2057,"length":21} + >console.log(numberA3) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +74 >} + + ~~ => Pos: (2080 to 2081) SpanInfo: {"start":2057,"length":21} + >console.log(numberA3) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2082 to 2100) SpanInfo: {"start":2092,"length":8} + >numberA3 + >:=> (line 75, col 10) to (line 75, col 18) +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2101 to 2115) SpanInfo: {"start":2102,"length":13} + >...robotAInfo + >:=> (line 75, col 20) to (line 75, col 33) +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2116 to 2134) SpanInfo: {"start":2120,"length":11} + >getRobots() + >:=> (line 75, col 38) to (line 75, col 49) +-------------------------------- +76 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2135 to 2161) SpanInfo: {"start":2139,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +77 >} + + ~~ => Pos: (2162 to 2163) SpanInfo: {"start":2139,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2164 to 2182) SpanInfo: {"start":2174,"length":8} + >numberA3 + >:=> (line 78, col 10) to (line 78, col 18) +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2183 to 2197) SpanInfo: {"start":2184,"length":13} + >...robotAInfo + >:=> (line 78, col 20) to (line 78, col 33) +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2198 to 2221) SpanInfo: {"start":2202,"length":16} + >[robotA, robotB] + >:=> (line 78, col 38) to (line 78, col 54) +-------------------------------- +79 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2222 to 2248) SpanInfo: {"start":2226,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +80 >} + + ~~ => Pos: (2249 to 2250) SpanInfo: {"start":2226,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +81 >for (let [...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2251 to 2279) SpanInfo: {"start":2261,"length":18} + >...multiRobotAInfo + >:=> (line 81, col 10) to (line 81, col 28) +81 >for (let [...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2280 to 2298) SpanInfo: {"start":2284,"length":11} + >multiRobots + >:=> (line 81, col 33) to (line 81, col 44) +-------------------------------- +82 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2299 to 2332) SpanInfo: {"start":2303,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 82, col 4) to (line 82, col 32) +-------------------------------- +83 >} + + ~~ => Pos: (2333 to 2334) SpanInfo: {"start":2303,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 82, col 4) to (line 82, col 32) +-------------------------------- +84 >for (let [...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2335 to 2363) SpanInfo: {"start":2345,"length":18} + >...multiRobotAInfo + >:=> (line 84, col 10) to (line 84, col 28) +84 >for (let [...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2364 to 2387) SpanInfo: {"start":2368,"length":16} + >getMultiRobots() + >:=> (line 84, col 33) to (line 84, col 49) +-------------------------------- +85 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2388 to 2421) SpanInfo: {"start":2392,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +86 >} + + ~~ => Pos: (2422 to 2423) SpanInfo: {"start":2392,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +87 >for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2452) SpanInfo: {"start":2434,"length":18} + >...multiRobotAInfo + >:=> (line 87, col 10) to (line 87, col 28) +87 >for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2453 to 2486) SpanInfo: {"start":2457,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 87, col 33) to (line 87, col 59) +-------------------------------- +88 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2487 to 2520) SpanInfo: {"start":2491,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +89 >} + ~ => Pos: (2521 to 2521) SpanInfo: {"start":2491,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..5dfc730003f --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,814 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >for (let [, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (547 to 575) SpanInfo: {"start":559,"length":16} + >nameA = "noName" + >:=> (line 18, col 12) to (line 18, col 28) +18 >for (let [, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (576 to 589) SpanInfo: {"start":580,"length":6} + >robots + >:=> (line 18, col 33) to (line 18, col 39) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (590 to 613) SpanInfo: {"start":594,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (614 to 615) SpanInfo: {"start":594,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (616 to 644) SpanInfo: {"start":628,"length":16} + >nameA = "noName" + >:=> (line 21, col 12) to (line 21, col 28) +21 >for (let [, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (645 to 663) SpanInfo: {"start":649,"length":11} + >getRobots() + >:=> (line 21, col 33) to (line 21, col 44) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (664 to 687) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (688 to 689) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (690 to 718) SpanInfo: {"start":702,"length":16} + >nameA = "noName" + >:=> (line 24, col 12) to (line 24, col 28) +24 >for (let [, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (719 to 742) SpanInfo: {"start":723,"length":16} + >[robotA, robotB] + >:=> (line 24, col 33) to (line 24, col 49) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (743 to 766) SpanInfo: {"start":747,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (767 to 768) SpanInfo: {"start":747,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (769 to 779) SpanInfo: {"start":781,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 27, col 12) to (line 30, col 24) +27 >for (let [, [ + + ~~~ => Pos: (780 to 782) SpanInfo: {"start":787,"length":25} + >primarySkillA = "primary" + >:=> (line 28, col 4) to (line 28, col 29) +-------------------------------- +28 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (783 to 813) SpanInfo: {"start":787,"length":25} + >primarySkillA = "primary" + >:=> (line 28, col 4) to (line 28, col 29) +-------------------------------- +29 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (814 to 847) SpanInfo: {"start":818,"length":29} + >secondarySkillA = "secondary" + >:=> (line 29, col 4) to (line 29, col 33) +-------------------------------- +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (848 to 848) SpanInfo: {"start":818,"length":29} + >secondarySkillA = "secondary" + >:=> (line 29, col 4) to (line 29, col 33) +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (849 to 872) SpanInfo: {"start":781,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 27, col 12) to (line 30, col 24) +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 891) SpanInfo: {"start":877,"length":11} + >multiRobots + >:=> (line 30, col 29) to (line 30, col 40) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (892 to 923) SpanInfo: {"start":896,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (924 to 925) SpanInfo: {"start":896,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (926 to 936) SpanInfo: {"start":938,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 33, col 12) to (line 36, col 24) +33 >for (let [, [ + + ~~~ => Pos: (937 to 939) SpanInfo: {"start":944,"length":25} + >primarySkillA = "primary" + >:=> (line 34, col 4) to (line 34, col 29) +-------------------------------- +34 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (940 to 970) SpanInfo: {"start":944,"length":25} + >primarySkillA = "primary" + >:=> (line 34, col 4) to (line 34, col 29) +-------------------------------- +35 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (971 to 1004) SpanInfo: {"start":975,"length":29} + >secondarySkillA = "secondary" + >:=> (line 35, col 4) to (line 35, col 33) +-------------------------------- +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (1005 to 1005) SpanInfo: {"start":975,"length":29} + >secondarySkillA = "secondary" + >:=> (line 35, col 4) to (line 35, col 33) +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1006 to 1029) SpanInfo: {"start":938,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 33, col 12) to (line 36, col 24) +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1030 to 1053) SpanInfo: {"start":1034,"length":16} + >getMultiRobots() + >:=> (line 36, col 29) to (line 36, col 45) +-------------------------------- +37 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1054 to 1085) SpanInfo: {"start":1058,"length":26} + >console.log(primarySkillA) + >:=> (line 37, col 4) to (line 37, col 30) +-------------------------------- +38 >} + + ~~ => Pos: (1086 to 1087) SpanInfo: {"start":1058,"length":26} + >console.log(primarySkillA) + >:=> (line 37, col 4) to (line 37, col 30) +-------------------------------- +39 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (1088 to 1098) SpanInfo: {"start":1100,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 39, col 12) to (line 42, col 24) +39 >for (let [, [ + + ~~~ => Pos: (1099 to 1101) SpanInfo: {"start":1106,"length":25} + >primarySkillA = "primary" + >:=> (line 40, col 4) to (line 40, col 29) +-------------------------------- +40 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1102 to 1132) SpanInfo: {"start":1106,"length":25} + >primarySkillA = "primary" + >:=> (line 40, col 4) to (line 40, col 29) +-------------------------------- +41 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1133 to 1166) SpanInfo: {"start":1137,"length":29} + >secondarySkillA = "secondary" + >:=> (line 41, col 4) to (line 41, col 33) +-------------------------------- +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1167 to 1167) SpanInfo: {"start":1137,"length":29} + >secondarySkillA = "secondary" + >:=> (line 41, col 4) to (line 41, col 33) +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1168 to 1191) SpanInfo: {"start":1100,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 39, col 12) to (line 42, col 24) +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1192 to 1225) SpanInfo: {"start":1196,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 42, col 29) to (line 42, col 55) +-------------------------------- +43 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1226 to 1257) SpanInfo: {"start":1230,"length":26} + >console.log(primarySkillA) + >:=> (line 43, col 4) to (line 43, col 30) +-------------------------------- +44 >} + + ~~ => Pos: (1258 to 1259) SpanInfo: {"start":1230,"length":26} + >console.log(primarySkillA) + >:=> (line 43, col 4) to (line 43, col 30) +-------------------------------- +45 >for (let [numberB = -1] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1260 to 1282) SpanInfo: {"start":1270,"length":12} + >numberB = -1 + >:=> (line 45, col 10) to (line 45, col 22) +45 >for (let [numberB = -1] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1283 to 1296) SpanInfo: {"start":1287,"length":6} + >robots + >:=> (line 45, col 27) to (line 45, col 33) +-------------------------------- +46 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1297 to 1322) SpanInfo: {"start":1301,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +47 >} + + ~~ => Pos: (1323 to 1324) SpanInfo: {"start":1301,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +48 >for (let [numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1325 to 1347) SpanInfo: {"start":1335,"length":12} + >numberB = -1 + >:=> (line 48, col 10) to (line 48, col 22) +48 >for (let [numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1348 to 1366) SpanInfo: {"start":1352,"length":11} + >getRobots() + >:=> (line 48, col 27) to (line 48, col 38) +-------------------------------- +49 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1367 to 1392) SpanInfo: {"start":1371,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +50 >} + + ~~ => Pos: (1393 to 1394) SpanInfo: {"start":1371,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +51 >for (let [numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1395 to 1417) SpanInfo: {"start":1405,"length":12} + >numberB = -1 + >:=> (line 51, col 10) to (line 51, col 22) +51 >for (let [numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1418 to 1441) SpanInfo: {"start":1422,"length":16} + >[robotA, robotB] + >:=> (line 51, col 27) to (line 51, col 43) +-------------------------------- +52 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1442 to 1467) SpanInfo: {"start":1446,"length":20} + >console.log(numberB) + >:=> (line 52, col 4) to (line 52, col 24) +-------------------------------- +53 >} + + ~~ => Pos: (1468 to 1469) SpanInfo: {"start":1446,"length":20} + >console.log(numberB) + >:=> (line 52, col 4) to (line 52, col 24) +-------------------------------- +54 >for (let [nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1470 to 1496) SpanInfo: {"start":1480,"length":16} + >nameB = "noName" + >:=> (line 54, col 10) to (line 54, col 26) +54 >for (let [nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1497 to 1515) SpanInfo: {"start":1501,"length":11} + >multiRobots + >:=> (line 54, col 31) to (line 54, col 42) +-------------------------------- +55 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1516 to 1539) SpanInfo: {"start":1520,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +56 >} + + ~~ => Pos: (1540 to 1541) SpanInfo: {"start":1520,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +57 >for (let [nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1542 to 1568) SpanInfo: {"start":1552,"length":16} + >nameB = "noName" + >:=> (line 57, col 10) to (line 57, col 26) +57 >for (let [nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1569 to 1592) SpanInfo: {"start":1573,"length":16} + >getMultiRobots() + >:=> (line 57, col 31) to (line 57, col 47) +-------------------------------- +58 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1593 to 1616) SpanInfo: {"start":1597,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1617 to 1618) SpanInfo: {"start":1597,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1619 to 1645) SpanInfo: {"start":1629,"length":16} + >nameB = "noName" + >:=> (line 60, col 10) to (line 60, col 26) +60 >for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1646 to 1679) SpanInfo: {"start":1650,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 60, col 31) to (line 60, col 57) +-------------------------------- +61 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1680 to 1703) SpanInfo: {"start":1684,"length":18} + >console.log(nameB) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +62 >} + + ~~ => Pos: (1704 to 1705) SpanInfo: {"start":1684,"length":18} + >console.log(nameB) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1706 to 1729) SpanInfo: {"start":1716,"length":13} + >numberA2 = -1 + >:=> (line 63, col 10) to (line 63, col 23) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1730 to 1748) SpanInfo: {"start":1731,"length":17} + >nameA2 = "noName" + >:=> (line 63, col 25) to (line 63, col 42) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1749 to 1767) SpanInfo: {"start":1750,"length":17} + >skillA2 = "skill" + >:=> (line 63, col 44) to (line 63, col 61) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1768 to 1781) SpanInfo: {"start":1772,"length":6} + >robots + >:=> (line 63, col 66) to (line 63, col 72) +-------------------------------- +64 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1782 to 1806) SpanInfo: {"start":1786,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (1807 to 1808) SpanInfo: {"start":1786,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1809 to 1832) SpanInfo: {"start":1819,"length":13} + >numberA2 = -1 + >:=> (line 66, col 10) to (line 66, col 23) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1833 to 1851) SpanInfo: {"start":1834,"length":17} + >nameA2 = "noName" + >:=> (line 66, col 25) to (line 66, col 42) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1852 to 1870) SpanInfo: {"start":1853,"length":17} + >skillA2 = "skill" + >:=> (line 66, col 44) to (line 66, col 61) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1871 to 1889) SpanInfo: {"start":1875,"length":11} + >getRobots() + >:=> (line 66, col 66) to (line 66, col 77) +-------------------------------- +67 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1890 to 1914) SpanInfo: {"start":1894,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (1915 to 1916) SpanInfo: {"start":1894,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1917 to 1940) SpanInfo: {"start":1927,"length":13} + >numberA2 = -1 + >:=> (line 69, col 10) to (line 69, col 23) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1941 to 1959) SpanInfo: {"start":1942,"length":17} + >nameA2 = "noName" + >:=> (line 69, col 25) to (line 69, col 42) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1960 to 1978) SpanInfo: {"start":1961,"length":17} + >skillA2 = "skill" + >:=> (line 69, col 44) to (line 69, col 61) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1979 to 2002) SpanInfo: {"start":1983,"length":16} + >[robotA, robotB] + >:=> (line 69, col 66) to (line 69, col 82) +-------------------------------- +70 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2003 to 2027) SpanInfo: {"start":2007,"length":19} + >console.log(nameA2) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +71 >} + + ~~ => Pos: (2028 to 2029) SpanInfo: {"start":2007,"length":19} + >console.log(nameA2) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +72 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2030 to 2057) SpanInfo: {"start":2040,"length":17} + >nameMA = "noName" + >:=> (line 72, col 10) to (line 72, col 27) +72 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2058 to 2060) SpanInfo: {"start":2065,"length":25} + >primarySkillA = "primary" + >:=> (line 73, col 4) to (line 73, col 29) +-------------------------------- +73 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2061 to 2091) SpanInfo: {"start":2065,"length":25} + >primarySkillA = "primary" + >:=> (line 73, col 4) to (line 73, col 29) +-------------------------------- +74 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2092 to 2125) SpanInfo: {"start":2096,"length":29} + >secondarySkillA = "secondary" + >:=> (line 74, col 4) to (line 74, col 33) +-------------------------------- +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (2126 to 2126) SpanInfo: {"start":2096,"length":29} + >secondarySkillA = "secondary" + >:=> (line 74, col 4) to (line 74, col 33) +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2127 to 2150) SpanInfo: {"start":2059,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 72, col 29) to (line 75, col 24) +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2151 to 2169) SpanInfo: {"start":2155,"length":11} + >multiRobots + >:=> (line 75, col 29) to (line 75, col 40) +-------------------------------- +76 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2170 to 2194) SpanInfo: {"start":2174,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +77 >} + + ~~ => Pos: (2195 to 2196) SpanInfo: {"start":2174,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +78 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2197 to 2224) SpanInfo: {"start":2207,"length":17} + >nameMA = "noName" + >:=> (line 78, col 10) to (line 78, col 27) +78 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2225 to 2227) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 79, col 4) to (line 79, col 29) +-------------------------------- +79 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2228 to 2258) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 79, col 4) to (line 79, col 29) +-------------------------------- +80 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2292) SpanInfo: {"start":2263,"length":29} + >secondarySkillA = "secondary" + >:=> (line 80, col 4) to (line 80, col 33) +-------------------------------- +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (2293 to 2293) SpanInfo: {"start":2263,"length":29} + >secondarySkillA = "secondary" + >:=> (line 80, col 4) to (line 80, col 33) +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2294 to 2317) SpanInfo: {"start":2226,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 78, col 29) to (line 81, col 24) +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2318 to 2341) SpanInfo: {"start":2322,"length":16} + >getMultiRobots() + >:=> (line 81, col 29) to (line 81, col 45) +-------------------------------- +82 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2342 to 2366) SpanInfo: {"start":2346,"length":19} + >console.log(nameMA) + >:=> (line 82, col 4) to (line 82, col 23) +-------------------------------- +83 >} + + ~~ => Pos: (2367 to 2368) SpanInfo: {"start":2346,"length":19} + >console.log(nameMA) + >:=> (line 82, col 4) to (line 82, col 23) +-------------------------------- +84 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2369 to 2396) SpanInfo: {"start":2379,"length":17} + >nameMA = "noName" + >:=> (line 84, col 10) to (line 84, col 27) +84 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2397 to 2399) SpanInfo: {"start":2404,"length":25} + >primarySkillA = "primary" + >:=> (line 85, col 4) to (line 85, col 29) +-------------------------------- +85 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2400 to 2430) SpanInfo: {"start":2404,"length":25} + >primarySkillA = "primary" + >:=> (line 85, col 4) to (line 85, col 29) +-------------------------------- +86 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2431 to 2464) SpanInfo: {"start":2435,"length":29} + >secondarySkillA = "secondary" + >:=> (line 86, col 4) to (line 86, col 33) +-------------------------------- +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (2465 to 2465) SpanInfo: {"start":2435,"length":29} + >secondarySkillA = "secondary" + >:=> (line 86, col 4) to (line 86, col 33) +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2466 to 2489) SpanInfo: {"start":2398,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 84, col 29) to (line 87, col 24) +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2490 to 2523) SpanInfo: {"start":2494,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 87, col 29) to (line 87, col 55) +-------------------------------- +88 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2548) SpanInfo: {"start":2528,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +89 >} + + ~~ => Pos: (2549 to 2550) SpanInfo: {"start":2528,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2551 to 2574) SpanInfo: {"start":2561,"length":13} + >numberA3 = -1 + >:=> (line 90, col 10) to (line 90, col 23) +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2575 to 2589) SpanInfo: {"start":2576,"length":13} + >...robotAInfo + >:=> (line 90, col 25) to (line 90, col 38) +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2590 to 2603) SpanInfo: {"start":2594,"length":6} + >robots + >:=> (line 90, col 43) to (line 90, col 49) +-------------------------------- +91 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2604 to 2630) SpanInfo: {"start":2608,"length":21} + >console.log(numberA3) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +92 >} + + ~~ => Pos: (2631 to 2632) SpanInfo: {"start":2608,"length":21} + >console.log(numberA3) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2633 to 2656) SpanInfo: {"start":2643,"length":13} + >numberA3 = -1 + >:=> (line 93, col 10) to (line 93, col 23) +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2657 to 2671) SpanInfo: {"start":2658,"length":13} + >...robotAInfo + >:=> (line 93, col 25) to (line 93, col 38) +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2672 to 2690) SpanInfo: {"start":2676,"length":11} + >getRobots() + >:=> (line 93, col 43) to (line 93, col 54) +-------------------------------- +94 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2691 to 2717) SpanInfo: {"start":2695,"length":21} + >console.log(numberA3) + >:=> (line 94, col 4) to (line 94, col 25) +-------------------------------- +95 >} + + ~~ => Pos: (2718 to 2719) SpanInfo: {"start":2695,"length":21} + >console.log(numberA3) + >:=> (line 94, col 4) to (line 94, col 25) +-------------------------------- +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2720 to 2743) SpanInfo: {"start":2730,"length":13} + >numberA3 = -1 + >:=> (line 96, col 10) to (line 96, col 23) +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2744 to 2758) SpanInfo: {"start":2745,"length":13} + >...robotAInfo + >:=> (line 96, col 25) to (line 96, col 38) +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2759 to 2782) SpanInfo: {"start":2763,"length":16} + >[robotA, robotB] + >:=> (line 96, col 43) to (line 96, col 59) +-------------------------------- +97 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2783 to 2809) SpanInfo: {"start":2787,"length":21} + >console.log(numberA3) + >:=> (line 97, col 4) to (line 97, col 25) +-------------------------------- +98 >} + ~ => Pos: (2810 to 2810) SpanInfo: {"start":2787,"length":21} + >console.log(numberA3) + >:=> (line 97, col 4) to (line 97, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline new file mode 100644 index 00000000000..14e0d2a2d27 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline @@ -0,0 +1,523 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >for (let {name: nameA } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (603 to 625) SpanInfo: {"start":613,"length":11} + >name: nameA + >:=> (line 24, col 10) to (line 24, col 21) +24 >for (let {name: nameA } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (626 to 639) SpanInfo: {"start":630,"length":6} + >robots + >:=> (line 24, col 27) to (line 24, col 33) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (640 to 663) SpanInfo: {"start":644,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (664 to 665) SpanInfo: {"start":644,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let {name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (666 to 688) SpanInfo: {"start":676,"length":11} + >name: nameA + >:=> (line 27, col 10) to (line 27, col 21) +27 >for (let {name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (689 to 707) SpanInfo: {"start":693,"length":11} + >getRobots() + >:=> (line 27, col 27) to (line 27, col 38) +-------------------------------- +28 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (708 to 731) SpanInfo: {"start":712,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +29 >} + + ~~ => Pos: (732 to 733) SpanInfo: {"start":712,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +30 >for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (734 to 756) SpanInfo: {"start":744,"length":11} + >name: nameA + >:=> (line 30, col 10) to (line 30, col 21) +30 >for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (757 to 840) SpanInfo: {"start":761,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 30, col 27) to (line 30, col 103) +-------------------------------- +31 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (841 to 864) SpanInfo: {"start":845,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +32 >} + + ~~ => Pos: (865 to 866) SpanInfo: {"start":845,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (867 to 884) SpanInfo: {"start":878,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 33, col 11) to (line 33, col 63) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (885 to 905) SpanInfo: {"start":888,"length":17} + >primary: primaryA + >:=> (line 33, col 21) to (line 33, col 38) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (906 to 929) SpanInfo: {"start":907,"length":21} + >secondary: secondaryA + >:=> (line 33, col 40) to (line 33, col 61) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (930 to 931) SpanInfo: {"start":878,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 33, col 11) to (line 33, col 63) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (932 to 950) SpanInfo: {"start":936,"length":11} + >multiRobots + >:=> (line 33, col 69) to (line 33, col 80) +-------------------------------- +34 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (951 to 977) SpanInfo: {"start":955,"length":21} + >console.log(primaryA) + >:=> (line 34, col 4) to (line 34, col 25) +-------------------------------- +35 >} + + ~~ => Pos: (978 to 979) SpanInfo: {"start":955,"length":21} + >console.log(primaryA) + >:=> (line 34, col 4) to (line 34, col 25) +-------------------------------- +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (980 to 997) SpanInfo: {"start":991,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 36, col 11) to (line 36, col 63) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (998 to 1018) SpanInfo: {"start":1001,"length":17} + >primary: primaryA + >:=> (line 36, col 21) to (line 36, col 38) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1019 to 1042) SpanInfo: {"start":1020,"length":21} + >secondary: secondaryA + >:=> (line 36, col 40) to (line 36, col 61) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1043 to 1044) SpanInfo: {"start":991,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 36, col 11) to (line 36, col 63) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1045 to 1068) SpanInfo: {"start":1049,"length":16} + >getMultiRobots() + >:=> (line 36, col 69) to (line 36, col 85) +-------------------------------- +37 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1069 to 1095) SpanInfo: {"start":1073,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +38 >} + + ~~ => Pos: (1096 to 1097) SpanInfo: {"start":1073,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~ => Pos: (1098 to 1115) SpanInfo: {"start":1109,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 39, col 11) to (line 39, col 63) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1116 to 1136) SpanInfo: {"start":1119,"length":17} + >primary: primaryA + >:=> (line 39, col 21) to (line 39, col 38) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1137 to 1160) SpanInfo: {"start":1138,"length":21} + >secondary: secondaryA + >:=> (line 39, col 40) to (line 39, col 61) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1161 to 1162) SpanInfo: {"start":1109,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 39, col 11) to (line 39, col 63) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1163 to 1236) SpanInfo: {"start":1167,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 39, col 69) to (line 40, col 78) +-------------------------------- +40 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1237 to 1318) SpanInfo: {"start":1167,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 39, col 69) to (line 40, col 78) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1319 to 1345) SpanInfo: {"start":1323,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1346 to 1347) SpanInfo: {"start":1323,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1348 to 1369) SpanInfo: {"start":1358,"length":11} + >name: nameA + >:=> (line 43, col 10) to (line 43, col 21) +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1370 to 1385) SpanInfo: {"start":1371,"length":13} + >skill: skillA + >:=> (line 43, col 23) to (line 43, col 36) +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1386 to 1399) SpanInfo: {"start":1390,"length":6} + >robots + >:=> (line 43, col 42) to (line 43, col 48) +-------------------------------- +44 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1400 to 1423) SpanInfo: {"start":1404,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +45 >} + + ~~ => Pos: (1424 to 1425) SpanInfo: {"start":1404,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1426 to 1447) SpanInfo: {"start":1436,"length":11} + >name: nameA + >:=> (line 46, col 10) to (line 46, col 21) +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1448 to 1463) SpanInfo: {"start":1449,"length":13} + >skill: skillA + >:=> (line 46, col 23) to (line 46, col 36) +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1464 to 1482) SpanInfo: {"start":1468,"length":11} + >getRobots() + >:=> (line 46, col 42) to (line 46, col 53) +-------------------------------- +47 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1483 to 1506) SpanInfo: {"start":1487,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1507 to 1508) SpanInfo: {"start":1487,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1509 to 1530) SpanInfo: {"start":1519,"length":11} + >name: nameA + >:=> (line 49, col 10) to (line 49, col 21) +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1531 to 1546) SpanInfo: {"start":1532,"length":13} + >skill: skillA + >:=> (line 49, col 23) to (line 49, col 36) +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1547 to 1630) SpanInfo: {"start":1551,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 49, col 42) to (line 49, col 118) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1631 to 1654) SpanInfo: {"start":1635,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1655 to 1656) SpanInfo: {"start":1635,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1657 to 1678) SpanInfo: {"start":1667,"length":11} + >name: nameA + >:=> (line 52, col 10) to (line 52, col 21) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~ => Pos: (1679 to 1686) SpanInfo: {"start":1680,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1687 to 1707) SpanInfo: {"start":1690,"length":17} + >primary: primaryA + >:=> (line 52, col 33) to (line 52, col 50) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1708 to 1731) SpanInfo: {"start":1709,"length":21} + >secondary: secondaryA + >:=> (line 52, col 52) to (line 52, col 73) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (1732 to 1733) SpanInfo: {"start":1680,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1734 to 1752) SpanInfo: {"start":1738,"length":11} + >multiRobots + >:=> (line 52, col 81) to (line 52, col 92) +-------------------------------- +53 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1753 to 1776) SpanInfo: {"start":1757,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1777 to 1778) SpanInfo: {"start":1757,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1779 to 1800) SpanInfo: {"start":1789,"length":11} + >name: nameA + >:=> (line 55, col 10) to (line 55, col 21) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (1801 to 1808) SpanInfo: {"start":1802,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1809 to 1829) SpanInfo: {"start":1812,"length":17} + >primary: primaryA + >:=> (line 55, col 33) to (line 55, col 50) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1830 to 1853) SpanInfo: {"start":1831,"length":21} + >secondary: secondaryA + >:=> (line 55, col 52) to (line 55, col 73) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1854 to 1855) SpanInfo: {"start":1802,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1856 to 1879) SpanInfo: {"start":1860,"length":16} + >getMultiRobots() + >:=> (line 55, col 81) to (line 55, col 97) +-------------------------------- +56 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1880 to 1903) SpanInfo: {"start":1884,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (1904 to 1905) SpanInfo: {"start":1884,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1906 to 1927) SpanInfo: {"start":1916,"length":11} + >name: nameA + >:=> (line 58, col 10) to (line 58, col 21) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (1928 to 1935) SpanInfo: {"start":1929,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1936 to 1956) SpanInfo: {"start":1939,"length":17} + >primary: primaryA + >:=> (line 58, col 33) to (line 58, col 50) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1957 to 1980) SpanInfo: {"start":1958,"length":21} + >secondary: secondaryA + >:=> (line 58, col 52) to (line 58, col 73) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1981 to 1982) SpanInfo: {"start":1929,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1983 to 2056) SpanInfo: {"start":1987,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 58, col 81) to (line 59, col 78) +-------------------------------- +59 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2057 to 2138) SpanInfo: {"start":1987,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 58, col 81) to (line 59, col 78) +-------------------------------- +60 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2139 to 2162) SpanInfo: {"start":2143,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + ~ => Pos: (2163 to 2163) SpanInfo: {"start":2143,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..d2169558daf --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,662 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 324) SpanInfo: {"start":225,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (325 to 426) SpanInfo: {"start":325,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (427 to 506) SpanInfo: {"start":325,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (507 to 529) SpanInfo: {"start":534,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (530 to 548) SpanInfo: {"start":534,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (549 to 550) SpanInfo: {"start":549,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (551 to 578) SpanInfo: {"start":583,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (579 to 602) SpanInfo: {"start":583,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (603 to 604) SpanInfo: {"start":603,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >for (let {name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (605 to 638) SpanInfo: {"start":615,"length":22} + >name: nameA = "noName" + >:=> (line 24, col 10) to (line 24, col 32) +24 >for (let {name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (639 to 652) SpanInfo: {"start":643,"length":6} + >robots + >:=> (line 24, col 38) to (line 24, col 44) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (653 to 676) SpanInfo: {"start":657,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (677 to 678) SpanInfo: {"start":657,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let {name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (679 to 712) SpanInfo: {"start":689,"length":22} + >name: nameA = "noName" + >:=> (line 27, col 10) to (line 27, col 32) +27 >for (let {name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (713 to 731) SpanInfo: {"start":717,"length":11} + >getRobots() + >:=> (line 27, col 38) to (line 27, col 49) +-------------------------------- +28 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (732 to 755) SpanInfo: {"start":736,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +29 >} + + ~~ => Pos: (756 to 757) SpanInfo: {"start":736,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +30 >for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (758 to 791) SpanInfo: {"start":768,"length":22} + >name: nameA = "noName" + >:=> (line 30, col 10) to (line 30, col 32) +30 >for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (792 to 875) SpanInfo: {"start":796,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 30, col 38) to (line 30, col 114) +-------------------------------- +31 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (876 to 899) SpanInfo: {"start":880,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +32 >} + + ~~ => Pos: (900 to 901) SpanInfo: {"start":880,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (902 to 919) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (920 to 952) SpanInfo: {"start":923,"length":29} + >primary: primaryA = "primary" + >:=> (line 33, col 21) to (line 33, col 50) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (953 to 990) SpanInfo: {"start":954,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 33, col 52) to (line 33, col 87) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (991 to 993) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +-------------------------------- +34 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (994 to 1043) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +34 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1044 to 1062) SpanInfo: {"start":1048,"length":11} + >multiRobots + >:=> (line 34, col 54) to (line 34, col 65) +-------------------------------- +35 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1063 to 1089) SpanInfo: {"start":1067,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +36 >} + + ~~ => Pos: (1090 to 1091) SpanInfo: {"start":1067,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1092 to 1109) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1110 to 1142) SpanInfo: {"start":1113,"length":29} + >primary: primaryA = "primary" + >:=> (line 37, col 21) to (line 37, col 50) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1143 to 1180) SpanInfo: {"start":1144,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 52) to (line 37, col 87) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (1181 to 1183) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +-------------------------------- +38 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1184 to 1233) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +38 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1234 to 1257) SpanInfo: {"start":1238,"length":16} + >getMultiRobots() + >:=> (line 38, col 54) to (line 38, col 70) +-------------------------------- +39 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1258 to 1284) SpanInfo: {"start":1262,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +40 >} + + ~~ => Pos: (1285 to 1286) SpanInfo: {"start":1262,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1287 to 1304) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1305 to 1337) SpanInfo: {"start":1308,"length":29} + >primary: primaryA = "primary" + >:=> (line 41, col 21) to (line 41, col 50) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1338 to 1375) SpanInfo: {"start":1339,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 41, col 52) to (line 41, col 87) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (1376 to 1378) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +-------------------------------- +42 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1379 to 1428) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +42 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~=> Pos: (1429 to 1432) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +43 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1433 to 1520) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +44 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1521 to 1602) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +45 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1603 to 1629) SpanInfo: {"start":1607,"length":21} + >console.log(primaryA) + >:=> (line 45, col 4) to (line 45, col 25) +-------------------------------- +46 >} + + ~~ => Pos: (1630 to 1631) SpanInfo: {"start":1607,"length":21} + >console.log(primaryA) + >:=> (line 45, col 4) to (line 45, col 25) +-------------------------------- +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1632 to 1664) SpanInfo: {"start":1642,"length":22} + >name: nameA = "noName" + >:=> (line 47, col 10) to (line 47, col 32) +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1665 to 1692) SpanInfo: {"start":1666,"length":25} + >skill: skillA = "noSkill" + >:=> (line 47, col 34) to (line 47, col 59) +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1693 to 1706) SpanInfo: {"start":1697,"length":6} + >robots + >:=> (line 47, col 65) to (line 47, col 71) +-------------------------------- +48 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1707 to 1730) SpanInfo: {"start":1711,"length":18} + >console.log(nameA) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +49 >} + + ~~ => Pos: (1731 to 1732) SpanInfo: {"start":1711,"length":18} + >console.log(nameA) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1733 to 1765) SpanInfo: {"start":1743,"length":22} + >name: nameA = "noName" + >:=> (line 50, col 10) to (line 50, col 32) +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1766 to 1794) SpanInfo: {"start":1767,"length":25} + >skill: skillA = "noSkill" + >:=> (line 50, col 34) to (line 50, col 59) +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1795 to 1813) SpanInfo: {"start":1799,"length":11} + >getRobots() + >:=> (line 50, col 66) to (line 50, col 77) +-------------------------------- +51 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1814 to 1837) SpanInfo: {"start":1818,"length":18} + >console.log(nameA) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + + ~~ => Pos: (1838 to 1839) SpanInfo: {"start":1818,"length":18} + >console.log(nameA) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1840 to 1872) SpanInfo: {"start":1850,"length":22} + >name: nameA = "noName" + >:=> (line 53, col 10) to (line 53, col 32) +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1873 to 1901) SpanInfo: {"start":1874,"length":25} + >skill: skillA = "noSkill" + >:=> (line 53, col 34) to (line 53, col 59) +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1902 to 1985) SpanInfo: {"start":1906,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 53, col 66) to (line 53, col 142) +-------------------------------- +54 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1986 to 2009) SpanInfo: {"start":1990,"length":18} + >console.log(nameA) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +55 >} + + ~~ => Pos: (2010 to 2011) SpanInfo: {"start":1990,"length":18} + >console.log(nameA) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +56 >for (let { + + ~~~~~~~~~~~ => Pos: (2012 to 2022) SpanInfo: {"start":2027,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 4) to (line 57, col 26) +-------------------------------- +57 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2023 to 2050) SpanInfo: {"start":2027,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 4) to (line 57, col 26) +-------------------------------- +58 > skills: { + + ~~~~~~~~~~~ => Pos: (2051 to 2061) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +58 > skills: { + + ~~~ => Pos: (2062 to 2064) SpanInfo: {"start":2073,"length":29} + >primary: primaryA = "primary" + >:=> (line 59, col 8) to (line 59, col 37) +-------------------------------- +59 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2065 to 2103) SpanInfo: {"start":2073,"length":29} + >primary: primaryA = "primary" + >:=> (line 59, col 8) to (line 59, col 37) +-------------------------------- +60 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2104 to 2147) SpanInfo: {"start":2112,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 60, col 8) to (line 60, col 43) +-------------------------------- +61 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2148 to 2152) SpanInfo: {"start":2112,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 60, col 8) to (line 60, col 43) +61 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2153 to 2200) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +-------------------------------- +62 >} of multiRobots) { + + ~ => Pos: (2201 to 2201) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +62 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2202 to 2220) SpanInfo: {"start":2206,"length":11} + >multiRobots + >:=> (line 62, col 5) to (line 62, col 16) +-------------------------------- +63 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2221 to 2244) SpanInfo: {"start":2225,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (2245 to 2246) SpanInfo: {"start":2225,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for (let { + + ~~~~~~~~~~~ => Pos: (2247 to 2257) SpanInfo: {"start":2262,"length":22} + >name: nameA = "noName" + >:=> (line 66, col 4) to (line 66, col 26) +-------------------------------- +66 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2258 to 2285) SpanInfo: {"start":2262,"length":22} + >name: nameA = "noName" + >:=> (line 66, col 4) to (line 66, col 26) +-------------------------------- +67 > skills: { + + ~~~~~~~~~~~ => Pos: (2286 to 2296) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +67 > skills: { + + ~~~ => Pos: (2297 to 2299) SpanInfo: {"start":2308,"length":29} + >primary: primaryA = "primary" + >:=> (line 68, col 8) to (line 68, col 37) +-------------------------------- +68 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2300 to 2338) SpanInfo: {"start":2308,"length":29} + >primary: primaryA = "primary" + >:=> (line 68, col 8) to (line 68, col 37) +-------------------------------- +69 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2339 to 2382) SpanInfo: {"start":2347,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 69, col 8) to (line 69, col 43) +-------------------------------- +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2383 to 2387) SpanInfo: {"start":2347,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 69, col 8) to (line 69, col 43) +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2388 to 2435) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +-------------------------------- +71 >} of getMultiRobots()) { + + ~ => Pos: (2436 to 2436) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +71 >} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2437 to 2460) SpanInfo: {"start":2441,"length":16} + >getMultiRobots() + >:=> (line 71, col 5) to (line 71, col 21) +-------------------------------- +72 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2461 to 2484) SpanInfo: {"start":2465,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +73 >} + + ~~ => Pos: (2485 to 2486) SpanInfo: {"start":2465,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +74 >for (let { + + ~~~~~~~~~~~ => Pos: (2487 to 2497) SpanInfo: {"start":2502,"length":22} + >name: nameA = "noName" + >:=> (line 75, col 4) to (line 75, col 26) +-------------------------------- +75 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2498 to 2525) SpanInfo: {"start":2502,"length":22} + >name: nameA = "noName" + >:=> (line 75, col 4) to (line 75, col 26) +-------------------------------- +76 > skills: { + + ~~~~~~~~~~~ => Pos: (2526 to 2536) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +76 > skills: { + + ~~~ => Pos: (2537 to 2539) SpanInfo: {"start":2548,"length":29} + >primary: primaryA = "primary" + >:=> (line 77, col 8) to (line 77, col 37) +-------------------------------- +77 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2540 to 2578) SpanInfo: {"start":2548,"length":29} + >primary: primaryA = "primary" + >:=> (line 77, col 8) to (line 77, col 37) +-------------------------------- +78 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2579 to 2622) SpanInfo: {"start":2587,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 78, col 8) to (line 78, col 43) +-------------------------------- +79 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2623 to 2627) SpanInfo: {"start":2587,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 78, col 8) to (line 78, col 43) +79 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2628 to 2675) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +-------------------------------- +80 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (2676 to 2676) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +80 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2677 to 2764) SpanInfo: {"start":2681,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 80, col 5) to (line 81, col 78) +-------------------------------- +81 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2765 to 2846) SpanInfo: {"start":2681,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 80, col 5) to (line 81, col 78) +-------------------------------- +82 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2847 to 2870) SpanInfo: {"start":2851,"length":18} + >console.log(nameA) + >:=> (line 82, col 4) to (line 82, col 22) +-------------------------------- +83 >} + ~ => Pos: (2871 to 2871) SpanInfo: {"start":2851,"length":18} + >console.log(nameA) + >:=> (line 82, col 4) to (line 82, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline new file mode 100644 index 00000000000..03f0ee87356 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 132) SpanInfo: {"start":89,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >function foo1([, nameA]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (133 to 146) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +6 >function foo1([, nameA]: Robot) { + + ~~~~~~~~~~~~~~~~~ => Pos: (147 to 163) SpanInfo: {"start":150,"length":5} + >nameA + >:=> (line 6, col 17) to (line 6, col 22) +6 >function foo1([, nameA]: Robot) { + + ~~~ => Pos: (164 to 166) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +7 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (167 to 190) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +8 >} + + ~~ => Pos: (191 to 192) SpanInfo: {"start":191,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([numberB]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (193 to 206) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +9 >function foo2([numberB]: Robot) { + + ~~~~~~~~~~~~~~~~~ => Pos: (207 to 223) SpanInfo: {"start":208,"length":7} + >numberB + >:=> (line 9, col 15) to (line 9, col 22) +9 >function foo2([numberB]: Robot) { + + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +10 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (227 to 252) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +11 >} + + ~~ => Pos: (253 to 254) SpanInfo: {"start":253,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (255 to 268) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~ => Pos: (269 to 278) SpanInfo: {"start":270,"length":8} + >numberA2 + >:=> (line 12, col 15) to (line 12, col 23) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~ => Pos: (279 to 286) SpanInfo: {"start":280,"length":6} + >nameA2 + >:=> (line 12, col 25) to (line 12, col 31) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~~~~~~~~=> Pos: (287 to 303) SpanInfo: {"start":288,"length":7} + >skillA2 + >:=> (line 12, col 33) to (line 12, col 40) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~=> Pos: (304 to 306) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (307 to 331) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (332 to 333) SpanInfo: {"start":332,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (334 to 347) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~ => Pos: (348 to 357) SpanInfo: {"start":349,"length":8} + >numberA3 + >:=> (line 15, col 15) to (line 15, col 23) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (358 to 380) SpanInfo: {"start":359,"length":13} + >...robotAInfo + >:=> (line 15, col 25) to (line 15, col 38) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~=> Pos: (381 to 383) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(robotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (384 to 412) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (413 to 414) SpanInfo: {"start":413,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (415 to 428) SpanInfo: {"start":415,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (429 to 462) SpanInfo: {"start":429,"length":32} + >foo1([2, "trimmer", "trimming"]) + >:=> (line 19, col 0) to (line 19, col 32) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (463 to 476) SpanInfo: {"start":463,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (477 to 510) SpanInfo: {"start":477,"length":32} + >foo2([2, "trimmer", "trimming"]) + >:=> (line 21, col 0) to (line 21, col 32) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (511 to 524) SpanInfo: {"start":511,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 558) SpanInfo: {"start":525,"length":32} + >foo3([2, "trimmer", "trimming"]) + >:=> (line 23, col 0) to (line 23, col 32) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (559 to 572) SpanInfo: {"start":559,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4([2, "trimmer", "trimming"]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (573 to 605) SpanInfo: {"start":573,"length":32} + >foo4([2, "trimmer", "trimming"]) + >:=> (line 25, col 0) to (line 25, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline new file mode 100644 index 00000000000..cb9088c99ef --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 90) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (91 to 147) SpanInfo: {"start":91,"length":55} + >var robotA: Robot = ["trimmer", ["trimming", "edging"]] + >:=> (line 5, col 0) to (line 5, col 55) +-------------------------------- +6 >function foo1([, skillA]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +6 >function foo1([, skillA]: Robot) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (162 to 179) SpanInfo: {"start":165,"length":6} + >skillA + >:=> (line 6, col 17) to (line 6, col 23) +6 >function foo1([, skillA]: Robot) { + + ~~~ => Pos: (180 to 182) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +7 > console.log(skillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (183 to 207) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +8 >} + + ~~ => Pos: (208 to 209) SpanInfo: {"start":208,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([nameMB]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (210 to 223) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +9 >function foo2([nameMB]: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (224 to 239) SpanInfo: {"start":225,"length":6} + >nameMB + >:=> (line 9, col 15) to (line 9, col 21) +9 >function foo2([nameMB]: Robot) { + + ~~~ => Pos: (240 to 242) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +10 > console.log(nameMB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (243 to 267) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +11 >} + + ~~ => Pos: (268 to 269) SpanInfo: {"start":268,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (270 to 283) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~ => Pos: (284 to 291) SpanInfo: {"start":285,"length":6} + >nameMA + >:=> (line 12, col 15) to (line 12, col 21) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (292 to 307) SpanInfo: {"start":294,"length":13} + >primarySkillA + >:=> (line 12, col 24) to (line 12, col 37) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~~~~=> Pos: (308 to 324) SpanInfo: {"start":309,"length":15} + >secondarySkillA + >:=> (line 12, col 39) to (line 12, col 54) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~=> Pos: (325 to 333) SpanInfo: {"start":293,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 12, col 23) to (line 12, col 55) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~=> Pos: (334 to 336) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (337 to 361) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (362 to 363) SpanInfo: {"start":362,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (364 to 377) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 405) SpanInfo: {"start":379,"length":18} + >...multiRobotAInfo + >:=> (line 15, col 15) to (line 15, col 33) +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~ => Pos: (406 to 408) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +-------------------------------- +16 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (409 to 442) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +-------------------------------- +17 >} + + ~~ => Pos: (443 to 444) SpanInfo: {"start":443,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (445 to 458) SpanInfo: {"start":445,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (459 to 499) SpanInfo: {"start":459,"length":39} + >foo1(["roomba", ["vaccum", "mopping"]]) + >:=> (line 19, col 0) to (line 19, col 39) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (500 to 513) SpanInfo: {"start":500,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (514 to 554) SpanInfo: {"start":514,"length":39} + >foo2(["roomba", ["vaccum", "mopping"]]) + >:=> (line 21, col 0) to (line 21, col 39) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (555 to 568) SpanInfo: {"start":555,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (569 to 609) SpanInfo: {"start":569,"length":39} + >foo3(["roomba", ["vaccum", "mopping"]]) + >:=> (line 23, col 0) to (line 23, col 39) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (610 to 623) SpanInfo: {"start":610,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4(["roomba", ["vaccum", "mopping"]]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (624 to 663) SpanInfo: {"start":624,"length":39} + >foo4(["roomba", ["vaccum", "mopping"]]) + >:=> (line 25, col 0) to (line 25, col 39) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..d071692b0f2 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 132) SpanInfo: {"start":89,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (133 to 146) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (147 to 198) SpanInfo: {"start":150,"length":16} + >nameA = "noName" + >:=> (line 6, col 17) to (line 6, col 33) +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (199 to 201) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +7 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 225) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +8 >} + + ~~ => Pos: (226 to 227) SpanInfo: {"start":226,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (228 to 241) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (242 to 287) SpanInfo: {"start":243,"length":12} + >numberB = -1 + >:=> (line 9, col 15) to (line 9, col 27) +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (288 to 290) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +10 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (291 to 316) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +11 >} + + ~~ => Pos: (317 to 318) SpanInfo: {"start":317,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (319 to 332) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~ => Pos: (333 to 347) SpanInfo: {"start":334,"length":13} + >numberA2 = -1 + >:=> (line 12, col 15) to (line 12, col 28) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (348 to 364) SpanInfo: {"start":349,"length":15} + >nameA2 = "name" + >:=> (line 12, col 30) to (line 12, col 45) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (365 to 415) SpanInfo: {"start":366,"length":17} + >skillA2 = "skill" + >:=> (line 12, col 47) to (line 12, col 64) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (416 to 418) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (419 to 443) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (444 to 445) SpanInfo: {"start":444,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (446 to 459) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~ => Pos: (460 to 474) SpanInfo: {"start":461,"length":13} + >numberA3 = -1 + >:=> (line 15, col 15) to (line 15, col 28) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (475 to 521) SpanInfo: {"start":476,"length":13} + >...robotAInfo + >:=> (line 15, col 30) to (line 15, col 43) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (522 to 524) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(robotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 553) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (554 to 555) SpanInfo: {"start":554,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (556 to 569) SpanInfo: {"start":556,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (570 to 603) SpanInfo: {"start":570,"length":32} + >foo1([2, "trimmer", "trimming"]) + >:=> (line 19, col 0) to (line 19, col 32) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (604 to 617) SpanInfo: {"start":604,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (618 to 651) SpanInfo: {"start":618,"length":32} + >foo2([2, "trimmer", "trimming"]) + >:=> (line 21, col 0) to (line 21, col 32) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (652 to 665) SpanInfo: {"start":652,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (666 to 699) SpanInfo: {"start":666,"length":32} + >foo3([2, "trimmer", "trimming"]) + >:=> (line 23, col 0) to (line 23, col 32) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (700 to 713) SpanInfo: {"start":700,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4([2, "trimmer", "trimming"]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (714 to 746) SpanInfo: {"start":714,"length":32} + >foo4([2, "trimmer", "trimming"]) + >:=> (line 25, col 0) to (line 25, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline new file mode 100644 index 00000000000..34b41cc1218 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline @@ -0,0 +1,172 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 82) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (83 to 139) SpanInfo: {"start":83,"length":55} + >var robotA: Robot = ["trimmer", ["trimming", "edging"]] + >:=> (line 5, col 0) to (line 5, col 55) +-------------------------------- +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~ => Pos: (140 to 153) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (154 to 228) SpanInfo: {"start":157,"length":31} + >skillA = ["noSkill", "noSkill"] + >:=> (line 6, col 17) to (line 6, col 48) +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~=> Pos: (229 to 231) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +7 > console.log(skillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (232 to 256) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +8 >} + + ~~ => Pos: (257 to 258) SpanInfo: {"start":257,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~ => Pos: (259 to 272) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (273 to 332) SpanInfo: {"start":274,"length":17} + >nameMB = "noName" + >:=> (line 9, col 15) to (line 9, col 32) +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~=> Pos: (333 to 335) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +10 > console.log(nameMB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (336 to 360) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +11 >} + + ~~ => Pos: (361 to 362) SpanInfo: {"start":361,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([nameMA = "noName", [ + + ~~~~~~~~~~~~~~ => Pos: (363 to 376) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +12 >function foo3([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~ => Pos: (377 to 395) SpanInfo: {"start":378,"length":17} + >nameMA = "noName" + >:=> (line 12, col 15) to (line 12, col 32) +12 >function foo3([nameMA = "noName", [ + + ~~~ => Pos: (396 to 398) SpanInfo: {"start":403,"length":25} + >primarySkillA = "primary" + >:=> (line 13, col 4) to (line 13, col 29) +-------------------------------- +13 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (399 to 429) SpanInfo: {"start":403,"length":25} + >primarySkillA = "primary" + >:=> (line 13, col 4) to (line 13, col 29) +-------------------------------- +14 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (430 to 463) SpanInfo: {"start":434,"length":29} + >secondarySkillA = "secondary" + >:=> (line 14, col 4) to (line 14, col 33) +-------------------------------- +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~ => Pos: (464 to 464) SpanInfo: {"start":434,"length":29} + >secondarySkillA = "secondary" + >:=> (line 14, col 4) to (line 14, col 33) +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 498) SpanInfo: {"start":397,"length":93} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["noSkill", "noSkill"] + >:=> (line 12, col 34) to (line 15, col 26) +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~~~ => Pos: (499 to 501) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +-------------------------------- +16 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (502 to 526) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +-------------------------------- +17 >} + + ~~ => Pos: (527 to 528) SpanInfo: {"start":527,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (529 to 542) SpanInfo: {"start":529,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (543 to 583) SpanInfo: {"start":543,"length":39} + >foo1(["roomba", ["vaccum", "mopping"]]) + >:=> (line 19, col 0) to (line 19, col 39) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (584 to 597) SpanInfo: {"start":584,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (598 to 638) SpanInfo: {"start":598,"length":39} + >foo2(["roomba", ["vaccum", "mopping"]]) + >:=> (line 21, col 0) to (line 21, col 39) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (639 to 652) SpanInfo: {"start":639,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3(["roomba", ["vaccum", "mopping"]]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (653 to 692) SpanInfo: {"start":653,"length":39} + >foo3(["roomba", ["vaccum", "mopping"]]) + >:=> (line 23, col 0) to (line 23, col 39) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline new file mode 100644 index 00000000000..be773df4530 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline @@ -0,0 +1,200 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 127) SpanInfo: undefined +-------------------------------- +8 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (128 to 154) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (155 to 161) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (162 to 163) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (164 to 252) SpanInfo: {"start":164,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (253 to 266) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~ => Pos: (267 to 275) SpanInfo: {"start":269,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 12, col 16) to (line 12, col 68) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (276 to 296) SpanInfo: {"start":279,"length":17} + >primary: primaryA + >:=> (line 12, col 26) to (line 12, col 43) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (297 to 320) SpanInfo: {"start":298,"length":21} + >secondary: secondaryA + >:=> (line 12, col 45) to (line 12, col 66) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~=> Pos: (321 to 330) SpanInfo: {"start":269,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 12, col 16) to (line 12, col 68) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~=> Pos: (331 to 333) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +-------------------------------- +13 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (334 to 360) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +-------------------------------- +14 >} + + ~~ => Pos: (361 to 362) SpanInfo: {"start":361,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (363 to 376) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (377 to 390) SpanInfo: {"start":379,"length":11} + >name: nameC + >:=> (line 15, col 16) to (line 15, col 27) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~ => Pos: (391 to 398) SpanInfo: {"start":392,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 29) to (line 15, col 81) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (399 to 419) SpanInfo: {"start":402,"length":17} + >primary: primaryB + >:=> (line 15, col 39) to (line 15, col 56) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 443) SpanInfo: {"start":421,"length":21} + >secondary: secondaryB + >:=> (line 15, col 58) to (line 15, col 79) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~=> Pos: (444 to 453) SpanInfo: {"start":392,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 29) to (line 15, col 81) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~=> Pos: (454 to 456) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(secondaryB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (457 to 485) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (486 to 487) SpanInfo: {"start":486,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >function foo3({ skills }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (488 to 501) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +18 >function foo3({ skills }: Robot) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (502 to 519) SpanInfo: {"start":504,"length":6} + >skills + >:=> (line 18, col 16) to (line 18, col 22) +18 >function foo3({ skills }: Robot) { + + ~~~ => Pos: (520 to 522) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +-------------------------------- +19 > console.log(skills.primary); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (523 to 555) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +-------------------------------- +20 >} + + ~~ => Pos: (556 to 557) SpanInfo: {"start":556,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (558 to 571) SpanInfo: {"start":558,"length":12} + >foo1(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (572 to 657) SpanInfo: {"start":572,"length":84} + >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 22, col 0) to (line 22, col 84) +-------------------------------- +23 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (658 to 671) SpanInfo: {"start":658,"length":12} + >foo2(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (672 to 757) SpanInfo: {"start":672,"length":84} + >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 24, col 0) to (line 24, col 84) +-------------------------------- +25 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (758 to 771) SpanInfo: {"start":758,"length":12} + >foo3(robotA) + >:=> (line 25, col 0) to (line 25, col 12) +-------------------------------- +26 >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (772 to 856) SpanInfo: {"start":772,"length":84} + >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 26, col 0) to (line 26, col 84) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..c06c9b56fe5 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,274 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 128) SpanInfo: undefined +-------------------------------- +8 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (129 to 156) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (157 to 163) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (164 to 165) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (166 to 254) SpanInfo: {"start":166,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >function foo1( + + ~~~~~~~~~~~~~~~ => Pos: (255 to 269) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +13 > { + + ~~~~~~ => Pos: (270 to 275) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +-------------------------------- +14 > skills: { + + ~~~~~~~~~~~~~~~ => Pos: (276 to 290) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +14 > skills: { + + ~~~ => Pos: (291 to 293) SpanInfo: {"start":306,"length":29} + >primary: primaryA = "primary" + >:=> (line 15, col 12) to (line 15, col 41) +-------------------------------- +15 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (294 to 336) SpanInfo: {"start":306,"length":29} + >primary: primaryA = "primary" + >:=> (line 15, col 12) to (line 15, col 41) +-------------------------------- +16 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (337 to 384) SpanInfo: {"start":349,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 16, col 12) to (line 16, col 47) +-------------------------------- +17 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~ => Pos: (385 to 393) SpanInfo: {"start":349,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 16, col 12) to (line 16, col 47) +17 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (394 to 445) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +-------------------------------- +18 > }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (446 to 467) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +18 > }: Robot = robotA) { + + ~~~ => Pos: (468 to 470) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +19 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (471 to 497) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +20 >} + + ~~ => Pos: (498 to 499) SpanInfo: {"start":498,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function foo2( + + ~~~~~~~~~~~~~~~ => Pos: (500 to 514) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +22 > { + + ~~~~~~ => Pos: (515 to 520) SpanInfo: {"start":529,"length":20} + >name: nameC = "name" + >:=> (line 23, col 8) to (line 23, col 28) +-------------------------------- +23 > name: nameC = "name", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 550) SpanInfo: {"start":529,"length":20} + >name: nameC = "name" + >:=> (line 23, col 8) to (line 23, col 28) +-------------------------------- +24 > skills: { + + ~~~~~~~~~~~~~~~ => Pos: (551 to 565) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +24 > skills: { + + ~~~ => Pos: (566 to 568) SpanInfo: {"start":581,"length":29} + >primary: primaryB = "primary" + >:=> (line 25, col 12) to (line 25, col 41) +-------------------------------- +25 > primary: primaryB = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (569 to 611) SpanInfo: {"start":581,"length":29} + >primary: primaryB = "primary" + >:=> (line 25, col 12) to (line 25, col 41) +-------------------------------- +26 > secondary: secondaryB = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (612 to 659) SpanInfo: {"start":624,"length":35} + >secondary: secondaryB = "secondary" + >:=> (line 26, col 12) to (line 26, col 47) +-------------------------------- +27 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~ => Pos: (660 to 668) SpanInfo: {"start":624,"length":35} + >secondary: secondaryB = "secondary" + >:=> (line 26, col 12) to (line 26, col 47) +27 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (669 to 720) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +-------------------------------- +28 > }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (721 to 742) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +28 > }: Robot = robotA) { + + ~~~ => Pos: (743 to 745) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +29 > console.log(secondaryB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (746 to 774) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +30 >} + + ~~ => Pos: (775 to 776) SpanInfo: {"start":775,"length":1} + >} + >:=> (line 30, col 0) to (line 30, col 1) +-------------------------------- +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~~~~~~~~~~~~ => Pos: (777 to 790) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (791 to 869) SpanInfo: {"start":793,"length":57} + >skills = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 31, col 16) to (line 31, col 73) +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~=> Pos: (870 to 872) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +-------------------------------- +32 > console.log(skills.primary); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 905) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +-------------------------------- +33 >} + + ~~ => Pos: (906 to 907) SpanInfo: {"start":906,"length":1} + >} + >:=> (line 33, col 0) to (line 33, col 1) +-------------------------------- +34 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (908 to 921) SpanInfo: {"start":908,"length":12} + >foo1(robotA) + >:=> (line 34, col 0) to (line 34, col 12) +-------------------------------- +35 >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (922 to 1007) SpanInfo: {"start":922,"length":84} + >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 35, col 0) to (line 35, col 84) +-------------------------------- +36 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (1008 to 1021) SpanInfo: {"start":1008,"length":12} + >foo2(robotA) + >:=> (line 36, col 0) to (line 36, col 12) +-------------------------------- +37 >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1022 to 1107) SpanInfo: {"start":1022,"length":84} + >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 37, col 0) to (line 37, col 84) +-------------------------------- +38 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (1108 to 1121) SpanInfo: {"start":1108,"length":12} + >foo3(robotA) + >:=> (line 38, col 0) to (line 38, col 12) +-------------------------------- +39 >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1122 to 1206) SpanInfo: {"start":1122,"length":84} + >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 39, col 0) to (line 39, col 84) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline new file mode 100644 index 00000000000..21f11f320ab --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline @@ -0,0 +1,164 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >function foo1({ name: nameA }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (187 to 200) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +10 >function foo1({ name: nameA }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (201 to 223) SpanInfo: {"start":203,"length":11} + >name: nameA + >:=> (line 10, col 16) to (line 10, col 27) +10 >function foo1({ name: nameA }: Robot) { + + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +11 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (227 to 250) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + + ~~ => Pos: (251 to 252) SpanInfo: {"start":251,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) +-------------------------------- +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (253 to 266) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (267 to 280) SpanInfo: {"start":269,"length":11} + >name: nameB + >:=> (line 13, col 16) to (line 13, col 27) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (281 to 304) SpanInfo: {"start":282,"length":13} + >skill: skillB + >:=> (line 13, col 29) to (line 13, col 42) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~=> Pos: (305 to 307) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +14 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (308 to 331) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +15 >} + + ~~ => Pos: (332 to 333) SpanInfo: {"start":332,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >function foo3({ name }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (334 to 347) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +16 >function foo3({ name }: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (348 to 363) SpanInfo: {"start":350,"length":4} + >name + >:=> (line 16, col 16) to (line 16, col 20) +16 >function foo3({ name }: Robot) { + + ~~~ => Pos: (364 to 366) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +17 > console.log(name); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 389) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +18 >} + + ~~ => Pos: (390 to 391) SpanInfo: {"start":390,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +-------------------------------- +19 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (392 to 405) SpanInfo: {"start":392,"length":12} + >foo1(robotA) + >:=> (line 19, col 0) to (line 19, col 12) +-------------------------------- +20 >foo1({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (406 to 454) SpanInfo: {"start":406,"length":47} + >foo1({ name: "Edger", skill: "cutting edges" }) + >:=> (line 20, col 0) to (line 20, col 47) +-------------------------------- +21 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (455 to 468) SpanInfo: {"start":455,"length":12} + >foo2(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo2({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (469 to 517) SpanInfo: {"start":469,"length":47} + >foo2({ name: "Edger", skill: "cutting edges" }) + >:=> (line 22, col 0) to (line 22, col 47) +-------------------------------- +23 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (518 to 531) SpanInfo: {"start":518,"length":12} + >foo3(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo3({ name: "Edger", skill: "cutting edges" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (532 to 579) SpanInfo: {"start":532,"length":47} + >foo3({ name: "Edger", skill: "cutting edges" }) + >:=> (line 24, col 0) to (line 24, col 47) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..6cb9b39c0d3 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,164 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name?: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 36) SpanInfo: undefined +-------------------------------- +3 > skill?: string; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (37 to 56) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (57 to 58) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (59 to 81) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (82 to 109) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (110 to 111) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (112 to 132) SpanInfo: {"start":112,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (133 to 188) SpanInfo: {"start":133,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~~~~~~~~~~~~ => Pos: (189 to 202) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (203 to 244) SpanInfo: {"start":205,"length":24} + >name: nameA = "" + >:=> (line 10, col 16) to (line 10, col 40) +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~=> Pos: (245 to 247) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +11 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (248 to 271) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + + ~~ => Pos: (272 to 273) SpanInfo: {"start":272,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) +-------------------------------- +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~ => Pos: (274 to 287) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 314) SpanInfo: {"start":290,"length":24} + >name: nameB = "" + >:=> (line 13, col 16) to (line 13, col 40) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (315 to 355) SpanInfo: {"start":316,"length":25} + >skill: skillB = "noSkill" + >:=> (line 13, col 42) to (line 13, col 67) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~=> Pos: (356 to 358) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +14 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (359 to 382) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +15 >} + + ~~ => Pos: (383 to 384) SpanInfo: {"start":383,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~~~~~~~~~~~~ => Pos: (385 to 398) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (399 to 432) SpanInfo: {"start":401,"length":17} + >name = "" + >:=> (line 16, col 16) to (line 16, col 33) +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~=> Pos: (433 to 435) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +17 > console.log(name); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (436 to 458) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +18 >} + + ~~ => Pos: (459 to 460) SpanInfo: {"start":459,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +-------------------------------- +19 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (461 to 474) SpanInfo: {"start":461,"length":12} + >foo1(robotA) + >:=> (line 19, col 0) to (line 19, col 12) +-------------------------------- +20 >foo1({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (475 to 523) SpanInfo: {"start":475,"length":47} + >foo1({ name: "Edger", skill: "cutting edges" }) + >:=> (line 20, col 0) to (line 20, col 47) +-------------------------------- +21 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (524 to 537) SpanInfo: {"start":524,"length":12} + >foo2(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo2({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (538 to 586) SpanInfo: {"start":538,"length":47} + >foo2({ name: "Edger", skill: "cutting edges" }) + >:=> (line 22, col 0) to (line 22, col 47) +-------------------------------- +23 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (587 to 600) SpanInfo: {"start":587,"length":12} + >foo3(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo3({ name: "Edger", skill: "cutting edges" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (601 to 648) SpanInfo: {"start":601,"length":47} + >foo3({ name: "Edger", skill: "cutting edges" }) + >:=> (line 24, col 0) to (line 24, col 47) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline new file mode 100644 index 00000000000..3939c66c56e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline @@ -0,0 +1,109 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var { name: nameA } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (247 to 276) SpanInfo: {"start":253,"length":11} + >name: nameA + >:=> (line 11, col 6) to (line 11, col 17) +-------------------------------- +12 >var { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~ => Pos: (277 to 294) SpanInfo: {"start":283,"length":11} + >name: nameB + >:=> (line 12, col 6) to (line 12, col 17) +12 >var { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (295 to 321) SpanInfo: {"start":296,"length":13} + >skill: skillB + >:=> (line 12, col 19) to (line 12, col 32) +-------------------------------- +13 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~ => Pos: (322 to 339) SpanInfo: {"start":328,"length":11} + >name: nameC + >:=> (line 13, col 6) to (line 13, col 17) +13 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (340 to 401) SpanInfo: {"start":341,"length":13} + >skill: skillC + >:=> (line 13, col 19) to (line 13, col 32) +-------------------------------- +14 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (402 to 423) SpanInfo: {"start":402,"length":19} + >if (nameA == nameB) + >:=> (line 14, col 0) to (line 14, col 19) +-------------------------------- +15 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (424 to 448) SpanInfo: {"start":428,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +16 >} + + ~~ => Pos: (449 to 450) SpanInfo: {"start":428,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +17 >else { + + ~~~~~~~ => Pos: (451 to 457) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +18 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (458 to 481) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +19 >} + ~ => Pos: (482 to 482) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline new file mode 100644 index 00000000000..ce1edbb0ee9 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline @@ -0,0 +1,227 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var a: string, { name: nameA } = robotA; + + ~~~~~~~~~~~~~~ => Pos: (247 to 260) SpanInfo: undefined +11 >var a: string, { name: nameA } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (261 to 287) SpanInfo: {"start":264,"length":11} + >name: nameA + >:=> (line 11, col 17) to (line 11, col 28) +-------------------------------- +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~ => Pos: (288 to 301) SpanInfo: undefined +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~ => Pos: (302 to 316) SpanInfo: {"start":305,"length":11} + >name: nameB + >:=> (line 12, col 17) to (line 12, col 28) +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (317 to 343) SpanInfo: {"start":318,"length":13} + >skill: skillB + >:=> (line 12, col 30) to (line 12, col 43) +-------------------------------- +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~ => Pos: (344 to 357) SpanInfo: undefined +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~ => Pos: (358 to 372) SpanInfo: {"start":361,"length":11} + >name: nameC + >:=> (line 13, col 17) to (line 13, col 28) +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 434) SpanInfo: {"start":374,"length":13} + >skill: skillC + >:=> (line 13, col 30) to (line 13, col 43) +-------------------------------- +14 > + + ~ => Pos: (435 to 435) SpanInfo: undefined +-------------------------------- +15 >var { name: nameA } = robotA, a = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (436 to 464) SpanInfo: {"start":442,"length":11} + >name: nameA + >:=> (line 15, col 6) to (line 15, col 17) +15 >var { name: nameA } = robotA, a = hello; + + ~~~~~~~~~~~~ => Pos: (465 to 476) SpanInfo: {"start":466,"length":9} + >a = hello + >:=> (line 15, col 30) to (line 15, col 39) +-------------------------------- +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~~~~ => Pos: (477 to 494) SpanInfo: {"start":483,"length":11} + >name: nameB + >:=> (line 16, col 6) to (line 16, col 17) +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (495 to 520) SpanInfo: {"start":496,"length":13} + >skill: skillB + >:=> (line 16, col 19) to (line 16, col 32) +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~=> Pos: (521 to 535) SpanInfo: {"start":522,"length":12} + >b = " hello" + >:=> (line 16, col 45) to (line 16, col 57) +-------------------------------- +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~~~~~~~ => Pos: (536 to 553) SpanInfo: {"start":542,"length":11} + >name: nameC + >:=> (line 17, col 6) to (line 17, col 17) +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (554 to 614) SpanInfo: {"start":555,"length":13} + >skill: skillC + >:=> (line 17, col 19) to (line 17, col 32) +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~=> Pos: (615 to 626) SpanInfo: {"start":616,"length":9} + >c = hello + >:=> (line 17, col 80) to (line 17, col 89) +-------------------------------- +18 > + + ~ => Pos: (627 to 627) SpanInfo: undefined +-------------------------------- +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~ => Pos: (628 to 641) SpanInfo: {"start":628,"length":13} + >var a = hello + >:=> (line 19, col 0) to (line 19, col 13) +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (642 to 667) SpanInfo: {"start":645,"length":11} + >name: nameA + >:=> (line 19, col 17) to (line 19, col 28) +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~=> Pos: (668 to 681) SpanInfo: {"start":669,"length":11} + >a1= "hello" + >:=> (line 19, col 41) to (line 19, col 52) +-------------------------------- +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~ => Pos: (682 to 695) SpanInfo: {"start":682,"length":13} + >var b = hello + >:=> (line 20, col 0) to (line 20, col 13) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~ => Pos: (696 to 710) SpanInfo: {"start":699,"length":11} + >name: nameB + >:=> (line 20, col 17) to (line 20, col 28) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (711 to 736) SpanInfo: {"start":712,"length":13} + >skill: skillB + >:=> (line 20, col 30) to (line 20, col 43) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~=> Pos: (737 to 751) SpanInfo: {"start":738,"length":12} + >b1 = "hello" + >:=> (line 20, col 56) to (line 20, col 68) +-------------------------------- +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~ => Pos: (752 to 765) SpanInfo: {"start":752,"length":13} + >var c = hello + >:=> (line 21, col 0) to (line 21, col 13) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~~ => Pos: (766 to 780) SpanInfo: {"start":769,"length":11} + >name: nameC + >:=> (line 21, col 17) to (line 21, col 28) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (781 to 841) SpanInfo: {"start":782,"length":13} + >skill: skillC + >:=> (line 21, col 30) to (line 21, col 43) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~=> Pos: (842 to 854) SpanInfo: {"start":843,"length":10} + >c1 = hello + >:=> (line 21, col 91) to (line 21, col 101) +-------------------------------- +22 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (855 to 876) SpanInfo: {"start":855,"length":19} + >if (nameA == nameB) + >:=> (line 22, col 0) to (line 22, col 19) +-------------------------------- +23 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (877 to 901) SpanInfo: {"start":881,"length":19} + >console.log(skillB) + >:=> (line 23, col 4) to (line 23, col 23) +-------------------------------- +24 >} + + ~~ => Pos: (902 to 903) SpanInfo: {"start":881,"length":19} + >console.log(skillB) + >:=> (line 23, col 4) to (line 23, col 23) +-------------------------------- +25 >else { + + ~~~~~~~ => Pos: (904 to 910) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +26 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (911 to 934) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + ~ => Pos: (935 to 935) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline new file mode 100644 index 00000000000..0639ca49c9d --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline @@ -0,0 +1,87 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 91) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (92 to 135) SpanInfo: {"start":92,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (136 to 183) SpanInfo: {"start":136,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 6, col 0) to (line 6, col 46) +-------------------------------- +7 >let [, nameA] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (184 to 207) SpanInfo: {"start":191,"length":5} + >nameA + >:=> (line 7, col 7) to (line 7, col 12) +-------------------------------- +8 >let [numberB] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 231) SpanInfo: {"start":213,"length":7} + >numberB + >:=> (line 8, col 5) to (line 8, col 12) +-------------------------------- +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~~~~~~~ => Pos: (232 to 245) SpanInfo: {"start":237,"length":8} + >numberA2 + >:=> (line 9, col 5) to (line 9, col 13) +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~ => Pos: (246 to 253) SpanInfo: {"start":247,"length":6} + >nameA2 + >:=> (line 9, col 15) to (line 9, col 21) +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (254 to 273) SpanInfo: {"start":255,"length":7} + >skillA2 + >:=> (line 9, col 23) to (line 9, col 30) +-------------------------------- +10 >let [numberC2] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (274 to 323) SpanInfo: {"start":279,"length":8} + >numberC2 + >:=> (line 10, col 5) to (line 10, col 13) +-------------------------------- +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~ => Pos: (324 to 336) SpanInfo: {"start":329,"length":7} + >numberC + >:=> (line 11, col 5) to (line 11, col 12) +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~ => Pos: (337 to 343) SpanInfo: {"start":338,"length":5} + >nameC + >:=> (line 11, col 14) to (line 11, col 19) +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (344 to 387) SpanInfo: {"start":345,"length":6} + >skillC + >:=> (line 11, col 21) to (line 11, col 27) +-------------------------------- +12 >let [numberA3, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~ => Pos: (388 to 401) SpanInfo: {"start":393,"length":8} + >numberA3 + >:=> (line 12, col 5) to (line 12, col 13) +12 >let [numberA3, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (402 to 426) SpanInfo: {"start":403,"length":13} + >...robotAInfo + >:=> (line 12, col 15) to (line 12, col 28) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline new file mode 100644 index 00000000000..cb980a37c74 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline @@ -0,0 +1,105 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (53 to 105) SpanInfo: undefined +-------------------------------- +5 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (106 to 169) SpanInfo: {"start":106,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 5, col 0) to (line 5, col 62) +-------------------------------- +6 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (170 to 243) SpanInfo: {"start":170,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 6, col 0) to (line 6, col 72) +-------------------------------- +7 > + + ~ => Pos: (244 to 244) SpanInfo: undefined +-------------------------------- +8 >let [, skillA] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (245 to 274) SpanInfo: {"start":252,"length":6} + >skillA + >:=> (line 8, col 7) to (line 8, col 13) +-------------------------------- +9 >let [nameMB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (275 to 302) SpanInfo: {"start":280,"length":6} + >nameMB + >:=> (line 9, col 5) to (line 9, col 11) +-------------------------------- +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~ => Pos: (303 to 314) SpanInfo: {"start":308,"length":6} + >nameMA + >:=> (line 10, col 5) to (line 10, col 11) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~ => Pos: (315 to 330) SpanInfo: {"start":317,"length":13} + >primarySkillA + >:=> (line 10, col 14) to (line 10, col 27) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~ => Pos: (331 to 347) SpanInfo: {"start":332,"length":15} + >secondarySkillA + >:=> (line 10, col 29) to (line 10, col 44) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~=> Pos: (348 to 364) SpanInfo: {"start":316,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 10, col 13) to (line 10, col 45) +-------------------------------- +11 > + + ~ => Pos: (365 to 365) SpanInfo: undefined +-------------------------------- +12 >let [nameMC] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (366 to 415) SpanInfo: {"start":371,"length":6} + >nameMC + >:=> (line 12, col 5) to (line 12, col 11) +-------------------------------- +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~ => Pos: (416 to 428) SpanInfo: {"start":421,"length":7} + >nameMC2 + >:=> (line 13, col 5) to (line 13, col 12) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~ => Pos: (429 to 444) SpanInfo: {"start":431,"length":13} + >primarySkillC + >:=> (line 13, col 15) to (line 13, col 28) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~=> Pos: (445 to 461) SpanInfo: {"start":446,"length":15} + >secondarySkillC + >:=> (line 13, col 30) to (line 13, col 45) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (462 to 500) SpanInfo: {"start":430,"length":32} + >[primarySkillC, secondarySkillC] + >:=> (line 13, col 14) to (line 13, col 46) +-------------------------------- +14 > + + ~ => Pos: (501 to 501) SpanInfo: undefined +-------------------------------- +15 >let [...multiRobotAInfo] = multiRobotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (502 to 540) SpanInfo: {"start":507,"length":18} + >...multiRobotAInfo + >:=> (line 15, col 5) to (line 15, col 23) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..e3b43164563 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,87 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 91) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (92 to 135) SpanInfo: {"start":92,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (136 to 183) SpanInfo: {"start":136,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 6, col 0) to (line 6, col 46) +-------------------------------- +7 >let [, nameA = "noName"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (184 to 218) SpanInfo: {"start":191,"length":16} + >nameA = "noName" + >:=> (line 7, col 7) to (line 7, col 23) +-------------------------------- +8 >let [numberB = -1] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (219 to 247) SpanInfo: {"start":224,"length":12} + >numberB = -1 + >:=> (line 8, col 5) to (line 8, col 17) +-------------------------------- +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (248 to 266) SpanInfo: {"start":253,"length":13} + >numberA2 = -1 + >:=> (line 9, col 5) to (line 9, col 18) +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (267 to 285) SpanInfo: {"start":268,"length":17} + >nameA2 = "noName" + >:=> (line 9, col 20) to (line 9, col 37) +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (286 to 317) SpanInfo: {"start":287,"length":19} + >skillA2 = "noSkill" + >:=> (line 9, col 39) to (line 9, col 58) +-------------------------------- +10 >let [numberC2 = -1] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (318 to 372) SpanInfo: {"start":323,"length":13} + >numberC2 = -1 + >:=> (line 10, col 5) to (line 10, col 18) +-------------------------------- +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~ => Pos: (373 to 390) SpanInfo: {"start":378,"length":12} + >numberC = -1 + >:=> (line 11, col 5) to (line 11, col 17) +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~ => Pos: (391 to 408) SpanInfo: {"start":392,"length":16} + >nameC = "noName" + >:=> (line 11, col 19) to (line 11, col 35) +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (409 to 464) SpanInfo: {"start":410,"length":18} + >skillC = "noSkill" + >:=> (line 11, col 37) to (line 11, col 55) +-------------------------------- +12 >let [numberA3 = -1, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 483) SpanInfo: {"start":470,"length":13} + >numberA3 = -1 + >:=> (line 12, col 5) to (line 12, col 18) +12 >let [numberA3 = -1, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (484 to 508) SpanInfo: {"start":485,"length":13} + >...robotAInfo + >:=> (line 12, col 20) to (line 12, col 33) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline new file mode 100644 index 00000000000..ddbfdd29268 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline @@ -0,0 +1,84 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 97) SpanInfo: undefined +-------------------------------- +5 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (98 to 161) SpanInfo: {"start":98,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 5, col 0) to (line 5, col 62) +-------------------------------- +6 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (162 to 235) SpanInfo: {"start":162,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 6, col 0) to (line 6, col 72) +-------------------------------- +7 >let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (236 to 290) SpanInfo: {"start":243,"length":31} + >skillA = ["noSkill", "noSkill"] + >:=> (line 7, col 7) to (line 7, col 38) +-------------------------------- +8 >let [nameMB = "noName" ] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (291 to 330) SpanInfo: {"start":296,"length":17} + >nameMB = "noName" + >:=> (line 8, col 5) to (line 8, col 22) +-------------------------------- +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (331 to 353) SpanInfo: {"start":336,"length":17} + >nameMA = "noName" + >:=> (line 9, col 5) to (line 9, col 22) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (354 to 381) SpanInfo: {"start":356,"length":25} + >primarySkillA = "noSkill" + >:=> (line 9, col 25) to (line 9, col 50) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (382 to 410) SpanInfo: {"start":383,"length":27} + >secondarySkillA = "noSkill" + >:=> (line 9, col 52) to (line 9, col 79) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (411 to 452) SpanInfo: {"start":355,"length":81} + >[primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] + >:=> (line 9, col 24) to (line 9, col 105) +-------------------------------- +10 >let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (453 to 514) SpanInfo: {"start":458,"length":17} + >nameMC = "noName" + >:=> (line 10, col 5) to (line 10, col 22) +-------------------------------- +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (515 to 538) SpanInfo: {"start":520,"length":18} + >nameMC2 = "noName" + >:=> (line 11, col 5) to (line 11, col 23) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (539 to 566) SpanInfo: {"start":541,"length":25} + >primarySkillC = "noSkill" + >:=> (line 11, col 26) to (line 11, col 51) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (567 to 595) SpanInfo: {"start":568,"length":27} + >secondarySkillC = "noSkill" + >:=> (line 11, col 53) to (line 11, col 80) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (596 to 658) SpanInfo: {"start":540,"length":81} + >[primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] + >:=> (line 11, col 25) to (line 11, col 106) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline new file mode 100644 index 00000000000..60ee5897d48 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline @@ -0,0 +1,109 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var { name: nameA = "" } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (247 to 289) SpanInfo: {"start":253,"length":24} + >name: nameA = "" + >:=> (line 11, col 6) to (line 11, col 30) +-------------------------------- +12 >var { name: nameB = "", skill: skillB = "" } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (290 to 320) SpanInfo: {"start":296,"length":24} + >name: nameB = "" + >:=> (line 12, col 6) to (line 12, col 30) +12 >var { name: nameB = "", skill: skillB = "" } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (321 to 370) SpanInfo: {"start":322,"length":36} + >skill: skillB = "" + >:=> (line 12, col 32) to (line 12, col 68) +-------------------------------- +13 >var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (371 to 401) SpanInfo: {"start":377,"length":24} + >name: nameC = "" + >:=> (line 13, col 6) to (line 13, col 30) +13 >var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (402 to 486) SpanInfo: {"start":403,"length":36} + >skill: skillC = "" + >:=> (line 13, col 32) to (line 13, col 68) +-------------------------------- +14 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 508) SpanInfo: {"start":487,"length":19} + >if (nameA == nameB) + >:=> (line 14, col 0) to (line 14, col 19) +-------------------------------- +15 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (509 to 533) SpanInfo: {"start":513,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +16 >} + + ~~ => Pos: (534 to 535) SpanInfo: {"start":513,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +17 >else { + + ~~~~~~~ => Pos: (536 to 542) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +18 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (543 to 566) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +19 >} + ~ => Pos: (567 to 567) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline new file mode 100644 index 00000000000..66f814ada9c --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline @@ -0,0 +1,168 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 127) SpanInfo: undefined +-------------------------------- +8 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (128 to 154) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (155 to 161) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (162 to 163) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (164 to 252) SpanInfo: {"start":164,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (253 to 347) SpanInfo: {"start":253,"length":93} + >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } + >:=> (line 12, col 0) to (line 12, col 93) +-------------------------------- +13 > + + ~ => Pos: (348 to 348) SpanInfo: undefined +-------------------------------- +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~ => Pos: (349 to 361) SpanInfo: {"start":355,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 14, col 6) to (line 14, col 58) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (362 to 382) SpanInfo: {"start":365,"length":17} + >primary: primaryA + >:=> (line 14, col 16) to (line 14, col 33) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (383 to 406) SpanInfo: {"start":384,"length":21} + >secondary: secondaryA + >:=> (line 14, col 35) to (line 14, col 56) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~=> Pos: (407 to 419) SpanInfo: {"start":355,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 14, col 6) to (line 14, col 58) +-------------------------------- +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~ => Pos: (420 to 437) SpanInfo: {"start":426,"length":11} + >name: nameB + >:=> (line 15, col 6) to (line 15, col 17) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~ => Pos: (438 to 445) SpanInfo: {"start":439,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 19) to (line 15, col 71) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (446 to 466) SpanInfo: {"start":449,"length":17} + >primary: primaryB + >:=> (line 15, col 29) to (line 15, col 46) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (467 to 490) SpanInfo: {"start":468,"length":21} + >secondary: secondaryB + >:=> (line 15, col 48) to (line 15, col 69) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~=> Pos: (491 to 503) SpanInfo: {"start":439,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 19) to (line 15, col 71) +-------------------------------- +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~ => Pos: (504 to 521) SpanInfo: {"start":510,"length":11} + >name: nameC + >:=> (line 16, col 6) to (line 16, col 17) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~ => Pos: (522 to 529) SpanInfo: {"start":523,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 16, col 19) to (line 16, col 71) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (530 to 550) SpanInfo: {"start":533,"length":17} + >primary: primaryB + >:=> (line 16, col 29) to (line 16, col 46) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (551 to 574) SpanInfo: {"start":552,"length":21} + >secondary: secondaryB + >:=> (line 16, col 48) to (line 16, col 69) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (575 to 659) SpanInfo: {"start":523,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 16, col 19) to (line 16, col 71) +-------------------------------- +17 > + + ~ => Pos: (660 to 660) SpanInfo: undefined +-------------------------------- +18 >if (nameB == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (661 to 682) SpanInfo: {"start":661,"length":19} + >if (nameB == nameB) + >:=> (line 18, col 0) to (line 18, col 19) +-------------------------------- +19 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (683 to 706) SpanInfo: {"start":687,"length":18} + >console.log(nameC) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (707 to 708) SpanInfo: {"start":687,"length":18} + >console.log(nameC) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >else { + + ~~~~~~~ => Pos: (709 to 715) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (716 to 739) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + ~ => Pos: (740 to 740) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline new file mode 100644 index 00000000000..75b37a0231e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline @@ -0,0 +1,275 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 128) SpanInfo: undefined +-------------------------------- +8 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (129 to 156) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (157 to 163) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (164 to 165) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (166 to 254) SpanInfo: {"start":166,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (255 to 349) SpanInfo: {"start":255,"length":93} + >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } + >:=> (line 12, col 0) to (line 12, col 93) +-------------------------------- +13 > + + ~ => Pos: (350 to 350) SpanInfo: undefined +-------------------------------- +14 >var { + + ~~~~~~ => Pos: (351 to 356) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +15 > skills: { + + ~~~~~~~~~~~ => Pos: (357 to 367) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +15 > skills: { + + ~~~ => Pos: (368 to 370) SpanInfo: {"start":379,"length":29} + >primary: primaryA = "noSkill" + >:=> (line 16, col 8) to (line 16, col 37) +-------------------------------- +16 > primary: primaryA = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (371 to 409) SpanInfo: {"start":379,"length":29} + >primary: primaryA = "noSkill" + >:=> (line 16, col 8) to (line 16, col 37) +-------------------------------- +17 > secondary: secondaryA = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (410 to 451) SpanInfo: {"start":418,"length":33} + >secondary: secondaryA = "noSkill" + >:=> (line 17, col 8) to (line 17, col 41) +-------------------------------- +18 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (452 to 456) SpanInfo: {"start":418,"length":33} + >secondary: secondaryA = "noSkill" + >:=> (line 17, col 8) to (line 17, col 41) +18 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (457 to 504) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +19 >} = robotA; + + ~~~~~~~~~~~~ => Pos: (505 to 516) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +20 >var { + + ~~~~~~ => Pos: (517 to 522) SpanInfo: {"start":527,"length":31} + >name: nameB = "noNameSpecified" + >:=> (line 21, col 4) to (line 21, col 35) +-------------------------------- +21 > name: nameB = "noNameSpecified", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (523 to 559) SpanInfo: {"start":527,"length":31} + >name: nameB = "noNameSpecified" + >:=> (line 21, col 4) to (line 21, col 35) +-------------------------------- +22 > skills: { + + ~~~~~~~~~~~ => Pos: (560 to 570) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +22 > skills: { + + ~~~ => Pos: (571 to 573) SpanInfo: {"start":582,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 23, col 8) to (line 23, col 37) +-------------------------------- +23 > primary: primaryB = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (574 to 612) SpanInfo: {"start":582,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 23, col 8) to (line 23, col 37) +-------------------------------- +24 > secondary: secondaryB = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (613 to 654) SpanInfo: {"start":621,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 24, col 8) to (line 24, col 41) +-------------------------------- +25 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (655 to 659) SpanInfo: {"start":621,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 24, col 8) to (line 24, col 41) +25 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (660 to 707) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +-------------------------------- +26 >} = robotB; + + ~~~~~~~~~~~~ => Pos: (708 to 719) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +-------------------------------- +27 >var { + + ~~~~~~ => Pos: (720 to 725) SpanInfo: {"start":730,"length":31} + >name: nameC = "noNameSpecified" + >:=> (line 28, col 4) to (line 28, col 35) +-------------------------------- +28 > name: nameC = "noNameSpecified", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (726 to 762) SpanInfo: {"start":730,"length":31} + >name: nameC = "noNameSpecified" + >:=> (line 28, col 4) to (line 28, col 35) +-------------------------------- +29 > skills: { + + ~~~~~~~~~~~ => Pos: (763 to 773) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +29 > skills: { + + ~~~ => Pos: (774 to 776) SpanInfo: {"start":785,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 30, col 8) to (line 30, col 37) +-------------------------------- +30 > primary: primaryB = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (777 to 815) SpanInfo: {"start":785,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 30, col 8) to (line 30, col 37) +-------------------------------- +31 > secondary: secondaryB = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (816 to 857) SpanInfo: {"start":824,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 31, col 8) to (line 31, col 41) +-------------------------------- +32 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (858 to 862) SpanInfo: {"start":824,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 31, col 8) to (line 31, col 41) +32 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (863 to 910) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +-------------------------------- +33 >} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (911 to 1001) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +-------------------------------- +34 > + + ~ => Pos: (1002 to 1002) SpanInfo: undefined +-------------------------------- +35 >if (nameB == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1003 to 1024) SpanInfo: {"start":1003,"length":19} + >if (nameB == nameB) + >:=> (line 35, col 0) to (line 35, col 19) +-------------------------------- +36 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1025 to 1048) SpanInfo: {"start":1029,"length":18} + >console.log(nameC) + >:=> (line 36, col 4) to (line 36, col 22) +-------------------------------- +37 >} + + ~~ => Pos: (1049 to 1050) SpanInfo: {"start":1029,"length":18} + >console.log(nameC) + >:=> (line 36, col 4) to (line 36, col 22) +-------------------------------- +38 >else { + + ~~~~~~~ => Pos: (1051 to 1057) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) +-------------------------------- +39 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1058 to 1081) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) +-------------------------------- +40 >} + ~ => Pos: (1082 to 1082) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline index d8bfbc84aa0..aa39897be0f 100644 --- a/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline +++ b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline @@ -25,26 +25,14 @@ -------------------------------- 5 >a = [foo(30), (function () { - ~~~~~ => Pos: (64 to 68) SpanInfo: {"start":64,"length":49} + ~~~~~~~~~~~~~ => Pos: (64 to 76) SpanInfo: {"start":64,"length":49} >a = [foo(30), (function () { > return 30; >})()] >:=> (line 5, col 0) to (line 7, col 5) 5 >a = [foo(30), (function () { - ~~~~~~~~ => Pos: (69 to 76) SpanInfo: {"start":69,"length":7} - >foo(30) - >:=> (line 5, col 5) to (line 5, col 12) -5 >a = [foo(30), (function () { - - ~~ => Pos: (77 to 78) SpanInfo: {"start":78,"length":34} - >(function () { - > return 30; - >})() - >:=> (line 5, col 14) to (line 7, col 4) -5 >a = [foo(30), (function () { - - ~~~~~~~~~~~~~~ => Pos: (79 to 92) SpanInfo: {"start":97,"length":9} + ~~~~~~~~~~~~~~~~ => Pos: (77 to 92) SpanInfo: {"start":97,"length":9} >return 30 >:=> (line 6, col 4) to (line 6, col 13) -------------------------------- @@ -56,18 +44,11 @@ -------------------------------- 7 >})()]; - ~ => Pos: (108 to 108) SpanInfo: {"start":108,"length":1} + ~~~~ => Pos: (108 to 111) SpanInfo: {"start":108,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) 7 >})()]; - ~~~ => Pos: (109 to 111) SpanInfo: {"start":78,"length":34} - >(function () { - > return 30; - >})() - >:=> (line 5, col 14) to (line 7, col 4) -7 >})()]; - ~~~ => Pos: (112 to 114) SpanInfo: {"start":64,"length":49} >a = [foo(30), (function () { > return 30; @@ -94,17 +75,7 @@ -------------------------------- 11 >var x = bar()[0]; - ~~~~~~~ => Pos: (148 to 154) SpanInfo: {"start":148,"length":16} - >var x = bar()[0] - >:=> (line 11, col 0) to (line 11, col 16) -11 >var x = bar()[0]; - - ~~~~~~ => Pos: (155 to 160) SpanInfo: {"start":156,"length":5} - >bar() - >:=> (line 11, col 8) to (line 11, col 13) -11 >var x = bar()[0]; - - ~~~~~ => Pos: (161 to 165) SpanInfo: {"start":148,"length":16} + ~~~~~~~~~~~~~~~~~~ => Pos: (148 to 165) SpanInfo: {"start":148,"length":16} >var x = bar()[0] >:=> (line 11, col 0) to (line 11, col 16) -------------------------------- @@ -117,14 +88,7 @@ >:=> (line 12, col 0) to (line 14, col 7) 12 >x = (function () { - ~~ => Pos: (169 to 170) SpanInfo: {"start":170,"length":33} - >(function () { - > return a; - >})() - >:=> (line 12, col 4) to (line 14, col 4) -12 >x = (function () { - - ~~~~~~~~~~~~~~ => Pos: (171 to 184) SpanInfo: {"start":189,"length":8} + ~~~~~~~~~~~~~~~~ => Pos: (169 to 184) SpanInfo: {"start":189,"length":8} >return a >:=> (line 13, col 4) to (line 13, col 12) -------------------------------- @@ -136,18 +100,11 @@ -------------------------------- 14 >})()[x]; - ~ => Pos: (199 to 199) SpanInfo: {"start":199,"length":1} + ~~~~ => Pos: (199 to 202) SpanInfo: {"start":199,"length":1} >} >:=> (line 14, col 0) to (line 14, col 1) 14 >})()[x]; - ~~~ => Pos: (200 to 202) SpanInfo: {"start":170,"length":33} - >(function () { - > return a; - >})() - >:=> (line 12, col 4) to (line 14, col 4) -14 >})()[x]; - ~~~~~ => Pos: (203 to 207) SpanInfo: {"start":166,"length":40} >x = (function () { > return a; @@ -163,14 +120,7 @@ >:=> (line 15, col 0) to (line 17, col 5) 15 >a[(function () { - ~ => Pos: (210 to 210) SpanInfo: {"start":210,"length":33} - >(function () { - > return x; - >})() - >:=> (line 15, col 2) to (line 17, col 4) -15 >a[(function () { - - ~~~~~~~~~~~~~~ => Pos: (211 to 224) SpanInfo: {"start":229,"length":8} + ~~~~~~~~~~~~~~~ => Pos: (210 to 224) SpanInfo: {"start":229,"length":8} >return x >:=> (line 16, col 4) to (line 16, col 12) -------------------------------- @@ -181,15 +131,9 @@ >:=> (line 16, col 4) to (line 16, col 12) -------------------------------- 17 >})()]; - ~ => Pos: (239 to 239) SpanInfo: {"start":239,"length":1} + ~~~~ => Pos: (239 to 242) SpanInfo: {"start":239,"length":1} >} >:=> (line 17, col 0) to (line 17, col 1) -17 >})()]; - ~~~ => Pos: (240 to 242) SpanInfo: {"start":210,"length":33} - >(function () { - > return x; - >})() - >:=> (line 15, col 2) to (line 17, col 4) 17 >})()]; ~~ => Pos: (243 to 244) SpanInfo: {"start":208,"length":36} >a[(function () { diff --git a/tests/baselines/reference/bpSpan_binaryExpressions.baseline b/tests/baselines/reference/bpSpan_binaryExpressions.baseline index 370fec39a25..93f6b97005b 100644 --- a/tests/baselines/reference/bpSpan_binaryExpressions.baseline +++ b/tests/baselines/reference/bpSpan_binaryExpressions.baseline @@ -38,14 +38,7 @@ >:=> (line 6, col 0) to (line 8, col 8) 6 >x = (function foo() { - ~~ => Pos: (55 to 56) SpanInfo: {"start":56,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 6, col 4) to (line 8, col 4) -6 >x = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (57 to 73) SpanInfo: {"start":78,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (55 to 73) SpanInfo: {"start":78,"length":8} >return y >:=> (line 7, col 4) to (line 7, col 12) -------------------------------- @@ -57,18 +50,11 @@ -------------------------------- 8 >})() + y; - ~ => Pos: (88 to 88) SpanInfo: {"start":88,"length":1} + ~~~~ => Pos: (88 to 91) SpanInfo: {"start":88,"length":1} >} >:=> (line 8, col 0) to (line 8, col 1) 8 >})() + y; - ~~~ => Pos: (89 to 91) SpanInfo: {"start":56,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 6, col 4) to (line 8, col 4) -8 >})() + y; - ~~~~~~ => Pos: (92 to 97) SpanInfo: {"start":52,"length":44} >x = (function foo() { > return y; @@ -84,14 +70,7 @@ >:=> (line 9, col 0) to (line 11, col 9) 9 >x = y + 30 + (function foo() { - ~~ => Pos: (110 to 111) SpanInfo: {"start":111,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 9, col 13) to (line 11, col 4) -9 >x = y + 30 + (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (112 to 128) SpanInfo: {"start":133,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 128) SpanInfo: {"start":133,"length":8} >return y >:=> (line 10, col 4) to (line 10, col 12) -------------------------------- @@ -102,15 +81,9 @@ >:=> (line 10, col 4) to (line 10, col 12) -------------------------------- 11 >})() * 40; - ~ => Pos: (143 to 143) SpanInfo: {"start":143,"length":1} + ~~~~ => Pos: (143 to 146) SpanInfo: {"start":143,"length":1} >} >:=> (line 11, col 0) to (line 11, col 1) -11 >})() * 40; - ~~~ => Pos: (144 to 146) SpanInfo: {"start":111,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 9, col 13) to (line 11, col 4) 11 >})() * 40; ~~~~~~ => Pos: (147 to 152) SpanInfo: {"start":98,"length":54} >x = y + 30 + (function foo() { diff --git a/tests/baselines/reference/bpSpan_classes.baseline b/tests/baselines/reference/bpSpan_classes.baseline index 811109af835..ecba5c8706a 100644 --- a/tests/baselines/reference/bpSpan_classes.baseline +++ b/tests/baselines/reference/bpSpan_classes.baseline @@ -171,14 +171,9 @@ -------------------------------- 15 > return new Greeter(greeting); - ~~~~~~~~~~~~~~ => Pos: (249 to 262) SpanInfo: {"start":257,"length":28} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (249 to 286) SpanInfo: {"start":257,"length":28} >return new Greeter(greeting) >:=> (line 15, col 8) to (line 15, col 36) -15 > return new Greeter(greeting); - - ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (263 to 286) SpanInfo: {"start":264,"length":21} - >new Greeter(greeting) - >:=> (line 15, col 15) to (line 15, col 36) -------------------------------- 16 > } @@ -192,25 +187,15 @@ -------------------------------- 18 > var greeter = new Greeter("Hello, world!"); - ~~~~~~~~~~~~~~~~~ => Pos: (294 to 310) SpanInfo: {"start":298,"length":42} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (294 to 341) SpanInfo: {"start":298,"length":42} >var greeter = new Greeter("Hello, world!") >:=> (line 18, col 4) to (line 18, col 46) -18 > var greeter = new Greeter("Hello, world!"); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (311 to 341) SpanInfo: {"start":312,"length":28} - >new Greeter("Hello, world!") - >:=> (line 18, col 18) to (line 18, col 46) -------------------------------- 19 > var str = greeter.greet(); - ~~~~~~~~~~~~~ => Pos: (342 to 354) SpanInfo: {"start":346,"length":25} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (342 to 372) SpanInfo: {"start":346,"length":25} >var str = greeter.greet() >:=> (line 19, col 4) to (line 19, col 29) -19 > var str = greeter.greet(); - - ~~~~~~~~~~~~~~~~~~ => Pos: (355 to 372) SpanInfo: {"start":356,"length":15} - >greeter.greet() - >:=> (line 19, col 14) to (line 19, col 29) -------------------------------- 20 > @@ -240,14 +225,9 @@ -------------------------------- 23 > greeters[0] = new Greeter(greeting); - ~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 545) SpanInfo: {"start":533,"length":35} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 569) SpanInfo: {"start":533,"length":35} >greeters[0] = new Greeter(greeting) >:=> (line 23, col 8) to (line 23, col 43) -23 > greeters[0] = new Greeter(greeting); - - ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (546 to 569) SpanInfo: {"start":547,"length":21} - >new Greeter(greeting) - >:=> (line 23, col 22) to (line 23, col 43) -------------------------------- 24 > for (var i = 0; i < restGreetings.length; i++) { @@ -267,17 +247,7 @@ -------------------------------- 25 > greeters.push(new Greeter(restGreetings[i])); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (627 to 652) SpanInfo: {"start":639,"length":44} - >greeters.push(new Greeter(restGreetings[i])) - >:=> (line 25, col 12) to (line 25, col 56) -25 > greeters.push(new Greeter(restGreetings[i])); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (653 to 681) SpanInfo: {"start":653,"length":29} - >new Greeter(restGreetings[i]) - >:=> (line 25, col 26) to (line 25, col 55) -25 > greeters.push(new Greeter(restGreetings[i])); - - ~~~=> Pos: (682 to 684) SpanInfo: {"start":639,"length":44} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (627 to 684) SpanInfo: {"start":639,"length":44} >greeters.push(new Greeter(restGreetings[i])) >:=> (line 25, col 12) to (line 25, col 56) -------------------------------- @@ -309,14 +279,9 @@ -------------------------------- 31 > var b = foo2("Hello", "World", "!"); - ~~~~~~~~~~~ => Pos: (728 to 738) SpanInfo: {"start":732,"length":35} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (728 to 768) SpanInfo: {"start":732,"length":35} >var b = foo2("Hello", "World", "!") >:=> (line 31, col 4) to (line 31, col 39) -31 > var b = foo2("Hello", "World", "!"); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (739 to 768) SpanInfo: {"start":740,"length":27} - >foo2("Hello", "World", "!") - >:=> (line 31, col 12) to (line 31, col 39) -------------------------------- 32 > // This is simple signle line comment diff --git a/tests/baselines/reference/bpSpan_conditionalExpressions.baseline b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline index 5abd49d50cf..17432ee5439 100644 --- a/tests/baselines/reference/bpSpan_conditionalExpressions.baseline +++ b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline @@ -22,14 +22,7 @@ >:=> (line 3, col 0) to (line 7, col 4) 3 >var z = (function foo() { - ~~ => Pos: (44 to 45) SpanInfo: {"start":45,"length":36} - >(function foo() { - > return x; - >})() - >:=> (line 3, col 8) to (line 5, col 4) -3 >var z = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (46 to 62) SpanInfo: {"start":67,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (44 to 62) SpanInfo: {"start":67,"length":8} >return x >:=> (line 4, col 4) to (line 4, col 12) -------------------------------- @@ -41,18 +34,11 @@ -------------------------------- 5 >})() ? y : function bar() { - ~ => Pos: (77 to 77) SpanInfo: {"start":77,"length":1} + ~~~~ => Pos: (77 to 80) SpanInfo: {"start":77,"length":1} >} >:=> (line 5, col 0) to (line 5, col 1) 5 >})() ? y : function bar() { - ~~~ => Pos: (78 to 80) SpanInfo: {"start":45,"length":36} - >(function foo() { - > return x; - >})() - >:=> (line 3, col 8) to (line 5, col 4) -5 >})() ? y : function bar() { - ~~~~~~ => Pos: (81 to 86) SpanInfo: {"start":37,"length":90} >var z = (function foo() { > return x; @@ -74,16 +60,9 @@ -------------------------------- 7 >} (); - ~ => Pos: (123 to 123) SpanInfo: {"start":123,"length":1} + ~~~~~~ => Pos: (123 to 128) SpanInfo: {"start":123,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) -7 >} (); - - ~~~~~ => Pos: (124 to 128) SpanInfo: {"start":88,"length":39} - >function bar() { - > return x; - >} () - >:=> (line 5, col 11) to (line 7, col 4) -------------------------------- 8 >x = y ? (function () { @@ -94,14 +73,7 @@ >:=> (line 8, col 0) to (line 10, col 10) 8 >x = y ? (function () { - ~~ => Pos: (136 to 137) SpanInfo: {"start":137,"length":33} - >(function () { - > return z; - >})() - >:=> (line 8, col 8) to (line 10, col 4) -8 >x = y ? (function () { - - ~~~~~~~~~~~~~~ => Pos: (138 to 151) SpanInfo: {"start":156,"length":8} + ~~~~~~~~~~~~~~~~ => Pos: (136 to 151) SpanInfo: {"start":156,"length":8} >return z >:=> (line 9, col 4) to (line 9, col 12) -------------------------------- @@ -112,15 +84,9 @@ >:=> (line 9, col 4) to (line 9, col 12) -------------------------------- 10 >})() : 10; - ~ => Pos: (166 to 166) SpanInfo: {"start":166,"length":1} + ~~~~ => Pos: (166 to 169) SpanInfo: {"start":166,"length":1} >} >:=> (line 10, col 0) to (line 10, col 1) -10 >})() : 10; - ~~~ => Pos: (167 to 169) SpanInfo: {"start":137,"length":33} - >(function () { - > return z; - >})() - >:=> (line 8, col 8) to (line 10, col 4) 10 >})() : 10; ~~~~~~~ => Pos: (170 to 176) SpanInfo: {"start":129,"length":47} >x = y ? (function () { diff --git a/tests/baselines/reference/bpSpan_do.baseline b/tests/baselines/reference/bpSpan_do.baseline index 3ff287c2046..602ec5b16c7 100644 --- a/tests/baselines/reference/bpSpan_do.baseline +++ b/tests/baselines/reference/bpSpan_do.baseline @@ -107,14 +107,7 @@ >:=> (line 15, col 2) to (line 17, col 15) 15 >} while ((function () { - ~ => Pos: (131 to 131) SpanInfo: {"start":131,"length":46} - >(function () { - > return 30 * i; - > })() - >:=> (line 15, col 9) to (line 17, col 8) -15 >} while ((function () { - - ~~~~~~~~~~~~~~ => Pos: (132 to 145) SpanInfo: {"start":154,"length":13} + ~~~~~~~~~~~~~~~ => Pos: (131 to 145) SpanInfo: {"start":154,"length":13} >return 30 * i >:=> (line 16, col 8) to (line 16, col 21) -------------------------------- @@ -125,15 +118,9 @@ >:=> (line 16, col 8) to (line 16, col 21) -------------------------------- 17 > })() !== i); - ~~~~~ => Pos: (169 to 173) SpanInfo: {"start":173,"length":1} + ~~~~~~~~ => Pos: (169 to 176) SpanInfo: {"start":173,"length":1} >} >:=> (line 17, col 4) to (line 17, col 5) -17 > })() !== i); - ~~~ => Pos: (174 to 176) SpanInfo: {"start":131,"length":46} - >(function () { - > return 30 * i; - > })() - >:=> (line 15, col 9) to (line 17, col 8) 17 > })() !== i); ~~~~~~~~~ => Pos: (177 to 185) SpanInfo: {"start":124,"length":60} >while ((function () { diff --git a/tests/baselines/reference/bpSpan_for.baseline b/tests/baselines/reference/bpSpan_for.baseline index 7fd6ba4c858..46214f6e3b1 100644 --- a/tests/baselines/reference/bpSpan_for.baseline +++ b/tests/baselines/reference/bpSpan_for.baseline @@ -220,12 +220,7 @@ -------------------------------- 32 >for (i = 0, j = 20; j < 20, i < 20; j++) { - ~~~~~ => Pos: (351 to 355) SpanInfo: {"start":356,"length":13} - >i = 0, j = 20 - >:=> (line 32, col 5) to (line 32, col 18) -32 >for (i = 0, j = 20; j < 20, i < 20; j++) { - - ~~~~~~ => Pos: (356 to 361) SpanInfo: {"start":356,"length":5} + ~~~~~~~~~~~ => Pos: (351 to 361) SpanInfo: {"start":356,"length":5} >i = 0 >:=> (line 32, col 5) to (line 32, col 10) 32 >for (i = 0, j = 20; j < 20, i < 20; j++) { diff --git a/tests/baselines/reference/bpSpan_forIn.baseline b/tests/baselines/reference/bpSpan_forIn.baseline index c2b72df5b12..1c46a83e3b4 100644 --- a/tests/baselines/reference/bpSpan_forIn.baseline +++ b/tests/baselines/reference/bpSpan_forIn.baseline @@ -104,14 +104,9 @@ -------------------------------- 17 > return new String(); - ~~~~~~~~~~ => Pos: (221 to 230) SpanInfo: {"start":225,"length":19} + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 245) SpanInfo: {"start":225,"length":19} >return new String() >:=> (line 17, col 4) to (line 17, col 23) -17 > return new String(); - - ~~~~~~~~~~~~~~~ => Pos: (231 to 245) SpanInfo: {"start":232,"length":12} - >new String() - >:=> (line 17, col 11) to (line 17, col 23) -------------------------------- 18 >}) { diff --git a/tests/baselines/reference/bpSpan_functionExpressions.baseline b/tests/baselines/reference/bpSpan_functionExpressions.baseline index 135edff9418..f75bde15f07 100644 --- a/tests/baselines/reference/bpSpan_functionExpressions.baseline +++ b/tests/baselines/reference/bpSpan_functionExpressions.baseline @@ -80,14 +80,9 @@ -------------------------------- 10 > return greet(msg); - ~~~~~~~~~~ => Pos: (235 to 244) SpanInfo: {"start":239,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (235 to 257) SpanInfo: {"start":239,"length":17} >return greet(msg) >:=> (line 10, col 4) to (line 10, col 21) -10 > return greet(msg); - - ~~~~~~~~~~~~~ => Pos: (245 to 257) SpanInfo: {"start":246,"length":10} - >greet(msg) - >:=> (line 10, col 11) to (line 10, col 21) -------------------------------- 11 >}; @@ -132,17 +127,7 @@ -------------------------------- 15 > if (!a()) { - ~~~~~~~~~ => Pos: (322 to 330) SpanInfo: {"start":326,"length":9} - >if (!a()) - >:=> (line 15, col 4) to (line 15, col 13) -15 > if (!a()) { - - ~~~ => Pos: (331 to 333) SpanInfo: {"start":331,"length":3} - >a() - >:=> (line 15, col 9) to (line 15, col 12) -15 > if (!a()) { - - ~~~~ => Pos: (334 to 337) SpanInfo: {"start":326,"length":9} + ~~~~~~~~~~~~~~~~ => Pos: (322 to 337) SpanInfo: {"start":326,"length":9} >if (!a()) >:=> (line 15, col 4) to (line 15, col 13) -------------------------------- diff --git a/tests/baselines/reference/bpSpan_ifElse.baseline b/tests/baselines/reference/bpSpan_ifElse.baseline index b66316d3392..fc9e5f6758a 100644 --- a/tests/baselines/reference/bpSpan_ifElse.baseline +++ b/tests/baselines/reference/bpSpan_ifElse.baseline @@ -131,18 +131,11 @@ -------------------------------- 20 >} ()) { - ~ => Pos: (193 to 193) SpanInfo: {"start":193,"length":1} + ~~~~ => Pos: (193 to 196) SpanInfo: {"start":193,"length":1} >} >:=> (line 20, col 0) to (line 20, col 1) 20 >} ()) { - ~~~ => Pos: (194 to 196) SpanInfo: {"start":161,"length":36} - >function foo() { - > return 30; - >} () - >:=> (line 18, col 4) to (line 20, col 4) -20 >} ()) { - ~ => Pos: (197 to 197) SpanInfo: {"start":157,"length":41} >if (function foo() { > return 30; diff --git a/tests/baselines/reference/bpSpan_import.baseline b/tests/baselines/reference/bpSpan_import.baseline index 26279b48f26..af0f959c57c 100644 --- a/tests/baselines/reference/bpSpan_import.baseline +++ b/tests/baselines/reference/bpSpan_import.baseline @@ -41,20 +41,11 @@ -------------------------------- 7 >var x = new a(); - ~~~~~~~ => Pos: (72 to 78) SpanInfo: {"start":72,"length":15} + ~~~~~~~~~~~~~~~~~ => Pos: (72 to 88) SpanInfo: {"start":72,"length":15} >var x = new a() >:=> (line 7, col 0) to (line 7, col 15) -7 >var x = new a(); - - ~~~~~~~~~~ => Pos: (79 to 88) SpanInfo: {"start":80,"length":7} - >new a() - >:=> (line 7, col 8) to (line 7, col 15) -------------------------------- 8 >var y = new b(); - ~~~~~~~ => Pos: (89 to 95) SpanInfo: {"start":89,"length":15} + ~~~~~~~~~~~~~~~~ => Pos: (89 to 104) SpanInfo: {"start":89,"length":15} >var y = new b() - >:=> (line 8, col 0) to (line 8, col 15) -8 >var y = new b(); - ~~~~~~~~~ => Pos: (96 to 104) SpanInfo: {"start":97,"length":7} - >new b() - >:=> (line 8, col 8) to (line 8, col 15) \ No newline at end of file + >:=> (line 8, col 0) to (line 8, col 15) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline index 47c932640f9..bcc2326c1f3 100644 --- a/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline +++ b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline @@ -26,105 +26,46 @@ >:=> (line 4, col 0) to (line 6, col 5) 4 >foo((function bar() { - ~ => Pos: (46 to 46) SpanInfo: {"start":46,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 4, col 4) to (line 6, col 4) -4 >foo((function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (47 to 63) SpanInfo: {"start":68,"length":14} + ~~~~~~~~~~~~~~~~~~ => Pos: (46 to 63) SpanInfo: {"start":68,"length":14} >return foo(40) >:=> (line 5, col 4) to (line 5, col 18) -------------------------------- 5 > return foo(40); - ~~~~~~~~~~ => Pos: (64 to 73) SpanInfo: {"start":68,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (64 to 83) SpanInfo: {"start":68,"length":14} >return foo(40) >:=> (line 5, col 4) to (line 5, col 18) -5 > return foo(40); - - ~~~~~~~~~~ => Pos: (74 to 83) SpanInfo: {"start":75,"length":7} - >foo(40) - >:=> (line 5, col 11) to (line 5, col 18) -------------------------------- 6 >})()); - ~ => Pos: (84 to 84) SpanInfo: {"start":84,"length":1} + ~~~~~~~ => Pos: (84 to 90) SpanInfo: {"start":84,"length":1} >} >:=> (line 6, col 0) to (line 6, col 1) -6 >})()); - - ~~~ => Pos: (85 to 87) SpanInfo: {"start":46,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 4, col 4) to (line 6, col 4) -6 >})()); - - ~~~ => Pos: (88 to 90) SpanInfo: {"start":42,"length":47} - >foo((function bar() { - > return foo(40); - >})()) - >:=> (line 4, col 0) to (line 6, col 5) -------------------------------- 7 >var y = foo((function () { - ~~~~~~~ => Pos: (91 to 97) SpanInfo: {"start":91,"length":52} + ~~~~~~~~~~~~ => Pos: (91 to 102) SpanInfo: {"start":91,"length":52} >var y = foo((function () { > return foo(40); >})()) >:=> (line 7, col 0) to (line 9, col 5) 7 >var y = foo((function () { - ~~~~~ => Pos: (98 to 102) SpanInfo: {"start":99,"length":44} - >foo((function () { - > return foo(40); - >})()) - >:=> (line 7, col 8) to (line 9, col 5) -7 >var y = foo((function () { - - ~ => Pos: (103 to 103) SpanInfo: {"start":103,"length":39} - >(function () { - > return foo(40); - >})() - >:=> (line 7, col 12) to (line 9, col 4) -7 >var y = foo((function () { - - ~~~~~~~~~~~~~~ => Pos: (104 to 117) SpanInfo: {"start":122,"length":14} + ~~~~~~~~~~~~~~~ => Pos: (103 to 117) SpanInfo: {"start":122,"length":14} >return foo(40) >:=> (line 8, col 4) to (line 8, col 18) -------------------------------- 8 > return foo(40); - ~~~~~~~~~~ => Pos: (118 to 127) SpanInfo: {"start":122,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (118 to 137) SpanInfo: {"start":122,"length":14} >return foo(40) >:=> (line 8, col 4) to (line 8, col 18) -8 > return foo(40); - - ~~~~~~~~~~ => Pos: (128 to 137) SpanInfo: {"start":129,"length":7} - >foo(40) - >:=> (line 8, col 11) to (line 8, col 18) -------------------------------- 9 >})());; - ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + ~~~~~~~~ => Pos: (138 to 145) SpanInfo: {"start":138,"length":1} >} >:=> (line 9, col 0) to (line 9, col 1) -9 >})());; - - ~~~ => Pos: (139 to 141) SpanInfo: {"start":103,"length":39} - >(function () { - > return foo(40); - >})() - >:=> (line 7, col 12) to (line 9, col 4) -9 >})());; - - ~~~~ => Pos: (142 to 145) SpanInfo: {"start":99,"length":44} - >foo((function () { - > return foo(40); - >})()) - >:=> (line 7, col 8) to (line 9, col 5) -------------------------------- 10 >class greeter { @@ -167,25 +108,15 @@ -------------------------------- 16 >y = foo(30); - ~~~ => Pos: (221 to 223) SpanInfo: {"start":221,"length":11} + ~~~~~~~~~~~~~ => Pos: (221 to 233) SpanInfo: {"start":221,"length":11} >y = foo(30) >:=> (line 16, col 0) to (line 16, col 11) -16 >y = foo(30); - - ~~~~~~~~~~ => Pos: (224 to 233) SpanInfo: {"start":225,"length":7} - >foo(30) - >:=> (line 16, col 4) to (line 16, col 11) -------------------------------- 17 >y = foo(500 + y); - ~~~ => Pos: (234 to 236) SpanInfo: {"start":234,"length":16} + ~~~~~~~~~~~~~~~~~~ => Pos: (234 to 251) SpanInfo: {"start":234,"length":16} >y = foo(500 + y) >:=> (line 17, col 0) to (line 17, col 16) -17 >y = foo(500 + y); - - ~~~~~~~~~~~~~~~ => Pos: (237 to 251) SpanInfo: {"start":238,"length":12} - >foo(500 + y) - >:=> (line 17, col 4) to (line 17, col 16) -------------------------------- 18 >new greeter((function bar() { @@ -196,127 +127,58 @@ >:=> (line 18, col 0) to (line 20, col 5) 18 >new greeter((function bar() { - ~ => Pos: (264 to 264) SpanInfo: {"start":264,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 18, col 12) to (line 20, col 4) -18 >new greeter((function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (265 to 281) SpanInfo: {"start":286,"length":14} + ~~~~~~~~~~~~~~~~~~ => Pos: (264 to 281) SpanInfo: {"start":286,"length":14} >return foo(40) >:=> (line 19, col 4) to (line 19, col 18) -------------------------------- 19 > return foo(40); - ~~~~~~~~~~ => Pos: (282 to 291) SpanInfo: {"start":286,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (282 to 301) SpanInfo: {"start":286,"length":14} >return foo(40) >:=> (line 19, col 4) to (line 19, col 18) -19 > return foo(40); - - ~~~~~~~~~~ => Pos: (292 to 301) SpanInfo: {"start":293,"length":7} - >foo(40) - >:=> (line 19, col 11) to (line 19, col 18) -------------------------------- 20 >})()); - ~ => Pos: (302 to 302) SpanInfo: {"start":302,"length":1} + ~~~~~~~ => Pos: (302 to 308) SpanInfo: {"start":302,"length":1} >} >:=> (line 20, col 0) to (line 20, col 1) -20 >})()); - - ~~~ => Pos: (303 to 305) SpanInfo: {"start":264,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 18, col 12) to (line 20, col 4) -20 >})()); - - ~~~ => Pos: (306 to 308) SpanInfo: {"start":252,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 18, col 0) to (line 20, col 5) -------------------------------- 21 >var anotherGreeter = new greeter((function bar() { - ~~~~~~~~~~~~~~~~~~~~ => Pos: (309 to 328) SpanInfo: {"start":309,"length":76} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (309 to 341) SpanInfo: {"start":309,"length":76} >var anotherGreeter = new greeter((function bar() { > return foo(40); >})()) >:=> (line 21, col 0) to (line 23, col 5) 21 >var anotherGreeter = new greeter((function bar() { - ~~~~~~~~~~~~~ => Pos: (329 to 341) SpanInfo: {"start":330,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 21, col 21) to (line 23, col 5) -21 >var anotherGreeter = new greeter((function bar() { - - ~ => Pos: (342 to 342) SpanInfo: {"start":342,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 21, col 33) to (line 23, col 4) -21 >var anotherGreeter = new greeter((function bar() { - - ~~~~~~~~~~~~~~~~~=> Pos: (343 to 359) SpanInfo: {"start":364,"length":14} + ~~~~~~~~~~~~~~~~~~=> Pos: (342 to 359) SpanInfo: {"start":364,"length":14} >return foo(40) >:=> (line 22, col 4) to (line 22, col 18) -------------------------------- 22 > return foo(40); - ~~~~~~~~~~ => Pos: (360 to 369) SpanInfo: {"start":364,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (360 to 379) SpanInfo: {"start":364,"length":14} >return foo(40) >:=> (line 22, col 4) to (line 22, col 18) -22 > return foo(40); - - ~~~~~~~~~~ => Pos: (370 to 379) SpanInfo: {"start":371,"length":7} - >foo(40) - >:=> (line 22, col 11) to (line 22, col 18) -------------------------------- 23 >})()); - ~ => Pos: (380 to 380) SpanInfo: {"start":380,"length":1} + ~~~~~~~ => Pos: (380 to 386) SpanInfo: {"start":380,"length":1} >} >:=> (line 23, col 0) to (line 23, col 1) -23 >})()); - - ~~~ => Pos: (381 to 383) SpanInfo: {"start":342,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 21, col 33) to (line 23, col 4) -23 >})()); - - ~~~ => Pos: (384 to 386) SpanInfo: {"start":330,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 21, col 21) to (line 23, col 5) -------------------------------- 24 >anotherGreeter = new greeter(30); - ~~~~~~~~~~~~~~~~ => Pos: (387 to 402) SpanInfo: {"start":387,"length":32} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (387 to 420) SpanInfo: {"start":387,"length":32} >anotherGreeter = new greeter(30) >:=> (line 24, col 0) to (line 24, col 32) -24 >anotherGreeter = new greeter(30); - - ~~~~~~~~~~~~~~~~~~ => Pos: (403 to 420) SpanInfo: {"start":404,"length":15} - >new greeter(30) - >:=> (line 24, col 17) to (line 24, col 32) -------------------------------- 25 >anotherGreeter = new greeter(40 + y); - ~~~~~~~~~~~~~~~~ => Pos: (421 to 436) SpanInfo: {"start":421,"length":36} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (421 to 458) SpanInfo: {"start":421,"length":36} >anotherGreeter = new greeter(40 + y) >:=> (line 25, col 0) to (line 25, col 36) -25 >anotherGreeter = new greeter(40 + y); - - ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (437 to 458) SpanInfo: {"start":438,"length":19} - >new greeter(40 + y) - >:=> (line 25, col 17) to (line 25, col 36) -------------------------------- 26 >new greeter(30); @@ -343,22 +205,6 @@ >:=> (line 29, col 0) to (line 29, col 1) -------------------------------- 30 >foo2(foo(30), foo(40).toString()); - ~~~~~ => Pos: (537 to 541) SpanInfo: {"start":537,"length":33} - >foo2(foo(30), foo(40).toString()) - >:=> (line 30, col 0) to (line 30, col 33) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~ => Pos: (542 to 549) SpanInfo: {"start":542,"length":7} - >foo(30) - >:=> (line 30, col 5) to (line 30, col 12) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~ => Pos: (550 to 557) SpanInfo: {"start":551,"length":7} - >foo(40) - >:=> (line 30, col 14) to (line 30, col 21) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~~~~ => Pos: (558 to 568) SpanInfo: {"start":551,"length":18} - >foo(40).toString() - >:=> (line 30, col 14) to (line 30, col 32) -30 >foo2(foo(30), foo(40).toString()); - ~~ => Pos: (569 to 570) SpanInfo: {"start":537,"length":33} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (537 to 570) SpanInfo: {"start":537,"length":33} >foo2(foo(30), foo(40).toString()) >:=> (line 30, col 0) to (line 30, col 33) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_stmts.baseline b/tests/baselines/reference/bpSpan_stmts.baseline index 7f6bf21b40b..b818c9c9e30 100644 --- a/tests/baselines/reference/bpSpan_stmts.baseline +++ b/tests/baselines/reference/bpSpan_stmts.baseline @@ -278,14 +278,9 @@ -------------------------------- 37 > throw new Error(); - ~~~~~~~~~~~~~ => Pos: (549 to 561) SpanInfo: {"start":557,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 575) SpanInfo: {"start":557,"length":17} >throw new Error() >:=> (line 37, col 8) to (line 37, col 25) -37 > throw new Error(); - - ~~~~~~~~~~~~~~ => Pos: (562 to 575) SpanInfo: {"start":563,"length":11} - >new Error() - >:=> (line 37, col 14) to (line 37, col 25) -------------------------------- 38 > } catch (e1) { diff --git a/tests/baselines/reference/bpSpan_switch.baseline b/tests/baselines/reference/bpSpan_switch.baseline index c0e2259784d..7fde6067ed0 100644 --- a/tests/baselines/reference/bpSpan_switch.baseline +++ b/tests/baselines/reference/bpSpan_switch.baseline @@ -176,14 +176,7 @@ >:=> (line 29, col 0) to (line 31, col 5) 29 >switch ((function foo() { - ~ => Pos: (357 to 357) SpanInfo: {"start":357,"length":41} - >(function foo() { - > return x * 30; - >})() - >:=> (line 29, col 8) to (line 31, col 4) -29 >switch ((function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (358 to 374) SpanInfo: {"start":379,"length":13} + ~~~~~~~~~~~~~~~~~~ => Pos: (357 to 374) SpanInfo: {"start":379,"length":13} >return x * 30 >:=> (line 30, col 4) to (line 30, col 17) -------------------------------- @@ -195,18 +188,11 @@ -------------------------------- 31 >})()) { - ~ => Pos: (394 to 394) SpanInfo: {"start":394,"length":1} + ~~~~ => Pos: (394 to 397) SpanInfo: {"start":394,"length":1} >} >:=> (line 31, col 0) to (line 31, col 1) 31 >})()) { - ~~~ => Pos: (395 to 397) SpanInfo: {"start":357,"length":41} - >(function foo() { - > return x * 30; - >})() - >:=> (line 29, col 8) to (line 31, col 4) -31 >})()) { - ~ => Pos: (398 to 398) SpanInfo: {"start":349,"length":50} >switch ((function foo() { > return x * 30; @@ -225,14 +211,7 @@ >:=> (line 35, col 8) to (line 35, col 11) 32 > case (function bar() { - ~~ => Pos: (410 to 411) SpanInfo: {"start":411,"length":45} - >(function bar() { - > return 30; - > })() - >:=> (line 32, col 9) to (line 34, col 8) -32 > case (function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (412 to 428) SpanInfo: {"start":437,"length":9} + ~~~~~~~~~~~~~~~~~~~ => Pos: (410 to 428) SpanInfo: {"start":437,"length":9} >return 30 >:=> (line 33, col 8) to (line 33, col 17) -------------------------------- @@ -244,18 +223,11 @@ -------------------------------- 34 > })(): - ~~~~~ => Pos: (448 to 452) SpanInfo: {"start":452,"length":1} + ~~~~~~~~ => Pos: (448 to 455) SpanInfo: {"start":452,"length":1} >} >:=> (line 34, col 4) to (line 34, col 5) 34 > })(): - ~~~ => Pos: (453 to 455) SpanInfo: {"start":411,"length":45} - >(function bar() { - > return 30; - > })() - >:=> (line 32, col 9) to (line 34, col 8) -34 > })(): - ~~ => Pos: (456 to 457) SpanInfo: {"start":466,"length":3} >x++ >:=> (line 35, col 8) to (line 35, col 11) diff --git a/tests/baselines/reference/bpSpan_tryCatchFinally.baseline b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline index e5465b8812c..c35683b6e53 100644 --- a/tests/baselines/reference/bpSpan_tryCatchFinally.baseline +++ b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline @@ -85,14 +85,9 @@ -------------------------------- 12 > throw new Error(); - ~~~~~~~~~ => Pos: (113 to 121) SpanInfo: {"start":117,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (113 to 135) SpanInfo: {"start":117,"length":17} >throw new Error() >:=> (line 12, col 4) to (line 12, col 21) -12 > throw new Error(); - - ~~~~~~~~~~~~~~ => Pos: (122 to 135) SpanInfo: {"start":123,"length":11} - >new Error() - >:=> (line 12, col 10) to (line 12, col 21) -------------------------------- 13 >} @@ -173,45 +168,21 @@ >:=> (line 23, col 4) to (line 25, col 8) 23 > throw (function foo() { - ~~ => Pos: (210 to 211) SpanInfo: {"start":211,"length":59} - >(function foo() { - > new Error(x.toString()); - > })() - >:=> (line 23, col 10) to (line 25, col 8) -23 > throw (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (212 to 228) SpanInfo: {"start":237,"length":23} + ~~~~~~~~~~~~~~~~~~~ => Pos: (210 to 228) SpanInfo: {"start":237,"length":23} >new Error(x.toString()) >:=> (line 24, col 8) to (line 24, col 31) -------------------------------- 24 > new Error(x.toString()); - ~~~~~~~~~~~~~~~~~~ => Pos: (229 to 246) SpanInfo: {"start":237,"length":23} - >new Error(x.toString()) - >:=> (line 24, col 8) to (line 24, col 31) -24 > new Error(x.toString()); - - ~~~~~~~~~~~~ => Pos: (247 to 258) SpanInfo: {"start":247,"length":12} - >x.toString() - >:=> (line 24, col 18) to (line 24, col 30) -24 > new Error(x.toString()); - - ~~~ => Pos: (259 to 261) SpanInfo: {"start":237,"length":23} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (229 to 261) SpanInfo: {"start":237,"length":23} >new Error(x.toString()) >:=> (line 24, col 8) to (line 24, col 31) -------------------------------- 25 > })(); - ~~~~~ => Pos: (262 to 266) SpanInfo: {"start":266,"length":1} + ~~~~~~~~~~ => Pos: (262 to 271) SpanInfo: {"start":266,"length":1} >} >:=> (line 25, col 4) to (line 25, col 5) -25 > })(); - - ~~~~~ => Pos: (267 to 271) SpanInfo: {"start":211,"length":59} - >(function foo() { - > new Error(x.toString()); - > })() - >:=> (line 23, col 10) to (line 25, col 8) -------------------------------- 26 >} diff --git a/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline index c04ddb8503b..9a15f782081 100644 --- a/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline +++ b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline @@ -14,28 +14,13 @@ -------------------------------- 3 >var a = new Greeter(); - ~~~~~~~ => Pos: (18 to 24) SpanInfo: {"start":18,"length":30} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 49) SpanInfo: {"start":18,"length":30} >var a = new Greeter() >:=> (line 3, col 0) to (line 3, col 30) -3 >var a = new Greeter(); - - ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (25 to 49) SpanInfo: {"start":35,"length":13} - >new Greeter() - >:=> (line 3, col 17) to (line 3, col 30) -------------------------------- 4 >a = ( new Greeter()); - ~~~~~ => Pos: (50 to 54) SpanInfo: {"start":50,"length":29} - >a = ( new Greeter()) - >:=> (line 4, col 0) to (line 4, col 29) -4 >a = ( new Greeter()); - - ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (55 to 77) SpanInfo: {"start":65,"length":13} - >new Greeter() - >:=> (line 4, col 15) to (line 4, col 28) -4 >a = ( new Greeter()); - - ~~~ => Pos: (78 to 80) SpanInfo: {"start":50,"length":29} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 80) SpanInfo: {"start":50,"length":29} >a = ( new Greeter()) >:=> (line 4, col 0) to (line 4, col 29) -------------------------------- @@ -48,35 +33,17 @@ >:=> (line 5, col 0) to (line 7, col 4) 5 >a = (function foo() { - ~~~~~~~~~~~ => Pos: (84 to 94) SpanInfo: {"start":94,"length":48} - >(function foo() { - > return new Greeter(); - >})() - >:=> (line 5, col 13) to (line 7, col 4) -5 >a = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (95 to 111) SpanInfo: {"start":116,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (84 to 111) SpanInfo: {"start":116,"length":20} >return new Greeter() >:=> (line 6, col 4) to (line 6, col 24) -------------------------------- 6 > return new Greeter(); - ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":116,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (112 to 137) SpanInfo: {"start":116,"length":20} >return new Greeter() >:=> (line 6, col 4) to (line 6, col 24) -6 > return new Greeter(); - - ~~~~~~~~~~~~~~~~ => Pos: (122 to 137) SpanInfo: {"start":123,"length":13} - >new Greeter() - >:=> (line 6, col 11) to (line 6, col 24) -------------------------------- 7 >})(); - ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + ~~~~~ => Pos: (138 to 142) SpanInfo: {"start":138,"length":1} >} - >:=> (line 7, col 0) to (line 7, col 1) -7 >})(); - ~~~~ => Pos: (139 to 142) SpanInfo: {"start":94,"length":48} - >(function foo() { - > return new Greeter(); - >})() - >:=> (line 5, col 13) to (line 7, col 4) \ No newline at end of file + >:=> (line 7, col 0) to (line 7, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_typealias.baseline b/tests/baselines/reference/bpSpan_typealias.baseline index 88e60b55e47..80e654ad2f3 100644 --- a/tests/baselines/reference/bpSpan_typealias.baseline +++ b/tests/baselines/reference/bpSpan_typealias.baseline @@ -52,25 +52,15 @@ -------------------------------- 8 > var x: a = new m.c(); - ~~~~~~~~~~~~~~ => Pos: (111 to 124) SpanInfo: {"start":115,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (111 to 136) SpanInfo: {"start":115,"length":20} >var x: a = new m.c() >:=> (line 8, col 4) to (line 8, col 24) -8 > var x: a = new m.c(); - - ~~~~~~~~~~~~ => Pos: (125 to 136) SpanInfo: {"start":126,"length":9} - >new m.c() - >:=> (line 8, col 15) to (line 8, col 24) -------------------------------- 9 > var y: b = new m.c(); - ~~~~~~~~~~~~~~ => Pos: (137 to 150) SpanInfo: {"start":141,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (137 to 162) SpanInfo: {"start":141,"length":20} >var y: b = new m.c() >:=> (line 9, col 4) to (line 9, col 24) -9 > var y: b = new m.c(); - - ~~~~~~~~~~~~ => Pos: (151 to 162) SpanInfo: {"start":152,"length":9} - >new m.c() - >:=> (line 9, col 15) to (line 9, col 24) -------------------------------- 10 >} ~ => Pos: (163 to 163) SpanInfo: {"start":163,"length":1} diff --git a/tests/baselines/reference/bpSpan_unaryExpressions.baseline b/tests/baselines/reference/bpSpan_unaryExpressions.baseline index 2ad1191cf95..e0433bf5fad 100644 --- a/tests/baselines/reference/bpSpan_unaryExpressions.baseline +++ b/tests/baselines/reference/bpSpan_unaryExpressions.baseline @@ -32,14 +32,7 @@ >:=> (line 5, col 0) to (line 7, col 4) 5 >typeof (function foo() { - ~~ => Pos: (40 to 41) SpanInfo: {"start":41,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 5, col 7) to (line 7, col 4) -5 >typeof (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (42 to 58) SpanInfo: {"start":63,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (40 to 58) SpanInfo: {"start":63,"length":8} >return y >:=> (line 6, col 4) to (line 6, col 12) -------------------------------- @@ -51,16 +44,9 @@ -------------------------------- 7 >})(); - ~ => Pos: (73 to 73) SpanInfo: {"start":73,"length":1} + ~~~~~~ => Pos: (73 to 78) SpanInfo: {"start":73,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) -7 >})(); - - ~~~~~ => Pos: (74 to 78) SpanInfo: {"start":41,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 5, col 7) to (line 7, col 4) -------------------------------- 8 >++x; diff --git a/tests/baselines/reference/bpSpan_while.baseline b/tests/baselines/reference/bpSpan_while.baseline index 91632b78009..464a736447a 100644 --- a/tests/baselines/reference/bpSpan_while.baseline +++ b/tests/baselines/reference/bpSpan_while.baseline @@ -79,14 +79,7 @@ >:=> (line 12, col 0) to (line 14, col 11) 12 >while ((function () { - ~ => Pos: (126 to 126) SpanInfo: {"start":126,"length":38} - >(function () { - > return 30 * a; - >})() - >:=> (line 12, col 7) to (line 14, col 4) -12 >while ((function () { - - ~~~~~~~~~~~~~~ => Pos: (127 to 140) SpanInfo: {"start":145,"length":13} + ~~~~~~~~~~~~~~~ => Pos: (126 to 140) SpanInfo: {"start":145,"length":13} >return 30 * a >:=> (line 13, col 4) to (line 13, col 17) -------------------------------- @@ -98,18 +91,11 @@ -------------------------------- 14 >})() !== a) { - ~ => Pos: (160 to 160) SpanInfo: {"start":160,"length":1} + ~~~~ => Pos: (160 to 163) SpanInfo: {"start":160,"length":1} >} >:=> (line 14, col 0) to (line 14, col 1) 14 >})() !== a) { - ~~~ => Pos: (161 to 163) SpanInfo: {"start":126,"length":38} - >(function () { - > return 30 * a; - >})() - >:=> (line 12, col 7) to (line 14, col 4) -14 >})() !== a) { - ~~~~~~~ => Pos: (164 to 170) SpanInfo: {"start":119,"length":52} >while ((function () { > return 30 * a; diff --git a/tests/baselines/reference/capturedLetConstInLoop1.types b/tests/baselines/reference/capturedLetConstInLoop1.types index c68f2422f43..bed3db55d7c 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.types +++ b/tests/baselines/reference/capturedLetConstInLoop1.types @@ -1,18 +1,18 @@ === tests/cases/compiler/capturedLetConstInLoop1.ts === //==== let for (let x in {}) { ->x : any +>x : string >{} : {} (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (let x of []) { @@ -216,18 +216,18 @@ for (let y = 0; y < 1; ++y) { //=========const for (const x in {}) { ->x : any +>x : string >{} : {} (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (const x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop1_ES6.types b/tests/baselines/reference/capturedLetConstInLoop1_ES6.types index 5e25e1f930d..47b12586684 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop1_ES6.types @@ -1,18 +1,18 @@ === tests/cases/compiler/capturedLetConstInLoop1_ES6.ts === //==== let for (let x in {}) { ->x : any +>x : string >{} : {} (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (let x of []) { @@ -216,18 +216,18 @@ for (let y = 0; y < 1; ++y) { //=========const for (const x in {}) { ->x : any +>x : string >{} : {} (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (const x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop2.types b/tests/baselines/reference/capturedLetConstInLoop2.types index 5108fc399ee..2872eb4c763 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2.types +++ b/tests/baselines/reference/capturedLetConstInLoop2.types @@ -37,7 +37,7 @@ function foo0_1(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] let a = arguments.length; @@ -47,17 +47,17 @@ function foo0_1(x) { >length : number (function() { return x + a }); ->(function() { return x + a }) : () => any ->function() { return x + a } : () => any ->x + a : any ->x : any +>(function() { return x + a }) : () => string +>function() { return x + a } : () => string +>x + a : string +>x : string >a : number (() => x + a); ->(() => x + a) : () => any ->() => x + a : () => any ->x + a : any ->x : any +>(() => x + a) : () => string +>() => x + a : () => string +>x + a : string +>x : string >a : number } } @@ -400,7 +400,7 @@ function foo0_1_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] const a = arguments.length; @@ -410,17 +410,17 @@ function foo0_1_c(x) { >length : number (function() { return x + a }); ->(function() { return x + a }) : () => any ->function() { return x + a } : () => any ->x + a : any ->x : any +>(function() { return x + a }) : () => string +>function() { return x + a } : () => string +>x + a : string +>x : string >a : number (() => x + a); ->(() => x + a) : () => any ->() => x + a : () => any ->x + a : any ->x : any +>(() => x + a) : () => string +>() => x + a : () => string +>x + a : string +>x : string >a : number } } diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.types b/tests/baselines/reference/capturedLetConstInLoop2_ES6.types index 9fea265da44..8a4d9c82628 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.types @@ -36,7 +36,7 @@ function foo0_1(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] let a = arguments.length; @@ -46,17 +46,17 @@ function foo0_1(x) { >length : number (function() { return x + a }); ->(function() { return x + a }) : () => any ->function() { return x + a } : () => any ->x + a : any ->x : any +>(function() { return x + a }) : () => string +>function() { return x + a } : () => string +>x + a : string +>x : string >a : number (() => x + a); ->(() => x + a) : () => any ->() => x + a : () => any ->x + a : any ->x : any +>(() => x + a) : () => string +>() => x + a : () => string +>x + a : string +>x : string >a : number } } @@ -399,7 +399,7 @@ function foo0_1_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] const a = arguments.length; @@ -409,17 +409,17 @@ function foo0_1_c(x) { >length : number (function() { return x + a }); ->(function() { return x + a }) : () => any ->function() { return x + a } : () => any ->x + a : any ->x : any +>(function() { return x + a }) : () => string +>function() { return x + a } : () => string +>x + a : string +>x : string >a : number (() => x + a); ->(() => x + a) : () => any ->() => x + a : () => any ->x + a : any ->x : any +>(() => x + a) : () => string +>() => x + a : () => string +>x + a : string +>x : string >a : number } } diff --git a/tests/baselines/reference/capturedLetConstInLoop3.types b/tests/baselines/reference/capturedLetConstInLoop3.types index 51646f5a98b..9c0c188b727 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3.types +++ b/tests/baselines/reference/capturedLetConstInLoop3.types @@ -42,32 +42,32 @@ function foo0_1(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string } use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1(x) { @@ -438,32 +438,32 @@ function foo0_1_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string } use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1_c(x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop3_ES6.types b/tests/baselines/reference/capturedLetConstInLoop3_ES6.types index cc4b57ff9ea..03377d913c9 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop3_ES6.types @@ -43,32 +43,32 @@ function foo0_1(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string } use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1(x) { @@ -439,32 +439,32 @@ function foo0_1_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string } use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1_c(x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop4.types b/tests/baselines/reference/capturedLetConstInLoop4.types index f19e5d109b8..1bc928cefe4 100644 --- a/tests/baselines/reference/capturedLetConstInLoop4.types +++ b/tests/baselines/reference/capturedLetConstInLoop4.types @@ -2,20 +2,20 @@ //======let export function exportedFoo() { ->exportedFoo : () => any +>exportedFoo : () => string return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 : any ->v0 + v00 + v1 + v2 + v3 + v4 : any ->v0 + v00 + v1 + v2 + v3 : any ->v0 + v00 + v1 + v2 : any ->v0 + v00 + v1 : any ->v0 + v00 : any +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 : string +>v0 + v00 + v1 + v2 + v3 + v4 : string +>v0 + v00 + v1 + v2 + v3 : string +>v0 + v00 + v1 + v2 : string +>v0 + v00 + v1 : string +>v0 + v00 : string >v0 : any ->v00 : any +>v00 : string >v1 : number >v2 : any >v3 : any @@ -48,24 +48,24 @@ for (let x of []) { } for (let x in []) { ->x : any +>x : string >[] : undefined[] var v00 = x; ->v00 : any ->x : any +>v00 : string +>x : string (function() { return x + v00}); ->(function() { return x + v00}) : () => any ->function() { return x + v00} : () => any ->x + v00 : any ->x : any ->v00 : any +>(function() { return x + v00}) : () => string +>function() { return x + v00} : () => string +>x + v00 : string +>x : string +>v00 : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (let x = 0; x < 1; ++x) { @@ -302,20 +302,20 @@ for (let y = 0; y < 1; ++y) { //======const export function exportedFoo2() { ->exportedFoo2 : () => any +>exportedFoo2 : () => string return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c : any ->v0_c + v00_c + v1_c + v2_c : any ->v0_c + v00_c + v1_c : any ->v0_c + v00_c : any +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c : string +>v0_c + v00_c + v1_c + v2_c : string +>v0_c + v00_c + v1_c : string +>v0_c + v00_c : string >v0_c : any ->v00_c : any +>v00_c : string >v1_c : number >v2_c : number >v3_c : number @@ -348,24 +348,24 @@ for (const x of []) { } for (const x in []) { ->x : any +>x : string >[] : undefined[] var v00_c = x; ->v00_c : any ->x : any +>v00_c : string +>x : string (function() { return x + v00}); ->(function() { return x + v00}) : () => any ->function() { return x + v00} : () => any ->x + v00 : any ->x : any ->v00 : any +>(function() { return x + v00}) : () => string +>function() { return x + v00} : () => string +>x + v00 : string +>x : string +>v00 : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (const x = 0; x < 1;) { diff --git a/tests/baselines/reference/capturedLetConstInLoop4_ES6.types b/tests/baselines/reference/capturedLetConstInLoop4_ES6.types index fd5f6dadf62..cf44c7b6981 100644 --- a/tests/baselines/reference/capturedLetConstInLoop4_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop4_ES6.types @@ -2,20 +2,20 @@ //======let export function exportedFoo() { ->exportedFoo : () => any +>exportedFoo : () => string return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any ->v0 + v00 + v1 + v2 + v3 + v4 + v5 : any ->v0 + v00 + v1 + v2 + v3 + v4 : any ->v0 + v00 + v1 + v2 + v3 : any ->v0 + v00 + v1 + v2 : any ->v0 + v00 + v1 : any ->v0 + v00 : any +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : string +>v0 + v00 + v1 + v2 + v3 + v4 + v5 : string +>v0 + v00 + v1 + v2 + v3 + v4 : string +>v0 + v00 + v1 + v2 + v3 : string +>v0 + v00 + v1 + v2 : string +>v0 + v00 + v1 : string +>v0 + v00 : string >v0 : any ->v00 : any +>v00 : string >v1 : number >v2 : any >v3 : any @@ -48,24 +48,24 @@ for (let x of []) { } for (let x in []) { ->x : any +>x : string >[] : undefined[] var v00 = x; ->v00 : any ->x : any +>v00 : string +>x : string (function() { return x + v00}); ->(function() { return x + v00}) : () => any ->function() { return x + v00} : () => any ->x + v00 : any ->x : any ->v00 : any +>(function() { return x + v00}) : () => string +>function() { return x + v00} : () => string +>x + v00 : string +>x : string +>v00 : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (let x = 0; x < 1; ++x) { @@ -302,20 +302,20 @@ for (let y = 0; y < 1; ++y) { //======const export function exportedFoo2() { ->exportedFoo2 : () => any +>exportedFoo2 : () => string return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any ->v0_c + v00_c + v1_c + v2_c + v3_c : any ->v0_c + v00_c + v1_c + v2_c : any ->v0_c + v00_c + v1_c : any ->v0_c + v00_c : any +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : string +>v0_c + v00_c + v1_c + v2_c + v3_c : string +>v0_c + v00_c + v1_c + v2_c : string +>v0_c + v00_c + v1_c : string +>v0_c + v00_c : string >v0_c : any ->v00_c : any +>v00_c : string >v1_c : number >v2_c : number >v3_c : number @@ -348,24 +348,24 @@ for (const x of []) { } for (const x in []) { ->x : any +>x : string >[] : undefined[] var v00_c = x; ->v00_c : any ->x : any +>v00_c : string +>x : string (function() { return x + v00}); ->(function() { return x + v00}) : () => any ->function() { return x + v00} : () => any ->x + v00 : any ->x : any ->v00 : any +>(function() { return x + v00}) : () => string +>function() { return x + v00} : () => string +>x + v00 : string +>x : string +>v00 : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string } for (const x = 0; x < 1;) { diff --git a/tests/baselines/reference/capturedLetConstInLoop5.js b/tests/baselines/reference/capturedLetConstInLoop5.js index d7d177a19b9..b73484cb430 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.js +++ b/tests/baselines/reference/capturedLetConstInLoop5.js @@ -20,7 +20,7 @@ function foo00(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -159,7 +159,7 @@ function foo00_c(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -303,7 +303,7 @@ function foo00(x) { v = x_2; (function () { return x_2 + v; }); (function () { return x_2 + v; }); - if (x_2 == 1) { + if (x_2 == "1") { return { value: void 0 }; } }; @@ -471,7 +471,7 @@ function foo00_c(x) { v = x_12; (function () { return x_12 + v; }); (function () { return x_12 + v; }); - if (x_12 == 1) { + if (x_12 == "1") { return { value: void 0 }; } }; diff --git a/tests/baselines/reference/capturedLetConstInLoop5.symbols b/tests/baselines/reference/capturedLetConstInLoop5.symbols index 2d514e8c88c..965379d3a11 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop5.symbols @@ -54,7 +54,7 @@ function foo00(x) { >x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12)) >v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12)) return; @@ -395,7 +395,7 @@ function foo00_c(x) { >x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14)) >v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14)) return; diff --git a/tests/baselines/reference/capturedLetConstInLoop5.types b/tests/baselines/reference/capturedLetConstInLoop5.types index 3654ffe5820..b7b4b880dc4 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.types +++ b/tests/baselines/reference/capturedLetConstInLoop5.types @@ -50,31 +50,31 @@ function foo00(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string return; } @@ -83,7 +83,7 @@ function foo00(x) { use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1(x) { @@ -525,31 +525,31 @@ function foo00_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string return; } @@ -558,7 +558,7 @@ function foo00_c(x) { use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1_c(x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.js b/tests/baselines/reference/capturedLetConstInLoop5_ES6.js index e5996bb3053..0f0624b8a8b 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.js @@ -21,7 +21,7 @@ function foo00(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -160,7 +160,7 @@ function foo00_c(x) { var v = x; (function() { return x + v }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -298,7 +298,7 @@ function foo00(x) { var v = x; (function () { return x + v; }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } @@ -416,7 +416,7 @@ function foo00_c(x) { var v = x; (function () { return x + v; }); (() => x + v); - if (x == 1) { + if (x == "1") { return; } } diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols index b3d338ad60e..5b40cb44599 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols @@ -55,7 +55,7 @@ function foo00(x) { >x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) >v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) return; @@ -396,7 +396,7 @@ function foo00_c(x) { >x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) >v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) return; diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types index 8db8ae25e9b..855bbfc6308 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types @@ -51,31 +51,31 @@ function foo00(x) { >x : any for (let x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string return; } @@ -84,7 +84,7 @@ function foo00(x) { use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1(x) { @@ -526,31 +526,31 @@ function foo00_c(x) { >x : any for (const x in []) { ->x : any +>x : string >[] : undefined[] var v = x; ->v : any ->x : any +>v : string +>x : string (function() { return x + v }); ->(function() { return x + v }) : () => any ->function() { return x + v } : () => any ->x + v : any ->x : any ->v : any +>(function() { return x + v }) : () => string +>function() { return x + v } : () => string +>x + v : string +>x : string +>v : string (() => x + v); ->(() => x + v) : () => any ->() => x + v : () => any ->x + v : any ->x : any ->v : any +>(() => x + v) : () => string +>() => x + v : () => string +>x + v : string +>x : string +>v : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string return; } @@ -559,7 +559,7 @@ function foo00_c(x) { use(v); >use(v) : any >use : (a: any) => any ->v : any +>v : string } function foo1_c(x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop6.js b/tests/baselines/reference/capturedLetConstInLoop6.js index 187d9f10ad3..ca3b634ef18 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.js +++ b/tests/baselines/reference/capturedLetConstInLoop6.js @@ -14,10 +14,10 @@ for (let x of []) { for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -133,10 +133,10 @@ for (const x of []) { for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -259,10 +259,10 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) { var _loop_2 = function(x) { (function () { return x; }); (function () { return x; }); - if (x == 1) { + if (x == "1") { return "break"; } - if (x == 2) { + if (x == "2") { return "continue"; } }; @@ -417,10 +417,10 @@ for (var _b = 0, _c = []; _b < _c.length; _b++) { var _loop_12 = function(x) { (function () { return x; }); (function () { return x; }); - if (x == 1) { + if (x == "1") { return "break"; } - if (x == 2) { + if (x == "2") { return "continue"; } }; diff --git a/tests/baselines/reference/capturedLetConstInLoop6.symbols b/tests/baselines/reference/capturedLetConstInLoop6.symbols index 8d8e6d6ce59..872bc3a4727 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop6.symbols @@ -30,12 +30,12 @@ for (let x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8)) break; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8)) continue; @@ -272,12 +272,12 @@ for (const x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10)) break; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10)) continue; diff --git a/tests/baselines/reference/capturedLetConstInLoop6.types b/tests/baselines/reference/capturedLetConstInLoop6.types index 6c31bdef31b..f2b1103305f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6.types @@ -31,30 +31,30 @@ for (let x of []) { } for (let x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } @@ -396,30 +396,30 @@ for (const x of []) { } for (const x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.js b/tests/baselines/reference/capturedLetConstInLoop6_ES6.js index 924f55b6915..33d64e88927 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.js @@ -14,10 +14,10 @@ for (let x of []) { for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -133,10 +133,10 @@ for (const x of []) { for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -253,10 +253,10 @@ for (let x of []) { for (let x in []) { (function () { return x; }); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } @@ -360,10 +360,10 @@ for (const x of []) { for (const x in []) { (function () { return x; }); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 2) { + if (x == "2") { continue; } } diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop6_ES6.symbols index acd557e4714..63cb26c4300 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.symbols @@ -30,12 +30,12 @@ for (let x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8)) break; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8)) continue; @@ -272,12 +272,12 @@ for (const x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10)) break; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10)) continue; diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types index 87f21709120..cfd55a63aaa 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types @@ -31,30 +31,30 @@ for (let x of []) { } for (let x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } @@ -396,30 +396,30 @@ for (const x of []) { } for (const x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } diff --git a/tests/baselines/reference/capturedLetConstInLoop7.js b/tests/baselines/reference/capturedLetConstInLoop7.js index ce6769d2b1a..6ec4ec1df44 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.js +++ b/tests/baselines/reference/capturedLetConstInLoop7.js @@ -22,16 +22,16 @@ l00: for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00; } } @@ -210,16 +210,16 @@ l00_c: for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00_c; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00_c; } } @@ -406,16 +406,16 @@ l0: for (var _i = 0, _a = []; _i < _a.length; _i++) { var _loop_2 = function(x) { (function () { return x; }); (function () { return x; }); - if (x == 1) { + if (x == "1") { return "break"; } - if (x == 1) { + if (x == "1") { return "break-l00"; } - if (x == 2) { + if (x == "2") { return "continue"; } - if (x == 2) { + if (x == "2") { return "continue-l00"; } }; @@ -664,16 +664,16 @@ l0_c: for (var _b = 0, _c = []; _b < _c.length; _b++) { var _loop_12 = function(x) { (function () { return x; }); (function () { return x; }); - if (x == 1) { + if (x == "1") { return "break"; } - if (x == 1) { + if (x == "1") { return "break-l00_c"; } - if (x == 2) { + if (x == "2") { return "continue"; } - if (x == 2) { + if (x == "2") { return "continue-l00_c"; } }; diff --git a/tests/baselines/reference/capturedLetConstInLoop7.symbols b/tests/baselines/reference/capturedLetConstInLoop7.symbols index 2aa5ec2cd38..0f4395a6d68 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop7.symbols @@ -42,22 +42,22 @@ for (let x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8)) break; } - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8)) break l00; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8)) continue; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8)) continue l00; @@ -393,22 +393,22 @@ for (const x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10)) break; } - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10)) break l00_c; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10)) continue; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10)) continue l00_c; diff --git a/tests/baselines/reference/capturedLetConstInLoop7.types b/tests/baselines/reference/capturedLetConstInLoop7.types index 280985eae0f..29ea34e39a1 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.types +++ b/tests/baselines/reference/capturedLetConstInLoop7.types @@ -53,45 +53,45 @@ l00: >l00 : any for (let x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break l00; >l00 : any } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue l00; >l00 : any @@ -607,45 +607,45 @@ l00_c: >l00_c : any for (const x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break l00_c; >l00_c : any } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue l00_c; >l00_c : any diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.js b/tests/baselines/reference/capturedLetConstInLoop7_ES6.js index 4a2db640081..13c69a88392 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.js @@ -22,16 +22,16 @@ l00: for (let x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00; } } @@ -210,16 +210,16 @@ l00_c: for (const x in []) { (function() { return x}); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00_c; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00_c; } } @@ -396,16 +396,16 @@ l0: for (let x of []) { l00: for (let x in []) { (function () { return x; }); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00; } } @@ -563,16 +563,16 @@ l0_c: for (const x of []) { l00_c: for (const x in []) { (function () { return x; }); (() => x); - if (x == 1) { + if (x == "1") { break; } - if (x == 1) { + if (x == "1") { break l00_c; } - if (x == 2) { + if (x == "2") { continue; } - if (x == 2) { + if (x == "2") { continue l00_c; } } diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop7_ES6.symbols index 51131f421ba..a817377834b 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.symbols @@ -42,22 +42,22 @@ for (let x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8)) break; } - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8)) break l00; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8)) continue; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8)) continue l00; @@ -393,22 +393,22 @@ for (const x in []) { (() => x); >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10)) - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10)) break; } - if (x == 1) { + if (x == "1") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10)) break l00_c; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10)) continue; } - if (x == 2) { + if (x == "2") { >x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10)) continue l00_c; diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types index 56573fb4927..c72afb41942 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types @@ -53,45 +53,45 @@ l00: >l00 : any for (let x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break l00; >l00 : any } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue l00; >l00 : any @@ -607,45 +607,45 @@ l00_c: >l00_c : any for (const x in []) { ->x : any +>x : string >[] : undefined[] (function() { return x}); ->(function() { return x}) : () => any ->function() { return x} : () => any ->x : any +>(function() { return x}) : () => string +>function() { return x} : () => string +>x : string (() => x); ->(() => x) : () => any ->() => x : () => any ->x : any +>(() => x) : () => string +>() => x : () => string +>x : string - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break; } - if (x == 1) { ->x == 1 : boolean ->x : any ->1 : number + if (x == "1") { +>x == "1" : boolean +>x : string +>"1" : string break l00_c; >l00_c : any } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue; } - if (x == 2) { ->x == 2 : boolean ->x : any ->2 : number + if (x == "2") { +>x == "2" : boolean +>x : string +>"2" : string continue l00_c; >l00_c : any diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.js b/tests/baselines/reference/contextuallyTypeCommaOperator01.js new file mode 100644 index 00000000000..0da3ac91000 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.js @@ -0,0 +1,9 @@ +//// [contextuallyTypeCommaOperator01.ts] + +let x: (a: string) => string; + +x = (100, a => a); + +//// [contextuallyTypeCommaOperator01.js] +var x; +x = (100, function (a) { return a; }); diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols new file mode 100644 index 00000000000..c07fd28ae77 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts === + +let x: (a: string) => string; +>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 1, 8)) + +x = (100, a => a); +>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9)) + diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.types b/tests/baselines/reference/contextuallyTypeCommaOperator01.types new file mode 100644 index 00000000000..c3b7b700d64 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts === + +let x: (a: string) => string; +>x : (a: string) => string +>a : string + +x = (100, a => a); +>x = (100, a => a) : (a: string) => string +>x : (a: string) => string +>(100, a => a) : (a: string) => string +>100, a => a : (a: string) => string +>100 : number +>a => a : (a: string) => string +>a : string +>a : string + diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt new file mode 100644 index 00000000000..3214f7e5025 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(4,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(5,11): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (2 errors) ==== + + let x: (a: string) => string; + + x = (100, a => { + ~ +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + const b: number = a; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + return b; + }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.js b/tests/baselines/reference/contextuallyTypeCommaOperator02.js new file mode 100644 index 00000000000..0f8d67dd0ef --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.js @@ -0,0 +1,15 @@ +//// [contextuallyTypeCommaOperator02.ts] + +let x: (a: string) => string; + +x = (100, a => { + const b: number = a; + return b; +}); + +//// [contextuallyTypeCommaOperator02.js] +var x; +x = (100, function (a) { + var b = a; + return b; +}); diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator03.errors.txt b/tests/baselines/reference/contextuallyTypeCommaOperator03.errors.txt new file mode 100644 index 00000000000..715b7cf70ea --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator03.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts(4,6): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts (1 errors) ==== + + let x: (a: string) => string; + + x = (a => a, b => b); + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator03.js b/tests/baselines/reference/contextuallyTypeCommaOperator03.js new file mode 100644 index 00000000000..c4754f28c41 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator03.js @@ -0,0 +1,9 @@ +//// [contextuallyTypeCommaOperator03.ts] + +let x: (a: string) => string; + +x = (a => a, b => b); + +//// [contextuallyTypeCommaOperator03.js] +var x; +x = (function (a) { return a; }, function (b) { return b; }); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js new file mode 100644 index 00000000000..b8b1f0d1e00 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js @@ -0,0 +1,11 @@ +//// [contextuallyTypeLogicalAnd01.ts] + +let x: (a: string) => string; +let y = true; + +x = y && (a => a); + +//// [contextuallyTypeLogicalAnd01.js] +var x; +var y = true; +x = y && (function (a) { return a; }); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols new file mode 100644 index 00000000000..4d69b43e669 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts === + +let x: (a: string) => string; +>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 1, 8)) + +let y = true; +>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3)) + +x = y && (a => a); +>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) +>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10)) + diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types new file mode 100644 index 00000000000..a405888c8a9 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts === + +let x: (a: string) => string; +>x : (a: string) => string +>a : string + +let y = true; +>y : boolean +>true : boolean + +x = y && (a => a); +>x = y && (a => a) : (a: string) => string +>x : (a: string) => string +>y && (a => a) : (a: string) => string +>y : boolean +>(a => a) : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt new file mode 100644 index 00000000000..7452d333d88 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(5,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(6,11): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (2 errors) ==== + + let x: (a: string) => string; + let y = true; + + x = y && (a => { + ~ +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + const b: number = a; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + return b; + }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js new file mode 100644 index 00000000000..6dc1fa5b26a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js @@ -0,0 +1,17 @@ +//// [contextuallyTypeLogicalAnd02.ts] + +let x: (a: string) => string; +let y = true; + +x = y && (a => { + const b: number = a; + return b; +}); + +//// [contextuallyTypeLogicalAnd02.js] +var x; +var y = true; +x = y && (function (a) { + var b = a; + return b; +}); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd03.errors.txt b/tests/baselines/reference/contextuallyTypeLogicalAnd03.errors.txt new file mode 100644 index 00000000000..1430be00427 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd03.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts(5,6): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts (1 errors) ==== + + let x: (a: string) => string; + let y = true; + + x = (a => a) && (b => b); + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd03.js b/tests/baselines/reference/contextuallyTypeLogicalAnd03.js new file mode 100644 index 00000000000..cbf1b3a319a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd03.js @@ -0,0 +1,11 @@ +//// [contextuallyTypeLogicalAnd03.ts] + +let x: (a: string) => string; +let y = true; + +x = (a => a) && (b => b); + +//// [contextuallyTypeLogicalAnd03.js] +var x; +var y = true; +x = (function (a) { return a; }) && (function (b) { return b; }); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt new file mode 100644 index 00000000000..b5d4e01b677 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(13,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. + Type '"f"' is not assignable to type '"C"'. +tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(14,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. + Type '"f"' is not assignable to type '"C"'. + + +==== tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx (2 errors) ==== + + namespace JSX { + interface IntrinsicElements { + span: {}; + } + } + + const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo}; + + ; + ; + + ; + ~~~~~~~~~ +!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. +!!! error TS2322: Type '"f"' is not assignable to type '"C"'. + ; + ~~~~~~~ +!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. +!!! error TS2322: Type '"f"' is not assignable to type '"C"'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js new file mode 100644 index 00000000000..c21247c2835 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js @@ -0,0 +1,30 @@ +//// [contextuallyTypedStringLiteralsInJsxAttributes01.tsx] + +namespace JSX { + interface IntrinsicElements { + span: {}; + } +} + +const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo}; + +; +; + +; +; + +//// [contextuallyTypedStringLiteralsInJsxAttributes01.jsx] +var FooComponent = function (props) { return {props.foo}; }; +; +; +; +; + + +//// [contextuallyTypedStringLiteralsInJsxAttributes01.d.ts] +declare namespace JSX { +} +declare const FooComponent: (props: { + foo: "A" | "B" | "C"; +}) => any; diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types index 824abcc76be..4f539835ada 100644 --- a/tests/baselines/reference/downlevelLetConst17.types +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -139,23 +139,23 @@ do { >true : boolean for (let x in []) { ->x : any +>x : string >[] : undefined[] use(x); >use(x) : any >use : (a: any) => any ->x : any +>x : string } for (const x in []) { ->x : any +>x : string >[] : undefined[] use(x); >use(x) : any >use : (a: any) => any ->x : any +>x : string } for (const x of []) { diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index 0a49c71e29b..90c5974cd2b 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -2,10 +2,12 @@ tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected. tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'. tests/cases/compiler/duplicateLocalVariable1.ts(12,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file. -tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. -==== tests/cases/compiler/duplicateLocalVariable1.ts (5 errors) ==== +==== tests/cases/compiler/duplicateLocalVariable1.ts (7 errors) ==== / /@module: commonjs ~ @@ -202,7 +204,11 @@ tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequen var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); } var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index 0fbe0018bf8..5e89cc422cc 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -1,7 +1,9 @@ -tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. -==== tests/cases/compiler/duplicateLocalVariable2.ts (1 errors) ==== +==== tests/cases/compiler/duplicateLocalVariable2.ts (3 errors) ==== export class TestCase { constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { } @@ -30,7 +32,11 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); } var expected = [0xEF]; diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt b/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt new file mode 100644 index 00000000000..6df9c6de1ef --- /dev/null +++ b/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/b.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/a.d.ts (0 errors) ==== + + declare class X { } + +==== tests/cases/compiler/b.ts (1 errors) ==== + export {X}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export function f() { + var x: X; + return x; + } + \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.symbols b/tests/baselines/reference/exportSpecifierForAGlobal.symbols deleted file mode 100644 index b38fc7be270..00000000000 --- a/tests/baselines/reference/exportSpecifierForAGlobal.symbols +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/a.d.ts === - -declare class X { } ->X : Symbol(X, Decl(a.d.ts, 0, 0)) - -=== tests/cases/compiler/b.ts === -export {X}; ->X : Symbol(X, Decl(b.ts, 0, 8)) - -export function f() { ->f : Symbol(f, Decl(b.ts, 0, 11)) - - var x: X; ->x : Symbol(x, Decl(b.ts, 2, 7)) ->X : Symbol(X, Decl(a.d.ts, 0, 0)) - - return x; ->x : Symbol(x, Decl(b.ts, 2, 7)) -} - diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.types b/tests/baselines/reference/exportSpecifierForAGlobal.types deleted file mode 100644 index e3d728ad0d0..00000000000 --- a/tests/baselines/reference/exportSpecifierForAGlobal.types +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/a.d.ts === - -declare class X { } ->X : X - -=== tests/cases/compiler/b.ts === -export {X}; ->X : typeof X - -export function f() { ->f : () => X - - var x: X; ->x : X ->X : X - - return x; ->x : X -} - diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt new file mode 100644 index 00000000000..7eb095b05f0 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts(3,14): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts (1 errors) ==== + declare module X { export interface bar { } } + declare module "m" { + export { X }; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export function foo(): X.bar; + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols deleted file mode 100644 index 16abde86d32..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === -declare module X { export interface bar { } } ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) ->bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) - -declare module "m" { - export { X }; ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 12)) - - export function foo(): X.bar; ->foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 17)) ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) ->bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) -} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types deleted file mode 100644 index be03554a1b0..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === -declare module X { export interface bar { } } ->X : any ->bar : bar - -declare module "m" { - export { X }; ->X : any - - export function foo(): X.bar; ->foo : () => X.bar ->X : any ->bar : X.bar -} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt new file mode 100644 index 00000000000..00118010785 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(1,10): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== + declare module X { export interface bar { } } + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts (1 errors) ==== + export { X }; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export declare function foo(): X.bar; \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols deleted file mode 100644 index 9a57645b1cb..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === -declare module X { export interface bar { } } ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) ->bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) - -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === -export { X }; ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 8)) - -export declare function foo(): X.bar; ->foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 13)) ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) ->bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) - diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types deleted file mode 100644 index fa59948c116..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === -declare module X { export interface bar { } } ->X : any ->bar : bar - -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === -export { X }; ->X : any - -export declare function foo(): X.bar; ->foo : () => X.bar ->X : any ->bar : X.bar - diff --git a/tests/baselines/reference/for-inStatementsArray.js b/tests/baselines/reference/for-inStatementsArray.js new file mode 100644 index 00000000000..e3d331e2d8c --- /dev/null +++ b/tests/baselines/reference/for-inStatementsArray.js @@ -0,0 +1,76 @@ +//// [for-inStatementsArray.ts] +let a: Date[]; +let b: boolean[]; + +for (let x in a) { + let a1 = a[x]; + let a2 = a[(x)]; + let a3 = a[+x]; + let b1 = b[x]; + let b2 = b[(x)]; + let b3 = b[+x]; +} + +for (let x in a) { + for (let y in a) { + for (let z in a) { + let a1 = a[x]; + let a2 = a[y]; + let a3 = a[z]; + } + } +} + +let i: string; +let j: string; +for (i in a) { + for (j in b) { + let a1 = a[i]; + let a2 = a[j]; + } +} + +var s: string; +for (var s in a) { + let a1 = a[s]; +} +for (s in a) { + let a1 = a[s]; +} + + +//// [for-inStatementsArray.js] +var a; +var b; +for (var x in a) { + var a1 = a[x]; + var a2 = a[(x)]; + var a3 = a[+x]; + var b1 = b[x]; + var b2 = b[(x)]; + var b3 = b[+x]; +} +for (var x in a) { + for (var y in a) { + for (var z in a) { + var a1 = a[x]; + var a2 = a[y]; + var a3 = a[z]; + } + } +} +var i; +var j; +for (i in a) { + for (j in b) { + var a1 = a[i]; + var a2 = a[j]; + } +} +var s; +for (var s in a) { + var a1 = a[s]; +} +for (s in a) { + var a1 = a[s]; +} diff --git a/tests/baselines/reference/for-inStatementsArray.symbols b/tests/baselines/reference/for-inStatementsArray.symbols new file mode 100644 index 00000000000..5b6ea9385cd --- /dev/null +++ b/tests/baselines/reference/for-inStatementsArray.symbols @@ -0,0 +1,121 @@ +=== tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts === +let a: Date[]; +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +let b: boolean[]; +>b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) + +for (let x in a) { +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + let a1 = a[x]; +>a1 : Symbol(a1, Decl(for-inStatementsArray.ts, 4, 7)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) + + let a2 = a[(x)]; +>a2 : Symbol(a2, Decl(for-inStatementsArray.ts, 5, 7)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) + + let a3 = a[+x]; +>a3 : Symbol(a3, Decl(for-inStatementsArray.ts, 6, 7)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) + + let b1 = b[x]; +>b1 : Symbol(b1, Decl(for-inStatementsArray.ts, 7, 7)) +>b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) + + let b2 = b[(x)]; +>b2 : Symbol(b2, Decl(for-inStatementsArray.ts, 8, 7)) +>b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) + + let b3 = b[+x]; +>b3 : Symbol(b3, Decl(for-inStatementsArray.ts, 9, 7)) +>b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 3, 8)) +} + +for (let x in a) { +>x : Symbol(x, Decl(for-inStatementsArray.ts, 12, 8)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + for (let y in a) { +>y : Symbol(y, Decl(for-inStatementsArray.ts, 13, 12)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + for (let z in a) { +>z : Symbol(z, Decl(for-inStatementsArray.ts, 14, 16)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + let a1 = a[x]; +>a1 : Symbol(a1, Decl(for-inStatementsArray.ts, 15, 15)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>x : Symbol(x, Decl(for-inStatementsArray.ts, 12, 8)) + + let a2 = a[y]; +>a2 : Symbol(a2, Decl(for-inStatementsArray.ts, 16, 15)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>y : Symbol(y, Decl(for-inStatementsArray.ts, 13, 12)) + + let a3 = a[z]; +>a3 : Symbol(a3, Decl(for-inStatementsArray.ts, 17, 15)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>z : Symbol(z, Decl(for-inStatementsArray.ts, 14, 16)) + } + } +} + +let i: string; +>i : Symbol(i, Decl(for-inStatementsArray.ts, 22, 3)) + +let j: string; +>j : Symbol(j, Decl(for-inStatementsArray.ts, 23, 3)) + +for (i in a) { +>i : Symbol(i, Decl(for-inStatementsArray.ts, 22, 3)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + for (j in b) { +>j : Symbol(j, Decl(for-inStatementsArray.ts, 23, 3)) +>b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) + + let a1 = a[i]; +>a1 : Symbol(a1, Decl(for-inStatementsArray.ts, 26, 11)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>i : Symbol(i, Decl(for-inStatementsArray.ts, 22, 3)) + + let a2 = a[j]; +>a2 : Symbol(a2, Decl(for-inStatementsArray.ts, 27, 11)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>j : Symbol(j, Decl(for-inStatementsArray.ts, 23, 3)) + } +} + +var s: string; +>s : Symbol(s, Decl(for-inStatementsArray.ts, 31, 3), Decl(for-inStatementsArray.ts, 32, 8)) + +for (var s in a) { +>s : Symbol(s, Decl(for-inStatementsArray.ts, 31, 3), Decl(for-inStatementsArray.ts, 32, 8)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + let a1 = a[s]; +>a1 : Symbol(a1, Decl(for-inStatementsArray.ts, 33, 7)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>s : Symbol(s, Decl(for-inStatementsArray.ts, 31, 3), Decl(for-inStatementsArray.ts, 32, 8)) +} +for (s in a) { +>s : Symbol(s, Decl(for-inStatementsArray.ts, 31, 3), Decl(for-inStatementsArray.ts, 32, 8)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) + + let a1 = a[s]; +>a1 : Symbol(a1, Decl(for-inStatementsArray.ts, 36, 7)) +>a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) +>s : Symbol(s, Decl(for-inStatementsArray.ts, 31, 3), Decl(for-inStatementsArray.ts, 32, 8)) +} + diff --git a/tests/baselines/reference/for-inStatementsArray.types b/tests/baselines/reference/for-inStatementsArray.types new file mode 100644 index 00000000000..048b2819ff7 --- /dev/null +++ b/tests/baselines/reference/for-inStatementsArray.types @@ -0,0 +1,138 @@ +=== tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts === +let a: Date[]; +>a : Date[] +>Date : Date + +let b: boolean[]; +>b : boolean[] + +for (let x in a) { +>x : string +>a : Date[] + + let a1 = a[x]; +>a1 : Date +>a[x] : Date +>a : Date[] +>x : string + + let a2 = a[(x)]; +>a2 : Date +>a[(x)] : Date +>a : Date[] +>(x) : string +>x : string + + let a3 = a[+x]; +>a3 : Date +>a[+x] : Date +>a : Date[] +>+x : number +>x : string + + let b1 = b[x]; +>b1 : boolean +>b[x] : boolean +>b : boolean[] +>x : string + + let b2 = b[(x)]; +>b2 : boolean +>b[(x)] : boolean +>b : boolean[] +>(x) : string +>x : string + + let b3 = b[+x]; +>b3 : boolean +>b[+x] : boolean +>b : boolean[] +>+x : number +>x : string +} + +for (let x in a) { +>x : string +>a : Date[] + + for (let y in a) { +>y : string +>a : Date[] + + for (let z in a) { +>z : string +>a : Date[] + + let a1 = a[x]; +>a1 : Date +>a[x] : Date +>a : Date[] +>x : string + + let a2 = a[y]; +>a2 : Date +>a[y] : Date +>a : Date[] +>y : string + + let a3 = a[z]; +>a3 : Date +>a[z] : Date +>a : Date[] +>z : string + } + } +} + +let i: string; +>i : string + +let j: string; +>j : string + +for (i in a) { +>i : string +>a : Date[] + + for (j in b) { +>j : string +>b : boolean[] + + let a1 = a[i]; +>a1 : Date +>a[i] : Date +>a : Date[] +>i : string + + let a2 = a[j]; +>a2 : Date +>a[j] : Date +>a : Date[] +>j : string + } +} + +var s: string; +>s : string + +for (var s in a) { +>s : string +>a : Date[] + + let a1 = a[s]; +>a1 : Date +>a[s] : Date +>a : Date[] +>s : string +} +for (s in a) { +>s : string +>a : Date[] + + let a1 = a[s]; +>a1 : Date +>a[s] : Date +>a : Date[] +>s : string +} + diff --git a/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt new file mode 100644 index 00000000000..6886d992bb2 --- /dev/null +++ b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt @@ -0,0 +1,40 @@ +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(5,14): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(6,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(7,9): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(9,16): error TS2339: Property 'unknownProperty' does not exist on type 'string'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(13,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(17,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'. + + +==== tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts (6 errors) ==== + + let a: Date[]; + + for (let x in a) { + let a1 = a[x + 1]; + ~~~~~~~~ +!!! error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. + let a2 = a[x - 1]; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + if (x === 1) { + ~~~~~~~ +!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'number'. + } + let a3 = x.unknownProperty; + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'unknownProperty' does not exist on type 'string'. + } + + var i: number; + for (var i in a ) { + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'. + } + + var j: any; + for (var j in a ) { + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsArrayErrors.js b/tests/baselines/reference/for-inStatementsArrayErrors.js new file mode 100644 index 00000000000..981a840695c --- /dev/null +++ b/tests/baselines/reference/for-inStatementsArrayErrors.js @@ -0,0 +1,36 @@ +//// [for-inStatementsArrayErrors.ts] + +let a: Date[]; + +for (let x in a) { + let a1 = a[x + 1]; + let a2 = a[x - 1]; + if (x === 1) { + } + let a3 = x.unknownProperty; +} + +var i: number; +for (var i in a ) { +} + +var j: any; +for (var j in a ) { +} + + +//// [for-inStatementsArrayErrors.js] +var a; +for (var x in a) { + var a1 = a[x + 1]; + var a2 = a[x - 1]; + if (x === 1) { + } + var a3 = x.unknownProperty; +} +var i; +for (var i in a) { +} +var j; +for (var j in a) { +} diff --git a/tests/baselines/reference/for-inStatementsDestructuring.errors.txt b/tests/baselines/reference/for-inStatementsDestructuring.errors.txt index e540b182cf5..e54f2c93272 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring.errors.txt +++ b/tests/baselines/reference/for-inStatementsDestructuring.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring.ts(1,10): error TS2461: Type 'string' is not an array type. tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring.ts(1,10): error TS2491: The left-hand side of a 'for...in' statement cannot be a destructuring pattern. -==== tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring.ts (1 errors) ==== +==== tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring.ts (2 errors) ==== for (var [a, b] in []) {} ~~~~~~ +!!! error TS2461: Type 'string' is not an array type. + ~~~~~~ !!! error TS2491: The left-hand side of a 'for...in' statement cannot be a destructuring pattern. \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsDestructuring2.errors.txt b/tests/baselines/reference/for-inStatementsDestructuring2.errors.txt index 56d2436d4c7..7589610a64e 100644 --- a/tests/baselines/reference/for-inStatementsDestructuring2.errors.txt +++ b/tests/baselines/reference/for-inStatementsDestructuring2.errors.txt @@ -1,7 +1,13 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts(1,10): error TS2491: The left-hand side of a 'for...in' statement cannot be a destructuring pattern. +tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts(1,11): error TS2459: Type 'string' has no property 'a' and no string index signature. +tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts(1,14): error TS2459: Type 'string' has no property 'b' and no string index signature. -==== tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts (1 errors) ==== +==== tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts (3 errors) ==== for (var {a, b} in []) {} ~~~~~~ -!!! error TS2491: The left-hand side of a 'for...in' statement cannot be a destructuring pattern. \ No newline at end of file +!!! error TS2491: The left-hand side of a 'for...in' statement cannot be a destructuring pattern. + ~ +!!! error TS2459: Type 'string' has no property 'a' and no string index signature. + ~ +!!! error TS2459: Type 'string' has no property 'b' and no string index signature. \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index 67e536a3069..00ab58ab94d 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -7,7 +7,6 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(1 tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(18,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(19,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(20,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(21,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(22,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(38,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. @@ -16,7 +15,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(5 tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(62,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -==== tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts (16 errors) ==== +==== tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts (15 errors) ==== var aNumber: number; for (aNumber in {}) { } ~~~~~~~ @@ -56,8 +55,6 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6 ~~~~~~~~~~ !!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in 42 ? d[x] : c[x]) { } - ~~~~~~~~~~~~~~~~ -!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in c[23]) { } ~~~~~ !!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. diff --git a/tests/baselines/reference/forInBreakStatements.types b/tests/baselines/reference/forInBreakStatements.types index 7714429e5af..4f4b9b3bef9 100644 --- a/tests/baselines/reference/forInBreakStatements.types +++ b/tests/baselines/reference/forInBreakStatements.types @@ -1,7 +1,7 @@ === tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === for(var x in {}) { ->x : any +>x : string >{} : {} break; @@ -11,7 +11,7 @@ ONE: >ONE : any for(var x in {}) { ->x : any +>x : string >{} : {} break ONE; @@ -25,7 +25,7 @@ THREE: >THREE : any for(var x in {}) { ->x : any +>x : string >{} : {} break THREE; @@ -36,14 +36,14 @@ FOUR: >FOUR : any for(var x in {}) { ->x : any +>x : string >{} : {} FIVE: >FIVE : any for(var x in {}) { ->x : any +>x : string >{} : {} break FOUR; @@ -52,14 +52,14 @@ for(var x in {}) { } for(var x in {}) { ->x : any +>x : string >{} : {} SIX: >SIX : any for(var x in {}) break SIX; ->x : any +>x : string >{} : {} >SIX : any } @@ -68,11 +68,11 @@ SEVEN: >SEVEN : any for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; ->x : any +>x : string >{} : {} ->x : any +>x : string >{} : {} ->x : any +>x : string >{} : {} >SEVEN : any @@ -80,7 +80,7 @@ EIGHT: >EIGHT : any for (var x in {}){ ->x : any +>x : string >{} : {} var fn = function () { } diff --git a/tests/baselines/reference/forInContinueStatements.types b/tests/baselines/reference/forInContinueStatements.types index 572fd16053d..e45cc798542 100644 --- a/tests/baselines/reference/forInContinueStatements.types +++ b/tests/baselines/reference/forInContinueStatements.types @@ -1,7 +1,7 @@ === tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === for(var x in {}) { ->x : any +>x : string >{} : {} continue; @@ -11,7 +11,7 @@ ONE: >ONE : any for(var x in {}) { ->x : any +>x : string >{} : {} continue ONE; @@ -25,7 +25,7 @@ THREE: >THREE : any for(var x in {}) { ->x : any +>x : string >{} : {} continue THREE; @@ -36,14 +36,14 @@ FOUR: >FOUR : any for(var x in {}) { ->x : any +>x : string >{} : {} FIVE: >FIVE : any for(var x in {}) { ->x : any +>x : string >{} : {} continue FOUR; @@ -52,14 +52,14 @@ for(var x in {}) { } for(var x in {}) { ->x : any +>x : string >{} : {} SIX: >SIX : any for(var x in {}) continue SIX; ->x : any +>x : string >{} : {} >SIX : any } @@ -68,11 +68,11 @@ SEVEN: >SEVEN : any for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; ->x : any +>x : string >{} : {} ->x : any +>x : string >{} : {} ->x : any +>x : string >{} : {} >SEVEN : any @@ -80,7 +80,7 @@ EIGHT: >EIGHT : any for (var x in {}){ ->x : any +>x : string >{} : {} var fn = function () { } diff --git a/tests/baselines/reference/forInStatement1.types b/tests/baselines/reference/forInStatement1.types index 8ccacc9e2f7..ed2e568a39e 100644 --- a/tests/baselines/reference/forInStatement1.types +++ b/tests/baselines/reference/forInStatement1.types @@ -3,6 +3,6 @@ var expr: any; >expr : any for (var a in expr) { ->a : any +>a : string >expr : any } diff --git a/tests/baselines/reference/forInStatement3.types b/tests/baselines/reference/forInStatement3.types index 1d3803065bd..d3767790ed2 100644 --- a/tests/baselines/reference/forInStatement3.types +++ b/tests/baselines/reference/forInStatement3.types @@ -8,7 +8,7 @@ function F() { >T : T for (var a in expr) { ->a : any +>a : string >expr : T } } diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index cd0dd2d2423..015d41b123f 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -12,7 +12,7 @@ try { } catch (error) { >2147024809 : number } for (var key in this) { } ->key : any +>key : string >this : any class C { @@ -22,7 +22,7 @@ class C { >temp : () => void for (var x in this) { ->x : any +>x : string >this : this } } diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt index 9f60f5b648f..2ec355088f7 100644 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find module 'externalModule'. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2661: Invalid module name in augmentation, module 'm1' cannot be found. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2662: Invalid module name in augmentation, module 'm1' cannot be found. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'. @@ -12,7 +12,7 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): er !!! error TS2307: Cannot find module 'externalModule'. declare module "m1" { ~~~~ -!!! error TS2661: Invalid module name in augmentation, module 'm1' cannot be found. +!!! error TS2662: Invalid module name in augmentation, module 'm1' cannot be found. import im2 = require("externalModule"); ~~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'externalModule'. diff --git a/tests/baselines/reference/inOperatorWithGeneric.types b/tests/baselines/reference/inOperatorWithGeneric.types index 2048e11082a..facdb7b50e2 100644 --- a/tests/baselines/reference/inOperatorWithGeneric.types +++ b/tests/baselines/reference/inOperatorWithGeneric.types @@ -9,7 +9,7 @@ class C { >T : T for (var p in x) { ->p : any +>p : string >x : T } } diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js.map b/tests/baselines/reference/isolatedModulesSourceMap.js.map index 3d86a0a7144..a6778476dda 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.js.map +++ b/tests/baselines/reference/isolatedModulesSourceMap.js.map @@ -1,2 +1,2 @@ //// [file1.js.map] -{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt index 7edf071f5d1..57f604125d3 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt +++ b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt @@ -10,24 +10,27 @@ sourceFile:file1.ts ------------------------------------------------------------------- >>>export var x = 1; 1 > -2 >^^^^^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -7 > ^^^^^^^^^^^^^^^-> +2 >^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^-> 1 > > -2 >export var -3 > x -4 > = -5 > 1 -6 > ; +2 >export +3 > var +4 > x +5 > = +6 > 1 +7 > ; 1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(1, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(1, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(1, 18) Source(2, 18) + SourceIndex(0) +2 >Emitted(1, 8) Source(2, 8) + SourceIndex(0) +3 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +4 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(1, 16) Source(2, 16) + SourceIndex(0) +6 >Emitted(1, 17) Source(2, 17) + SourceIndex(0) +7 >Emitted(1, 18) Source(2, 18) + SourceIndex(0) --- >>>//# sourceMappingURL=file1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsxAndTypeAssertion.errors.txt b/tests/baselines/reference/jsxAndTypeAssertion.errors.txt index aebabf15133..d0e9bcf145b 100644 --- a/tests/baselines/reference/jsxAndTypeAssertion.errors.txt +++ b/tests/baselines/reference/jsxAndTypeAssertion.errors.txt @@ -1,14 +1,20 @@ +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,6): error TS17008: JSX element 'any' has no corresponding closing tag. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,13): error TS2304: Cannot find name 'test'. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(7,17): error TS1005: '}' expected. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(9,6): error TS17008: JSX element 'any' has no corresponding closing tag. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(11,6): error TS17008: JSX element 'foo' has no corresponding closing tag. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(11,32): error TS1005: '}' expected. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(13,36): error TS1005: '}' expected. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(15,17): error TS17008: JSX element 'foo' has no corresponding closing tag. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(15,45): error TS1005: '}' expected. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,2): error TS17008: JSX element 'foo' has no corresponding closing tag. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,8): error TS17008: JSX element 'foo' has no corresponding closing tag. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(19,13): error TS17008: JSX element 'foo' has no corresponding closing tag. tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS1005: ':' expected. -tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expected corresponding JSX closing tag for 'any'. -tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expected corresponding JSX closing tag for 'foo'. +tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS1005: ' { test: }; + ~~~ +!!! error TS17008: JSX element 'any' has no corresponding closing tag. ~~~~ !!! error TS2304: Cannot find name 'test'. ~ !!! error TS1005: '}' expected. x = ; + ~~~ +!!! error TS17008: JSX element 'any' has no corresponding closing tag. x = hello {{}} ; + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. ~ !!! error TS1005: '}' expected. @@ -32,18 +44,24 @@ tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(22,1): error TS17002: Expect !!! error TS1005: '}' expected. x = {}}>hello{{}}; + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. ~ !!! error TS1005: '}' expected. x = x, x = ; {{/foo/.test(x) ? : }} + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. + ~~~ +!!! error TS17008: JSX element 'foo' has no corresponding closing tag. !!! error TS1005: ':' expected. -!!! error TS17002: Expected corresponding JSX closing tag for 'any'. - -!!! error TS17002: Expected corresponding JSX closing tag for 'foo'. \ No newline at end of file +!!! error TS1005: 'React : Symbol(React, Decl(jsxEmitAttributeWithPreserve.tsx, 1, 11)) +>foo : Symbol(unknown) >data : Symbol(unknown) diff --git a/tests/baselines/reference/jsxHash.symbols b/tests/baselines/reference/jsxHash.symbols index 8a6ad0849f0..ddba4832d2c 100644 --- a/tests/baselines/reference/jsxHash.symbols +++ b/tests/baselines/reference/jsxHash.symbols @@ -1,34 +1,68 @@ === tests/cases/compiler/jsxHash.tsx === var t02 = {0}#; >t02 : Symbol(t02, Decl(jsxHash.tsx, 0, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t03 = #{0}; >t03 : Symbol(t03, Decl(jsxHash.tsx, 1, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t04 = #{0}#; >t04 : Symbol(t04, Decl(jsxHash.tsx, 2, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t05 = #; >t05 : Symbol(t05, Decl(jsxHash.tsx, 3, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t06 = #; >t06 : Symbol(t06, Decl(jsxHash.tsx, 4, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t07 = ##; >t07 : Symbol(t07, Decl(jsxHash.tsx, 5, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t08 = #; >t08 : Symbol(t08, Decl(jsxHash.tsx, 6, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t09 = ##; >t09 : Symbol(t09, Decl(jsxHash.tsx, 7, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t10 = #; >t10 : Symbol(t10, Decl(jsxHash.tsx, 8, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t11 = #; >t11 : Symbol(t11, Decl(jsxHash.tsx, 9, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t12 = #; >t12 : Symbol(t12, Decl(jsxHash.tsx, 10, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) diff --git a/tests/baselines/reference/jsxImportInAttribute.symbols b/tests/baselines/reference/jsxImportInAttribute.symbols index 845001b22c0..252b5cc98e4 100644 --- a/tests/baselines/reference/jsxImportInAttribute.symbols +++ b/tests/baselines/reference/jsxImportInAttribute.symbols @@ -8,6 +8,7 @@ let x = Test; // emit test_1.default >Test : Symbol(Test, Decl(consumer.tsx, 1, 6)) ; // ? +>anything : Symbol(unknown) >attr : Symbol(unknown) >Test : Symbol(Test, Decl(consumer.tsx, 1, 6)) diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt index 578159dc651..237c3399e88 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt @@ -50,6 +50,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,3): error TS1003: tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,11): error TS1109: Expression expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,22): error TS1109: Expression expected. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(18,2): error TS17008: JSX element 'a' has no corresponding closing tag. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(19,2): error TS17008: JSX element 'a' has no corresponding closing tag. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(22,10): error TS1005: '}' expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(23,20): error TS1003: Identifier expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(24,15): error TS1003: Identifier expected. @@ -58,14 +60,16 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS2304: tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(27,17): error TS1005: '>' expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,10): error TS2304: Cannot find name 'props'. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,28): error TS1005: '>' expected. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,2): error TS17008: JSX element 'a' has no corresponding closing tag. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,6): error TS1005: '{' expected. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,2): error TS17008: JSX element 'a' has no corresponding closing tag. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,6): error TS1005: '{' expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,7): error TS1109: Expression expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002: Expected corresponding JSX closing tag for 'a'. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '; @@ -188,7 +192,11 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002 ~ !!! error TS1109: Expression expected. ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. var x =
one
two
;; var x =
one
/* intervening comment */
two
;;
{"str";}; @@ -218,9 +226,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002 >; >; ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. ~ !!! error TS1005: '{' expected. ; + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. ~ !!! error TS1005: '{' expected. ~ @@ -230,4 +242,4 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS17002 ~~~ !!! error TS1003: Identifier expected. -!!! error TS17002: Expected corresponding JSX closing tag for 'a'. \ No newline at end of file +!!! error TS1005: '