Skip to content

Commit ff2ac75

Browse files
committed
fixup: test for semicolon-less statements in functions
1 parent 586d919 commit ff2ac75

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
@@ -249,6 +249,19 @@ describe('AsyncWriter', function () {
249249
);
250250
});
251251

252+
it('can handle semicolon-less input inside functions', function () {
253+
expect(
254+
runTranspiledCode(`
255+
(function() {
256+
let foo = {}
257+
foo.bar = {}
258+
foo.fn = function() {}
259+
return foo;
260+
})()
261+
`).bar
262+
).to.deep.equal({});
263+
});
264+
252265
it('moves top-level classes into the top-level scope', function () {
253266
const A = runTranspiledCode('class A {}');
254267
expect(A.constructor.name).to.equal('Function');

0 commit comments

Comments
 (0)