Index: src/json.js |
diff --git a/src/json.js b/src/json.js |
index e94d3c8e3e907f081891f2517b91de7de13b3f89..b0e14e1965dfb297d26436c668a81d8a7a049a21 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,14 +214,23 @@ function JSONStringify(value, replacer, space) { |
} |
+// ------------------------------------------------------------------- |
+ |
function SetUpJSON() { |
%CheckIsBootstrapping(); |
+ |
+ // Set up non-enumerable properties of the JSON object. |
InstallFunctions($JSON, DONT_ENUM, $Array( |
"parse", JSONParse, |
"stringify", JSONStringify |
)); |
} |
+SetUpJSON(); |
+ |
+ |
+// ------------------------------------------------------------------- |
+// JSON Builtins |
function JSONSerializeAdapter(key, object) { |
var holder = {}; |
@@ -222,5 +238,3 @@ function JSONSerializeAdapter(key, object) { |
// No need to pass the actual holder since there is no replacer function. |
return JSONSerialize(key, holder, void 0, new InternalArray(), "", ""); |
} |
- |
-SetUpJSON(); |