Skip to content

Commit 28ec3c7

Browse files
committed
minor tweaks
1 parent d2f7f19 commit 28ec3c7

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/core/util/env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ if (typeof Set !== 'undefined' && isNative(Set)) {
132132
this.set = Object.create(null)
133133
}
134134
has (key: string | number) {
135-
return this.set[key] !== undefined
135+
return this.set[key] === true
136136
}
137137
add (key: string | number) {
138-
this.set[key] = 1
138+
this.set[key] = true
139139
}
140140
clear () {
141141
this.set = Object.create(null)

src/core/vdom/patch.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ export function createPatchFunction (backend) {
202202

203203
function insert (parent, elm, ref) {
204204
if (parent) {
205-
nodeOps.insertBefore(parent, elm, ref)
205+
if (ref) {
206+
nodeOps.insertBefore(parent, elm, ref)
207+
} else {
208+
nodeOps.appendChild(parent, elm)
209+
}
206210
}
207211
}
208212

src/platforms/weex/runtime/node-ops.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export function createComment (text) {
1919
}
2020

2121
export function insertBefore (node, target, before) {
22-
if (!before) {
23-
return appendChild(node, target)
24-
}
2522
if (target.nodeType === 3) {
2623
if (node.type === 'text') {
2724
node.setAttr('value', target.text)

0 commit comments

Comments
 (0)