Skip to content

Commit

Permalink
[build] 2.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 1, 2017
1 parent 2c6b72f commit 51b7edf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 32 deletions.
24 changes: 14 additions & 10 deletions dist/vue-router.common.js
@@ -1,5 +1,5 @@
/**
* vue-router v2.5.2
* vue-router v2.5.3
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -76,7 +76,11 @@ var View = {
// this will be called in the instance's injected lifecycle hooks
data.registerRouteInstance = function (vm, val) {
// val could be undefined for unregistration
if (matched.instances[name] !== vm) {
var current = matched.instances[name];
if (
(val && current !== vm) ||
(!val && current === vm)
) {
matched.instances[name] = val;
}
}
Expand Down Expand Up @@ -587,8 +591,6 @@ var index$1 = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};

var isarray = index$1;

/**
* Expose `pathToRegexp`.
*/
Expand Down Expand Up @@ -769,7 +771,7 @@ function tokensToFunction (tokens) {
}
}

if (isarray(value)) {
if (index$1(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
Expand Down Expand Up @@ -920,7 +922,7 @@ function stringToRegexp (path, keys, options) {
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand Down Expand Up @@ -996,7 +998,7 @@ function tokensToRegExp (tokens, keys, options) {
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand All @@ -1007,7 +1009,7 @@ function pathToRegexp (path, keys, options) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}

if (isarray(path)) {
if (index$1(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}

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

VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
var route = to
? this.resolve(to).route
? to.matched
? to
: this.resolve(to).route
: this.currentRoute;
if (!route) {
return []
Expand Down Expand Up @@ -2453,7 +2457,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '2.5.2';
VueRouter.version = '2.5.3';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
24 changes: 14 additions & 10 deletions dist/vue-router.esm.js
@@ -1,5 +1,5 @@
/**
* vue-router v2.5.2
* vue-router v2.5.3
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -74,7 +74,11 @@ var View = {
// this will be called in the instance's injected lifecycle hooks
data.registerRouteInstance = function (vm, val) {
// val could be undefined for unregistration
if (matched.instances[name] !== vm) {
var current = matched.instances[name];
if (
(val && current !== vm) ||
(!val && current === vm)
) {
matched.instances[name] = val;
}
}
Expand Down Expand Up @@ -585,8 +589,6 @@ var index$1 = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};

var isarray = index$1;

/**
* Expose `pathToRegexp`.
*/
Expand Down Expand Up @@ -767,7 +769,7 @@ function tokensToFunction (tokens) {
}
}

if (isarray(value)) {
if (index$1(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
Expand Down Expand Up @@ -918,7 +920,7 @@ function stringToRegexp (path, keys, options) {
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand Down Expand Up @@ -994,7 +996,7 @@ function tokensToRegExp (tokens, keys, options) {
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand All @@ -1005,7 +1007,7 @@ function pathToRegexp (path, keys, options) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}

if (isarray(path)) {
if (index$1(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}

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

VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
var route = to
? this.resolve(to).route
? to.matched
? to
: this.resolve(to).route
: this.currentRoute;
if (!route) {
return []
Expand Down Expand Up @@ -2451,7 +2455,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '2.5.2';
VueRouter.version = '2.5.3';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
24 changes: 14 additions & 10 deletions dist/vue-router.js
@@ -1,5 +1,5 @@
/**
* vue-router v2.5.2
* vue-router v2.5.3
* (c) 2017 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -80,7 +80,11 @@ var View = {
// this will be called in the instance's injected lifecycle hooks
data.registerRouteInstance = function (vm, val) {
// val could be undefined for unregistration
if (matched.instances[name] !== vm) {
var current = matched.instances[name];
if (
(val && current !== vm) ||
(!val && current === vm)
) {
matched.instances[name] = val;
}
}
Expand Down Expand Up @@ -591,8 +595,6 @@ var index$1 = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};

var isarray = index$1;

/**
* Expose `pathToRegexp`.
*/
Expand Down Expand Up @@ -773,7 +775,7 @@ function tokensToFunction (tokens) {
}
}

if (isarray(value)) {
if (index$1(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
Expand Down Expand Up @@ -924,7 +926,7 @@ function stringToRegexp (path, keys, options) {
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand Down Expand Up @@ -1000,7 +1002,7 @@ function tokensToRegExp (tokens, keys, options) {
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!isarray(keys)) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
Expand All @@ -1011,7 +1013,7 @@ function pathToRegexp (path, keys, options) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}

if (isarray(path)) {
if (index$1(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}

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

VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
var route = to
? this.resolve(to).route
? to.matched
? to
: this.resolve(to).route
: this.currentRoute;
if (!route) {
return []
Expand Down Expand Up @@ -2457,7 +2461,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '2.5.2';
VueRouter.version = '2.5.3';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down

0 comments on commit 51b7edf

Please sign in to comment.