Skip to content

Commit caf3d72

Browse files
committed
Remove optimization, probs not worth it
1 parent cd7d015 commit caf3d72

File tree

1 file changed

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

1 file changed

+2
-17
lines changed

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,11 @@ export function serialize_set_binding(node, context, fallback) {
248248
return fallback();
249249
}
250250

251-
/** Potential optimization: find nearest function boundary and if it is not async, the assignment can't be async */
252-
const closest_function_boundary =
253-
/** @type {import('estree').BaseFunction | undefined} */
254-
(
255-
context.path.findLast(
256-
(node) =>
257-
node.type === 'FunctionDeclaration' ||
258-
node.type === 'FunctionExpression' ||
259-
node.type === 'ArrowFunctionExpression'
260-
)
261-
);
262-
const closest_function_boundary_is_async =
263-
closest_function_boundary !== undefined && closest_function_boundary.async === true;
264-
265251
const rhs_expression = /** @type {import('estree').Expression} */ (visit(node.right));
266252

267253
const iife_is_async =
268-
closest_function_boundary_is_async &&
269-
(is_expression_async(rhs_expression) ||
270-
assignments.some((assignment) => is_expression_async(assignment)));
254+
is_expression_async(rhs_expression) ||
255+
assignments.some((assignment) => is_expression_async(assignment));
271256

272257
const iife = b.arrow(
273258
[],

0 commit comments

Comments
 (0)