MCPcopy Create free account
hub / github.com/observablehq/framework / declareLocal

Function declareLocal

src/javascript/declarations.ts:8–13  ·  view source on GitHub ↗
(node: Identifier)

Source from the content-addressed store, hash-verified

6 const declarations: Identifier[] = [];
7
8 function declareLocal(node: Identifier) {
9 if (defaultGlobals.has(node.name) || node.name === "arguments") {
10 throw syntaxError(`Global '${node.name}' cannot be redefined`, node, input);
11 }
12 declarations.push(node);
13 }
14
15 function declarePattern(node: Pattern) {
16 switch (node.type) {

Callers 2

declarePatternFunction · 0.70
findDeclarationsFunction · 0.70

Calls 1

syntaxErrorFunction · 0.85

Tested by

no test coverage detected