Index: src/js/json.js |
diff --git a/src/js/json.js b/src/js/json.js |
index a7b692000870b1722be6d914383559675eed23f1..16f55c5cd80a2b5438a132b20226d509a66f430c 100644 |
--- a/src/js/json.js |
+++ b/src/js/json.js |
@@ -19,50 +19,8 @@ var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
// ------------------------------------------------------------------- |
-function CreateDataProperty(o, p, v) { |
- var desc = {value: v, enumerable: true, writable: true, configurable: true}; |
- return %reflect_define_property(o, p, desc); |
-} |
- |
- |
-function InternalizeJSONProperty(holder, name, reviver) { |
- var val = holder[name]; |
- if (IS_RECEIVER(val)) { |
- if (%is_arraylike(val)) { |
- var length = TO_LENGTH(val.length); |
- for (var i = 0; i < length; i++) { |
- var newElement = |
- InternalizeJSONProperty(val, %_NumberToString(i), reviver); |
- if (IS_UNDEFINED(newElement)) { |
- %reflect_delete_property(val, i); |
- } else { |
- CreateDataProperty(val, i, newElement); |
- } |
- } |
- } else { |
- var keys = %object_keys(val); |
- for (var i = 0; i < keys.length; i++) { |
- var p = keys[i]; |
- var newElement = InternalizeJSONProperty(val, p, reviver); |
- if (IS_UNDEFINED(newElement)) { |
- %reflect_delete_property(val, p); |
- } else { |
- CreateDataProperty(val, p, newElement); |
- } |
- } |
- } |
- } |
- return %_Call(reviver, holder, name, val); |
-} |
- |
- |
function JSONParse(text, reviver) { |
- var unfiltered = %ParseJson(text); |
- if (IS_CALLABLE(reviver)) { |
- return InternalizeJSONProperty({'': unfiltered}, '', reviver); |
- } else { |
- return unfiltered; |
- } |
+ return %ParseJson(text, reviver); |
} |
// ------------------------------------------------------------------- |