Closed yauhen closed 12 years ago
indexOf
is because it was expecting a string, will fix it for next version (ensure it typecast value to string).id
to be a non-empty string since it's a required segment of the route, otherId
could be an empty string tho. It should at least give a better error message on the next version. The string ""
wouldn't match the route {id}/:otherId:
anyway.Thanks for the feedback.
1) var route = crossroads.addRoute('/news/{id}', function (id) { console.log(id); // 12 (remove trailing zeroes since it's typecasted) }); route.interpolate({ id: 123 });
just fails due of SCRIPT438: Object doesn't support property or method 'indexOf' pattern_lexer.js, line 168 character 25
2) also if we have empty value {id:''} for following route "{id}/:otherId:" it also fails on validation