Skip to content

Commit 4a65d13

Browse files
committed
fixup: test for semicolon-less statements in functions
1 parent 893e367 commit 4a65d13

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,19 @@ describe('AsyncWriter', function () {
234234
);
235235
});
236236

237+
it('can handle semicolon-less input inside functions', function () {
238+
expect(
239+
runTranspiledCode(`
240+
(function() {
241+
let foo = {}
242+
foo.bar = {}
243+
foo.fn = function() {}
244+
return foo;
245+
})()
246+
`).bar
247+
).to.deep.equal({});
248+
});
249+
237250
it('moves top-level classes into the top-level scope', function () {
238251
const A = runTranspiledCode('class A {}');
239252
expect(A.constructor.name).to.equal('Function');

0 commit comments

Comments
 (0)