From 54e27a60689fadba273d0035520ae28c2d3d7cbe Mon Sep 17 00:00:00 2001 From: hareku Date: Fri, 29 May 2020 16:03:38 +0900 Subject: [PATCH 1/2] fix: remove error.stack modification (#3212) Error.stack is non standard Co-authored-by: Eduardo San Martin Morote This reverts commit beca9d2a535c17f23e9521fac4281ae89cccdfb3. --- src/history/errors.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/history/errors.js b/src/history/errors.js index 21f3f56f9..2d624e135 100644 --- a/src/history/errors.js +++ b/src/history/errors.js @@ -48,9 +48,6 @@ function createRouterError (from, to, type, message) { error.to = to error.type = type - const newStack = error.stack.split('\n') - newStack.splice(1, 2) // remove 2 last useless calls - error.stack = newStack.join('\n') return error } From e57ea29f821f57f36600c837de7a55bdfa3137fd Mon Sep 17 00:00:00 2001 From: aradjdi Date: Fri, 29 May 2020 16:21:55 +0200 Subject: [PATCH 2/2] chore: catch URI malformed error on decodeURI urls params --- src/create-matcher.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/create-matcher.js b/src/create-matcher.js index ab62be430..4b3a766b2 100644 --- a/src/create-matcher.js +++ b/src/create-matcher.js @@ -185,7 +185,16 @@ function matchRoute ( for (let i = 1, len = m.length; i < len; ++i) { const key = regex.keys[i - 1] - const val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i] + let val = m[i] + if (typeof m[i] === 'string') { + try { + val = decodeURIComponent(m[i]) + } catch (error) { + if (error.toString() !== 'URIError: URI malformed') { + throw error + } + } + } if (key) { // Fix #1994: using * with props: true generates a param named 0 params[key.name || 'pathMatch'] = val