mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Merge branch 'master' into funcDeclsInBlocks
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json src/compiler/parser.ts
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ====
|
||||
function * foo(a = yield => yield) {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ====
|
||||
function * yield() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
// Legal to use 'yield' in a type context.
|
||||
var v: yield;
|
||||
~~~~~
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ====
|
||||
function*foo(a = yield) {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (2 errors) ====
|
||||
function*bar() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
// 'yield' here is an identifier, and not a yield expression.
|
||||
function*foo(a = yield) {
|
||||
~~~~~
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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,11): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (1 errors) ====
|
||||
var v = { [yield]: foo }
|
||||
~~~~~~~
|
||||
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
var v = { [yield]: foo }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ====
|
||||
var v = function * () { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ====
|
||||
var v = function * foo() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ====
|
||||
var v = { *foo() { } }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (1 errors) ====
|
||||
var v = { *[foo()]() { } }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ====
|
||||
class C {
|
||||
public * foo() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*[foo]() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo<T>() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (1 errors) ====
|
||||
var v = { * foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ====
|
||||
function* foo() { yield }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
function bar() {
|
||||
yield foo;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (1 errors) ====
|
||||
function*foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
function bar() {
|
||||
function* quux() {
|
||||
yield(foo);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield
|
||||
yield
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield;
|
||||
yield;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield*foo
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield foo
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield(foo);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (1 errors) ====
|
||||
var v = function*() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield(foo);
|
||||
}
|
||||
13
tests/baselines/reference/computedPropertyNames1.errors.txt
Normal file
13
tests/baselines/reference/computedPropertyNames1.errors.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames1.ts(2,9): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames1.ts(3,9): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames1.ts (2 errors) ====
|
||||
var v = {
|
||||
get [0 + 1]() { return 0 },
|
||||
~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
set [0 + 1](v: string) { } //No error
|
||||
~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
//// [computedPropertyNames1.ts]
|
||||
var v = {
|
||||
get [0 + 1]() { return 0 },
|
||||
set [0 + 1](v: string) { } //No error
|
||||
}
|
||||
|
||||
//// [computedPropertyNames1.js]
|
||||
var v = {
|
||||
get [0 + 1]() {
|
||||
return 0;
|
||||
},
|
||||
set [0 + 1](v) {
|
||||
} //No error
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1.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,19 +1,37 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(4,5): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(5,12): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(6,9): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(7,9): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(9,16): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.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.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.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts (8 errors) ====
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
class C {
|
||||
[methodName]() { }
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
static [methodName]() { }
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
get [accessorName]() { }
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
set [accessorName](v) { }
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
static get [accessorName]() { }
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
static set [accessorName](v) { }
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
//// [computedPropertyNames2.ts]
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
class C {
|
||||
[methodName]() { }
|
||||
static [methodName]() { }
|
||||
get [accessorName]() { }
|
||||
set [accessorName](v) { }
|
||||
static get [accessorName]() { }
|
||||
static set [accessorName](v) { }
|
||||
}
|
||||
|
||||
//// [computedPropertyNames2.js]
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[methodName] = function () {
|
||||
};
|
||||
C[methodName] = function () {
|
||||
};
|
||||
Object.defineProperty(C.prototype, accessorName, {
|
||||
get: function () {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, accessorName, {
|
||||
set: function (v) {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, accessorName, {
|
||||
get: function () {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, accessorName, {
|
||||
set: function (v) {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return C;
|
||||
})();
|
||||
@@ -1,18 +1,36 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(3,5): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(4,12): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(6,9): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(8,16): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.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.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.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts (8 errors) ====
|
||||
var id;
|
||||
class C {
|
||||
[0 + 1]() { }
|
||||
~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
static [() => { }]() { }
|
||||
~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
get [delete id]() { }
|
||||
~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
set [[0, 1]](v) { }
|
||||
~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
static get [<String>""]() { }
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
static set [id.toString()](v) { }
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//// [computedPropertyNames3.ts]
|
||||
var id;
|
||||
class C {
|
||||
[0 + 1]() { }
|
||||
static [() => { }]() { }
|
||||
get [delete id]() { }
|
||||
set [[0, 1]](v) { }
|
||||
static get [<String>""]() { }
|
||||
static set [id.toString()](v) { }
|
||||
}
|
||||
|
||||
//// [computedPropertyNames3.js]
|
||||
var id;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[0 + 1] = function () {
|
||||
};
|
||||
C[function () {
|
||||
}] = function () {
|
||||
};
|
||||
Object.defineProperty(C.prototype, delete id, {
|
||||
get: function () {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, [0, 1], {
|
||||
set: function (v) {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, "", {
|
||||
get: function () {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, id.toString(), {
|
||||
set: function (v) {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return C;
|
||||
})();
|
||||
@@ -1,8 +1,9 @@
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(4,5): error TS1168: Computed property names are not allowed in method overloads.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(5,5): error TS1168: Computed property names are not allowed in method overloads.
|
||||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(6,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts (3 errors) ====
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
class C {
|
||||
@@ -13,4 +14,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1168: Computed property names are not allowed in method overloads.
|
||||
[methodName](v?: string) { }
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
25
tests/baselines/reference/conflictMarkerTrivia1.errors.txt
Normal file
25
tests/baselines/reference/conflictMarkerTrivia1.errors.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(2,1): error TS1184: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(4,1): error TS1184: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(6,1): error TS1184: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(3,5): error TS2300: Duplicate identifier 'v'.
|
||||
tests/cases/compiler/conflictMarkerTrivia1.ts(5,5): error TS2300: Duplicate identifier 'v'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conflictMarkerTrivia1.ts (5 errors) ====
|
||||
class C {
|
||||
<<<<<<< HEAD
|
||||
|
||||
!!! error TS1184: Merge conflict marker encountered.
|
||||
v = 1;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'v'.
|
||||
=======
|
||||
|
||||
!!! error TS1184: Merge conflict marker encountered.
|
||||
v = 2;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'v'.
|
||||
>>>>>>> Branch-a
|
||||
|
||||
!!! error TS1184: Merge conflict marker encountered.
|
||||
}
|
||||
@@ -195,12 +195,12 @@ function f4() {
|
||||
var z;
|
||||
}
|
||||
function f6() {
|
||||
var _a = [1, "hello"], _b = _a[0], x = _b === void0 ? 0 : _b, _c = _a[1], y = _c === void0 ? "" : _c;
|
||||
var _a = [1, "hello"], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? "" : _c;
|
||||
var x;
|
||||
var y;
|
||||
}
|
||||
function f7() {
|
||||
var _a = [1, "hello"], _b = _a[0], x = _b === void0 ? 0 : _b, _c = _a[1], y = _c === void0 ? 1 : _c; // Error, initializer for y must be string
|
||||
var _a = [1, "hello"], _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 1 : _c; // Error, initializer for y must be string
|
||||
var x;
|
||||
var y;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ function f11() {
|
||||
var b;
|
||||
}
|
||||
function f12() {
|
||||
var _a = [1, ["hello", { x: 5, y: true }]], a = _a[0], _b = _a[1], _c = _b === void0 ? ["abc", { x: 10, y: false }] : _b, b = _c[0], _d = _c[1], x = _d.x, c = _d.y;
|
||||
var _a = [1, ["hello", { x: 5, y: true }]], a = _a[0], _b = _a[1], _c = _b === void 0 ? ["abc", { x: 10, y: false }] : _b, b = _c[0], _d = _c[1], x = _d.x, c = _d.y;
|
||||
var a;
|
||||
var b;
|
||||
var x;
|
||||
@@ -237,7 +237,7 @@ function f13() {
|
||||
var _b = [[x, y], { x: x, y: y }], a = _b[0], b = _b[1];
|
||||
}
|
||||
function f14(_a) {
|
||||
var _b = _a[0], a = _b === void0 ? 1 : _b, _c = _a[1], _d = _c[0], b = _d === void0 ? "hello" : _d, _e = _c[1], x = _e.x, _f = _e.y, c = _f === void0 ? false : _f;
|
||||
var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], _d = _c[0], b = _d === void 0 ? "hello" : _d, _e = _c[1], x = _e.x, _f = _e.y, c = _f === void 0 ? false : _f;
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
@@ -260,7 +260,7 @@ function f16() {
|
||||
var _a = f15(), a = _a.a, b = _a.b, c = _a.c;
|
||||
}
|
||||
function f17(_a) {
|
||||
var _b = _a.a, a = _b === void0 ? "" : _b, _c = _a.b, b = _c === void0 ? 0 : _c, _d = _a.c, c = _d === void0 ? false : _d;
|
||||
var _b = _a.a, a = _b === void 0 ? "" : _b, _c = _a.b, b = _c === void 0 ? 0 : _c, _d = _a.c, c = _d === void 0 ? false : _d;
|
||||
}
|
||||
f17({});
|
||||
f17({ a: "hello" });
|
||||
@@ -274,7 +274,7 @@ function g4() {
|
||||
(_b = { b: b, a: a }, a = _b.a, b = _b.b, _b);
|
||||
_c = [a, b], aa[0] = _c[0], b = _c[1];
|
||||
_d = [b, a], a = _d[0], b = _d[1]; // Error
|
||||
_e = [2, "def"], _f = _e[0], a = _f === void0 ? 1 : _f, _g = _e[1], b = _g === void0 ? "abc" : _g;
|
||||
_e = [2, "def"], _f = _e[0], a = _f === void 0 ? 1 : _f, _g = _e[1], b = _g === void 0 ? "abc" : _g;
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
}
|
||||
function g5() {
|
||||
@@ -282,7 +282,7 @@ function g5() {
|
||||
_a = [1, 2], a = _a[0], b = _a[1];
|
||||
_b = [b, a], a = _b[0], b = _b[1];
|
||||
(_c = { b: b, a: a }, a = _c.a, b = _c.b, _c);
|
||||
_d = ([[2, 3]])[0], _e = _d === void0 ? [1, 2] : _d, a = _e[0], b = _e[1];
|
||||
_d = ([[2, 3]])[0], _e = _d === void 0 ? [1, 2] : _d, a = _e[0], b = _e[1];
|
||||
var x = (_f = [1, 2], a = _f[0], b = _f[1], _f);
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
}
|
||||
|
||||
81
tests/baselines/reference/noImplicitAnyIndexingSuppressed.js
Normal file
81
tests/baselines/reference/noImplicitAnyIndexingSuppressed.js
Normal file
@@ -0,0 +1,81 @@
|
||||
//// [noImplicitAnyIndexingSuppressed.ts]
|
||||
|
||||
enum MyEmusEnum {
|
||||
emu
|
||||
}
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation1 = MyEmusEnum[0]
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu]
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var strRepresentation3 = MyEmusEnum["monehh"];
|
||||
|
||||
// Should be okay; should be a MyEmusEnum
|
||||
var strRepresentation4 = MyEmusEnum["emu"];
|
||||
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var x = {}["hi"];
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var y = {}[10];
|
||||
|
||||
var hi: any = "hi";
|
||||
|
||||
var emptyObj = {};
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var z1 = emptyObj[hi];
|
||||
var z2 = (<any>emptyObj)[hi];
|
||||
|
||||
interface MyMap<T> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
var m: MyMap<number> = {
|
||||
"0": 0,
|
||||
"1": 1,
|
||||
"2": 2,
|
||||
"Okay that's enough for today.": NaN
|
||||
};
|
||||
|
||||
var mResult1 = m[MyEmusEnum.emu];
|
||||
var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]];
|
||||
var mResult3 = m[hi];
|
||||
|
||||
|
||||
|
||||
//// [noImplicitAnyIndexingSuppressed.js]
|
||||
var MyEmusEnum;
|
||||
(function (MyEmusEnum) {
|
||||
MyEmusEnum[MyEmusEnum["emu"] = 0] = "emu";
|
||||
})(MyEmusEnum || (MyEmusEnum = {}));
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation1 = MyEmusEnum[0];
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation2 = MyEmusEnum[0 /* emu */];
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var strRepresentation3 = MyEmusEnum["monehh"];
|
||||
// Should be okay; should be a MyEmusEnum
|
||||
var strRepresentation4 = 0 /* "emu" */;
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var x = {}["hi"];
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var y = {}[10];
|
||||
var hi = "hi";
|
||||
var emptyObj = {};
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var z1 = emptyObj[hi];
|
||||
var z2 = emptyObj[hi];
|
||||
var m = {
|
||||
"0": 0,
|
||||
"1": 1,
|
||||
"2": 2,
|
||||
"Okay that's enough for today.": NaN
|
||||
};
|
||||
var mResult1 = m[0 /* emu */];
|
||||
var mResult2 = m[MyEmusEnum[0 /* emu */]];
|
||||
var mResult3 = m[hi];
|
||||
118
tests/baselines/reference/noImplicitAnyIndexingSuppressed.types
Normal file
118
tests/baselines/reference/noImplicitAnyIndexingSuppressed.types
Normal file
@@ -0,0 +1,118 @@
|
||||
=== tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts ===
|
||||
|
||||
enum MyEmusEnum {
|
||||
>MyEmusEnum : MyEmusEnum
|
||||
|
||||
emu
|
||||
>emu : MyEmusEnum
|
||||
}
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation1 = MyEmusEnum[0]
|
||||
>strRepresentation1 : string
|
||||
>MyEmusEnum[0] : string
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu]
|
||||
>strRepresentation2 : string
|
||||
>MyEmusEnum[MyEmusEnum.emu] : string
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
>MyEmusEnum.emu : MyEmusEnum
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
>emu : MyEmusEnum
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var strRepresentation3 = MyEmusEnum["monehh"];
|
||||
>strRepresentation3 : any
|
||||
>MyEmusEnum["monehh"] : any
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
|
||||
// Should be okay; should be a MyEmusEnum
|
||||
var strRepresentation4 = MyEmusEnum["emu"];
|
||||
>strRepresentation4 : MyEmusEnum
|
||||
>MyEmusEnum["emu"] : MyEmusEnum
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var x = {}["hi"];
|
||||
>x : any
|
||||
>{}["hi"] : any
|
||||
>{} : {}
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var y = {}[10];
|
||||
>y : any
|
||||
>{}[10] : any
|
||||
>{} : {}
|
||||
|
||||
var hi: any = "hi";
|
||||
>hi : any
|
||||
|
||||
var emptyObj = {};
|
||||
>emptyObj : {}
|
||||
>{} : {}
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var z1 = emptyObj[hi];
|
||||
>z1 : any
|
||||
>emptyObj[hi] : any
|
||||
>emptyObj : {}
|
||||
>hi : any
|
||||
|
||||
var z2 = (<any>emptyObj)[hi];
|
||||
>z2 : any
|
||||
>(<any>emptyObj)[hi] : any
|
||||
>(<any>emptyObj) : any
|
||||
><any>emptyObj : any
|
||||
>emptyObj : {}
|
||||
>hi : any
|
||||
|
||||
interface MyMap<T> {
|
||||
>MyMap : MyMap<T>
|
||||
>T : T
|
||||
|
||||
[key: string]: T;
|
||||
>key : string
|
||||
>T : T
|
||||
}
|
||||
|
||||
var m: MyMap<number> = {
|
||||
>m : MyMap<number>
|
||||
>MyMap : MyMap<T>
|
||||
>{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { [x: string]: number; "0": number; "1": number; "2": number; "Okay that's enough for today.": number; }
|
||||
|
||||
"0": 0,
|
||||
"1": 1,
|
||||
"2": 2,
|
||||
"Okay that's enough for today.": NaN
|
||||
>NaN : number
|
||||
|
||||
};
|
||||
|
||||
var mResult1 = m[MyEmusEnum.emu];
|
||||
>mResult1 : number
|
||||
>m[MyEmusEnum.emu] : number
|
||||
>m : MyMap<number>
|
||||
>MyEmusEnum.emu : MyEmusEnum
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
>emu : MyEmusEnum
|
||||
|
||||
var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]];
|
||||
>mResult2 : number
|
||||
>m[MyEmusEnum[MyEmusEnum.emu]] : number
|
||||
>m : MyMap<number>
|
||||
>MyEmusEnum[MyEmusEnum.emu] : string
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
>MyEmusEnum.emu : MyEmusEnum
|
||||
>MyEmusEnum : typeof MyEmusEnum
|
||||
>emu : MyEmusEnum
|
||||
|
||||
var mResult3 = m[hi];
|
||||
>mResult3 : number
|
||||
>m[hi] : number
|
||||
>m : MyMap<number>
|
||||
>hi : any
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/objectLiteralMemberWithModifiers1.ts(1,11): error TS1184: Modifiers cannot appear here.
|
||||
tests/cases/compiler/objectLiteralMemberWithModifiers1.ts(1,11): error TS1185: Modifiers cannot appear here.
|
||||
|
||||
|
||||
==== tests/cases/compiler/objectLiteralMemberWithModifiers1.ts (1 errors) ====
|
||||
var v = { public foo() { } }
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
!!! error TS1185: Modifiers cannot appear here.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,11): error TS1184: Modifiers cannot appear here.
|
||||
tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,11): error TS1185: Modifiers cannot appear here.
|
||||
tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,22): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
|
||||
|
||||
==== tests/cases/compiler/objectLiteralMemberWithModifiers2.ts (2 errors) ====
|
||||
var v = { public get foo() { } }
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
!!! error TS1185: Modifiers cannot appear here.
|
||||
~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,3): error TS1184: Modifiers cannot appear here.
|
||||
tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,3): error TS1185: Modifiers cannot appear here.
|
||||
tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,14): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,14):
|
||||
var v = {
|
||||
public get foo() { }
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
!!! error TS1185: Modifiers cannot appear here.
|
||||
~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts(2,4): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts (1 errors) ====
|
||||
class C {
|
||||
[e]() { }
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
//// [parserComputedPropertyName12.ts]
|
||||
class C {
|
||||
[e]() { }
|
||||
}
|
||||
|
||||
//// [parserComputedPropertyName12.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[e] = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
[e]() { }
|
||||
>e : unknown
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts(1,15): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts (1 errors) ====
|
||||
var v = { set [e](v) { } }
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [parserComputedPropertyName17.ts]
|
||||
var v = { set [e](v) { } }
|
||||
|
||||
//// [parserComputedPropertyName17.js]
|
||||
var v = { set [e](v) {
|
||||
} };
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts ===
|
||||
var v = { set [e](v) { } }
|
||||
>v : {}
|
||||
>{ set [e](v) { } } : {}
|
||||
>e : unknown
|
||||
>v : any
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts(1,11): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts (1 errors) ====
|
||||
var v = { [e]: 1 };
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,5 +0,0 @@
|
||||
//// [parserComputedPropertyName2.ts]
|
||||
var v = { [e]: 1 };
|
||||
|
||||
//// [parserComputedPropertyName2.js]
|
||||
var v = { [e]: 1 };
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts ===
|
||||
var v = { [e]: 1 };
|
||||
>v : {}
|
||||
>{ [e]: 1 } : {}
|
||||
>e : unknown
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts(2,9): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts (1 errors) ====
|
||||
class C {
|
||||
set [e](v) { }
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
//// [parserComputedPropertyName24.ts]
|
||||
class C {
|
||||
set [e](v) { }
|
||||
}
|
||||
|
||||
//// [parserComputedPropertyName24.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, e, {
|
||||
set: function (v) {
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return C;
|
||||
})();
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
set [e](v) { }
|
||||
>e : unknown
|
||||
>v : any
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts(1,11): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts (1 errors) ====
|
||||
var v = { [e]() { } };
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [parserComputedPropertyName3.ts]
|
||||
var v = { [e]() { } };
|
||||
|
||||
//// [parserComputedPropertyName3.js]
|
||||
var v = { [e]() {
|
||||
} };
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts ===
|
||||
var v = { [e]() { } };
|
||||
>v : {}
|
||||
>{ [e]() { } } : {}
|
||||
>e : unknown
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS1171: A comma expression is not allowed in a computed property name.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (1 errors) ====
|
||||
var x = {
|
||||
[0, 1]: { }
|
||||
~~~~
|
||||
!!! error TS1171: A comma expression is not allowed in a computed property name.
|
||||
~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName37.ts(2,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName37.ts (1 errors) ====
|
||||
var v = {
|
||||
[public]: 0
|
||||
~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
//// [parserComputedPropertyName37.ts]
|
||||
var v = {
|
||||
[public]: 0
|
||||
};
|
||||
|
||||
//// [parserComputedPropertyName37.js]
|
||||
var v = {
|
||||
[public]: 0
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName37.ts ===
|
||||
var v = {
|
||||
>v : {}
|
||||
>{ [public]: 0} : {}
|
||||
|
||||
[public]: 0
|
||||
>public : unknown
|
||||
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts (1 errors) ====
|
||||
class C {
|
||||
[public]() { }
|
||||
~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
//// [parserComputedPropertyName38.ts]
|
||||
class C {
|
||||
[public]() { }
|
||||
}
|
||||
|
||||
//// [parserComputedPropertyName38.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[public] = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
[public]() { }
|
||||
>public : unknown
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts(1,15): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts (1 errors) ====
|
||||
var v = { get [e]() { } };
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [parserComputedPropertyName4.ts]
|
||||
var v = { get [e]() { } };
|
||||
|
||||
//// [parserComputedPropertyName4.js]
|
||||
var v = { get [e]() {
|
||||
} };
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts ===
|
||||
var v = { get [e]() { } };
|
||||
>v : {}
|
||||
>{ get [e]() { } } : {}
|
||||
>e : unknown
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName40.ts(2,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName40.ts (1 errors) ====
|
||||
class C {
|
||||
[a ? "" : ""]() {}
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
//// [parserComputedPropertyName40.ts]
|
||||
class C {
|
||||
[a ? "" : ""]() {}
|
||||
}
|
||||
|
||||
//// [parserComputedPropertyName40.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype[a ? "" : ""] = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName40.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
[a ? "" : ""]() {}
|
||||
>a ? "" : "" : string
|
||||
>a : unknown
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts(2,5): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts (1 errors) ====
|
||||
var v = {
|
||||
[0 in []]: true
|
||||
~~~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
//// [parserComputedPropertyName41.ts]
|
||||
var v = {
|
||||
[0 in []]: true
|
||||
}
|
||||
|
||||
//// [parserComputedPropertyName41.js]
|
||||
var v = {
|
||||
[0 in []]: true
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName41.ts ===
|
||||
var v = {
|
||||
>v : {}
|
||||
>{ [0 in []]: true} : {}
|
||||
|
||||
[0 in []]: true
|
||||
>0 in [] : boolean
|
||||
>[] : undefined[]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,11): error TS1184: Modifiers cannot appear here.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,11): error TS1185: Modifiers cannot appear here.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts (1 errors) ====
|
||||
var v = { public get [e]() { } };
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
!!! error TS1185: Modifiers cannot appear here.
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts(1,11): error TS9002: Computed property names are not currently supported.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts(1,19): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts (2 errors) ====
|
||||
var v = { [e]: 1, [e + e]: 2 };
|
||||
~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
~~~~~~~
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,5 +0,0 @@
|
||||
//// [parserComputedPropertyName6.ts]
|
||||
var v = { [e]: 1, [e + e]: 2 };
|
||||
|
||||
//// [parserComputedPropertyName6.js]
|
||||
var v = { [e]: 1, [e + e]: 2 };
|
||||
@@ -1,9 +0,0 @@
|
||||
=== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts ===
|
||||
var v = { [e]: 1, [e + e]: 2 };
|
||||
>v : {}
|
||||
>{ [e]: 1, [e + e]: 2 } : {}
|
||||
>e : unknown
|
||||
>e + e : any
|
||||
>e : unknown
|
||||
>e : unknown
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts(1,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts(1,11): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts (1 errors) ====
|
||||
var v = { [e]: 1 };
|
||||
~~~
|
||||
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts(1,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts(1,11): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts (1 errors) ====
|
||||
var v = { [e]() { } };
|
||||
~~~
|
||||
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,15): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,15): error TS9002: Computed property names are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts (1 errors) ====
|
||||
var v = { get [e]() { } };
|
||||
~~~
|
||||
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
|
||||
!!! error TS9002: Computed property names are not currently supported.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock2.ts(2,4): error TS1184: Modifiers cannot appear here.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock2.ts(2,4): error TS1185: Modifiers cannot appear here.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock2.ts (1 errors) ====
|
||||
{
|
||||
declare var x = this;
|
||||
~~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
!!! error TS1185: Modifiers cannot appear here.
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (1 errors) ====
|
||||
function* gen() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
// Once this is supported, the inner expression does not need to be parenthesized.
|
||||
var x = yield `abc${ x }def`;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts (1 errors) ====
|
||||
function* gen() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
// Once this is supported, yield *must* be parenthesized.
|
||||
var x = `abc${ yield 10 }def`;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/yieldExpression1.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||
tests/cases/compiler/yieldExpression1.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
|
||||
|
||||
==== tests/cases/compiler/yieldExpression1.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
yield
|
||||
}
|
||||
7
tests/cases/compiler/conflictMarkerTrivia1.ts
Normal file
7
tests/cases/compiler/conflictMarkerTrivia1.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
<<<<<<< HEAD
|
||||
v = 1;
|
||||
=======
|
||||
v = 2;
|
||||
>>>>>>> Branch-a
|
||||
}
|
||||
49
tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts
Normal file
49
tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
//@noImplicitAny: true
|
||||
//@suppressImplicitAnyIndexErrors: true
|
||||
|
||||
enum MyEmusEnum {
|
||||
emu
|
||||
}
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation1 = MyEmusEnum[0]
|
||||
|
||||
// Should be okay; should be a string.
|
||||
var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu]
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var strRepresentation3 = MyEmusEnum["monehh"];
|
||||
|
||||
// Should be okay; should be a MyEmusEnum
|
||||
var strRepresentation4 = MyEmusEnum["emu"];
|
||||
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var x = {}["hi"];
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var y = {}[10];
|
||||
|
||||
var hi: any = "hi";
|
||||
|
||||
var emptyObj = {};
|
||||
|
||||
// Should be okay, as we suppress implicit 'any' property access checks
|
||||
var z1 = emptyObj[hi];
|
||||
var z2 = (<any>emptyObj)[hi];
|
||||
|
||||
interface MyMap<T> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
var m: MyMap<number> = {
|
||||
"0": 0,
|
||||
"1": 1,
|
||||
"2": 2,
|
||||
"Okay that's enough for today.": NaN
|
||||
};
|
||||
|
||||
var mResult1 = m[MyEmusEnum.emu];
|
||||
var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]];
|
||||
var mResult3 = m[hi];
|
||||
|
||||
18
tests/cases/fourslash/formatConflictMarker1.ts
Normal file
18
tests/cases/fourslash/formatConflictMarker1.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////class C {
|
||||
////<<<<<<< HEAD
|
||||
//// v = 1;
|
||||
////=======
|
||||
////v = 2;
|
||||
////>>>>>>> Branch - a
|
||||
////}
|
||||
|
||||
format.document();
|
||||
verify.currentFileContentIs("class C {\r\n\
|
||||
<<<<<<< HEAD\r\n\
|
||||
v = 1;\r\n\
|
||||
=======\r\n\
|
||||
v = 2;\r\n\
|
||||
>>>>>>> Branch - a\r\n\
|
||||
}");
|
||||
@@ -317,7 +317,9 @@ describe('Colorization', function () {
|
||||
operator("<"),
|
||||
identifier("number"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
});
|
||||
|
||||
it("ClassifiesConflictTokens", () => {
|
||||
// no longer in something that looks generic.
|
||||
test("Foo<Foo> number",
|
||||
ts.EndOfLineState.Start,
|
||||
@@ -327,6 +329,33 @@ describe('Colorization', function () {
|
||||
operator(">"),
|
||||
keyword("number"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
|
||||
// Test conflict markers.
|
||||
test(
|
||||
"class C {\r\n\
|
||||
<<<<<<< HEAD\r\n\
|
||||
v = 1;\r\n\
|
||||
=======\r\n\
|
||||
v = 2;\r\n\
|
||||
>>>>>>> Branch - a\r\n\
|
||||
}",
|
||||
ts.EndOfLineState.Start,
|
||||
keyword("class"),
|
||||
identifier("C"),
|
||||
punctuation("{"),
|
||||
comment("<<<<<<< HEAD"),
|
||||
identifier("v"),
|
||||
operator("="),
|
||||
numberLiteral("1"),
|
||||
punctuation(";"),
|
||||
comment("======="),
|
||||
identifier("v"),
|
||||
operator("="),
|
||||
numberLiteral("2"),
|
||||
punctuation(";"),
|
||||
comment(">>>>>>> Branch - a"),
|
||||
punctuation("}"),
|
||||
finalEndOfLineState(ts.EndOfLineState.Start));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user