| Index: src/json.js
|
| diff --git a/src/json.js b/src/json.js
|
| index e94d3c8e3e907f081891f2517b91de7de13b3f89..048153b5d411503f247b6b9927a439c1b273c5f4 100644
|
| --- a/src/json.js
|
| +++ b/src/json.js
|
| @@ -25,8 +25,15 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| +// This file relies on the fact that the following declarations have been made
|
| +// in runtime.js:
|
| +// var $Array = global.Array;
|
| +// var $String = global.String;
|
| +
|
| var $JSON = global.JSON;
|
|
|
| +// -------------------------------------------------------------------
|
| +
|
| function Revive(holder, name, reviver) {
|
| var val = holder[name];
|
| if (IS_OBJECT(val)) {
|
| @@ -207,20 +214,24 @@ function JSONStringify(value, replacer, space) {
|
| }
|
|
|
|
|
| +function JSONSerializeAdapter(key, object) {
|
| + var holder = {};
|
| + holder[key] = object;
|
| + // No need to pass the actual holder since there is no replacer function.
|
| + return JSONSerialize(key, holder, void 0, new InternalArray(), "", "");
|
| +}
|
| +
|
| +
|
| +// -------------------------------------------------------------------
|
| +
|
| function SetUpJSON() {
|
| %CheckIsBootstrapping();
|
| +
|
| + // Set up non-enumerable properties of the JSON object.
|
| InstallFunctions($JSON, DONT_ENUM, $Array(
|
| "parse", JSONParse,
|
| "stringify", JSONStringify
|
| ));
|
| }
|
|
|
| -
|
| -function JSONSerializeAdapter(key, object) {
|
| - var holder = {};
|
| - holder[key] = object;
|
| - // No need to pass the actual holder since there is no replacer function.
|
| - return JSONSerialize(key, holder, void 0, new InternalArray(), "", "");
|
| -}
|
| -
|
| SetUpJSON();
|
|
|