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

Unified Diff: src/v8natives.js

Issue 5676005: Fix regression in JSON serialization of RegExps. (Closed)
Patch Set: Added test. 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 | « src/string.js ('k') | test/mjsunit/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 8e057037e4cf08c9ef5f46ef9a225b44d9064b88..4a1fd35cb9f20bf35628b05baf1442955a731be0 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -909,19 +909,13 @@ function BooleanValueOf() {
}
-function BooleanToJSON(key) {
- return CheckJSONPrimitive(this.valueOf());
-}
-
-
// ----------------------------------------------------------------------------
function SetupBoolean() {
InstallFunctions($Boolean.prototype, DONT_ENUM, $Array(
"toString", BooleanToString,
- "valueOf", BooleanValueOf,
- "toJSON", BooleanToJSON
+ "valueOf", BooleanValueOf
));
}
@@ -1021,18 +1015,6 @@ function NumberToPrecision(precision) {
}
-function CheckJSONPrimitive(val) {
- if (!IsPrimitive(val))
- throw MakeTypeError('result_not_primitive', ['toJSON', val]);
- return val;
-}
-
-
-function NumberToJSON(key) {
- return CheckJSONPrimitive(this.valueOf());
-}
-
-
// ----------------------------------------------------------------------------
function SetupNumber() {
@@ -1073,15 +1055,13 @@ function SetupNumber() {
"valueOf", NumberValueOf,
"toFixed", NumberToFixed,
"toExponential", NumberToExponential,
- "toPrecision", NumberToPrecision,
- "toJSON", NumberToJSON
+ "toPrecision", NumberToPrecision
));
}
SetupNumber();
-
// ----------------------------------------------------------------------------
// Function
« no previous file with comments | « src/string.js ('k') | test/mjsunit/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698