Home / Class/ Evaluation Class — svelte Architecture

Evaluation Class — svelte Architecture

Architecture documentation for the Evaluation class in scope.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  75e24897_71a6_47b0_c9ce_ac2a920efd8d["Evaluation"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305["scope.js"]
  75e24897_71a6_47b0_c9ce_ac2a920efd8d -->|defined in| ee93d8a6_6fde_b1c1_e15b_3a4da5326305
  f210eacb_3b9d_eacc_7972_c1f662fc4971["constructor()"]
  75e24897_71a6_47b0_c9ce_ac2a920efd8d -->|method| f210eacb_3b9d_eacc_7972_c1f662fc4971

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/scope.js lines 192–597

class Evaluation {
	/** @type {Set<any>} */
	values;

	/**
	 * True if there is exactly one possible value
	 * @readonly
	 * @type {boolean}
	 */
	is_known = true;

	/**
	 * True if the possible values contains `UNKNOWN`
	 * @readonly
	 * @type {boolean}
	 */
	has_unknown = false;

	/**
	 * True if the value is known to not be null/undefined
	 * @readonly
	 * @type {boolean}
	 */
	is_defined = true;

	/**
	 * True if the value is known to be a string
	 * @readonly
	 * @type {boolean}
	 */
	is_string = true;

	/**
	 * True if the value is known to be a number
	 * @readonly
	 * @type {boolean}
	 */
	is_number = true;

	/**
	 * True if the value is known to be a primitive
	 * @readonly
	 * @type {boolean}
	 */
	is_primitive = true;

	/**
	 * True if the value is known to be a function
	 * @readonly
	 * @type {boolean}
	 */
	is_function = true;

	/**
	 * @readonly
	 * @type {any}
	 */
	value = undefined;

	/**
	 *
	 * @param {Scope} scope
	 * @param {Expression | FunctionDeclaration} expression
	 * @param {Set<any>} values
	 */
	constructor(scope, expression, values) {
		current_evaluations.set(expression, this);

		this.values = values;

		switch (expression.type) {
			case 'Literal': {
				this.values.add(expression.value);
				break;
			}

			case 'Identifier': {
				const binding = scope.get(expression.name);

				if (binding) {
					if (

Domain

Frequently Asked Questions

What is the Evaluation class?
Evaluation is a class in the svelte codebase, defined in packages/svelte/src/compiler/phases/scope.js.
Where is Evaluation defined?
Evaluation is defined in packages/svelte/src/compiler/phases/scope.js at line 192.

Analyze Your Own Codebase

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

Try Supermodel Free