wip: fix insertBefore

This commit is contained in:
Evan You 2018-11-09 18:08:53 -05:00
parent 544f37ae48
commit 5639022f80
2 changed files with 4 additions and 5 deletions

View File

@ -113,7 +113,7 @@ export function createRenderer(options: RendererOptions) {
if (refNode === null) {
queueNodeOp([platformAppendChild, container, newNode])
} else {
queueNodeOp([platformInsertBefore, newNode, refNode])
queueNodeOp([platformInsertBefore, container, newNode, refNode])
}
}

View File

@ -1,7 +1,5 @@
// TODO infinite updates detection
// import { Op } from './patchNodeOps'
type Op = [Function, ...any[]]
const enum Priorities {
@ -180,9 +178,10 @@ function flush(): void {
// now we are really done
hasPendingFlush = false
pendingRejectors.length = 0
while ((job = nextTickQueue.shift())) {
job()
for (let i = 0; i < nextTickQueue.length; i++) {
nextTickQueue[i]()
}
nextTickQueue.length = 0
} else {
// got more job to do
// shouldn't reach here in compat mode, because the patchQueue is