File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ export class History {
146146 cb ( err )
147147 } )
148148 } else {
149- warn ( false , 'uncaught error during route navigation:' )
149+ if ( process . env . NODE_ENV !== 'production' ) {
150+ warn ( false , 'uncaught error during route navigation:' )
151+ }
150152 console . error ( err )
151153 }
152154 }
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ export default class VueRouter {
3939 afterHooks : Array < ?AfterNavigationHook >
4040
4141 constructor ( options : RouterOptions = { } ) {
42+ if ( process . env . NODE_ENV !== 'production' ) {
43+ warn ( this instanceof VueRouter , `Router must be called with the new operator.` )
44+ }
4245 this . app = null
4346 this . apps = [ ]
4447 this . options = options
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export function assert (condition: any, message: string) {
77}
88
99export function warn ( condition : any , message : string ) {
10- if ( process . env . NODE_ENV !== 'production' && ! condition ) {
10+ if ( ! condition ) {
1111 typeof console !== 'undefined' && console . warn ( `[vue-router] ${ message } ` )
1212 }
1313}
You can’t perform that action at this time.
0 commit comments