* added missing dontEnum() call for String.prototype.parseJSON

* shortened toJSONString() method to simply toJSON()
This commit is contained in:
Tobi Schäfer 2006-07-24 17:18:52 +00:00
parent ef369a61bf
commit b3c82d5a06

View file

@ -8,10 +8,10 @@
* *
* Copyright 1998-2006 Helma Software. All Rights Reserved. * Copyright 1998-2006 Helma Software. All Rights Reserved.
* *
* $RCSfile: all.js,v $ * $RCSfile: JSON.js,v $
* $Author: czv $ * $Author: tobi $
* $Revision: 1.4 $ * $Revision: 1.1 $
* $Date: 2006/05/30 18:34:31 $ * $Date: 2006/07/24 17:09:23 $
*/ */
@ -21,12 +21,12 @@
This file adds these methods to JavaScript: This file adds these methods to JavaScript:
object.toJSONString() object.toJSON()
This method produces a JSON text from an object. The This method produces a JSON text from an object. The
object must not contain any cyclical references. object must not contain any cyclical references.
array.toJSONString() array.toJSON()
This method produces a JSON text from an array. The This method produces a JSON text from an array. The
array must not contain any cyclical references. array must not contain any cyclical references.
@ -124,16 +124,16 @@
} }
}; };
Object.prototype.toJSONString = function () { Object.prototype.toJSON = function () {
return s.object(this); return s.object(this);
}; };
Array.prototype.toJSONString = function () { Array.prototype.toJSON = function () {
return s.array(this); return s.array(this);
}; };
Object.prototype.dontEnum("toJSONString"); Object.prototype.dontEnum("toJSON");
Array.prototype.dontEnum("toJSONString"); Array.prototype.dontEnum("toJSON");
return; return;
})(); })();
@ -145,3 +145,5 @@ String.prototype.parseJSON = function () {
return false; return false;
} }
}; };
String.prototype.dontEnum("parseJSON");