MCPcopy
hub / github.com/sveltejs/svelte / js

Function js

packages/svelte/src/compiler/phases/2-analyze/index.js:217–235  ·  view source on GitHub ↗

* @param {AST.Script | null} script * @param {ScopeRoot} root * @param {boolean} allow_reactive_declarations * @param {Scope | null} parent * @returns {Js}

(script, root, allow_reactive_declarations, parent)

Source from the content-addressed store, hash-verified

215 * @returns {Js}
216 */
217function js(script, root, allow_reactive_declarations, parent) {
218 /** @type {ESTree.Program} */
219 const ast = script?.content ?? {
220 type: 'Program',
221 sourceType: 'module',
222 start: -1,
223 end: -1,
224 body: []
225 };
226
227 const { scope, scopes, has_await } = create_scopes(
228 ast,
229 root,
230 allow_reactive_declarations,
231 parent
232 );
233
234 return { ast, scope, scopes, has_await };
235}
236
237/**
238 * @param {string} filename

Callers 1

analyze_componentFunction · 0.85

Calls 1

create_scopesFunction · 0.90

Tested by

no test coverage detected