TypeScript/tests/baselines/reference/computedPropertyNames13_ES5.js
LowR cd0434aa76
fix(39744): make template literals more spec compliant (#45304)
* fix(39744): make template literals more spec compliant

* Add evaluation test for template literals

* Add test for template literals with source map
2021-10-13 12:03:31 -07:00

39 lines
907 B
TypeScript

//// [computedPropertyNames13_ES5.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_ES5.js]
var s;
var n;
var a;
var C = /** @class */ (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 ".concat(a, " bye")] = function () { };
return C;
}());