Skip to content

Commit 51b7edf

Browse files
committed
[build] 2.5.3
1 parent 2c6b72f commit 51b7edf

File tree

4 files changed

+44
-32
lines changed

4 files changed

+44
-32
lines changed

dist/vue-router.common.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.2
2+
* vue-router v2.5.3
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -76,7 +76,11 @@ var View = {
7676
// this will be called in the instance's injected lifecycle hooks
7777
data.registerRouteInstance = function (vm, val) {
7878
// val could be undefined for unregistration
79-
if (matched.instances[name] !== vm) {
79+
var current = matched.instances[name];
80+
if (
81+
(val && current !== vm) ||
82+
(!val && current === vm)
83+
) {
8084
matched.instances[name] = val;
8185
}
8286
}
@@ -587,8 +591,6 @@ var index$1 = Array.isArray || function (arr) {
587591
return Object.prototype.toString.call(arr) == '[object Array]';
588592
};
589593

590-
var isarray = index$1;
591-
592594
/**
593595
* Expose `pathToRegexp`.
594596
*/
@@ -769,7 +771,7 @@ function tokensToFunction (tokens) {
769771
}
770772
}
771773

772-
if (isarray(value)) {
774+
if (index$1(value)) {
773775
if (!token.repeat) {
774776
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
775777
}
@@ -920,7 +922,7 @@ function stringToRegexp (path, keys, options) {
920922
* @return {!RegExp}
921923
*/
922924
function tokensToRegExp (tokens, keys, options) {
923-
if (!isarray(keys)) {
925+
if (!index$1(keys)) {
924926
options = /** @type {!Object} */ (keys || options);
925927
keys = [];
926928
}
@@ -996,7 +998,7 @@ function tokensToRegExp (tokens, keys, options) {
996998
* @return {!RegExp}
997999
*/
9981000
function pathToRegexp (path, keys, options) {
999-
if (!isarray(keys)) {
1001+
if (!index$1(keys)) {
10001002
options = /** @type {!Object} */ (keys || options);
10011003
keys = [];
10021004
}
@@ -1007,7 +1009,7 @@ function pathToRegexp (path, keys, options) {
10071009
return regexpToRegexp(path, /** @type {!Array} */ (keys))
10081010
}
10091011

1010-
if (isarray(path)) {
1012+
if (index$1(path)) {
10111013
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
10121014
}
10131015

@@ -2393,7 +2395,9 @@ VueRouter.prototype.forward = function forward () {
23932395

23942396
VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
23952397
var route = to
2396-
? this.resolve(to).route
2398+
? to.matched
2399+
? to
2400+
: this.resolve(to).route
23972401
: this.currentRoute;
23982402
if (!route) {
23992403
return []
@@ -2453,7 +2457,7 @@ function createHref (base, fullPath, mode) {
24532457
}
24542458

24552459
VueRouter.install = install;
2456-
VueRouter.version = '2.5.2';
2460+
VueRouter.version = '2.5.3';
24572461

24582462
if (inBrowser && window.Vue) {
24592463
window.Vue.use(VueRouter);

dist/vue-router.esm.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.2
2+
* vue-router v2.5.3
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -74,7 +74,11 @@ var View = {
7474
// this will be called in the instance's injected lifecycle hooks
7575
data.registerRouteInstance = function (vm, val) {
7676
// val could be undefined for unregistration
77-
if (matched.instances[name] !== vm) {
77+
var current = matched.instances[name];
78+
if (
79+
(val && current !== vm) ||
80+
(!val && current === vm)
81+
) {
7882
matched.instances[name] = val;
7983
}
8084
}
@@ -585,8 +589,6 @@ var index$1 = Array.isArray || function (arr) {
585589
return Object.prototype.toString.call(arr) == '[object Array]';
586590
};
587591

588-
var isarray = index$1;
589-
590592
/**
591593
* Expose `pathToRegexp`.
592594
*/
@@ -767,7 +769,7 @@ function tokensToFunction (tokens) {
767769
}
768770
}
769771

770-
if (isarray(value)) {
772+
if (index$1(value)) {
771773
if (!token.repeat) {
772774
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
773775
}
@@ -918,7 +920,7 @@ function stringToRegexp (path, keys, options) {
918920
* @return {!RegExp}
919921
*/
920922
function tokensToRegExp (tokens, keys, options) {
921-
if (!isarray(keys)) {
923+
if (!index$1(keys)) {
922924
options = /** @type {!Object} */ (keys || options);
923925
keys = [];
924926
}
@@ -994,7 +996,7 @@ function tokensToRegExp (tokens, keys, options) {
994996
* @return {!RegExp}
995997
*/
996998
function pathToRegexp (path, keys, options) {
997-
if (!isarray(keys)) {
999+
if (!index$1(keys)) {
9981000
options = /** @type {!Object} */ (keys || options);
9991001
keys = [];
10001002
}
@@ -1005,7 +1007,7 @@ function pathToRegexp (path, keys, options) {
10051007
return regexpToRegexp(path, /** @type {!Array} */ (keys))
10061008
}
10071009

1008-
if (isarray(path)) {
1010+
if (index$1(path)) {
10091011
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
10101012
}
10111013

@@ -2391,7 +2393,9 @@ VueRouter.prototype.forward = function forward () {
23912393

23922394
VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
23932395
var route = to
2394-
? this.resolve(to).route
2396+
? to.matched
2397+
? to
2398+
: this.resolve(to).route
23952399
: this.currentRoute;
23962400
if (!route) {
23972401
return []
@@ -2451,7 +2455,7 @@ function createHref (base, fullPath, mode) {
24512455
}
24522456

24532457
VueRouter.install = install;
2454-
VueRouter.version = '2.5.2';
2458+
VueRouter.version = '2.5.3';
24552459

24562460
if (inBrowser && window.Vue) {
24572461
window.Vue.use(VueRouter);

dist/vue-router.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.5.2
2+
* vue-router v2.5.3
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -80,7 +80,11 @@ var View = {
8080
// this will be called in the instance's injected lifecycle hooks
8181
data.registerRouteInstance = function (vm, val) {
8282
// val could be undefined for unregistration
83-
if (matched.instances[name] !== vm) {
83+
var current = matched.instances[name];
84+
if (
85+
(val && current !== vm) ||
86+
(!val && current === vm)
87+
) {
8488
matched.instances[name] = val;
8589
}
8690
}
@@ -591,8 +595,6 @@ var index$1 = Array.isArray || function (arr) {
591595
return Object.prototype.toString.call(arr) == '[object Array]';
592596
};
593597

594-
var isarray = index$1;
595-
596598
/**
597599
* Expose `pathToRegexp`.
598600
*/
@@ -773,7 +775,7 @@ function tokensToFunction (tokens) {
773775
}
774776
}
775777

776-
if (isarray(value)) {
778+
if (index$1(value)) {
777779
if (!token.repeat) {
778780
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
779781
}
@@ -924,7 +926,7 @@ function stringToRegexp (path, keys, options) {
924926
* @return {!RegExp}
925927
*/
926928
function tokensToRegExp (tokens, keys, options) {
927-
if (!isarray(keys)) {
929+
if (!index$1(keys)) {
928930
options = /** @type {!Object} */ (keys || options);
929931
keys = [];
930932
}
@@ -1000,7 +1002,7 @@ function tokensToRegExp (tokens, keys, options) {
10001002
* @return {!RegExp}
10011003
*/
10021004
function pathToRegexp (path, keys, options) {
1003-
if (!isarray(keys)) {
1005+
if (!index$1(keys)) {
10041006
options = /** @type {!Object} */ (keys || options);
10051007
keys = [];
10061008
}
@@ -1011,7 +1013,7 @@ function pathToRegexp (path, keys, options) {
10111013
return regexpToRegexp(path, /** @type {!Array} */ (keys))
10121014
}
10131015

1014-
if (isarray(path)) {
1016+
if (index$1(path)) {
10151017
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
10161018
}
10171019

@@ -2397,7 +2399,9 @@ VueRouter.prototype.forward = function forward () {
23972399

23982400
VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
23992401
var route = to
2400-
? this.resolve(to).route
2402+
? to.matched
2403+
? to
2404+
: this.resolve(to).route
24012405
: this.currentRoute;
24022406
if (!route) {
24032407
return []
@@ -2457,7 +2461,7 @@ function createHref (base, fullPath, mode) {
24572461
}
24582462

24592463
VueRouter.install = install;
2460-
VueRouter.version = '2.5.2';
2464+
VueRouter.version = '2.5.3';
24612465

24622466
if (inBrowser && window.Vue) {
24632467
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)