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

Function add_params

packages/svelte/src/compiler/phases/scope.js:951–957  ·  view source on GitHub ↗

* @param {Scope} scope * @param {Pattern[]} params

(scope, params)

Source from the content-addressed store, hash-verified

949 * @param {Pattern[]} params
950 */
951 function add_params(scope, params) {
952 for (const param of params) {
953 for (const node of extract_identifiers(param)) {
954 scope.declare(node, 'normal', param.type === 'RestElement' ? 'rest_param' : 'param');
955 }
956 }
957 }
958
959 /**
960 * @type {Visitor<Node, State, AST.SvelteNode>}

Callers 3

FunctionExpressionFunction · 0.85
FunctionDeclarationFunction · 0.85
ArrowFunctionExpressionFunction · 0.85

Calls 2

extract_identifiersFunction · 0.90
declareMethod · 0.80

Tested by

no test coverage detected