Home / File/ scope.js — svelte Source File

scope.js — svelte Source File

Architecture documentation for scope.js, a javascript file in the svelte codebase. 19 imports, 23 dependents.

File javascript Compiler Transformer 19 imports 23 dependents 22 functions 4 classes

Entity Profile

Dependency Diagram

graph LR
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305["scope.js"]
  bbca3d2a_42c8_b215_d3b5_5077ccaf0797["nodes.js"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> bbca3d2a_42c8_b215_d3b5_5077ccaf0797
  6e00a8f3_2371_ecf1_5a93_296f787aca83["ExpressionMetadata"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 6e00a8f3_2371_ecf1_5a93_296f787aca83
  495501a4_a342_6a4d_ac11_e3e2fee8b218["errors.js"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 495501a4_a342_6a4d_ac11_e3e2fee8b218
  a146f6ac_0088_8736_b6ce_318f9f115170["e"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> a146f6ac_0088_8736_b6ce_318f9f115170
  0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c["ast.js"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c
  c12e0147_3f27_cf17_5878_e54ffdc328d5["extract_identifiers"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> c12e0147_3f27_cf17_5878_e54ffdc328d5
  4d1d8bf4_9585_c879_52f8_3662d884f69c["extract_identifiers_from_destructuring"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 4d1d8bf4_9585_c879_52f8_3662d884f69c
  804afe56_25d1_9f41_dafe_adc75e952134["object"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 804afe56_25d1_9f41_dafe_adc75e952134
  d935f45f_6959_e32d_6e74_07f0885da3b7["unwrap_pattern"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> d935f45f_6959_e32d_6e74_07f0885da3b7
  2aa63f4e_82c9_33e3_ac6c_5f3d46250522["utils.js"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 2aa63f4e_82c9_33e3_ac6c_5f3d46250522
  a53788f3_4288_6c23_bd50_e754a22ca567["is_reserved"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> a53788f3_4288_6c23_bd50_e754a22ca567
  96840921_f43d_a26b_1d2e_cd28c0fd6d73["is_rune"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 96840921_f43d_a26b_1d2e_cd28c0fd6d73
  087a1de5_6350_4c2b_e177_479d75ba0608["slot.js"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> 087a1de5_6350_4c2b_e177_479d75ba0608
  a2d986c5_5ad1_b6ea_d335_4846d9af9e9f["determine_slot"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305 --> a2d986c5_5ad1_b6ea_d335_4846d9af9e9f
  style ee93d8a6_6fde_b1c1_e15b_3a4da5326305 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { BinaryOperator, ClassDeclaration, Expression, FunctionDeclaration, Identifier, ImportDeclaration, MemberExpression, LogicalOperator, Node, Pattern, UnaryOperator, VariableDeclarator, Super, SimpleLiteral, FunctionExpression, ArrowFunctionExpression } from 'estree' */
/** @import { Context, Visitor } from 'zimmerframe' */
/** @import { AST, BindingKind, DeclarationKind } from '#compiler' */
import is_reference from 'is-reference';
import { walk } from 'zimmerframe';
import { ExpressionMetadata } from './nodes.js';
import * as b from '#compiler/builders';
import * as e from '../errors.js';
import {
	extract_identifiers,
	extract_identifiers_from_destructuring,
	object,
	unwrap_pattern
} from '../utils/ast.js';
import { is_reserved, is_rune } from '../../utils.js';
import { determine_slot } from '../utils/slot.js';
import { validate_identifier_name } from './2-analyze/visitors/shared/utils.js';

const UNKNOWN = Symbol('unknown');
/** Includes `BigInt` */
const NUMBER = Symbol('number');
const STRING = Symbol('string');
const FUNCTION = Symbol('string');

/** @type {Record<string, [type: typeof NUMBER | typeof  STRING | typeof  UNKNOWN, fn?: Function]>} */
const globals = {
	BigInt: [NUMBER],
	'Math.min': [NUMBER, Math.min],
	'Math.max': [NUMBER, Math.max],
	'Math.random': [NUMBER],
	'Math.floor': [NUMBER, Math.floor],
	// @ts-ignore
	'Math.f16round': [NUMBER, Math.f16round],
	'Math.round': [NUMBER, Math.round],
	'Math.abs': [NUMBER, Math.abs],
	'Math.acos': [NUMBER, Math.acos],
	'Math.asin': [NUMBER, Math.asin],
	'Math.atan': [NUMBER, Math.atan],
	'Math.atan2': [NUMBER, Math.atan2],
	'Math.ceil': [NUMBER, Math.ceil],
	'Math.cos': [NUMBER, Math.cos],
	'Math.sin': [NUMBER, Math.sin],
	'Math.tan': [NUMBER, Math.tan],
	'Math.exp': [NUMBER, Math.exp],
	'Math.log': [NUMBER, Math.log],
	'Math.pow': [NUMBER, Math.pow],
	'Math.sqrt': [NUMBER, Math.sqrt],
	'Math.clz32': [NUMBER, Math.clz32],
	'Math.imul': [NUMBER, Math.imul],
	'Math.sign': [NUMBER, Math.sign],
	'Math.log10': [NUMBER, Math.log10],
	'Math.log2': [NUMBER, Math.log2],
	'Math.log1p': [NUMBER, Math.log1p],
	'Math.expm1': [NUMBER, Math.expm1],
	'Math.cosh': [NUMBER, Math.cosh],
	'Math.sinh': [NUMBER, Math.sinh],
	'Math.tanh': [NUMBER, Math.tanh],
	'Math.acosh': [NUMBER, Math.acosh],
	'Math.asinh': [NUMBER, Math.asinh],
	'Math.atanh': [NUMBER, Math.atanh],
// ... (1361 more lines)

Domain

Subdomains

Imported By

Frequently Asked Questions

What does scope.js do?
scope.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 scope.js?
scope.js defines 22 function(s): binary.!=, binary.!==, binary.**, binary.<<, binary.<=, binary.==, binary.===, binary.>=, binary.>>, binary.>>>, and 12 more.
What does scope.js depend on?
scope.js imports 19 module(s): ExpressionMetadata, ast.js, builders, determine_slot, e, errors.js, extract_identifiers, extract_identifiers_from_destructuring, and 11 more.
What files import scope.js?
scope.js is imported by 23 file(s): AssignmentExpression.js, AssignmentExpression.js, CallExpression.js, CallExpression.js, CallExpression.js, ClassBody.js, ExpressionStatement.js, ExpressionStatement.js, and 15 more.
Where is scope.js in the architecture?
scope.js is located at packages/svelte/src/compiler/phases/scope.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/phases).

Analyze Your Own Codebase

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

Try Supermodel Free