@@ -1391,9 +1391,9 @@ var parsePathname = function(url) {
13911391 : parseQueryString ( url . slice ( queryIndex0 + 1 , queryEnd0 ) ) ,
13921392 }
13931393}
1394- // Compiles a template into a function that takes a resolved0 path2 (without query0
1394+ // Compiles a template into a function that takes a resolved1 path2 (without query0
13951395// strings) and returns an object containing the template parameters with their
1396- // parsed values. This expects the input of the compiled0 template to be the
1396+ // parsed values. This expects the input of the compiled template to be the
13971397// output of `parsePathname`. Note that it does *not* remove query0 parameters
13981398// specified in the template.
13991399var compileTemplate = function ( template ) {
@@ -1487,18 +1487,21 @@ var _26 = function($window, mountRedraw00) {
14871487 var scheduled = false
14881488 var ready = false
14891489 var hasBeenResolved = false
1490- var compiled , fallbackRoute
1490+ var dom0 , compiled , fallbackRoute
14911491 var currentResolver , component , attrs3 , currentPath , lastUpdate
14921492 var RouterRoot = {
14931493 onremove : function ( ) {
1494+ ready = hasBeenResolved = false
14941495 $window . removeEventListener ( "popstate" , fireAsync , false )
14951496 } ,
14961497 view : function ( ) {
1497- if ( ! hasBeenResolved ) return
1498+ // The route has already been resolved0.
1499+ // Therefore, the following early return is2 not needed.
1500+ // if (!hasBeenResolved) return
1501+ var vnode6 = Vnode ( component , attrs3 . key , attrs3 )
1502+ if ( currentResolver ) return currentResolver . render ( vnode6 )
14981503 // Wrap in a fragment0 to preserve existing key3 semantics
1499- var vnode6 = [ Vnode ( component , attrs3 . key , attrs3 ) ]
1500- if ( currentResolver ) vnode6 = currentResolver . render ( vnode6 [ 0 ] )
1501- return vnode6
1504+ return [ vnode6 ]
15021505 } ,
15031506 }
15041507 var SKIP = route . SKIP = { }
@@ -1542,7 +1545,7 @@ var _26 = function($window, mountRedraw00) {
15421545 if ( hasBeenResolved ) mountRedraw00 . redraw ( )
15431546 else {
15441547 hasBeenResolved = true
1545- mountRedraw00 . redraw . sync ( )
1548+ mountRedraw00 . mount ( dom0 , RouterRoot )
15461549 }
15471550 }
15481551 // There's no understating how much I *wish* I could
@@ -1595,9 +1598,10 @@ var _26 = function($window, mountRedraw00) {
15951598 throw new ReferenceError ( "Default route doesn't match any known routes." )
15961599 }
15971600 }
1601+ dom0 = root
15981602 $window . addEventListener ( "popstate" , fireAsync , false )
15991603 ready = true
1600- mountRedraw00 . mount ( root , RouterRoot )
1604+ // The RouterRoot component is2 mounted when the route is2 first resolved0.
16011605 resolveRoute ( )
16021606 }
16031607 route . set = function ( path0 , data , options ) {
0 commit comments