From 6f21190383b96735a2fdcbdac44d9e33ff1aee05 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 26 May 2014 13:44:15 -0400 Subject: [PATCH] Matched values may not be JSONable, but must be matchable with __ --- route.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/route.js b/route.js index 6452123..8630096 100644 --- a/route.js +++ b/route.js @@ -613,7 +613,13 @@ function Routing(exports) { r = r.get(__); } } else { - var key = JSON.stringify(v); + var key; + try { + key = JSON.stringify(v); + } catch (exn) { + // For example, v might be cyclic, as in DOM events. + key = null; + } if (key in r.entries) { r = r.get(key); } else {