Skip to content

Commit d682c0d

Browse files
committed
[build] 2.5.2
1 parent 4ea7730 commit d682c0d

File tree

4 files changed

+41
-20
lines changed

4 files changed

+41
-20
lines changed

dist/vue-router.common.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.1
2+
* vue-router v2.5.2
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -28,14 +28,17 @@ var View = {
2828
default: 'default'
2929
}
3030
},
31-
render: function render (h, ref) {
31+
render: function render (_, ref) {
3232
var props = ref.props;
3333
var children = ref.children;
3434
var parent = ref.parent;
3535
var data = ref.data;
3636

3737
data.routerView = true;
3838

39+
// directly use parent context's createElement() function
40+
// so that components rendered by router-view can resolve named slots
41+
var h = parent.$createElement;
3942
var name = props.name;
4043
var route = parent.$route;
4144
var cache = parent._routerViewCache || (parent._routerViewCache = {});
@@ -1686,7 +1689,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
16861689

16871690
var current = this.current;
16881691
var abort = function (err) {
1689-
if (err instanceof Error) {
1692+
if (isError(err)) {
16901693
if (this$1.errorCbs.length) {
16911694
this$1.errorCbs.forEach(function (cb) { cb(err); });
16921695
} else {
@@ -1730,7 +1733,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
17301733
}
17311734
try {
17321735
hook(route, current, function (to) {
1733-
if (to === false || to instanceof Error) {
1736+
if (to === false || isError(to)) {
17341737
// next(false) -> abort navigation, ensure current URL
17351738
this$1.ensureURL(true);
17361739
abort(to);
@@ -1950,7 +1953,7 @@ function resolveAsyncComponents (matched) {
19501953
var msg = "Failed to resolve async component " + key + ": " + reason;
19511954
process.env.NODE_ENV !== 'production' && warn(false, msg);
19521955
if (!error) {
1953-
error = reason instanceof Error
1956+
error = isError(reason)
19541957
? reason
19551958
: new Error(msg);
19561959
next(error);
@@ -2011,6 +2014,10 @@ function once (fn) {
20112014
}
20122015
}
20132016

2017+
function isError (err) {
2018+
return Object.prototype.toString.call(err).indexOf('Error') > -1
2019+
}
2020+
20142021
/* */
20152022

20162023

@@ -2446,7 +2453,7 @@ function createHref (base, fullPath, mode) {
24462453
}
24472454

24482455
VueRouter.install = install;
2449-
VueRouter.version = '2.5.1';
2456+
VueRouter.version = '2.5.2';
24502457

24512458
if (inBrowser && window.Vue) {
24522459
window.Vue.use(VueRouter);

dist/vue-router.esm.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.1
2+
* vue-router v2.5.2
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -26,14 +26,17 @@ var View = {
2626
default: 'default'
2727
}
2828
},
29-
render: function render (h, ref) {
29+
render: function render (_, ref) {
3030
var props = ref.props;
3131
var children = ref.children;
3232
var parent = ref.parent;
3333
var data = ref.data;
3434

3535
data.routerView = true;
3636

37+
// directly use parent context's createElement() function
38+
// so that components rendered by router-view can resolve named slots
39+
var h = parent.$createElement;
3740
var name = props.name;
3841
var route = parent.$route;
3942
var cache = parent._routerViewCache || (parent._routerViewCache = {});
@@ -1684,7 +1687,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
16841687

16851688
var current = this.current;
16861689
var abort = function (err) {
1687-
if (err instanceof Error) {
1690+
if (isError(err)) {
16881691
if (this$1.errorCbs.length) {
16891692
this$1.errorCbs.forEach(function (cb) { cb(err); });
16901693
} else {
@@ -1728,7 +1731,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
17281731
}
17291732
try {
17301733
hook(route, current, function (to) {
1731-
if (to === false || to instanceof Error) {
1734+
if (to === false || isError(to)) {
17321735
// next(false) -> abort navigation, ensure current URL
17331736
this$1.ensureURL(true);
17341737
abort(to);
@@ -1948,7 +1951,7 @@ function resolveAsyncComponents (matched) {
19481951
var msg = "Failed to resolve async component " + key + ": " + reason;
19491952
process.env.NODE_ENV !== 'production' && warn(false, msg);
19501953
if (!error) {
1951-
error = reason instanceof Error
1954+
error = isError(reason)
19521955
? reason
19531956
: new Error(msg);
19541957
next(error);
@@ -2009,6 +2012,10 @@ function once (fn) {
20092012
}
20102013
}
20112014

2015+
function isError (err) {
2016+
return Object.prototype.toString.call(err).indexOf('Error') > -1
2017+
}
2018+
20122019
/* */
20132020

20142021

@@ -2444,7 +2451,7 @@ function createHref (base, fullPath, mode) {
24442451
}
24452452

24462453
VueRouter.install = install;
2447-
VueRouter.version = '2.5.1';
2454+
VueRouter.version = '2.5.2';
24482455

24492456
if (inBrowser && window.Vue) {
24502457
window.Vue.use(VueRouter);

dist/vue-router.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.1
2+
* vue-router v2.5.2
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -32,14 +32,17 @@ var View = {
3232
default: 'default'
3333
}
3434
},
35-
render: function render (h, ref) {
35+
render: function render (_, ref) {
3636
var props = ref.props;
3737
var children = ref.children;
3838
var parent = ref.parent;
3939
var data = ref.data;
4040

4141
data.routerView = true;
4242

43+
// directly use parent context's createElement() function
44+
// so that components rendered by router-view can resolve named slots
45+
var h = parent.$createElement;
4346
var name = props.name;
4447
var route = parent.$route;
4548
var cache = parent._routerViewCache || (parent._routerViewCache = {});
@@ -1690,7 +1693,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
16901693

16911694
var current = this.current;
16921695
var abort = function (err) {
1693-
if (err instanceof Error) {
1696+
if (isError(err)) {
16941697
if (this$1.errorCbs.length) {
16951698
this$1.errorCbs.forEach(function (cb) { cb(err); });
16961699
} else {
@@ -1734,7 +1737,7 @@ History.prototype.confirmTransition = function confirmTransition (route, onCompl
17341737
}
17351738
try {
17361739
hook(route, current, function (to) {
1737-
if (to === false || to instanceof Error) {
1740+
if (to === false || isError(to)) {
17381741
// next(false) -> abort navigation, ensure current URL
17391742
this$1.ensureURL(true);
17401743
abort(to);
@@ -1954,7 +1957,7 @@ function resolveAsyncComponents (matched) {
19541957
var msg = "Failed to resolve async component " + key + ": " + reason;
19551958
"development" !== 'production' && warn(false, msg);
19561959
if (!error) {
1957-
error = reason instanceof Error
1960+
error = isError(reason)
19581961
? reason
19591962
: new Error(msg);
19601963
next(error);
@@ -2015,6 +2018,10 @@ function once (fn) {
20152018
}
20162019
}
20172020

2021+
function isError (err) {
2022+
return Object.prototype.toString.call(err).indexOf('Error') > -1
2023+
}
2024+
20182025
/* */
20192026

20202027

@@ -2450,7 +2457,7 @@ function createHref (base, fullPath, mode) {
24502457
}
24512458

24522459
VueRouter.install = install;
2453-
VueRouter.version = '2.5.1';
2460+
VueRouter.version = '2.5.2';
24542461

24552462
if (inBrowser && window.Vue) {
24562463
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)