Home / File/ function.js — svelte Source File

function.js — svelte Source File

Architecture documentation for function.js, a javascript file in the svelte codebase. 0 imports, 2 dependents.

File javascript Compiler Transformer 2 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  2dd566f0_5d8b_e1b6_882d_fa97f525e4bc["function.js"]
  e5b7b6d8_db59_62cf_4830_cfc2cecac557["ArrowFunctionExpression.js"]
  e5b7b6d8_db59_62cf_4830_cfc2cecac557 --> 2dd566f0_5d8b_e1b6_882d_fa97f525e4bc
  61b744cc_8c4a_ea78_0b55_5d8b38d92f7d["FunctionExpression.js"]
  61b744cc_8c4a_ea78_0b55_5d8b38d92f7d --> 2dd566f0_5d8b_e1b6_882d_fa97f525e4bc
  style 2dd566f0_5d8b_e1b6_882d_fa97f525e4bc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { ArrowFunctionExpression, FunctionExpression, Node } from 'estree' */
/** @import { ComponentContext } from '../../types' */

/**
 * @param {ArrowFunctionExpression | FunctionExpression} node
 * @param {ComponentContext} context
 */
export const visit_function = (node, context) => {
	let state = { ...context.state, in_constructor: false, in_derived: false };

	if (node.type === 'FunctionExpression') {
		const parent = /** @type {Node} */ (context.path.at(-1));
		state.in_constructor = parent.type === 'MethodDefinition' && parent.kind === 'constructor';
	}

	context.next(state);
};

Domain

Subdomains

Functions

Frequently Asked Questions

What does function.js do?
function.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 function.js?
function.js defines 1 function(s): visit_function.
What files import function.js?
function.js is imported by 2 file(s): ArrowFunctionExpression.js, FunctionExpression.js.
Where is function.js in the architecture?
function.js is located at packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/function.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/phases/3-transform/client/visitors/shared).

Analyze Your Own Codebase

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

Try Supermodel Free