justinfagnani / route

A client + server routing library for Dart
BSD 3-Clause "New" or "Revised" License
114 stars 40 forks source link

Routing is browser-dependent when routes overloap #37

Closed polux closed 11 years ago

polux commented 11 years ago

Because https://github.com/dart-lang/route/blob/master/lib/client.dart#L35 uses a HashMap and not a LinkedHashMap, handle(url) can behave differently depending on the browser the code obtained via dart2js runs on.

I guess routes should not overlap but it's sometimes convenient to add a .* default route at the end of the routes. Maybe that's not something you want to enable. Either way, since there's no check that routes don't overlap, using a LinkedHashMap would improve determinism.

justinfagnani commented 11 years ago

Just fixed as you suggested. BTW, we take pull requests.

polux commented 11 years ago

Thanks! Will do next time.