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