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) { if (refNode === null) {
queueNodeOp([platformAppendChild, container, newNode]) queueNodeOp([platformAppendChild, container, newNode])
} else { } else {
queueNodeOp([platformInsertBefore, newNode, refNode]) queueNodeOp([platformInsertBefore, container, newNode, refNode])
} }
} }

View File

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