| 8694 | } |
| 8695 | |
| 8696 | function genDirectives (el) { |
| 8697 | var dirs = el.directives; |
| 8698 | if (!dirs) { return } |
| 8699 | var res = 'directives:['; |
| 8700 | var hasRuntime = false; |
| 8701 | var i, l, dir, needRuntime; |
| 8702 | for (i = 0, l = dirs.length; i < l; i++) { |
| 8703 | dir = dirs[i]; |
| 8704 | needRuntime = true; |
| 8705 | var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name]; |
| 8706 | if (gen) { |
| 8707 | // compile-time directive that manipulates AST. |
| 8708 | // returns true if it also needs a runtime counterpart. |
| 8709 | needRuntime = !!gen(el, dir, warn$3); |
| 8710 | } |
| 8711 | if (needRuntime) { |
| 8712 | hasRuntime = true; |
| 8713 | res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; |
| 8714 | } |
| 8715 | } |
| 8716 | if (hasRuntime) { |
| 8717 | return res.slice(0, -1) + ']' |
| 8718 | } |
| 8719 | } |
| 8720 | |
| 8721 | function genInlineTemplate (el) { |
| 8722 | var ast = el.children[0]; |