File tree 4 files changed +24
-6
lines changed
4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const router = new VueRouter({
47
47
{ path : '/bar' , component : Bar } ,
48
48
{ path : '/é' , component : Unicode } ,
49
49
{ path : '/é/:unicode' , component : Unicode } ,
50
- { path : '/query/:q' , component : Query }
50
+ { path : '/query/:q' , component : Query , name : 'param' }
51
51
]
52
52
} )
53
53
@@ -69,14 +69,16 @@ const vueInstance = new Vue({
69
69
<li><router-link to="/é/ñ?t=%25ñ">/é/ñ?t=%ñ</router-link></li>
70
70
<li><router-link to="/é/ñ#é">/é/ñ#é</router-link></li>
71
71
<li><router-link to="/query/A%25">/query/A%</router-link></li>
72
+ <li><router-link :to="{ name: 'param', params: { q: 'A%' }}">/query/A% (object)</router-link></li>
73
+ <li><router-link to="/query/A%2FE">/query/A%2FE</router-link></li>
74
+ <li><router-link :to="{ name: 'param', params: { q: 'A/E' }}">/query/A%2FE (object)</router-link></li>
72
75
</ul>
73
76
<pre id="query-t">{{ $route.query.t }}</pre>
74
77
<pre id="hash">{{ $route.hash }}</pre>
75
78
<router-view class="view"></router-view>
76
79
</div>
77
80
` ,
78
- methods : {
79
- }
81
+ methods : { }
80
82
} ) . $mount ( '#app' )
81
83
82
84
document . getElementById ( 'unmount' ) . addEventListener ( 'click' , ( ) => {
Original file line number Diff line number Diff line change @@ -175,7 +175,14 @@ function matchRoute (
175
175
path : string ,
176
176
params : Object
177
177
) : boolean {
178
- const m = decodeURI ( path ) . match ( regex )
178
+ let m
179
+ try {
180
+ m = decodeURI ( path ) . match ( regex )
181
+ } catch ( err ) {
182
+ if ( process . env . NODE_ENV !== 'production' ) {
183
+ warn ( `Error decoding "${ path } ". Leaving it intact.` )
184
+ }
185
+ }
179
186
180
187
if ( ! m ) {
181
188
return false
Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ const encode = str =>
14
14
. replace ( encodeReserveRE , encodeReserveReplacer )
15
15
. replace ( commaRE , ',' )
16
16
17
- const decode = decodeURIComponent
17
+ export function decode ( str ) {
18
+ try {
19
+ return decodeURIComponent ( str )
20
+ } catch ( err ) {
21
+ if ( process . env . NODE_ENV !== 'production' ) {
22
+ warn ( `Error decoding "${ str } ". Leaving it intact.` )
23
+ }
24
+ }
25
+ return str
26
+ }
18
27
19
28
export function resolveQuery (
20
29
query : ?string ,
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ if (args.indexOf('-c') < 0) {
61
61
function adaptArgv ( argv ) {
62
62
// take every remaining argument and treat it as a test file
63
63
// this allows to run `node test/e2e/runner.js test/e2e/basic.js`
64
- argv . retries = 1
64
+ argv . retries = process . env . CI ? 1 : 0
65
65
argv . test = argv [ '_' ] . slice ( 0 )
66
66
67
67
if ( argv . c === DEFAULT_CONFIG && argv . config === DEFAULT_CONFIG ) {
You can’t perform that action at this time.
0 commit comments