Home / Function/ BinaryExpression() — svelte Function Reference

BinaryExpression() — svelte Function Reference

Architecture documentation for the BinaryExpression() function in BinaryExpression.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  8c64e324_a753_a33e_728e_674e41451780["BinaryExpression()"]
  abd78909_21a6_b584_c741_fc2f2153a05d["BinaryExpression.js"]
  8c64e324_a753_a33e_728e_674e41451780 -->|defined in| abd78909_21a6_b584_c741_fc2f2153a05d
  style 8c64e324_a753_a33e_728e_674e41451780 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/3-transform/client/visitors/BinaryExpression.js lines 10–34

export function BinaryExpression(node, context) {
	if (dev) {
		const operator = node.operator;

		if (operator === '===' || operator === '!==') {
			return b.call(
				'$.strict_equals',
				/** @type {Expression} */ (context.visit(node.left)),
				/** @type {Expression} */ (context.visit(node.right)),
				operator === '!==' && b.false
			);
		}

		if (operator === '==' || operator === '!=') {
			return b.call(
				'$.equals',
				/** @type {Expression} */ (context.visit(node.left)),
				/** @type {Expression} */ (context.visit(node.right)),
				operator === '!=' && b.false
			);
		}
	}

	context.next();
}

Domain

Subdomains

Frequently Asked Questions

What does BinaryExpression() do?
BinaryExpression() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/client/visitors/BinaryExpression.js.
Where is BinaryExpression() defined?
BinaryExpression() is defined in packages/svelte/src/compiler/phases/3-transform/client/visitors/BinaryExpression.js at line 10.

Analyze Your Own Codebase

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

Try Supermodel Free