TypeScript/tests/baselines/reference/classWithoutExplicitConstructor.js
Sheetal Nandi 6ab3adfd43 Modified the emitComment logic to handle emitting leading or trailing spaces depending on flags
Leading comments have trailing separator while trailing comments have leading space
This removes the extra trailing space in the trailing comments
2014-08-15 14:32:08 -07:00

37 lines
621 B
TypeScript

//// [classWithoutExplicitConstructor.ts]
class C {
x = 1
y = 'hello';
}
var c = new C();
var c2 = new C(null); // error
class D<T extends Date> {
x = 2
y: T = null;
}
var d = new D();
var d2 = new D(null); // error
//// [classWithoutExplicitConstructor.js]
var C = (function () {
function C() {
this.x = 1;
this.y = 'hello';
}
return C;
})();
var c = new C();
var c2 = new C(null); // error
var D = (function () {
function D() {
this.x = 2;
this.y = null;
}
return D;
})();
var d = new D();
var d2 = new D(null); // error