chore: remove unnecessary `binding.is_called` property (#15361)

pull/15380/head
Rich Harris 6 months ago committed by GitHub
parent 1b882fb1b5
commit 7958eb74df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: remove unnecessary `binding.is_called` property

@ -162,7 +162,7 @@ function get_delegated_event(event_name, handler, context) {
return unhoisted;
}
if (binding !== null && binding.initial !== null && !binding.updated && !binding.is_called) {
if (binding !== null && binding.initial !== null && !binding.updated) {
const binding_type = binding.initial.type;
if (

@ -213,14 +213,6 @@ export function CallExpression(node, context) {
break;
}
if (node.callee.type === 'Identifier') {
const binding = context.state.scope.get(node.callee.name);
if (binding !== null) {
binding.is_called = true;
}
}
// `$inspect(foo)` or `$derived(foo) should not trigger the `static-state-reference` warning
if (rune === '$inspect' || rune === '$derived') {
context.next({ ...context.state, function_depth: context.state.function_depth + 1 });

@ -1,4 +1,4 @@
/** @import { TaggedTemplateExpression, VariableDeclarator } from 'estree' */
/** @import { TaggedTemplateExpression } from 'estree' */
/** @import { Context } from '../types' */
import { is_pure } from './shared/utils.js';
@ -12,12 +12,5 @@ export function TaggedTemplateExpression(node, context) {
context.state.expression.has_state = true;
}
if (node.tag.type === 'Identifier') {
const binding = context.state.scope.get(node.tag.name);
if (binding !== null) {
binding.is_called = true;
}
}
context.next();
}

@ -57,7 +57,6 @@ export class Binding {
*/
metadata = null;
is_called = false;
mutated = false;
reassigned = false;

Loading…
Cancel
Save