Skip to content

Commit f583eec

Browse files
committed
[build] Fix leak based on vuejs#5988
1 parent 69bf519 commit f583eec

File tree

9 files changed

+151
-147
lines changed

9 files changed

+151
-147
lines changed

dist/vue.common.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,22 +2770,23 @@ Watcher.prototype.get = function get () {
27702770
pushTarget(this);
27712771
var value;
27722772
var vm = this.vm;
2773-
if (this.user) {
2774-
try {
2775-
value = this.getter.call(vm, vm);
2776-
} catch (e) {
2773+
try {
2774+
value = this.getter.call(vm, vm);
2775+
} catch (e) {
2776+
if (this.user) {
27772777
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
2778+
} else {
2779+
throw e
27782780
}
2779-
} else {
2780-
value = this.getter.call(vm, vm);
2781-
}
2782-
// "touch" every property so they are all tracked as
2783-
// dependencies for deep watching
2784-
if (this.deep) {
2785-
traverse(value);
2781+
} finally {
2782+
// "touch" every property so they are all tracked as
2783+
// dependencies for deep watching
2784+
if (this.deep) {
2785+
traverse(value);
2786+
}
2787+
popTarget();
2788+
this.cleanupDeps();
27862789
}
2787-
popTarget();
2788-
this.cleanupDeps();
27892790
return value
27902791
};
27912792

@@ -4956,11 +4957,11 @@ function createPatchFunction (backend) {
49564957
insert(parentElm, vnode.elm, refElm);
49574958
}
49584959

4959-
function insert (parent, elm, ref) {
4960+
function insert (parent, elm, ref$$1) {
49604961
if (isDef(parent)) {
4961-
if (isDef(ref)) {
4962-
if (ref.parentNode === parent) {
4963-
nodeOps.insertBefore(parent, elm, ref);
4962+
if (isDef(ref$$1)) {
4963+
if (ref$$1.parentNode === parent) {
4964+
nodeOps.insertBefore(parent, elm, ref$$1);
49644965
}
49654966
} else {
49664967
nodeOps.appendChild(parent, elm);
@@ -7144,10 +7145,10 @@ var show = {
71447145
var value = ref.value;
71457146

71467147
vnode = locateNode(vnode);
7147-
var transition = vnode.data && vnode.data.transition;
7148+
var transition$$1 = vnode.data && vnode.data.transition;
71487149
var originalDisplay = el.__vOriginalDisplay =
71497150
el.style.display === 'none' ? '' : el.style.display;
7150-
if (value && transition && !isIE9) {
7151+
if (value && transition$$1 && !isIE9) {
71517152
vnode.data.show = true;
71527153
enter(vnode, function () {
71537154
el.style.display = originalDisplay;
@@ -7164,8 +7165,8 @@ var show = {
71647165
/* istanbul ignore if */
71657166
if (value === oldValue) { return }
71667167
vnode = locateNode(vnode);
7167-
var transition = vnode.data && vnode.data.transition;
7168-
if (transition && !isIE9) {
7168+
var transition$$1 = vnode.data && vnode.data.transition;
7169+
if (transition$$1 && !isIE9) {
71697170
vnode.data.show = true;
71707171
if (value) {
71717172
enter(vnode, function () {

dist/vue.esm.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,22 +2768,23 @@ Watcher.prototype.get = function get () {
27682768
pushTarget(this);
27692769
var value;
27702770
var vm = this.vm;
2771-
if (this.user) {
2772-
try {
2773-
value = this.getter.call(vm, vm);
2774-
} catch (e) {
2771+
try {
2772+
value = this.getter.call(vm, vm);
2773+
} catch (e) {
2774+
if (this.user) {
27752775
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
2776+
} else {
2777+
throw e
27762778
}
2777-
} else {
2778-
value = this.getter.call(vm, vm);
2779-
}
2780-
// "touch" every property so they are all tracked as
2781-
// dependencies for deep watching
2782-
if (this.deep) {
2783-
traverse(value);
2779+
} finally {
2780+
// "touch" every property so they are all tracked as
2781+
// dependencies for deep watching
2782+
if (this.deep) {
2783+
traverse(value);
2784+
}
2785+
popTarget();
2786+
this.cleanupDeps();
27842787
}
2785-
popTarget();
2786-
this.cleanupDeps();
27872788
return value
27882789
};
27892790

@@ -4954,11 +4955,11 @@ function createPatchFunction (backend) {
49544955
insert(parentElm, vnode.elm, refElm);
49554956
}
49564957

4957-
function insert (parent, elm, ref) {
4958+
function insert (parent, elm, ref$$1) {
49584959
if (isDef(parent)) {
4959-
if (isDef(ref)) {
4960-
if (ref.parentNode === parent) {
4961-
nodeOps.insertBefore(parent, elm, ref);
4960+
if (isDef(ref$$1)) {
4961+
if (ref$$1.parentNode === parent) {
4962+
nodeOps.insertBefore(parent, elm, ref$$1);
49624963
}
49634964
} else {
49644965
nodeOps.appendChild(parent, elm);
@@ -7142,10 +7143,10 @@ var show = {
71427143
var value = ref.value;
71437144

71447145
vnode = locateNode(vnode);
7145-
var transition = vnode.data && vnode.data.transition;
7146+
var transition$$1 = vnode.data && vnode.data.transition;
71467147
var originalDisplay = el.__vOriginalDisplay =
71477148
el.style.display === 'none' ? '' : el.style.display;
7148-
if (value && transition && !isIE9) {
7149+
if (value && transition$$1 && !isIE9) {
71497150
vnode.data.show = true;
71507151
enter(vnode, function () {
71517152
el.style.display = originalDisplay;
@@ -7162,8 +7163,8 @@ var show = {
71627163
/* istanbul ignore if */
71637164
if (value === oldValue) { return }
71647165
vnode = locateNode(vnode);
7165-
var transition = vnode.data && vnode.data.transition;
7166-
if (transition && !isIE9) {
7166+
var transition$$1 = vnode.data && vnode.data.transition;
7167+
if (transition$$1 && !isIE9) {
71677168
vnode.data.show = true;
71687169
if (value) {
71697170
enter(vnode, function () {

dist/vue.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,22 +2770,23 @@ Watcher.prototype.get = function get () {
27702770
pushTarget(this);
27712771
var value;
27722772
var vm = this.vm;
2773-
if (this.user) {
2774-
try {
2775-
value = this.getter.call(vm, vm);
2776-
} catch (e) {
2773+
try {
2774+
value = this.getter.call(vm, vm);
2775+
} catch (e) {
2776+
if (this.user) {
27772777
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
2778+
} else {
2779+
throw e
27782780
}
2779-
} else {
2780-
value = this.getter.call(vm, vm);
2781-
}
2782-
// "touch" every property so they are all tracked as
2783-
// dependencies for deep watching
2784-
if (this.deep) {
2785-
traverse(value);
2781+
} finally {
2782+
// "touch" every property so they are all tracked as
2783+
// dependencies for deep watching
2784+
if (this.deep) {
2785+
traverse(value);
2786+
}
2787+
popTarget();
2788+
this.cleanupDeps();
27862789
}
2787-
popTarget();
2788-
this.cleanupDeps();
27892790
return value
27902791
};
27912792

@@ -4948,11 +4949,11 @@ function createPatchFunction (backend) {
49484949
insert(parentElm, vnode.elm, refElm);
49494950
}
49504951

4951-
function insert (parent, elm, ref) {
4952+
function insert (parent, elm, ref$$1) {
49524953
if (isDef(parent)) {
4953-
if (isDef(ref)) {
4954-
if (ref.parentNode === parent) {
4955-
nodeOps.insertBefore(parent, elm, ref);
4954+
if (isDef(ref$$1)) {
4955+
if (ref$$1.parentNode === parent) {
4956+
nodeOps.insertBefore(parent, elm, ref$$1);
49564957
}
49574958
} else {
49584959
nodeOps.appendChild(parent, elm);
@@ -7136,10 +7137,10 @@ var show = {
71367137
var value = ref.value;
71377138

71387139
vnode = locateNode(vnode);
7139-
var transition = vnode.data && vnode.data.transition;
7140+
var transition$$1 = vnode.data && vnode.data.transition;
71407141
var originalDisplay = el.__vOriginalDisplay =
71417142
el.style.display === 'none' ? '' : el.style.display;
7142-
if (value && transition && !isIE9) {
7143+
if (value && transition$$1 && !isIE9) {
71437144
vnode.data.show = true;
71447145
enter(vnode, function () {
71457146
el.style.display = originalDisplay;
@@ -7156,8 +7157,8 @@ var show = {
71567157
/* istanbul ignore if */
71577158
if (value === oldValue) { return }
71587159
vnode = locateNode(vnode);
7159-
var transition = vnode.data && vnode.data.transition;
7160-
if (transition && !isIE9) {
7160+
var transition$$1 = vnode.data && vnode.data.transition;
7161+
if (transition$$1 && !isIE9) {
71617162
vnode.data.show = true;
71627163
if (value) {
71637164
enter(vnode, function () {

dist/vue.min.js

Lines changed: 1 addition & 3 deletions
Large diffs are not rendered by default.

dist/vue.runtime.common.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,22 +2766,23 @@ Watcher.prototype.get = function get () {
27662766
pushTarget(this);
27672767
var value;
27682768
var vm = this.vm;
2769-
if (this.user) {
2770-
try {
2771-
value = this.getter.call(vm, vm);
2772-
} catch (e) {
2769+
try {
2770+
value = this.getter.call(vm, vm);
2771+
} catch (e) {
2772+
if (this.user) {
27732773
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
2774+
} else {
2775+
throw e
27742776
}
2775-
} else {
2776-
value = this.getter.call(vm, vm);
2777-
}
2778-
// "touch" every property so they are all tracked as
2779-
// dependencies for deep watching
2780-
if (this.deep) {
2781-
traverse(value);
2777+
} finally {
2778+
// "touch" every property so they are all tracked as
2779+
// dependencies for deep watching
2780+
if (this.deep) {
2781+
traverse(value);
2782+
}
2783+
popTarget();
2784+
this.cleanupDeps();
27822785
}
2783-
popTarget();
2784-
this.cleanupDeps();
27852786
return value
27862787
};
27872788

@@ -4952,11 +4953,11 @@ function createPatchFunction (backend) {
49524953
insert(parentElm, vnode.elm, refElm);
49534954
}
49544955

4955-
function insert (parent, elm, ref) {
4956+
function insert (parent, elm, ref$$1) {
49564957
if (isDef(parent)) {
4957-
if (isDef(ref)) {
4958-
if (ref.parentNode === parent) {
4959-
nodeOps.insertBefore(parent, elm, ref);
4958+
if (isDef(ref$$1)) {
4959+
if (ref$$1.parentNode === parent) {
4960+
nodeOps.insertBefore(parent, elm, ref$$1);
49604961
}
49614962
} else {
49624963
nodeOps.appendChild(parent, elm);
@@ -6679,10 +6680,10 @@ var show = {
66796680
var value = ref.value;
66806681

66816682
vnode = locateNode(vnode);
6682-
var transition = vnode.data && vnode.data.transition;
6683+
var transition$$1 = vnode.data && vnode.data.transition;
66836684
var originalDisplay = el.__vOriginalDisplay =
66846685
el.style.display === 'none' ? '' : el.style.display;
6685-
if (value && transition && !isIE9) {
6686+
if (value && transition$$1 && !isIE9) {
66866687
vnode.data.show = true;
66876688
enter(vnode, function () {
66886689
el.style.display = originalDisplay;
@@ -6699,8 +6700,8 @@ var show = {
66996700
/* istanbul ignore if */
67006701
if (value === oldValue) { return }
67016702
vnode = locateNode(vnode);
6702-
var transition = vnode.data && vnode.data.transition;
6703-
if (transition && !isIE9) {
6703+
var transition$$1 = vnode.data && vnode.data.transition;
6704+
if (transition$$1 && !isIE9) {
67046705
vnode.data.show = true;
67056706
if (value) {
67066707
enter(vnode, function () {

dist/vue.runtime.esm.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,22 +2764,23 @@ Watcher.prototype.get = function get () {
27642764
pushTarget(this);
27652765
var value;
27662766
var vm = this.vm;
2767-
if (this.user) {
2768-
try {
2769-
value = this.getter.call(vm, vm);
2770-
} catch (e) {
2767+
try {
2768+
value = this.getter.call(vm, vm);
2769+
} catch (e) {
2770+
if (this.user) {
27712771
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
2772+
} else {
2773+
throw e
27722774
}
2773-
} else {
2774-
value = this.getter.call(vm, vm);
2775-
}
2776-
// "touch" every property so they are all tracked as
2777-
// dependencies for deep watching
2778-
if (this.deep) {
2779-
traverse(value);
2775+
} finally {
2776+
// "touch" every property so they are all tracked as
2777+
// dependencies for deep watching
2778+
if (this.deep) {
2779+
traverse(value);
2780+
}
2781+
popTarget();
2782+
this.cleanupDeps();
27802783
}
2781-
popTarget();
2782-
this.cleanupDeps();
27832784
return value
27842785
};
27852786

@@ -4950,11 +4951,11 @@ function createPatchFunction (backend) {
49504951
insert(parentElm, vnode.elm, refElm);
49514952
}
49524953

4953-
function insert (parent, elm, ref) {
4954+
function insert (parent, elm, ref$$1) {
49544955
if (isDef(parent)) {
4955-
if (isDef(ref)) {
4956-
if (ref.parentNode === parent) {
4957-
nodeOps.insertBefore(parent, elm, ref);
4956+
if (isDef(ref$$1)) {
4957+
if (ref$$1.parentNode === parent) {
4958+
nodeOps.insertBefore(parent, elm, ref$$1);
49584959
}
49594960
} else {
49604961
nodeOps.appendChild(parent, elm);
@@ -6677,10 +6678,10 @@ var show = {
66776678
var value = ref.value;
66786679

66796680
vnode = locateNode(vnode);
6680-
var transition = vnode.data && vnode.data.transition;
6681+
var transition$$1 = vnode.data && vnode.data.transition;
66816682
var originalDisplay = el.__vOriginalDisplay =
66826683
el.style.display === 'none' ? '' : el.style.display;
6683-
if (value && transition && !isIE9) {
6684+
if (value && transition$$1 && !isIE9) {
66846685
vnode.data.show = true;
66856686
enter(vnode, function () {
66866687
el.style.display = originalDisplay;
@@ -6697,8 +6698,8 @@ var show = {
66976698
/* istanbul ignore if */
66986699
if (value === oldValue) { return }
66996700
vnode = locateNode(vnode);
6700-
var transition = vnode.data && vnode.data.transition;
6701-
if (transition && !isIE9) {
6701+
var transition$$1 = vnode.data && vnode.data.transition;
6702+
if (transition$$1 && !isIE9) {
67026703
vnode.data.show = true;
67036704
if (value) {
67046705
enter(vnode, function () {

0 commit comments

Comments
 (0)