Home / File/ UpdateExpression.js — svelte Source File

UpdateExpression.js — svelte Source File

Architecture documentation for UpdateExpression.js, a javascript file in the svelte codebase. 4 imports, 1 dependents.

File javascript Compiler Transformer 4 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  f9172498_1705_28e2_3e27_64d084b5e682["UpdateExpression.js"]
  0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c["ast.js"]
  f9172498_1705_28e2_3e27_64d084b5e682 --> 0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c
  804afe56_25d1_9f41_dafe_adc75e952134["object"]
  f9172498_1705_28e2_3e27_64d084b5e682 --> 804afe56_25d1_9f41_dafe_adc75e952134
  bf0d8f1b_17da_970d_bf44_fbcf099d5371["utils.js"]
  f9172498_1705_28e2_3e27_64d084b5e682 --> bf0d8f1b_17da_970d_bf44_fbcf099d5371
  5ebdf508_43c0_4c5b_b633_950058ffd709["validate_assignment"]
  f9172498_1705_28e2_3e27_64d084b5e682 --> 5ebdf508_43c0_4c5b_b633_950058ffd709
  4aa8a188_84d4_0274_ed83_cac0ab1d3572["index.js"]
  4aa8a188_84d4_0274_ed83_cac0ab1d3572 --> f9172498_1705_28e2_3e27_64d084b5e682
  style f9172498_1705_28e2_3e27_64d084b5e682 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { UpdateExpression } from 'estree' */
/** @import { Context } from '../types' */
import { object } from '../../../utils/ast.js';
import { validate_assignment } from './shared/utils.js';

/**
 * @param {UpdateExpression} node
 * @param {Context} context
 */
export function UpdateExpression(node, context) {
	validate_assignment(node, node.argument, context);

	if (context.state.reactive_statement) {
		const id = node.argument.type === 'MemberExpression' ? object(node.argument) : node.argument;
		if (id?.type === 'Identifier') {
			const binding = context.state.scope.get(id.name);

			if (binding) {
				context.state.reactive_statement.assignments.add(binding);
			}
		}
	}

	if (context.state.expression) {
		context.state.expression.has_assignment = true;
	}

	context.next();
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does UpdateExpression.js do?
UpdateExpression.js is a source file in the svelte codebase, written in javascript. It belongs to the Compiler domain, Transformer subdomain.
What functions are defined in UpdateExpression.js?
UpdateExpression.js defines 1 function(s): UpdateExpression.
What does UpdateExpression.js depend on?
UpdateExpression.js imports 4 module(s): ast.js, object, utils.js, validate_assignment.
What files import UpdateExpression.js?
UpdateExpression.js is imported by 1 file(s): index.js.
Where is UpdateExpression.js in the architecture?
UpdateExpression.js is located at packages/svelte/src/compiler/phases/2-analyze/visitors/UpdateExpression.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/phases/2-analyze/visitors).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free