From 793240ac240b9a787ef843488ca51f0c9519cd18 Mon Sep 17 00:00:00 2001 From: Brian Merrifield Date: Tue, 28 Jul 2015 16:08:57 -0400 Subject: [PATCH] fix setRoute behavior --- lib/director/browser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/director/browser.js b/lib/director/browser.js index 1e47293..8556100 100644 --- a/lib/director/browser.js +++ b/lib/director/browser.js @@ -222,7 +222,12 @@ Router.prototype.setRoute = function (i, v, val) { url[i] = v; } else if (typeof val === 'string') { - url.splice(i, v, s); + url.splice(i, v, val); + } + else if (typeof i === 'number' && typeof v === 'number') { + if (i < url.length) { + url.splice(i, v); + } } else { url = [i];