5fc2ec701b
Conflicts: src/compiler/emitter.ts tests/baselines/reference/FunctionPropertyAssignments5_es6.js tests/baselines/reference/computedPropertyNames9_ES6.js tests/baselines/reference/computedPropertyNamesDeclarationEmit3.js tests/baselines/reference/computedPropertyNamesDeclarationEmit4.js tests/baselines/reference/parserES5ComputedPropertyName3.js tests/baselines/reference/parserES5ComputedPropertyName4.js
38 lines
883 B
JavaScript
38 lines
883 B
JavaScript
//// [computedPropertyNames13_ES6.ts]
|
|
var s: string;
|
|
var n: number;
|
|
var a: any;
|
|
class C {
|
|
[s]() {}
|
|
[n]() { }
|
|
static [s + s]() { }
|
|
[s + n]() { }
|
|
[+s]() { }
|
|
static [""]() { }
|
|
[0]() { }
|
|
[a]() { }
|
|
static [<any>true]() { }
|
|
[`hello bye`]() { }
|
|
static [`hello ${a} bye`]() { }
|
|
}
|
|
|
|
//// [computedPropertyNames13_ES6.js]
|
|
var s;
|
|
var n;
|
|
var a;
|
|
var C = (function () {
|
|
function C() {
|
|
}
|
|
C.prototype[s] = function () { };
|
|
C.prototype[n] = function () { };
|
|
C[s + s] = function () { };
|
|
C.prototype[s + n] = function () { };
|
|
C.prototype[+s] = function () { };
|
|
C[""] = function () { };
|
|
C.prototype[0] = function () { };
|
|
C.prototype[a] = function () { };
|
|
C[true] = function () { };
|
|
C.prototype[`hello bye`] = function () { };
|
|
C[`hello ${a} bye`] = function () { };
|
|
return C;
|
|
})();
|