From 56ab65a24da96887b79270404b6a3cbee37a5d72 Mon Sep 17 00:00:00 2001 From: Theodore Ni Date: Thu, 4 Aug 2016 09:21:52 -0700 Subject: [PATCH] Build up specificity for nested routes. When adding an array of routes, each route will increase the specificity instead of using only that of the last route. --- lib/route-recognizer.js | 11 +++-------- tests/recognizer-tests.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/route-recognizer.js b/lib/route-recognizer.js index db9e09e..7ea7b34 100644 --- a/lib/route-recognizer.js +++ b/lib/route-recognizer.js @@ -125,10 +125,7 @@ function parse(route, names, specificity, shouldDecodes) { // `x`, irrespective of the other parts. // Because of this similarity, we assign each type of segment a number value written as a // string. We can find the specificity of compound routes by concatenating these strings - // together, from left to right. After we have looped through all of the segments, - // we convert the string to a number. - specificity.val = ''; - + // together, from left to right. for (var i=0; i