* @param {Identifier} node * @param {AST.SvelteNode[]} path
(node, path)
| 774 | * @param {AST.SvelteNode[]} path |
| 775 | */ |
| 776 | reference(node, path) { |
| 777 | path = [...path]; // ensure that mutations to path afterwards don't affect this reference |
| 778 | let references = this.references.get(node.name); |
| 779 | |
| 780 | if (!references) this.references.set(node.name, (references = [])); |
| 781 | |
| 782 | references.push({ node, path }); |
| 783 | |
| 784 | const binding = this.declarations.get(node.name); |
| 785 | if (binding) { |
| 786 | binding.references.push({ node, path }); |
| 787 | } else if (this.parent) { |
| 788 | this.parent.reference(node, path); |
| 789 | } else { |
| 790 | // no binding was found, and this is the top level scope, |
| 791 | // which means this is a global |
| 792 | this.root.conflicts.add(node.name); |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | /** |
| 797 | * Does partial evaluation to find an exact value or at least the rough type of the expression. |
no test coverage detected