Skip to content

Commit 5c81887

Browse files
committed
tidy up
1 parent 20c9695 commit 5c81887

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @import { AssignmentExpression, BinaryOperator, Expression, Node, Pattern } from 'estree' */
22
/** @import { SvelteNode } from '#compiler' */
33
/** @import { Context, ServerTransformState } from '../types.js' */
4-
import { extract_paths } from '../../../../utils/ast.js';
54
import * as b from '../../../../utils/builders.js';
5+
import { extract_paths } from '../../../../utils/ast.js';
66
import { serialize_get_binding } from './shared/utils.js';
77

88
/**
@@ -12,6 +12,7 @@ import { serialize_get_binding } from './shared/utils.js';
1212
export function AssignmentExpression(node, context) {
1313
const parent = /** @type {Node} */ (context.path.at(-1));
1414
const is_standalone = parent.type.endsWith('Statement');
15+
1516
return serialize_assignment(node, context, is_standalone, context.next);
1617
}
1718

@@ -63,10 +64,6 @@ function serialize_assignment(node, context, is_standalone, fallback) {
6364
return sequence;
6465
}
6566

66-
if (node.left.type !== 'Identifier' && node.left.type !== 'MemberExpression') {
67-
throw new Error(`Unexpected assignment type ${node.left.type}`);
68-
}
69-
7067
let left = node.left;
7168

7269
while (left.type === 'MemberExpression') {

0 commit comments

Comments
 (0)