From b3c82d5a061307a23b6892319f64880c64577dd6 Mon Sep 17 00:00:00 2001 From: p3k Date: Mon, 24 Jul 2006 17:18:52 +0000 Subject: [PATCH] * added missing dontEnum() call for String.prototype.parseJSON * shortened toJSONString() method to simply toJSON() --- core/JSON.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/JSON.js b/core/JSON.js index 6f2b3a52..eb999c0d 100644 --- a/core/JSON.js +++ b/core/JSON.js @@ -8,10 +8,10 @@ * * Copyright 1998-2006 Helma Software. All Rights Reserved. * - * $RCSfile: all.js,v $ - * $Author: czv $ - * $Revision: 1.4 $ - * $Date: 2006/05/30 18:34:31 $ + * $RCSfile: JSON.js,v $ + * $Author: tobi $ + * $Revision: 1.1 $ + * $Date: 2006/07/24 17:09:23 $ */ @@ -21,12 +21,12 @@ This file adds these methods to JavaScript: - object.toJSONString() + object.toJSON() This method produces a JSON text from an object. The object must not contain any cyclical references. - array.toJSONString() + array.toJSON() This method produces a JSON text from an array. The array must not contain any cyclical references. @@ -124,16 +124,16 @@ } }; - Object.prototype.toJSONString = function () { + Object.prototype.toJSON = function () { return s.object(this); }; - Array.prototype.toJSONString = function () { + Array.prototype.toJSON = function () { return s.array(this); }; - Object.prototype.dontEnum("toJSONString"); - Array.prototype.dontEnum("toJSONString"); + Object.prototype.dontEnum("toJSON"); + Array.prototype.dontEnum("toJSON"); return; })(); @@ -145,3 +145,5 @@ String.prototype.parseJSON = function () { return false; } }; + +String.prototype.dontEnum("parseJSON");