Skip to content

Commit 893e367

Browse files
committed
fixup: another one, this time for classes
1 parent 12d4d63 commit 893e367

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/async-rewriter2/src/async-writer-babel.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ describe('AsyncWriter', function () {
241241
expect(ctx.A).to.equal(A);
242242
});
243243

244+
it('can initialize immediately after a class definition', function () {
245+
const A = runTranspiledCode(
246+
'class A { prop = 42; }\nconst foo = new A(); foo'
247+
);
248+
expect(A.prop).to.equal(42);
249+
});
250+
244251
it('does not move classes from block scopes to the top-level scope', function () {
245252
const A = runTranspiledCode('{ class A {} }');
246253
expect(A).to.equal(undefined);

0 commit comments

Comments
 (0)