Chromium Code Reviews| 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; |
|
Toon Verwaest
2012/10/17 17:52:50
If possible, also use IS_UNDEFINED here; like belo
Yang
2012/10/18 12:27:33
I don't think this is necessary:
if nothing is wri
|
| 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, ""); |
| } |