Home / Function/ constructor() — svelte Function Reference

constructor() — svelte Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5c4ba0c1_a105_1c1d_27a4_4abc1d9e72ab["constructor()"]
  f49779c1_f219_37b0_968a_883379ecd32c["SvelteMap"]
  5c4ba0c1_a105_1c1d_27a4_4abc1d9e72ab -->|defined in| f49779c1_f219_37b0_968a_883379ecd32c
  4dfcf957_8573_ff55_bd31_4181227109e3["tag()"]
  5c4ba0c1_a105_1c1d_27a4_4abc1d9e72ab -->|calls| 4dfcf957_8573_ff55_bd31_4181227109e3
  c4654be9_603f_7b49_e404_23ea06eb0af5["set()"]
  5c4ba0c1_a105_1c1d_27a4_4abc1d9e72ab -->|calls| c4654be9_603f_7b49_e404_23ea06eb0af5
  style 5c4ba0c1_a105_1c1d_27a4_4abc1d9e72ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/reactivity/map.js lines 63–80

	constructor(value) {
		super();

		if (DEV) {
			// If the value is invalid then the native exception will fire here
			value = new Map(value);

			tag(this.#version, 'SvelteMap version');
			tag(this.#size, 'SvelteMap.size');
		}

		if (value) {
			for (var [key, v] of value) {
				super.set(key, v);
			}
			this.#size.v = super.size;
		}
	}

Subdomains

Calls

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the svelte codebase, defined in packages/svelte/src/reactivity/map.js.
Where is constructor() defined?
constructor() is defined in packages/svelte/src/reactivity/map.js at line 63.
What does constructor() call?
constructor() calls 2 function(s): set, tag.

Analyze Your Own Codebase

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

Try Supermodel Free