OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/json-stringifier.h" | 5 #include "src/json-stringifier.h" |
6 | 6 |
7 #include "src/conversions.h" | 7 #include "src/conversions.h" |
8 #include "src/lookup.h" | 8 #include "src/lookup.h" |
9 #include "src/messages.h" | 9 #include "src/messages.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 StackPop(); | 530 StackPop(); |
531 return SUCCESS; | 531 return SUCCESS; |
532 } | 532 } |
533 | 533 |
534 JsonStringifier::Result JsonStringifier::SerializeJSReceiverSlow( | 534 JsonStringifier::Result JsonStringifier::SerializeJSReceiverSlow( |
535 Handle<JSReceiver> object) { | 535 Handle<JSReceiver> object) { |
536 Handle<FixedArray> contents = property_list_; | 536 Handle<FixedArray> contents = property_list_; |
537 if (contents.is_null()) { | 537 if (contents.is_null()) { |
538 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 538 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
539 isolate_, contents, | 539 isolate_, contents, |
540 KeyAccumulator::GetKeys(object, OWN_ONLY, ENUMERABLE_STRINGS), | 540 KeyAccumulator::GetKeys(object, KeyCollectionMode::kOwnOnly, |
| 541 ENUMERABLE_STRINGS), |
541 EXCEPTION); | 542 EXCEPTION); |
542 } | 543 } |
543 builder_.AppendCharacter('{'); | 544 builder_.AppendCharacter('{'); |
544 Indent(); | 545 Indent(); |
545 bool comma = false; | 546 bool comma = false; |
546 for (int i = 0; i < contents->length(); i++) { | 547 for (int i = 0; i < contents->length(); i++) { |
547 Object* key = contents->get(i); | 548 Object* key = contents->get(i); |
548 Handle<String> key_handle; | 549 Handle<String> key_handle; |
549 MaybeHandle<Object> maybe_property; | 550 MaybeHandle<Object> maybe_property; |
550 if (key->IsString()) { | 551 if (key->IsString()) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 if (object->IsOneByteRepresentationUnderneath()) { | 698 if (object->IsOneByteRepresentationUnderneath()) { |
698 SerializeString_<uint8_t, uc16>(object); | 699 SerializeString_<uint8_t, uc16>(object); |
699 } else { | 700 } else { |
700 SerializeString_<uc16, uc16>(object); | 701 SerializeString_<uc16, uc16>(object); |
701 } | 702 } |
702 } | 703 } |
703 } | 704 } |
704 | 705 |
705 } // namespace internal | 706 } // namespace internal |
706 } // namespace v8 | 707 } // namespace v8 |
OLD | NEW |