TypeScript/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.js

42 lines
675 B
TypeScript
Raw Normal View History

//// [emitClassDeclarationWithConstructorInES6.ts]
2015-03-16 05:40:15 +01:00
class A {
y: number;
constructor(x: number) {
}
2015-03-16 05:40:15 +01:00
foo(a: any);
foo() { }
}
2015-03-16 05:40:15 +01:00
class B {
y: number;
x: string = "hello";
2015-03-16 05:40:15 +01:00
_bar: string;
constructor(x: number, z = "hello", ...args) {
this.y = 10;
}
2015-03-16 05:40:15 +01:00
baz(...args): string;
baz(z: string, v: number): string {
return this._bar;
}
}
//// [emitClassDeclarationWithConstructorInES6.js]
2015-03-16 05:40:15 +01:00
class A {
constructor(x) {
}
foo() { }
}
2015-03-16 05:40:15 +01:00
class B {
constructor(x, z = "hello", ...args) {
this.x = "hello";
this.y = 10;
}
2015-03-16 05:40:15 +01:00
baz(z, v) {
return this._bar;
}
}