mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
557 B
TypeScript
33 lines
557 B
TypeScript
//// [tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts] ////
|
|
|
|
//// [classBodyWithStatements.ts]
|
|
class C {
|
|
var x = 1;
|
|
}
|
|
|
|
class C2 {
|
|
function foo() {}
|
|
}
|
|
|
|
var x = 1;
|
|
var y = 2;
|
|
class C3 {
|
|
x: number = y + 1; // ok, need a var in the statement production
|
|
}
|
|
|
|
//// [classBodyWithStatements.js]
|
|
"use strict";
|
|
class C {
|
|
}
|
|
var x = 1;
|
|
class C2 {
|
|
}
|
|
function foo() { }
|
|
var x = 1;
|
|
var y = 2;
|
|
class C3 {
|
|
constructor() {
|
|
this.x = y + 1; // ok, need a var in the statement production
|
|
}
|
|
}
|