Skip to content

Commit 2d58d0e

Browse files
committed
fix all unit tests
1 parent ecd9c7d commit 2d58d0e

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/compiler/codegen/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,10 @@ function genDirectives (el: ASTElement): string | void {
210210
}
211211
}
212212

213-
function genChildren (el: ASTElement, asThunk?: boolean): string | void {
214-
if (!el.children.length) {
215-
return
213+
function genChildren (el: ASTElement): string | void {
214+
if (el.children.length) {
215+
return '[' + el.children.map(genNode).join(',') + ']'
216216
}
217-
const code = '[' + el.children.map(genNode).join(',') + ']'
218-
return asThunk
219-
? `function(){return ${code}}`
220-
: code
221217
}
222218

223219
function genNode (node: ASTNode) {
@@ -243,7 +239,7 @@ function genSlot (el: ASTElement): string {
243239
}
244240

245241
function genComponent (el: ASTElement): string {
246-
const children = genChildren(el, true)
242+
const children = genChildren(el)
247243
return `_h(${el.component},${genData(el)}${
248244
children ? `,${children}` : ''
249245
})`

src/core/vdom/create-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export function createComponent (
6969
context.$createElement,
7070
{
7171
props,
72-
parent: context,
7372
data,
73+
parent: context,
7474
children: normalizeChildren(children),
7575
slots: () => resolveSlots(children)
7676
}

test/unit/features/transition/transition.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if (!isIE9) {
151151
enter,
152152
leave
153153
}
154-
}, () => [this.ok ? h('div', { class: 'test' }, 'foo') : undefined])
154+
}, this.ok ? [h('div', { class: 'test' }, 'foo')] : undefined)
155155
])
156156
},
157157
data: { ok: true }

0 commit comments

Comments
 (0)