Skip to content

Commit 21e3db1

Browse files
authored
Merge pull request #3333 from Conduitry/gh-3179
preserve async/generator-ness of hoisted function expressions
2 parents 76d04dc + bfa0bc9 commit 21e3db1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/compiler/compile/nodes/shared/Expression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export default class Expression {
363363
}
364364

365365
const fn = deindent`
366-
function ${name}(${args.join(', ')}) ${body}
366+
${node.async && 'async '}function${node.generator && '*'} ${name}(${args.join(', ')}) ${body}
367367
`;
368368

369369
if (dependencies.size === 0 && contextual_dependencies.size === 0) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
html: `
3+
<button>nothing</button>
4+
`,
5+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<button on:click={async () => { await null; }}>nothing</button>

0 commit comments

Comments
 (0)