Index: src/json.js |
diff --git a/src/json.js b/src/json.js |
index 85224b0f053ffde051228ae9f66de947009db402..608cb7109d972f5981be6f51fefa17aab6ebc2ab 100644 |
--- a/src/json.js |
+++ b/src/json.js |
@@ -307,10 +307,12 @@ function BasicJSONSerialize(key, value, stack, builder) { |
function JSONStringify(value, replacer, space) { |
if (%_ArgumentsLength() == 1) { |
+ var result = %BasicJSONStringify(value); |
+ if (result != 0) return result; |
var builder = new InternalArray(); |
BasicJSONSerialize('', value, new InternalArray(), builder); |
if (builder.length == 0) return; |
- var result = %_FastAsciiArrayJoin(builder, ""); |
+ result = %_FastAsciiArrayJoin(builder, ""); |
if (!IS_UNDEFINED(result)) return result; |
return %StringBuilderConcat(builder, builder.length, ""); |
} |