(componentEl, prop)
| 74 | } |
| 75 | |
| 76 | function parseArg(componentEl, prop) { |
| 77 | if (typeof prop !== 'string') return null; |
| 78 | var cache = componentEl._attrsCache || (componentEl._attrsCache = {}); |
| 79 | if (!cache[prop]) { |
| 80 | var attrValue = componentEl.getAttribute(prop); |
| 81 | if (attrValue == null) return null; |
| 82 | try { |
| 83 | cache[prop] = createParser(tokenizer.tokenize(attrValue)).requireElement("expression"); |
| 84 | } catch (e) { |
| 85 | console.error("component: failed to parse attrs." + prop + ":", e.message); |
| 86 | return null; |
| 87 | } |
| 88 | } |
| 89 | return cache[prop]; |
| 90 | } |
| 91 | |
| 92 | function parentContext(componentEl) { |
| 93 | var parent = componentEl.parentElement; |
no test coverage detected