From cf4f34c224d2904202c76a8784e38657ee00dbfd Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 17 Nov 2014 14:38:35 -0800 Subject: [PATCH] Add parser tests for computed properties --- src/compiler/parser.ts | 18 ++++--- tests/baselines/reference/giant.errors.txt | 48 +++++++++---------- ...SignatureMustHaveTypeAnnotation.errors.txt | 12 ++--- .../indexSignatureWithInitializer.errors.txt | 20 +++----- .../indexWithoutParamType2.errors.txt | 6 +-- ...objectTypeWithOptionalProperty1.errors.txt | 4 +- ...jectTypesWithOptionalProperties.errors.txt | 4 +- .../parserComputedPropertyName1.errors.txt | 7 +++ .../parserComputedPropertyName10.errors.txt | 9 ++++ .../parserComputedPropertyName11.errors.txt | 9 ++++ .../parserComputedPropertyName13.errors.txt | 7 +++ .../parserComputedPropertyName14.errors.txt | 7 +++ .../parserComputedPropertyName15.errors.txt | 7 +++ .../parserComputedPropertyName16.errors.txt | 9 ++++ .../parserComputedPropertyName18.errors.txt | 7 +++ .../parserComputedPropertyName19.errors.txt | 7 +++ .../parserComputedPropertyName20.errors.txt | 9 ++++ .../parserComputedPropertyName21.errors.txt | 9 ++++ .../parserComputedPropertyName22.errors.txt | 9 ++++ .../parserComputedPropertyName23.errors.txt | 9 ++++ .../parserComputedPropertyName25.errors.txt | 14 ++++++ .../parserComputedPropertyName26.errors.txt | 14 ++++++ .../parserComputedPropertyName27.errors.txt | 14 ++++++ .../parserComputedPropertyName28.errors.txt | 13 +++++ .../parserComputedPropertyName29.errors.txt | 17 +++++++ .../parserComputedPropertyName30.errors.txt | 14 ++++++ .../parserComputedPropertyName31.errors.txt | 14 ++++++ .../parserComputedPropertyName32.errors.txt | 9 ++++ .../parserComputedPropertyName33.errors.txt | 17 +++++++ .../parserComputedPropertyName34.errors.txt | 17 +++++++ .../parserComputedPropertyName5.errors.txt | 19 ++++++++ .../parserComputedPropertyName7.errors.txt | 9 ++++ .../parserComputedPropertyName8.errors.txt | 9 ++++ .../parserComputedPropertyName9.errors.txt | 12 +++++ .../parserES5ComputedPropertyName1.errors.txt | 9 ++++ ...parserES5ComputedPropertyName10.errors.txt | 9 ++++ ...parserES5ComputedPropertyName11.errors.txt | 12 +++++ .../parserES5ComputedPropertyName2.errors.txt | 7 +++ .../parserES5ComputedPropertyName3.errors.txt | 7 +++ .../parserES5ComputedPropertyName4.errors.txt | 7 +++ .../parserES5ComputedPropertyName5.errors.txt | 9 ++++ .../parserES5ComputedPropertyName6.errors.txt | 9 ++++ .../parserES5ComputedPropertyName7.errors.txt | 9 ++++ .../parserES5ComputedPropertyName8.errors.txt | 7 +++ .../parserES5ComputedPropertyName9.errors.txt | 12 +++++ .../parserIndexSignature11.errors.txt | 6 +-- .../parserIndexSignature4.errors.txt | 11 ++--- .../parserIndexSignature5.errors.txt | 6 +-- .../reference/propertyAssignment.errors.txt | 6 +-- ...uestionMarkInPropertyAssignment.errors.txt | 4 +- .../parserES5ComputedPropertyName1.ts | 4 ++ .../parserES5ComputedPropertyName10.ts | 4 ++ .../parserES5ComputedPropertyName11.ts | 4 ++ .../parserES5ComputedPropertyName2.ts | 2 + .../parserES5ComputedPropertyName3.ts | 2 + .../parserES5ComputedPropertyName4.ts | 2 + .../parserES5ComputedPropertyName5.ts | 4 ++ .../parserES5ComputedPropertyName6.ts | 4 ++ .../parserES5ComputedPropertyName7.ts | 4 ++ .../parserES5ComputedPropertyName8.ts | 2 + .../parserES5ComputedPropertyName9.ts | 4 ++ .../parserComputedPropertyName1.ts | 2 + .../parserComputedPropertyName10.ts | 4 ++ .../parserComputedPropertyName11.ts | 4 ++ .../parserComputedPropertyName12.ts | 4 ++ .../parserComputedPropertyName13.ts | 2 + .../parserComputedPropertyName14.ts | 2 + .../parserComputedPropertyName15.ts | 2 + .../parserComputedPropertyName16.ts | 4 ++ .../parserComputedPropertyName17.ts | 2 + .../parserComputedPropertyName18.ts | 2 + .../parserComputedPropertyName19.ts | 2 + .../parserComputedPropertyName2.ts | 2 + .../parserComputedPropertyName20.ts | 4 ++ .../parserComputedPropertyName21.ts | 4 ++ .../parserComputedPropertyName22.ts | 4 ++ .../parserComputedPropertyName23.ts | 4 ++ .../parserComputedPropertyName24.ts | 4 ++ .../parserComputedPropertyName25.ts | 6 +++ .../parserComputedPropertyName26.ts | 6 +++ .../parserComputedPropertyName27.ts | 6 +++ .../parserComputedPropertyName28.ts | 5 ++ .../parserComputedPropertyName29.ts | 6 +++ .../parserComputedPropertyName3.ts | 2 + .../parserComputedPropertyName30.ts | 6 +++ .../parserComputedPropertyName31.ts | 6 +++ .../parserComputedPropertyName32.ts | 4 ++ .../parserComputedPropertyName33.ts | 6 +++ .../parserComputedPropertyName34.ts | 6 +++ .../parserComputedPropertyName4.ts | 2 + .../parserComputedPropertyName5.ts | 2 + .../parserComputedPropertyName6.ts | 2 + .../parserComputedPropertyName7.ts | 4 ++ .../parserComputedPropertyName8.ts | 4 ++ .../parserComputedPropertyName9.ts | 4 ++ 95 files changed, 626 insertions(+), 78 deletions(-) create mode 100644 tests/baselines/reference/parserComputedPropertyName1.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName10.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName11.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName13.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName14.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName15.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName16.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName18.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName19.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName20.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName21.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName22.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName23.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName25.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName26.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName27.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName28.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName29.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName30.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName31.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName32.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName33.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName34.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName5.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName7.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName8.errors.txt create mode 100644 tests/baselines/reference/parserComputedPropertyName9.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName2.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName3.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName6.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt create mode 100644 tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index d884aef808c..99bb1f6f85d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4528,14 +4528,12 @@ module ts { var inStrictMode = (node.parserContextFlags & ParserContextFlags.StrictMode) !== 0; for (var i = 0, n = node.properties.length; i < n; i++) { - var prop = node.properties[i]; - if (prop.kind === SyntaxKind.OmittedExpression || p.name.kind === SyntaxKind.ComputedPropertyName) { + var prop = node.properties[i]; + var name = prop.name; + if (prop.kind === SyntaxKind.OmittedExpression || name.kind === SyntaxKind.ComputedPropertyName) { continue; } - var p = prop; - var name = p.name; - // ECMA-262 11.1.5 Object Initialiser // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true // a.This production is contained in strict code and IsDataDescriptor(previous) is true and @@ -4545,20 +4543,20 @@ module ts { // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind: number; - if (p.kind === SyntaxKind.PropertyAssignment) { + if (prop.kind === SyntaxKind.PropertyAssignment) { currentKind = Property; } - else if (p.kind === SyntaxKind.ShorthandPropertyAssignment) { + else if (prop.kind === SyntaxKind.ShorthandPropertyAssignment) { currentKind = Property; } - else if (p.kind === SyntaxKind.GetAccessor) { + else if (prop.kind === SyntaxKind.GetAccessor) { currentKind = GetAccessor; } - else if (p.kind === SyntaxKind.SetAccessor) { + else if (prop.kind === SyntaxKind.SetAccessor) { currentKind = SetAccesor; } else { - Debug.fail("Unexpected syntax kind:" + p.kind); + Debug.fail("Unexpected syntax kind:" + prop.kind); } if (!hasProperty(seen, name.text)) { diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index 767c419952c..5bc00b7cd28 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(61,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(61,5): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -13,7 +13,7 @@ tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(125,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(125,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context. @@ -23,7 +23,7 @@ tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(204,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(204,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(233,39): error TS1037: A function implementation cannot be declared in an ambient context. @@ -54,7 +54,7 @@ tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(319,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(319,5): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -63,7 +63,7 @@ tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(383,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(383,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context. @@ -73,7 +73,7 @@ tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only availabl tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/giant.ts(462,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(462,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(491,39): error TS1037: A function implementation cannot be declared in an ambient context. @@ -120,7 +120,7 @@ tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed tests/cases/compiler/giant.ts(558,24): error TS1111: A constructor implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(561,21): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(563,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(587,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(587,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(606,22): error TS1037: A function implementation cannot be declared in an ambient context. @@ -137,7 +137,7 @@ tests/cases/compiler/giant.ts(621,29): error TS1036: Statements are not allowed tests/cases/compiler/giant.ts(623,24): error TS1111: A constructor implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(626,21): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(628,21): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(653,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(653,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(672,22): error TS1037: A function implementation cannot be declared in an ambient context. @@ -360,8 +360,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -468,8 +468,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -593,8 +593,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -820,8 +820,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -928,8 +928,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -1053,8 +1053,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -1322,8 +1322,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -1424,8 +1424,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all //Index Signature [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt index e7437fcb056..c76acf795ac 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(2,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(2,5): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1021: An index signature must have a type annotation. -tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(7,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(7,5): error TS1164: Computed property names are not allowed in class property declarations. tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021: An index signature must have a type annotation. ==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (4 errors) ==== interface I { [x]: string; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [x: string]; ~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. @@ -16,8 +16,8 @@ tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021 class C { [x]: string - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. } diff --git a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt index 9eeff2c5781..414bcdfb84c 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt +++ b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt @@ -1,22 +1,16 @@ -tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS1020: An index signature parameter cannot have an initializer. -tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS1020: An index signature parameter cannot have an initializer. -tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/indexSignatureWithInitializer.ts(2,5): error TS1161: Computed property names are not allowed in interfaces or type literals. +tests/cases/compiler/indexSignatureWithInitializer.ts(6,5): error TS1164: Computed property names are not allowed in class property declarations. -==== tests/cases/compiler/indexSignatureWithInitializer.ts (4 errors) ==== +==== tests/cases/compiler/indexSignatureWithInitializer.ts (2 errors) ==== interface I { [x = '']: string; - ~ -!!! error TS1020: An index signature parameter cannot have an initializer. - ~~~~~~ -!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + ~~~~~~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. } class C { [x = 0]: string - ~ -!!! error TS1020: An index signature parameter cannot have an initializer. - ~~~~~ -!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + ~~~~~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. } \ No newline at end of file diff --git a/tests/baselines/reference/indexWithoutParamType2.errors.txt b/tests/baselines/reference/indexWithoutParamType2.errors.txt index 3e7b9b49223..f9ab6057546 100644 --- a/tests/baselines/reference/indexWithoutParamType2.errors.txt +++ b/tests/baselines/reference/indexWithoutParamType2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/indexWithoutParamType2.ts(2,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/indexWithoutParamType2.ts(2,5): error TS1164: Computed property names are not allowed in class property declarations. ==== tests/cases/compiler/indexWithoutParamType2.ts (1 errors) ==== class C { [x]: string - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt index e2e1c05ea1e..7e17563873a 100644 --- a/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt +++ b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/objectTypeWithOptionalProperty1.ts(2,10): error TS1162: An object member cannot be declared optional. +tests/cases/compiler/objectTypeWithOptionalProperty1.ts(2,10): error TS1160: An object member cannot be declared optional. ==== tests/cases/compiler/objectTypeWithOptionalProperty1.ts (1 errors) ==== var b = { x?: 1 // error ~ -!!! error TS1162: An object member cannot be declared optional. +!!! error TS1160: An object member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt index a2269c29d11..d33a5e35b63 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(12,6): error TS1112: A class member cannot be declared optional. tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(20,6): error TS1112: A class member cannot be declared optional. -tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1162: An object member cannot be declared optional. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1160: An object member cannot be declared optional. ==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (3 errors) ==== @@ -33,5 +33,5 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWith var b = { x?: 1 // error ~ -!!! error TS1162: An object member cannot be declared optional. +!!! error TS1160: An object member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName1.errors.txt b/tests/baselines/reference/parserComputedPropertyName1.errors.txt new file mode 100644 index 00000000000..508d06a915c --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts(1,15): error TS1005: ':' expected. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts (1 errors) ==== + var v = { [e] }; + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName10.errors.txt b/tests/baselines/reference/parserComputedPropertyName10.errors.txt new file mode 100644 index 00000000000..279750d21bd --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName10.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts (1 errors) ==== + class C { + [e] = 1 + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName11.errors.txt b/tests/baselines/reference/parserComputedPropertyName11.errors.txt new file mode 100644 index 00000000000..2d2edd2b841 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName11.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts(2,4): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts (1 errors) ==== + class C { + [e](); + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName13.errors.txt b/tests/baselines/reference/parserComputedPropertyName13.errors.txt new file mode 100644 index 00000000000..eb5eb57d902 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName13.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts(1,10): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts (1 errors) ==== + var v: { [e]: number }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName14.errors.txt b/tests/baselines/reference/parserComputedPropertyName14.errors.txt new file mode 100644 index 00000000000..ac5fcfff3bd --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName14.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts(1,10): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts (1 errors) ==== + var v: { [e](): number }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName15.errors.txt b/tests/baselines/reference/parserComputedPropertyName15.errors.txt new file mode 100644 index 00000000000..e03c5c1f259 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName15.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts(1,31): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts (1 errors) ==== + var v: { [e: number]: string; [e]: number }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName16.errors.txt b/tests/baselines/reference/parserComputedPropertyName16.errors.txt new file mode 100644 index 00000000000..8deb137f3af --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName16.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts(2,3): error TS1162: Computed property names are not allowed in enums. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts (1 errors) ==== + enum E { + [e] = 1 + ~~~ +!!! error TS1162: Computed property names are not allowed in enums. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName18.errors.txt b/tests/baselines/reference/parserComputedPropertyName18.errors.txt new file mode 100644 index 00000000000..1e09dae76aa --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName18.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts(1,10): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts (1 errors) ==== + var v: { [e]?(): number }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName19.errors.txt b/tests/baselines/reference/parserComputedPropertyName19.errors.txt new file mode 100644 index 00000000000..3ee3ed84d7b --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName19.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts(1,10): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts (1 errors) ==== + var v: { [e]? }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName20.errors.txt b/tests/baselines/reference/parserComputedPropertyName20.errors.txt new file mode 100644 index 00000000000..2b77f033d9e --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName20.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts(2,5): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts (1 errors) ==== + interface I { + [e](): number + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName21.errors.txt b/tests/baselines/reference/parserComputedPropertyName21.errors.txt new file mode 100644 index 00000000000..f472afd93ee --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName21.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts(2,5): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts (1 errors) ==== + interface I { + [e]: number + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName22.errors.txt b/tests/baselines/reference/parserComputedPropertyName22.errors.txt new file mode 100644 index 00000000000..dae871108f0 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName22.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts(2,5): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts (1 errors) ==== + declare class C { + [e]: number + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName23.errors.txt b/tests/baselines/reference/parserComputedPropertyName23.errors.txt new file mode 100644 index 00000000000..2018032ef94 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName23.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts(2,9): error TS1086: An accessor cannot be declared in an ambient context. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts (1 errors) ==== + declare class C { + get [e](): number + ~~~ +!!! error TS1086: An accessor cannot be declared in an ambient context. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName25.errors.txt b/tests/baselines/reference/parserComputedPropertyName25.errors.txt new file mode 100644 index 00000000000..7e0d3abdd37 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName25.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(3,5): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts(4,6): error TS2304: Cannot find name 'e2'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts (2 errors) ==== + class C { + // No ASI + [e] = 0 + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + [e2] = 1 + ~~ +!!! error TS2304: Cannot find name 'e2'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName26.errors.txt b/tests/baselines/reference/parserComputedPropertyName26.errors.txt new file mode 100644 index 00000000000..85d0729e73f --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName26.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts(3,5): error TS1162: Computed property names are not allowed in enums. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts(4,6): error TS2304: Cannot find name 'e2'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts (2 errors) ==== + enum E { + // No ASI + [e] = 0 + ~~~ +!!! error TS1162: Computed property names are not allowed in enums. + [e2] = 1 + ~~ +!!! error TS2304: Cannot find name 'e2'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName27.errors.txt b/tests/baselines/reference/parserComputedPropertyName27.errors.txt new file mode 100644 index 00000000000..ee13c5878c7 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName27.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts(4,9): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts(4,6): error TS2304: Cannot find name 'e2'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts (2 errors) ==== + class C { + // No ASI + [e]: number = 0 + [e2]: number + ~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e2'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName28.errors.txt b/tests/baselines/reference/parserComputedPropertyName28.errors.txt new file mode 100644 index 00000000000..f36b15b61b6 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName28.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(2,5): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts(3,5): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts (2 errors) ==== + class C { + [e]: number = 0; + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + [e2]: number + ~~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName29.errors.txt b/tests/baselines/reference/parserComputedPropertyName29.errors.txt new file mode 100644 index 00000000000..0b832d1b68f --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName29.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,5): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(4,5): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts(3,11): error TS2304: Cannot find name 'id'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts (3 errors) ==== + class C { + // yes ASI + [e] = id++ + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + ~~ +!!! error TS2304: Cannot find name 'id'. + [e2]: number + ~~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName30.errors.txt b/tests/baselines/reference/parserComputedPropertyName30.errors.txt new file mode 100644 index 00000000000..0058f0ef698 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName30.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts(4,5): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts(3,11): error TS2304: Cannot find name 'id'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts (2 errors) ==== + enum E { + // no ASI, comma expected + [e] = id++ + ~~ +!!! error TS2304: Cannot find name 'id'. + [e2] = 1 + ~ +!!! error TS1005: ',' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName31.errors.txt b/tests/baselines/reference/parserComputedPropertyName31.errors.txt new file mode 100644 index 00000000000..21f96dcbf5d --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName31.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(3,5): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts(4,5): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts (2 errors) ==== + class C { + // yes ASI + [e]: number + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + [e2]: number + ~~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName32.errors.txt b/tests/baselines/reference/parserComputedPropertyName32.errors.txt new file mode 100644 index 00000000000..88d738421e2 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName32.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts(2,5): error TS1163: Computed property names are not allowed in an ambient context. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts (1 errors) ==== + declare class C { + [e](): number + ~~~ +!!! error TS1163: Computed property names are not allowed in an ambient context. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName33.errors.txt b/tests/baselines/reference/parserComputedPropertyName33.errors.txt new file mode 100644 index 00000000000..bea498036f8 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName33.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts(4,12): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts(5,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts(4,6): error TS2304: Cannot find name 'e2'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts (3 errors) ==== + class C { + // No ASI + [e] = 0 + [e2]() { } + ~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e2'. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName34.errors.txt b/tests/baselines/reference/parserComputedPropertyName34.errors.txt new file mode 100644 index 00000000000..b1cc4b91533 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName34.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(3,5): error TS1162: Computed property names are not allowed in enums. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(4,5): error TS1162: Computed property names are not allowed in enums. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts(3,11): error TS2304: Cannot find name 'id'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts (3 errors) ==== + enum E { + // no ASI, comma expected + [e] = id++, + ~~~ +!!! error TS1162: Computed property names are not allowed in enums. + ~~ +!!! error TS2304: Cannot find name 'id'. + [e2] = 1 + ~~~~ +!!! error TS1162: Computed property names are not allowed in enums. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName5.errors.txt b/tests/baselines/reference/parserComputedPropertyName5.errors.txt new file mode 100644 index 00000000000..149550c93ff --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName5.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,18): error TS1005: ':' expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,28): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,32): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,18): error TS2304: Cannot find name 'get'. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,23): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts (5 errors) ==== + var v = { public get [e]() { } }; + ~~~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~ +!!! error TS2304: Cannot find name 'get'. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName7.errors.txt b/tests/baselines/reference/parserComputedPropertyName7.errors.txt new file mode 100644 index 00000000000..6c46fc343a8 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName7.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts (1 errors) ==== + class C { + [e] + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName8.errors.txt b/tests/baselines/reference/parserComputedPropertyName8.errors.txt new file mode 100644 index 00000000000..07f5ec5dee1 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName8.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts(2,11): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts (1 errors) ==== + class C { + public [e] + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName9.errors.txt b/tests/baselines/reference/parserComputedPropertyName9.errors.txt new file mode 100644 index 00000000000..a93da2261c8 --- /dev/null +++ b/tests/baselines/reference/parserComputedPropertyName9.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts(2,9): error TS2304: Cannot find name 'Type'. + + +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts (2 errors) ==== + class C { + [e]: Type + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + ~~~~ +!!! error TS2304: Cannot find name 'Type'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt new file mode 100644 index 00000000000..75e5d505696 --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts(2,5): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts (1 errors) ==== + declare class C { + [e]: number + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt new file mode 100644 index 00000000000..c2e53b50818 --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName10.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts (1 errors) ==== + class C { + [e] = 1 + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt new file mode 100644 index 00000000000..cfd2ba4c3f8 --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName11.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts(2,4): error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts(2,4): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts (2 errors) ==== + class C { + [e](); + ~~~ +!!! error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName2.errors.txt new file mode 100644 index 00000000000..9b2d920f53f --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts(1,11): error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts (1 errors) ==== + var v = { [e]: 1 }; + ~~~ +!!! error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName3.errors.txt new file mode 100644 index 00000000000..da346e98bae --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts(1,11): error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts (1 errors) ==== + var v = { [e]() { } }; + ~~~ +!!! error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt new file mode 100644 index 00000000000..b99115f8d1e --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,15): error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts (1 errors) ==== + var v = { get [e]() { } }; + ~~~ +!!! error TS1165: Computed property names are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt new file mode 100644 index 00000000000..fc7a67e729b --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts(2,5): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts (1 errors) ==== + interface I { + [e]: number + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName6.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName6.errors.txt new file mode 100644 index 00000000000..ce3592b08e0 --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts(2,3): error TS1162: Computed property names are not allowed in enums. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts (1 errors) ==== + enum E { + [e] = 1 + ~~~ +!!! error TS1162: Computed property names are not allowed in enums. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt new file mode 100644 index 00000000000..5bc1a94da3b --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName7.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts (1 errors) ==== + class C { + [e] + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt new file mode 100644 index 00000000000..e5312829ab6 --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName8.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts(1,10): error TS1161: Computed property names are not allowed in interfaces or type literals. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts (1 errors) ==== + var v: { [e]: number }; + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt new file mode 100644 index 00000000000..af78dcc3e4e --- /dev/null +++ b/tests/baselines/reference/parserES5ComputedPropertyName9.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,4): error TS1164: Computed property names are not allowed in class property declarations. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts(2,9): error TS2304: Cannot find name 'Type'. + + +==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts (2 errors) ==== + class C { + [e]: Type + ~~~ +!!! error TS1164: Computed property names are not allowed in class property declarations. + ~~~~ +!!! error TS2304: Cannot find name 'Type'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexSignature11.errors.txt b/tests/baselines/reference/parserIndexSignature11.errors.txt index 585e72a3516..427d3090e48 100644 --- a/tests/baselines/reference/parserIndexSignature11.errors.txt +++ b/tests/baselines/reference/parserIndexSignature11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(2,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(2,9): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(3,9): error TS1021: An index signature must have a type annotation. tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts(4,10): error TS1096: An index signature must have exactly one parameter. @@ -6,8 +6,8 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature1 ==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature11.ts (3 errors) ==== interface I { [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. [p1: string]; ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. diff --git a/tests/baselines/reference/parserIndexSignature4.errors.txt b/tests/baselines/reference/parserIndexSignature4.errors.txt index cf4bbad234b..f93d8aed249 100644 --- a/tests/baselines/reference/parserIndexSignature4.errors.txt +++ b/tests/baselines/reference/parserIndexSignature4.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,4): error TS1020: An index signature parameter cannot have an initializer. -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,4): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts(2,3): error TS1161: Computed property names are not allowed in interfaces or type literals. -==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature4.ts (1 errors) ==== interface I { [a = 0] - ~ -!!! error TS1020: An index signature parameter cannot have an initializer. - ~~~~~ -!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + ~~~~~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexSignature5.errors.txt b/tests/baselines/reference/parserIndexSignature5.errors.txt index 5c33bb583b6..dc6bd18d773 100644 --- a/tests/baselines/reference/parserIndexSignature5.errors.txt +++ b/tests/baselines/reference/parserIndexSignature5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts(2,4): error TS1022: An index signature parameter must have a type annotation. +tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts(2,3): error TS1161: Computed property names are not allowed in interfaces or type literals. ==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature5.ts (1 errors) ==== interface I { [a] - ~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. } \ No newline at end of file diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt index 20894f159e0..41bc7cb6065 100644 --- a/tests/baselines/reference/propertyAssignment.errors.txt +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/propertyAssignment.ts(6,14): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/propertyAssignment.ts(6,13): error TS1161: Computed property names are not allowed in interfaces or type literals. tests/cases/compiler/propertyAssignment.ts(14,1): error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. @@ -10,8 +10,8 @@ tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: numbe var bar1: { x : number; } var foo2: { [index]; } // should be an error - ~~~~~ -!!! error TS1022: An index signature parameter must have a type annotation. + ~~~~~~~ +!!! error TS1161: Computed property names are not allowed in interfaces or type literals. var bar2: { x : number; } var foo3: { ():void; } diff --git a/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt index d51b97546d4..f89252523ef 100644 --- a/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt +++ b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts(1,12): error TS1162: An object member cannot be declared optional. +tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts(1,12): error TS1160: An object member cannot be declared optional. ==== tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts (1 errors) ==== var x = {x ?: 1} // should not crash ~ -!!! error TS1162: An object member cannot be declared optional. \ No newline at end of file +!!! error TS1160: An object member cannot be declared optional. \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts new file mode 100644 index 00000000000..8316cdfbc0e --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName1.ts @@ -0,0 +1,4 @@ +//@target: ES5 +declare class C { + [e]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts new file mode 100644 index 00000000000..777c44e0185 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName10.ts @@ -0,0 +1,4 @@ +//@target: ES5 +class C { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts new file mode 100644 index 00000000000..b5e27ecc71b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName11.ts @@ -0,0 +1,4 @@ +//@target: ES5 +class C { + [e](); +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts new file mode 100644 index 00000000000..2f37b0f2cad --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts @@ -0,0 +1,2 @@ +//@target: ES5 +var v = { [e]: 1 }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts new file mode 100644 index 00000000000..5091ee0b98c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts @@ -0,0 +1,2 @@ +//@target: ES5 +var v = { [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts new file mode 100644 index 00000000000..67b97a6a0bb --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts @@ -0,0 +1,2 @@ +//@target: ES5 +var v = { get [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts new file mode 100644 index 00000000000..05072071410 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName5.ts @@ -0,0 +1,4 @@ +//@target: ES5 +interface I { + [e]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts new file mode 100644 index 00000000000..622bd43e465 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName6.ts @@ -0,0 +1,4 @@ +//@target: ES5 +enum E { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts new file mode 100644 index 00000000000..280dc1a5a0d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName7.ts @@ -0,0 +1,4 @@ +//@target: ES5 +class C { + [e] +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts new file mode 100644 index 00000000000..48abbd6fe95 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts @@ -0,0 +1,2 @@ +//@target: ES5 +var v: { [e]: number }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts new file mode 100644 index 00000000000..de00d6f8245 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName9.ts @@ -0,0 +1,4 @@ +//@target: ES5 +class C { + [e]: Type +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts new file mode 100644 index 00000000000..e6fbccb8e1f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { [e] }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts new file mode 100644 index 00000000000..6f87e04e3f5 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName10.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts new file mode 100644 index 00000000000..17af42fcca3 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName11.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + [e](); +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts new file mode 100644 index 00000000000..b9b870a9ec9 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName12.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + [e]() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts new file mode 100644 index 00000000000..809e258d2d4 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v: { [e]: number }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts new file mode 100644 index 00000000000..3d9fb800d70 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v: { [e](): number }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts new file mode 100644 index 00000000000..ba0a7b84b90 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName15.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v: { [e: number]: string; [e]: number }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts new file mode 100644 index 00000000000..4da898ea68f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName16.ts @@ -0,0 +1,4 @@ +//@target: ES6 +enum E { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts new file mode 100644 index 00000000000..6e6485ea85f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { set [e](v) { } } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts new file mode 100644 index 00000000000..dd05fcac482 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v: { [e]?(): number }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts new file mode 100644 index 00000000000..f190dadb92c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v: { [e]? }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts new file mode 100644 index 00000000000..4efacefce9b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { [e]: 1 }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts new file mode 100644 index 00000000000..148f07becc1 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName20.ts @@ -0,0 +1,4 @@ +//@target: ES6 +interface I { + [e](): number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts new file mode 100644 index 00000000000..f9ec2669ae3 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName21.ts @@ -0,0 +1,4 @@ +//@target: ES6 +interface I { + [e]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts new file mode 100644 index 00000000000..237a4f4e12c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName22.ts @@ -0,0 +1,4 @@ +//@target: ES6 +declare class C { + [e]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts new file mode 100644 index 00000000000..633931ad368 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName23.ts @@ -0,0 +1,4 @@ +//@target: ES6 +declare class C { + get [e](): number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts new file mode 100644 index 00000000000..8ff0f753e1f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName24.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + set [e](v) { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts new file mode 100644 index 00000000000..3bf29e66bae --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName25.ts @@ -0,0 +1,6 @@ +//@target: ES6 +class C { + // No ASI + [e] = 0 + [e2] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts new file mode 100644 index 00000000000..e6eaa682b59 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName26.ts @@ -0,0 +1,6 @@ +//@target: ES6 +enum E { + // No ASI + [e] = 0 + [e2] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts new file mode 100644 index 00000000000..d52b7d43cfc --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName27.ts @@ -0,0 +1,6 @@ +//@target: ES6 +class C { + // No ASI + [e]: number = 0 + [e2]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts new file mode 100644 index 00000000000..2cae79f1934 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName28.ts @@ -0,0 +1,5 @@ +//@target: ES6 +class C { + [e]: number = 0; + [e2]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts new file mode 100644 index 00000000000..c3e42731ab9 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName29.ts @@ -0,0 +1,6 @@ +//@target: ES6 +class C { + // yes ASI + [e] = id++ + [e2]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts new file mode 100644 index 00000000000..0988e19a1ef --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts new file mode 100644 index 00000000000..f7eb547332b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName30.ts @@ -0,0 +1,6 @@ +//@target: ES6 +enum E { + // no ASI, comma expected + [e] = id++ + [e2] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts new file mode 100644 index 00000000000..30e511fa91b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName31.ts @@ -0,0 +1,6 @@ +//@target: ES6 +class C { + // yes ASI + [e]: number + [e2]: number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts new file mode 100644 index 00000000000..f1a50fe108d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName32.ts @@ -0,0 +1,4 @@ +//@target: ES6 +declare class C { + [e](): number +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts new file mode 100644 index 00000000000..2ca7ac84af7 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName33.ts @@ -0,0 +1,6 @@ +//@target: ES6 +class C { + // No ASI + [e] = 0 + [e2]() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts new file mode 100644 index 00000000000..c83710593a0 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName34.ts @@ -0,0 +1,6 @@ +//@target: ES6 +enum E { + // no ASI, comma expected + [e] = id++, + [e2] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts new file mode 100644 index 00000000000..e36773105fe --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { get [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts new file mode 100644 index 00000000000..869f340929b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { public get [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts new file mode 100644 index 00000000000..aaf4131d158 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts @@ -0,0 +1,2 @@ +//@target: ES6 +var v = { [e]: 1, [e + e]: 2 }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts new file mode 100644 index 00000000000..8f918c61160 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName7.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + [e] +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts new file mode 100644 index 00000000000..6e55c04b7a1 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName8.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + public [e] +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts new file mode 100644 index 00000000000..0c60d35fb90 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName9.ts @@ -0,0 +1,4 @@ +//@target: ES6 +class C { + [e]: Type +} \ No newline at end of file