File tree Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Expand file tree Collapse file tree 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({
4747 { path : '/bar' , component : Bar } ,
4848 { path : '/é' , component : Unicode } ,
4949 { path : '/é/:unicode' , component : Unicode } ,
50- { path : '/query/:q' , component : Query }
50+ { path : '/query/:q' , component : Query , name : 'param' }
5151 ]
5252} )
5353
@@ -69,14 +69,16 @@ const vueInstance = new Vue({
6969 <li><router-link to="/é/ñ?t=%25ñ">/é/ñ?t=%ñ</router-link></li>
7070 <li><router-link to="/é/ñ#é">/é/ñ#é</router-link></li>
7171 <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>
7275 </ul>
7376 <pre id="query-t">{{ $route.query.t }}</pre>
7477 <pre id="hash">{{ $route.hash }}</pre>
7578 <router-view class="view"></router-view>
7679 </div>
7780 ` ,
78- methods : {
79- }
81+ methods : { }
8082} ) . $mount ( '#app' )
8183
8284document . getElementById ( 'unmount' ) . addEventListener ( 'click' , ( ) => {
Original file line number Diff line number Diff line change @@ -175,7 +175,14 @@ function matchRoute (
175175 path : string ,
176176 params : Object
177177) : 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+ }
179186
180187 if ( ! m ) {
181188 return false
Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ const encode = str =>
1414 . replace ( encodeReserveRE , encodeReserveReplacer )
1515 . replace ( commaRE , ',' )
1616
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+ }
1827
1928export function resolveQuery (
2029 query : ?string ,
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ if (args.indexOf('-c') < 0) {
6161function adaptArgv ( argv ) {
6262 // take every remaining argument and treat it as a test file
6363 // 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
6565 argv . test = argv [ '_' ] . slice ( 0 )
6666
6767 if ( argv . c === DEFAULT_CONFIG && argv . config === DEFAULT_CONFIG ) {
You can’t perform that action at this time.
0 commit comments