(elt)
| 2836 | } |
| 2837 | } |
| 2838 | #resolveTemplateScopes(elt) { |
| 2839 | var root = elt.closest('[data-live-template], [dom-scope="isolated"]'); |
| 2840 | if (!root || !root.__hs_scopes) return; |
| 2841 | var matches = []; |
| 2842 | var node = elt; |
| 2843 | while (node && node !== root) { |
| 2844 | var prev = node.previousSibling; |
| 2845 | while (prev) { |
| 2846 | if (prev.nodeType === 8) { |
| 2847 | var text = prev.data; |
| 2848 | if (text.startsWith("hs-scope:")) { |
| 2849 | matches.push(text); |
| 2850 | break; |
| 2851 | } |
| 2852 | } |
| 2853 | prev = prev.previousSibling; |
| 2854 | } |
| 2855 | node = node.parentElement; |
| 2856 | } |
| 2857 | if (!matches.length) return; |
| 2858 | var internalData = this.getInternalData(elt); |
| 2859 | if (!internalData.elementScope) internalData.elementScope = {}; |
| 2860 | for (var i = 0; i < matches.length; i++) { |
| 2861 | var parts = matches[i].split(":"); |
| 2862 | var loopId = parts[1]; |
| 2863 | var iter = parseInt(parts[2]); |
| 2864 | var scope = root.__hs_scopes[loopId]; |
| 2865 | if (!scope) continue; |
| 2866 | internalData.elementScope[scope.identifier] = scope.source[iter]; |
| 2867 | if (scope.indexIdentifier) { |
| 2868 | internalData.elementScope[scope.indexIdentifier] = iter; |
| 2869 | } |
| 2870 | } |
| 2871 | } |
| 2872 | #beforeProcessHooks = []; |
| 2873 | #afterProcessHooks = []; |
| 2874 | addBeforeProcessHook(fn) { |
no test coverage detected