Skip to content

Commit 41a20aa

Browse files
authored
chore: remove b.async (#16566)
1 parent b181c45 commit 41a20aa

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

packages/svelte/src/compiler/phases/3-transform/shared/assignments.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ export function visit_assignment_expression(node, context, build_assignment) {
6565
statements.push(b.return(rhs));
6666
}
6767

68-
const iife = b.arrow([rhs], b.block(statements));
69-
70-
const iife_is_async =
68+
const async =
7169
is_expression_async(value) ||
7270
assignments.some((assignment) => is_expression_async(assignment));
7371

74-
return iife_is_async ? b.await(b.call(b.async(iife), value)) : b.call(iife, value);
72+
const iife = b.arrow([rhs], b.block(statements), async);
73+
const call = b.call(iife, value);
74+
75+
return async ? b.await(call) : call;
7576
}
7677

7778
const sequence = b.sequence(assignments);

packages/svelte/src/compiler/utils/builders.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,6 @@ export function assignment(operator, left, right) {
5656
return { type: 'AssignmentExpression', operator, left, right };
5757
}
5858

59-
/**
60-
* @template T
61-
* @param {T & ESTree.BaseFunction} func
62-
* @returns {T & ESTree.BaseFunction}
63-
*/
64-
export function async(func) {
65-
return { ...func, async: true };
66-
}
67-
6859
/**
6960
* @param {ESTree.Expression} argument
7061
* @returns {ESTree.AwaitExpression}

0 commit comments

Comments
 (0)