Skip to content

Commit cd7d015

Browse files
committed
Fixed wrong flipped logic
1 parent 77f91fd commit cd7d015

File tree

1 file changed

+5
-5
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client

1 file changed

+5
-5
lines changed

packages/svelte/src/compiler/phases/3-transform/client/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ export function serialize_set_binding(node, context, fallback) {
259259
node.type === 'ArrowFunctionExpression'
260260
)
261261
);
262-
const closest_function_boundary_not_async =
263-
closest_function_boundary === undefined || closest_function_boundary.async !== true;
262+
const closest_function_boundary_is_async =
263+
closest_function_boundary !== undefined && closest_function_boundary.async === true;
264264

265265
const rhs_expression = /** @type {import('estree').Expression} */ (visit(node.right));
266266

267267
const iife_is_async =
268-
!closest_function_boundary_not_async ||
269-
is_expression_async(rhs_expression) ||
270-
assignments.some((assignment) => is_expression_async(assignment));
268+
closest_function_boundary_is_async &&
269+
(is_expression_async(rhs_expression) ||
270+
assignments.some((assignment) => is_expression_async(assignment)));
271271

272272
const iife = b.arrow(
273273
[],

0 commit comments

Comments
 (0)