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 "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 EXCEPTION); | 561 EXCEPTION); |
562 } | 562 } |
563 Result result = SerializeProperty(property, comma, key); | 563 Result result = SerializeProperty(property, comma, key); |
564 if (!comma && result == SUCCESS) comma = true; | 564 if (!comma && result == SUCCESS) comma = true; |
565 if (result == EXCEPTION) return result; | 565 if (result == EXCEPTION) return result; |
566 } | 566 } |
567 } else { | 567 } else { |
568 Handle<FixedArray> contents; | 568 Handle<FixedArray> contents; |
569 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 569 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
570 isolate_, contents, | 570 isolate_, contents, |
571 JSReceiver::GetKeys(object, JSReceiver::OWN_ONLY), | 571 JSReceiver::GetKeys(object, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS), |
572 EXCEPTION); | 572 EXCEPTION); |
573 | 573 |
574 for (int i = 0; i < contents->length(); i++) { | 574 for (int i = 0; i < contents->length(); i++) { |
575 Object* key = contents->get(i); | 575 Object* key = contents->get(i); |
576 Handle<String> key_handle; | 576 Handle<String> key_handle; |
577 MaybeHandle<Object> maybe_property; | 577 MaybeHandle<Object> maybe_property; |
578 if (key->IsString()) { | 578 if (key->IsString()) { |
579 key_handle = Handle<String>(String::cast(key), isolate_); | 579 key_handle = Handle<String>(String::cast(key), isolate_); |
580 maybe_property = Object::GetPropertyOrElement(object, key_handle); | 580 maybe_property = Object::GetPropertyOrElement(object, key_handle); |
581 } else { | 581 } else { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } else { | 680 } else { |
681 SerializeString_<uc16, uc16>(object); | 681 SerializeString_<uc16, uc16>(object); |
682 } | 682 } |
683 } | 683 } |
684 } | 684 } |
685 | 685 |
686 } // namespace internal | 686 } // namespace internal |
687 } // namespace v8 | 687 } // namespace v8 |
688 | 688 |
689 #endif // V8_JSON_STRINGIFIER_H_ | 689 #endif // V8_JSON_STRINGIFIER_H_ |
OLD | NEW |