The order of the routes-property-object seems to be of importance in the Ampersand Router.
We stumbled upon this, because we needed to dynamically define our routes. When we used lodash.assign(routes1, routes2) to merge a bunch of routes, the "catch-all-wildcart" of the first "routes1"-object overruled all routes in our second "routes2"-object. If we reverse the assign-order, things behave differently.
4.3.3 Object
An object is a member of the type Object. It is an unordered collection of properties each of which contains a primitive value, object, or function. A function stored in a property of an object is called a method.
We noticed in other parts of our app that we can not rely on the order of the properties in a Javascript Object. Yes, we were testing on an old Android 4.x.x's Stock Browser, but this post does confirm our observations: http://stackoverflow.com/questions/280713/elements-order-in-a-for-in-loop
The order of the routes-property-object seems to be of importance in the Ampersand Router.
We stumbled upon this, because we needed to dynamically define our routes. When we used lodash.assign(routes1, routes2) to merge a bunch of routes, the "catch-all-wildcart" of the first "routes1"-object overruled all routes in our second "routes2"-object. If we reverse the assign-order, things behave differently.
Anyone having same issues here? No-one having crossbrowser issues here? From ECMAScript Third Edition (pdf):
We noticed in other parts of our app that we can not rely on the order of the properties in a Javascript Object. Yes, we were testing on an old Android 4.x.x's Stock Browser, but this post does confirm our observations: http://stackoverflow.com/questions/280713/elements-order-in-a-for-in-loop