| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_JSON_STRINGIFIER_H_ | 5 #ifndef V8_JSON_STRINGIFIER_H_ |
| 6 #define V8_JSON_STRINGIFIER_H_ | 6 #define V8_JSON_STRINGIFIER_H_ |
| 7 | 7 |
| 8 #include "v8.h" | 8 #include "v8.h" |
| 9 #include "conversions.h" | 9 #include "conversions.h" |
| 10 #include "utils.h" | 10 #include "utils.h" |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 EXCEPTION); | 668 EXCEPTION); |
| 669 } | 669 } |
| 670 Result result = SerializeProperty(property, comma, key); | 670 Result result = SerializeProperty(property, comma, key); |
| 671 if (!comma && result == SUCCESS) comma = true; | 671 if (!comma && result == SUCCESS) comma = true; |
| 672 if (result == EXCEPTION) return result; | 672 if (result == EXCEPTION) return result; |
| 673 } | 673 } |
| 674 } else { | 674 } else { |
| 675 Handle<FixedArray> contents; | 675 Handle<FixedArray> contents; |
| 676 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 676 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 677 isolate_, contents, | 677 isolate_, contents, |
| 678 JSReceiver::GetKeys(object, JSReceiver::LOCAL_ONLY), | 678 JSReceiver::GetKeys(object, JSReceiver::OWN_ONLY), |
| 679 EXCEPTION); | 679 EXCEPTION); |
| 680 | 680 |
| 681 for (int i = 0; i < contents->length(); i++) { | 681 for (int i = 0; i < contents->length(); i++) { |
| 682 Object* key = contents->get(i); | 682 Object* key = contents->get(i); |
| 683 Handle<String> key_handle; | 683 Handle<String> key_handle; |
| 684 MaybeHandle<Object> maybe_property; | 684 MaybeHandle<Object> maybe_property; |
| 685 if (key->IsString()) { | 685 if (key->IsString()) { |
| 686 key_handle = Handle<String>(String::cast(key), isolate_); | 686 key_handle = Handle<String>(String::cast(key), isolate_); |
| 687 maybe_property = Object::GetPropertyOrElement(object, key_handle); | 687 maybe_property = Object::GetPropertyOrElement(object, key_handle); |
| 688 } else { | 688 } else { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 SerializeString_<false, uint8_t>(object); | 877 SerializeString_<false, uint8_t>(object); |
| 878 } else { | 878 } else { |
| 879 SerializeString_<false, uc16>(object); | 879 SerializeString_<false, uc16>(object); |
| 880 } | 880 } |
| 881 } | 881 } |
| 882 } | 882 } |
| 883 | 883 |
| 884 } } // namespace v8::internal | 884 } } // namespace v8::internal |
| 885 | 885 |
| 886 #endif // V8_JSON_STRINGIFIER_H_ | 886 #endif // V8_JSON_STRINGIFIER_H_ |
| OLD | NEW |