diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.errors.txt new file mode 100644 index 00000000000..ec8f9f5ea58 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts(5,3): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts (1 errors) ==== + var v = { + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} + ~~~~ +!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.js new file mode 100644 index 00000000000..a0a7b11fa9b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.js @@ -0,0 +1,25 @@ +//// [computedPropertyNamesDeclarationEmit6_ES5.ts] +var v = { + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} +} + + +//// [computedPropertyNamesDeclarationEmit6_ES5.js] +var _a; +var v = (_a = {}, + _a[-1] = {}, + _a[+1] = {}, + _a[~1] = {}, + _a[!1] = {}, + _a); + + +//// [computedPropertyNamesDeclarationEmit6_ES5.d.ts] +declare var v: { + [x: number]: {}; + [-1]: {}; + 1: {}; +}; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.symbols new file mode 100644 index 00000000000..40280f88d4c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit6_ES5.ts, 0, 3)) + + [-1]: {}, +>[-1] : Symbol([-1], Decl(computedPropertyNamesDeclarationEmit6_ES5.ts, 0, 9)) + + [+1]: {}, +>[+1] : Symbol([+1], Decl(computedPropertyNamesDeclarationEmit6_ES5.ts, 1, 11)) + + [~1]: {}, +>[~1] : Symbol([~1], Decl(computedPropertyNamesDeclarationEmit6_ES5.ts, 2, 11)) + + [!1]: {} +>[!1] : Symbol([!1], Decl(computedPropertyNamesDeclarationEmit6_ES5.ts, 3, 11)) +} + diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.types new file mode 100644 index 00000000000..ed412b8041c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5.types @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts === +var v = { +>v : { [x: number]: {}; [-1]: {}; 1: {}; } +>{ [-1]: {}, [+1]: {}, [~1]: {}, [!1]: {}} : { [x: number]: {}; [-1]: {}; [+1]: {}; } + + [-1]: {}, +>[-1] : {} +>-1 : -1 +>1 : 1 +>{} : {} + + [+1]: {}, +>[+1] : {} +>+1 : 1 +>1 : 1 +>{} : {} + + [~1]: {}, +>[~1] : {} +>~1 : number +>1 : 1 +>{} : {} + + [!1]: {} +>[!1] : {} +>!1 : boolean +>1 : 1 +>{} : {} +} + diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.errors.txt new file mode 100644 index 00000000000..d5db4741dd2 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts(5,3): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + + +==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts (1 errors) ==== + var v = { + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} + ~~~~ +!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js new file mode 100644 index 00000000000..0adc9fb6de7 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js @@ -0,0 +1,24 @@ +//// [computedPropertyNamesDeclarationEmit6_ES6.ts] +var v = { + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} +} + + +//// [computedPropertyNamesDeclarationEmit6_ES6.js] +var v = { + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} +}; + + +//// [computedPropertyNamesDeclarationEmit6_ES6.d.ts] +declare var v: { + [x: number]: {}; + [-1]: {}; + 1: {}; +}; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.symbols new file mode 100644 index 00000000000..0be9c2e9441 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit6_ES6.ts, 0, 3)) + + [-1]: {}, +>[-1] : Symbol([-1], Decl(computedPropertyNamesDeclarationEmit6_ES6.ts, 0, 9)) + + [+1]: {}, +>[+1] : Symbol([+1], Decl(computedPropertyNamesDeclarationEmit6_ES6.ts, 1, 11)) + + [~1]: {}, +>[~1] : Symbol([~1], Decl(computedPropertyNamesDeclarationEmit6_ES6.ts, 2, 11)) + + [!1]: {} +>[!1] : Symbol([!1], Decl(computedPropertyNamesDeclarationEmit6_ES6.ts, 3, 11)) +} + diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types new file mode 100644 index 00000000000..d68d458621c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts === +var v = { +>v : { [x: number]: {}; [-1]: {}; 1: {}; } +>{ [-1]: {}, [+1]: {}, [~1]: {}, [!1]: {}} : { [x: number]: {}; [-1]: {}; [+1]: {}; } + + [-1]: {}, +>[-1] : {} +>-1 : -1 +>1 : 1 +>{} : {} + + [+1]: {}, +>[+1] : {} +>+1 : 1 +>1 : 1 +>{} : {} + + [~1]: {}, +>[~1] : {} +>~1 : number +>1 : 1 +>{} : {} + + [!1]: {} +>[!1] : {} +>!1 : boolean +>1 : 1 +>{} : {} +} + diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts index cb120d70822..002ad4be296 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES5.ts @@ -1,5 +1,8 @@ // @target: es5 // @declaration: true var v = { - [-1]: {} + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} } diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts index 8d904244f3f..b146f3de98a 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts @@ -1,5 +1,8 @@ // @target: es6 // @declaration: true var v = { - [-1]: {} -} \ No newline at end of file + [-1]: {}, + [+1]: {}, + [~1]: {}, + [!1]: {} +}