Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: src/date.js

Issue 5676005: Fix regression in JSON serialization of RegExps. (Closed)
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/json.js » ('j') | test/mjsunit/json.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
diff --git a/src/date.js b/src/date.js
index 960147072c27cca7d690fe8beba71d64dffc7ea0..cdc35cbb720a71a4b8ca875bf78b2631fdf402a9 100644
--- a/src/date.js
+++ b/src/date.js
@@ -992,6 +992,13 @@ function DateToISOString() {
}
+function CheckJSONPrimitive(val) {
+ if (!IsPrimitive(val))
+ throw MakeTypeError('result_not_primitive', ['toJSON', val]);
+ return val;
+}
+
+
function DateToJSON(key) {
return CheckJSONPrimitive(this.toISOString());
Rico 2010/12/15 07:46:10 Two things; 1. If "this" is a custom object, and i
Lasse Reichstein 2010/12/15 08:59:54 Rewritten completely, CheckJSONPrimitive removed a
}
« no previous file with comments | « no previous file | src/json.js » ('j') | test/mjsunit/json.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698