Home / File/ AssignmentExpression.js — svelte Source File

AssignmentExpression.js — svelte Source File

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

File javascript Compiler Transformer 5 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

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

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

	if (context.state.reactive_statement) {
		const id = node.left.type === 'MemberExpression' ? object(node.left) : node.left;
		if (id !== null) {
			for (const id of extract_identifiers(node.left)) {
				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

Frequently Asked Questions

What does AssignmentExpression.js do?
AssignmentExpression.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 AssignmentExpression.js?
AssignmentExpression.js defines 1 function(s): AssignmentExpression.
What does AssignmentExpression.js depend on?
AssignmentExpression.js imports 5 module(s): ast.js, extract_identifiers, object, utils.js, validate_assignment.
What files import AssignmentExpression.js?
AssignmentExpression.js is imported by 1 file(s): index.js.
Where is AssignmentExpression.js in the architecture?
AssignmentExpression.js is located at packages/svelte/src/compiler/phases/2-analyze/visitors/AssignmentExpression.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