|
1 | 1 | /* @flow */
|
2 | 2 |
|
3 |
| -import { makeMap, isBuiltInTag, cached, no, remove } from 'shared/util' |
| 3 | +import { makeMap, isBuiltInTag, cached, no } from 'shared/util' |
4 | 4 |
|
5 | 5 | let isStaticKey
|
6 | 6 | let isPlatformReservedTag
|
@@ -30,7 +30,7 @@ export function optimize (root: ?ASTElement, options: CompilerOptions) {
|
30 | 30 |
|
31 | 31 | function genStaticKeys (keys: string): Function {
|
32 | 32 | return makeMap(
|
33 |
| - 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,staticProps' + |
| 33 | + 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' + |
34 | 34 | (keys ? ',' + keys : '')
|
35 | 35 | )
|
36 | 36 | }
|
@@ -99,17 +99,13 @@ function isStatic (node: ASTNode): boolean {
|
99 | 99 | if (node.type === 3) { // text
|
100 | 100 | return true
|
101 | 101 | }
|
102 |
| - const nodeAttrs = Object.keys(node) |
103 |
| - if (node.staticProps && node.props && node.staticProps.length === node.props.length) { |
104 |
| - remove(nodeAttrs, 'props') |
105 |
| - } |
106 | 102 | return !!(node.pre || (
|
107 | 103 | !node.hasBindings && // no dynamic bindings
|
108 | 104 | !node.if && !node.for && // not v-if or v-for or v-else
|
109 | 105 | !isBuiltInTag(node.tag) && // not a built-in
|
110 | 106 | isPlatformReservedTag(node.tag) && // not a component
|
111 | 107 | !isDirectChildOfTemplateFor(node) &&
|
112 |
| - nodeAttrs.every(isStaticKey) |
| 108 | + Object.keys(node).every(isStaticKey) |
113 | 109 | ))
|
114 | 110 | }
|
115 | 111 |
|
|
0 commit comments