From 690dfe000bf11fa6b39235d9a177dc79948841d4 Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Wed, 3 Nov 2010 10:13:03 -0700 Subject: Serialize RegExp to string in JSON. Closes #119. --- src/JSON.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/JSON.js') diff --git a/src/JSON.js b/src/JSON.js index 8606319a..b2647104 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -33,6 +33,8 @@ function toJsonArray(buf, obj, pretty, stack){ var type = typeof obj; if (obj === _null) { buf.push($null); + } else if (obj instanceof RegExp) { + buf.push(angular['String']['quoteUnicode'](obj.toString())); } else if (type === $function) { return; } else if (type === $boolean) { -- cgit v1.2.3