aboutsummaryrefslogtreecommitdiffstats
path: root/src/JSON.js
diff options
context:
space:
mode:
authorElliott Sprehn2010-11-03 10:13:03 -0700
committerIgor Minar2010-11-03 11:10:51 -0700
commit690dfe000bf11fa6b39235d9a177dc79948841d4 (patch)
tree9a8ef41493e9e7dff0b17ab842ead7d9d3803ed5 /src/JSON.js
parent91c835dc0eb5b03e968ad890c41323de80bf45da (diff)
downloadangular.js-690dfe000bf11fa6b39235d9a177dc79948841d4.tar.bz2
Serialize RegExp to string in JSON. Closes #119.
Diffstat (limited to 'src/JSON.js')
-rw-r--r--src/JSON.js2
1 files changed, 2 insertions, 0 deletions
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) {