Stop erroring on computed properties for ES3/ES5 emit.

This commit is contained in:
Daniel Rosenwasser
2015-02-04 15:33:53 -08:00
parent 657d465398
commit d6b2c6d0bb
103 changed files with 918 additions and 1057 deletions
+1 -4
View File
@@ -10626,10 +10626,7 @@ module ts {
}
var computedPropertyName = <ComputedPropertyName>node;
if (languageVersion < ScriptTarget.ES6) {
return grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher);
}
else if (computedPropertyName.expression.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>computedPropertyName.expression).operator === SyntaxKind.CommaToken) {
if (computedPropertyName.expression.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>computedPropertyName.expression).operator === SyntaxKind.CommaToken) {
return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
}
@@ -1,12 +1,9 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,12): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,20): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (3 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (2 errors) ====
var v = { [yield]: foo }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS2304: Cannot find name 'yield'.
~~~
@@ -1,15 +1,12 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: Generators are not currently supported.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,14): error TS9000: 'yield' expressions are not currently supported.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (3 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (2 errors) ====
function * foo() {
~
!!! error TS9001: Generators are not currently supported.
var v = { [yield]: foo }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS9000: 'yield' expressions are not currently supported.
}
@@ -1,13 +1,10 @@
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: Generators are not currently supported.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (3 errors) ====
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (2 errors) ====
var v = { *[foo()]() { } }
~
!!! error TS9001: Generators are not currently supported.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2304: Cannot find name 'foo'.
@@ -1,52 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(13,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(14,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts(15,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts (11 errors) ====
var s: string;
var n: number;
var a: any;
var v = {
[s]() { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[n]() { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[s + s]() { },
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[s + n]() { },
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+s]() { },
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[""]() { },
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[0]() { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[a]() { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[<any>true]() { },
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[`hello bye`]() { },
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[`hello ${a} bye`]() { }
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,46 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts ===
var s: string;
>s : string
var n: number;
>n : number
var a: any;
>a : any
var v = {
>v : {}
>{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [<any>true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : {}
[s]() { },
>s : string
[n]() { },
>n : number
[s + s]() { },
>s + s : string
>s : string
>s : string
[s + n]() { },
>s + n : string
>s : string
>n : number
[+s]() { },
>+s : number
>s : string
[""]() { },
[0]() { },
[a]() { },
>a : any
[<any>true]() { },
><any>true : any
[`hello bye`]() { },
[`hello ${a} bye`]() { }
>a : any
}
@@ -1,85 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(7,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(7,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(10,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(10,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(12,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(12,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(13,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(13,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(14,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(14,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(15,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts(15,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts (22 errors) ====
var s: string;
var n: number;
var a: any;
var v = {
get [s]() { return 0; },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [n](v) { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [s + s]() { return 0; },
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [s + n](v) { },
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [+s]() { return 0; },
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [""](v) { },
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [0]() { return 0; },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [a](v) { },
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [<any>true]() { return 0; },
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [`hello bye`](v) { },
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [`hello ${a} bye`]() { return 0; }
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,53 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts ===
var s: string;
>s : string
var n: number;
>n : number
var a: any;
>a : any
var v = {
>v : {}
>{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [<any>true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : {}
get [s]() { return 0; },
>s : string
set [n](v) { },
>n : number
>v : any
get [s + s]() { return 0; },
>s + s : string
>s : string
>s : string
set [s + n](v) { },
>s + n : string
>s : string
>n : number
>v : any
get [+s]() { return 0; },
>+s : number
>s : string
set [""](v) { },
>v : any
get [0]() { return 0; },
set [a](v) { },
>a : any
>v : any
get [<any>true]() { return 0; },
><any>true : any
set [`hello bye`](v) { },
>v : any
get [`hello ${a} bye`]() { return 0; }
>a : any
}
@@ -1,52 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(7,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(10,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(13,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(14,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts(15,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts (11 errors) ====
var s: string;
var n: number;
var a: any;
class C {
[s]() {}
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[n]() { }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [s + s]() { }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[s + n]() { }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+s]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [""]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[0]() { }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[a]() { }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [<any>true]() { }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[`hello bye`]() { }
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [`hello ${a} bye`]() { }
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,45 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts ===
var s: string;
>s : string
var n: number;
>n : number
var a: any;
>a : any
class C {
>C : C
[s]() {}
>s : string
[n]() { }
>n : number
static [s + s]() { }
>s + s : string
>s : string
>s : string
[s + n]() { }
>s + n : string
>s : string
>n : number
[+s]() { }
>+s : number
>s : string
static [""]() { }
[0]() { }
[a]() { }
>a : any
static [<any>true]() { }
><any>true : any
[`hello bye`]() { }
static [`hello ${a} bye`]() { }
>a : any
}
@@ -1,48 +1,30 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(3,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(4,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(6,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(6,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(8,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts(8,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts (12 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames14_ES5.ts (6 errors) ====
var b: boolean;
class C {
[b]() {}
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static [true]() { }
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[[]]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static [{}]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[undefined]() { }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static [null]() { }
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -1,26 +1,17 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts (5 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames15_ES5.ts (2 errors) ====
var p1: number | string;
var p2: number | number[];
var p3: string | boolean;
class C {
[p1]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[p2]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[p3]() { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -1,52 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(7,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(10,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(12,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(13,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(14,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts(15,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts (11 errors) ====
var s: string;
var n: number;
var a: any;
class C {
get [s]() { return 0;}
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [n](v) { }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static get [s + s]() { return 0; }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [s + n](v) { }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [+s]() { return 0; }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static set [""](v) { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [0]() { return 0; }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [a](v) { }
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static get [<any>true]() { return 0; }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [`hello bye`](v) { }
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [`hello ${a} bye`]() { return 0; }
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,52 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts ===
var s: string;
>s : string
var n: number;
>n : number
var a: any;
>a : any
class C {
>C : C
get [s]() { return 0;}
>s : string
set [n](v) { }
>n : number
>v : any
static get [s + s]() { return 0; }
>s + s : string
>s : string
>s : string
set [s + n](v) { }
>s + n : string
>s : string
>n : number
>v : any
get [+s]() { return 0; }
>+s : number
>s : string
static set [""](v) { }
>v : any
get [0]() { return 0; }
set [a](v) { }
>a : any
>v : any
static get [<any>true]() { return 0; }
><any>true : any
set [`hello bye`](v) { }
>v : any
get [`hello ${a} bye`]() { return 0; }
>a : any
}
@@ -1,48 +1,30 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(3,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(4,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(4,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(7,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts(8,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts (12 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES5.ts (6 errors) ====
var b: boolean;
class C {
get [b]() { return 0;}
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static set [true](v) { }
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
get [[]]() { return 0; }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
set [{}](v) { }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static get [undefined]() { return 0; }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
set [null](v) { }
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -1,11 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES5.ts (1 errors) ====
function foo() {
var obj = {
[this.bar]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
}
@@ -0,0 +1,14 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES5.ts ===
function foo() {
>foo : () => void
var obj = {
>obj : {}
>{ [this.bar]: 0 } : {}
[this.bar]: 0
>this.bar : any
>this : any
>bar : any
}
}
@@ -1,13 +1,10 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module body.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts (1 errors) ====
module M {
var obj = {
[this.bar]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2331: 'this' cannot be referenced in a module body.
}
@@ -1,19 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts(2,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts(2,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts (4 errors) ====
var v = {
get [0 + 1]() { return 0 },
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [0 + 1](v: string) { } //No error
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,12 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts ===
var v = {
>v : {}
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : {}
get [0 + 1]() { return 0 },
>0 + 1 : number
set [0 + 1](v: string) { } //No error
>0 + 1 : number
>v : string
}
@@ -1,9 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES5.ts (1 errors) ====
var obj = {
[this.bar]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,10 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES5.ts ===
var obj = {
>obj : {}
>{ [this.bar]: 0} : {}
[this.bar]: 0
>this.bar : any
>this : any
>bar : any
}
@@ -1,15 +1,12 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames21_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames21_ES5.ts(5,6): error TS2465: 'this' cannot be referenced in a computed property name.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames21_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames21_ES5.ts (1 errors) ====
class C {
bar() {
return 0;
}
[this.bar()]() { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2465: 'this' cannot be referenced in a computed property name.
}
@@ -1,14 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES5.ts(4,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES5.ts (1 errors) ====
class C {
bar() {
var obj = {
[this.bar()]() { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
return 0;
}
}
@@ -0,0 +1,21 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES5.ts ===
class C {
>C : C
bar() {
>bar : () => number
var obj = {
>obj : {}
>{ [this.bar()]() { } } : {}
[this.bar()]() { }
>this.bar() : number
>this.bar : () => number
>this : C
>bar : () => number
};
return 0;
}
}
@@ -1,22 +1,14 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames23_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames23_ES5.ts(6,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames23_ES5.ts(6,12): error TS2465: 'this' cannot be referenced in a computed property name.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames23_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames23_ES5.ts (1 errors) ====
class C {
bar() {
return 0;
}
[
~
{ [this.bar()]: 1 }[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2465: 'this' cannot be referenced in a computed property name.
]() { }
~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,8 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames24_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames24_ES5.ts(9,6): error TS2466: 'super' cannot be referenced in a computed property name.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames24_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames24_ES5.ts (1 errors) ====
class Base {
bar() {
return 0;
@@ -12,8 +11,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames24_ES5.ts(9,
// Gets emitted as super, not _super, which is consistent with
// use of super in static properties initializers.
[super.bar()]() { }
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS2466: 'super' cannot be referenced in a computed property name.
}
@@ -1,19 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES5.ts(9,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES5.ts (1 errors) ====
class Base {
bar() {
return 0;
}
}
class C extends Base {
foo() {
var obj = {
[super.bar()]() { }
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
return 0;
}
}
@@ -0,0 +1,31 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES5.ts ===
class Base {
>Base : Base
bar() {
>bar : () => number
return 0;
}
}
class C extends Base {
>C : C
>Base : Base
foo() {
>foo : () => number
var obj = {
>obj : {}
>{ [super.bar()]() { } } : {}
[super.bar()]() { }
>super.bar() : number
>super.bar : () => number
>super : Base
>bar : () => number
};
return 0;
}
}
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts(10,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts(10,12): error TS2466: 'super' cannot be referenced in a computed property name.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts (1 errors) ====
class Base {
bar() {
return 0;
@@ -13,14 +11,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts(10
// Gets emitted as super, not _super, which is consistent with
// use of super in static properties initializers.
[
~
{ [super.bar()]: 1 }[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS2466: 'super' cannot be referenced in a computed property name.
]() { }
~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,14 +1,11 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES5.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES5.ts(4,7): error TS2466: 'super' cannot be referenced in a computed property name.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES5.ts (1 errors) ====
class Base {
}
class C extends Base {
[(super(), "prop")]() { }
~~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS2466: 'super' cannot be referenced in a computed property name.
}
@@ -1,16 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts(7,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts (1 errors) ====
class Base {
}
class C extends Base {
constructor() {
super();
var obj = {
[(super(), "prop")]() { }
~~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
}
}
@@ -0,0 +1,26 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts ===
class Base {
>Base : Base
}
class C extends Base {
>C : C
>Base : Base
constructor() {
super();
>super() : void
>super : typeof Base
var obj = {
>obj : {}
>{ [(super(), "prop")]() { } } : {}
[(super(), "prop")]() { }
>(super(), "prop") : string
>super(), "prop" : string
>super() : void
>super : typeof Base
};
}
}
@@ -1,16 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts(5,17): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts (1 errors) ====
class C {
bar() {
() => {
var obj = {
[this.bar()]() { } // needs capture
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
}
return 0;
}
}
@@ -0,0 +1,25 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts ===
class C {
>C : C
bar() {
>bar : () => number
() => {
>() => { var obj = { [this.bar()]() { } // needs capture }; } : () => void
var obj = {
>obj : {}
>{ [this.bar()]() { } // needs capture } : {}
[this.bar()]() { } // needs capture
>this.bar() : number
>this.bar : () => number
>this : C
>bar : () => number
};
}
return 0;
}
}
@@ -1,37 +1,19 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(5,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(7,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(8,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(9,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts (8 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts (2 errors) ====
var methodName = "method";
var accessorName = "accessor";
class C {
[methodName]() { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [methodName]() { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get [accessorName]() { }
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
set [accessorName](v) { }
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static get [accessorName]() { }
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
static set [accessorName](v) { }
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,8 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames30_ES5.ts(11,17): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames30_ES5.ts(11,19): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames30_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames30_ES5.ts (1 errors) ====
class Base {
}
class C extends Base {
@@ -14,8 +13,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames30_ES5.ts(11
// illegal, and not capturing this is consistent with
//treatment of other similar violations.
[(super(), "prop")]() { }
~~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
};
@@ -1,21 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES5.ts(10,17): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES5.ts (1 errors) ====
class Base {
bar() {
return 0;
}
}
class C extends Base {
foo() {
() => {
var obj = {
[super.bar()]() { } // needs capture
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
}
return 0;
}
}
@@ -0,0 +1,35 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES5.ts ===
class Base {
>Base : Base
bar() {
>bar : () => number
return 0;
}
}
class C extends Base {
>C : C
>Base : Base
foo() {
>foo : () => number
() => {
>() => { var obj = { [super.bar()]() { } // needs capture }; } : () => void
var obj = {
>obj : {}
>{ [super.bar()]() { } // needs capture } : {}
[super.bar()]() { } // needs capture
>super.bar() : number
>super.bar : () => number
>super : Base
>bar : () => number
};
}
return 0;
}
}
@@ -1,16 +1,13 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames32_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames32_ES5.ts(6,10): error TS2466: A computed property name cannot reference a type parameter from its containing type.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames32_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames32_ES5.ts (1 errors) ====
function foo<T>() { return '' }
class C<T> {
bar() {
return 0;
}
[foo<T>()]() { }
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~
!!! error TS2466: A computed property name cannot reference a type parameter from its containing type.
}
@@ -1,15 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES5.ts(5,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES5.ts (1 errors) ====
function foo<T>() { return '' }
class C<T> {
bar() {
var obj = {
[foo<T>()]() { }
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
return 0;
}
}
@@ -0,0 +1,25 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES5.ts ===
function foo<T>() { return '' }
>foo : <T>() => string
>T : T
class C<T> {
>C : C<T>
>T : T
bar() {
>bar : () => number
var obj = {
>obj : {}
>{ [foo<T>()]() { } } : {}
[foo<T>()]() { }
>foo<T>() : string
>foo : <T>() => string
>T : T
};
return 0;
}
}
@@ -1,15 +1,12 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames34_ES5.ts(5,13): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames34_ES5.ts(5,18): error TS2302: Static members cannot reference class type parameters.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames34_ES5.ts (2 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames34_ES5.ts (1 errors) ====
function foo<T>() { return '' }
class C<T> {
static bar() {
var obj = {
[foo<T>()]() { }
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~
!!! error TS2302: Static members cannot reference class type parameters.
};
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -14,9 +12,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(9,
get ["get1"]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set ["set1"](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,19 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts (2 errors) ====
class Foo { x }
class Foo2 { x; y }
class C {
[s: number]: Foo2;
// Computed properties
get ["get1"]() { return new Foo }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set ["set1"](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,26 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts ===
class Foo { x }
>Foo : Foo
>x : any
class Foo2 { x; y }
>Foo2 : Foo2
>x : any
>y : any
class C {
>C : C
[s: number]: Foo2;
>s : number
>Foo2 : Foo2
// Computed properties
get ["get1"]() { return new Foo }
>new Foo : Foo
>Foo : typeof Foo
set ["set1"](p: Foo2) { }
>p : Foo2
>Foo2 : Foo2
}
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,5): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -14,9 +12,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(9,
get [1 << 6]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [1 << 6](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(9,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -14,9 +12,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(9,
get [1 << 6]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set [1 << 6](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,48 +1,30 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(3,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(4,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(8,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (12 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts (6 errors) ====
var id;
class C {
[0 + 1]() { }
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static [() => { }]() { }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
get [delete id]() { }
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
set [[0, 1]](v) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static get [<String>""]() { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
~~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
static set [id.toString()](v) { }
~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(8,5): error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -12,11 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames40_ES5.ts(9,
// Computed properties
[""]() { return new Foo }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '[""]' of type '() => Foo' is not assignable to string index type '() => Foo2'.
[""]() { return new Foo2 }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,15 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES5.ts(8,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
class C {
[s: string]: () => Foo2;
// Computed properties
static [""]() { return new Foo }
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,22 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES5.ts ===
class Foo { x }
>Foo : Foo
>x : any
class Foo2 { x; y }
>Foo2 : Foo2
>x : any
>y : any
class C {
>C : C
[s: string]: () => Foo2;
>s : string
>Foo2 : Foo2
// Computed properties
static [""]() { return new Foo }
>new Foo : Foo
>Foo : typeof Foo
}
@@ -1,9 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -16,9 +14,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(11
get ["get1"]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set ["set1"](p: Foo2) { }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,10 +1,8 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (4 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (2 errors) ====
class Foo { x }
class Foo2 { x; y }
@@ -13,14 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10
get ["get1"]() { return new Foo }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
class D extends C {
set ["set1"](p: Foo) { }
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,16 +1,12 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (1 errors) ====
class Foo { x }
class Foo2 { x; y }
class C {
get ["get1"]() { return new Foo }
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
class D extends C {
@@ -19,6 +15,4 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11
set ["set1"](p: Foo) { }
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'.
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,9 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts (1 errors) ====
var o = {
["" || 0]: 0
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
@@ -0,0 +1,9 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts ===
var o = {
>o : {}
>{ ["" || 0]: 0} : {}
["" || 0]: 0
>"" || 0 : string | number
};
@@ -1,11 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES5.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES5.ts (1 errors) ====
enum E1 { x }
enum E2 { x }
var o = {
[E1.x || E2.x]: 0
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
};
@@ -0,0 +1,23 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES5.ts ===
enum E1 { x }
>E1 : E1
>x : E1
enum E2 { x }
>E2 : E2
>x : E2
var o = {
>o : {}
>{ [E1.x || E2.x]: 0} : {}
[E1.x || E2.x]: 0
>E1.x || E2.x : E1 | E2
>E1.x : E1
>E1 : typeof E1
>x : E1
>E2.x : E2
>E2 : typeof E2
>x : E2
};
@@ -1,38 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(16,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts(16,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts (6 errors) ====
declare function extractIndexer<T>(p: { [n: number]: T }): T;
enum E { x }
var a: any;
extractIndexer({
[a]: ""
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}); // Should return string
extractIndexer({
[E.x]: ""
~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}); // Should return string
extractIndexer({
["" || 0]: ""
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}); // Should return any (widened form of undefined)
@@ -0,0 +1,47 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts ===
declare function extractIndexer<T>(p: { [n: number]: T }): T;
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>T : T
>p : { [n: number]: T; }
>n : number
>T : T
>T : T
enum E { x }
>E : E
>x : E
var a: any;
>a : any
extractIndexer({
>extractIndexer({ [a]: ""}) : string
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>{ [a]: ""} : { [x: number]: string; }
[a]: ""
>a : any
}); // Should return string
extractIndexer({
>extractIndexer({ [E.x]: ""}) : string
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>{ [E.x]: ""} : { [x: number]: string; }
[E.x]: ""
>E.x : E
>E : typeof E
>x : E
}); // Should return string
extractIndexer({
>extractIndexer({ ["" || 0]: ""}) : any
>extractIndexer : <T>(p: { [n: number]: T; }) => T
>{ ["" || 0]: ""} : { [x: number]: undefined; }
["" || 0]: ""
>"" || 0 : string | number
}); // Should return any (widened form of undefined)
@@ -1,52 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(13,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(14,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts(15,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts (11 errors) ====
var s: string;
var n: number;
var a: any;
var v = {
[s]: 0,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[n]: n,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[s + s]: 1,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[s + n]: 2,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+s]: s,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[""]: 0,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[0]: 0,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[a]: 1,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[<any>true]: 0,
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[`hello bye`]: 0,
~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[`hello ${a} bye`]: 0
~~~~~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,48 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts ===
var s: string;
>s : string
var n: number;
>n : number
var a: any;
>a : any
var v = {
>v : {}
>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [<any>true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : {}
[s]: 0,
>s : string
[n]: n,
>n : number
>n : number
[s + s]: 1,
>s + s : string
>s : string
>s : string
[s + n]: 2,
>s + n : string
>s : string
>n : number
[+s]: s,
>+s : number
>s : string
>s : string
[""]: 0,
[0]: 0,
[a]: 1,
>a : any
[<any>true]: 0,
><any>true : any
[`hello bye`]: 0,
[`hello ${a} bye`]: 0
>a : any
}
@@ -1,48 +1,30 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(3,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(3,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(4,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(4,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(5,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts(8,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts (12 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames5_ES5.ts (6 errors) ====
var b: boolean;
var v = {
[b]: 0,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[true]: 1,
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[[]]: 0,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[{}]: 0,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[undefined]: undefined,
~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[null]: null
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -1,26 +1,17 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts (5 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames6_ES5.ts (2 errors) ====
var p1: number | string;
var p2: number | number[];
var p3: string | boolean;
var v = {
[p1]: 0,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[p2]: 1,
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[p3]: 2
~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -1,12 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES5.ts(5,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES5.ts (1 errors) ====
enum E {
member
}
var v = {
[E.member]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,16 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES5.ts ===
enum E {
>E : E
member
>member : E
}
var v = {
>v : {}
>{ [E.member]: 0} : {}
[E.member]: 0
>E.member : E
>E : typeof E
>member : E
}
@@ -1,23 +1,17 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(6,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts (4 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames8_ES5.ts (2 errors) ====
function f<T, U extends string>() {
var t: T;
var u: U;
var v = {
[t]: 0,
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[u]: 1
~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
};
}
@@ -1,10 +1,7 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(9,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts (4 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts (1 errors) ====
function f(s: string): string;
function f(n: number): number;
function f<T>(x: T): T;
@@ -12,14 +9,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(9,5
var v = {
[f("")]: 0,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[f(0)]: 0,
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[f(true)]: 0
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}
@@ -2,11 +2,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
Index signatures are incompatible.
Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts (1 errors) ====
interface I {
[s: number]: boolean;
}
@@ -18,9 +16,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
[+"foo"]: "",
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"bar"]: 0
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,18 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts (2 errors) ====
interface I {
[s: string]: (x: string) => number;
[s: number]: (x: any) => number; // Doesn't get hit
}
var o: I = {
["" + 0](y) { return y.length; },
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
["" + 1]: y => y.length
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,33 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts ===
interface I {
>I : I
[s: string]: (x: string) => number;
>s : string
>x : string
[s: number]: (x: any) => number; // Doesn't get hit
>s : number
>x : any
}
var o: I = {
>o : I
>I : I
>{ ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length} : { [x: string]: (y: string) => number; [x: number]: undefined; }
["" + 0](y) { return y.length; },
>"" + 0 : string
>y : string
>y.length : number
>y : string
>length : number
["" + 1]: y => y.length
>"" + 1 : string
>y => y.length : (y: string) => number
>y : string
>y.length : number
>y : string
>length : number
}
@@ -1,18 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts (2 errors) ====
interface I {
[s: string]: (x: any) => number; // Doesn't get hit
[s: number]: (x: string) => number;
}
var o: I = {
[+"foo"](y) { return y.length; },
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"bar"]: y => y.length
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,33 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts ===
interface I {
>I : I
[s: string]: (x: any) => number; // Doesn't get hit
>s : string
>x : any
[s: number]: (x: string) => number;
>s : number
>x : string
}
var o: I = {
>o : I
>I : I
>{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: string]: (y: string) => number; [x: number]: (y: string) => number; }
[+"foo"](y) { return y.length; },
>+"foo" : number
>y : string
>y.length : number
>y : string
>length : number
[+"bar"]: y => y.length
>+"bar" : number
>y => y.length : (y: string) => number
>y : string
>y.length : number
>y : string
>length : number
}
@@ -1,17 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts (2 errors) ====
interface I {
[s: string]: (x: string) => number;
}
var o: I = {
[+"foo"](y) { return y.length; },
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"bar"]: y => y.length
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,29 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts ===
interface I {
>I : I
[s: string]: (x: string) => number;
>s : string
>x : string
}
var o: I = {
>o : I
>I : I
>{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: string]: (y: string) => number; }
[+"foo"](y) { return y.length; },
>+"foo" : number
>y : string
>y.length : number
>y : string
>length : number
[+"bar"]: y => y.length
>+"bar" : number
>y => y.length : (y: string) => number
>y : string
>y.length : number
>y : string
>length : number
}
@@ -1,18 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts (2 errors) ====
interface I {
[s: string]: any;
[s: number]: any;
}
var o: I = {
[""+"foo"]: "",
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[""+"bar"]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,22 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts ===
interface I {
>I : I
[s: string]: any;
>s : string
[s: number]: any;
>s : number
}
var o: I = {
>o : I
>I : I
>{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; [x: number]: undefined; }
[""+"foo"]: "",
>""+"foo" : string
[""+"bar"]: 0
>""+"bar" : string
}
@@ -1,18 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts (2 errors) ====
interface I {
[s: string]: any;
[s: number]: any;
}
var o: I = {
[+"foo"]: "",
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"bar"]: 0
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -0,0 +1,22 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts ===
interface I {
>I : I
[s: string]: any;
>s : string
[s: number]: any;
>s : number
}
var o: I = {
>o : I
>I : I
>{ [+"foo"]: "", [+"bar"]: 0} : { [x: string]: string | number; [x: number]: string | number; }
[+"foo"]: "",
>+"foo" : number
[+"bar"]: 0
>+"bar" : number
}
@@ -1,34 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts (6 errors) ====
interface I<T> {
[s: string]: T;
}
declare function foo<T>(obj: I<T>): T
foo({
p: "",
0: () => { },
["hi" + "bye"]: true,
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[0 + 1]: 0,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"hi"]: [0]
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
});
@@ -0,0 +1,40 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts ===
interface I<T> {
>I : I<T>
>T : T
[s: string]: T;
>s : string
>T : T
}
declare function foo<T>(obj: I<T>): T
>foo : <T>(obj: I<T>) => T
>T : T
>obj : I<T>
>I : I<T>
>T : T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | number[] | (() => void)
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | number[] | (() => void); 0: () => void; p: string; }
p: "",
>p : string
0: () => { },
>() => { } : () => void
["hi" + "bye"]: true,
>"hi" + "bye" : string
[0 + 1]: 0,
>0 + 1 : number
[+"hi"]: [0]
>+"hi" : number
>[0] : number[]
});
@@ -1,34 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(10,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(11,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts(12,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts (6 errors) ====
interface I<T> {
[s: number]: T;
}
declare function foo<T>(obj: I<T>): T
foo({
p: "",
0: () => { },
["hi" + "bye"]: true,
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[0 + 1]: 0,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"hi"]: [0]
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
});
@@ -0,0 +1,40 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts ===
interface I<T> {
>I : I<T>
>T : T
[s: number]: T;
>s : number
>T : T
}
declare function foo<T>(obj: I<T>): T
>foo : <T>(obj: I<T>) => T
>T : T
>obj : I<T>
>I : I<T>
>T : T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | number[] | (() => void)
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | number[] | (() => void); 0: () => void; p: string; }
p: "",
>p : string
0: () => { },
>() => { } : () => void
["hi" + "bye"]: true,
>"hi" + "bye" : string
[0 + 1]: 0,
>0 + 1 : number
[+"hi"]: [0]
>+"hi" : number
>[0] : number[]
});
@@ -2,11 +2,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
Index signatures are incompatible.
Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ====
interface I {
[s: string]: boolean;
[s: number]: boolean;
@@ -19,9 +17,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
[""+"foo"]: "",
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[""+"bar"]: 0
~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -2,11 +2,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
Index signatures are incompatible.
Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ====
interface I {
[s: string]: boolean;
[s: number]: boolean;
@@ -19,9 +17,5 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
[+"foo"]: "",
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[+"bar"]: 0
~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,17 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts(3,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts(4,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts (3 errors) ====
class C {
["" + ""]() { }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get ["" + ""]() { return 0; }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set ["" + ""](x) { }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -26,3 +26,8 @@ var C = (function () {
});
return C;
})();
//// [computedPropertyNamesDeclarationEmit1_ES5.d.ts]
declare class C {
}
@@ -0,0 +1,14 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts ===
class C {
>C : C
["" + ""]() { }
>"" + "" : string
get ["" + ""]() { return 0; }
>"" + "" : string
set ["" + ""](x) { }
>"" + "" : string
>x : any
}
@@ -1,17 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts(2,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts(3,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts(4,16): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts (3 errors) ====
class C {
static ["" + ""]() { }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static get ["" + ""]() { return 0; }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
static set ["" + ""](x) { }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -26,3 +26,8 @@ var C = (function () {
});
return C;
})();
//// [computedPropertyNamesDeclarationEmit2_ES5.d.ts]
declare class C {
}
@@ -0,0 +1,14 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts ===
class C {
>C : C
static ["" + ""]() { }
>"" + "" : string
static get ["" + ""]() { return 0; }
>"" + "" : string
static set ["" + ""](x) { }
>"" + "" : string
>x : any
}
@@ -1,27 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(3,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(4,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(4,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts(5,9): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts (6 errors) ====
var v = {
["" + ""]: 0,
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
["" + ""]() { },
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
get ["" + ""]() { return 0; },
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
set ["" + ""](x) { }
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -17,3 +17,7 @@ var v = {
set ["" + ""](x) {
}
};
//// [computedPropertyNamesDeclarationEmit5_ES5.d.ts]
declare var v: {};
@@ -0,0 +1,18 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts ===
var v = {
>v : {}
>{ ["" + ""]: 0, ["" + ""]() { }, get ["" + ""]() { return 0; }, set ["" + ""](x) { }} : {}
["" + ""]: 0,
>"" + "" : string
["" + ""]() { },
>"" + "" : string
get ["" + ""]() { return 0; },
>"" + "" : string
set ["" + ""](x) { }
>"" + "" : string
>x : any
}
@@ -1,9 +1,8 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(4,5): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(5,5): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts(6,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts (3 errors) ====
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_ES5.ts (2 errors) ====
var methodName = "method";
var accessorName = "accessor";
class C {
@@ -14,6 +13,4 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads_
~~~~~~~~~~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
[methodName](v?: string) { }
~~~~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
}
@@ -1,11 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts (1 errors) ====
class C {
["hello"]() {
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
debugger;
}
}
@@ -0,0 +1,8 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts ===
class C {
>C : C
["hello"]() {
debugger;
}
}
@@ -1,11 +0,0 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts(2,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts (1 errors) ====
var v = {
["hello"]() {
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
debugger;
}
}
@@ -0,0 +1,9 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts ===
var v = {
>v : {}
>{ ["hello"]() { debugger; }} : {}
["hello"]() {
debugger;
}
}

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