(componentEl, prop)
| 661 | return source; |
| 662 | } |
| 663 | function parseArg(componentEl, prop) { |
| 664 | if (typeof prop !== "string") return null; |
| 665 | var cache = componentEl._attrsCache || (componentEl._attrsCache = {}); |
| 666 | if (!cache[prop]) { |
| 667 | var attrValue = componentEl.getAttribute(prop); |
| 668 | if (attrValue == null) return null; |
| 669 | try { |
| 670 | cache[prop] = createParser(tokenizer.tokenize(attrValue)).requireElement("expression"); |
| 671 | } catch (e) { |
| 672 | console.error("component: failed to parse attrs." + prop + ":", e.message); |
| 673 | return null; |
| 674 | } |
| 675 | } |
| 676 | return cache[prop]; |
| 677 | } |
| 678 | function parentContext(componentEl) { |
| 679 | var parent = componentEl.parentElement; |
| 680 | return parent ? runtime.makeContext(parent, null, parent, null) : null; |
no test coverage detected