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/value-serializer.h" | 5 #include "src/value-serializer.h" |
6 | 6 |
7 #include <type_traits> | 7 #include <type_traits> |
8 | 8 |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 void ValueSerializer::ThrowDataCloneError( | 737 void ValueSerializer::ThrowDataCloneError( |
738 MessageTemplate::Template template_index, Handle<Object> arg0) { | 738 MessageTemplate::Template template_index, Handle<Object> arg0) { |
739 Handle<String> message = | 739 Handle<String> message = |
740 MessageTemplate::FormatMessage(isolate_, template_index, arg0); | 740 MessageTemplate::FormatMessage(isolate_, template_index, arg0); |
741 if (delegate_) { | 741 if (delegate_) { |
742 delegate_->ThrowDataCloneError(Utils::ToLocal(message)); | 742 delegate_->ThrowDataCloneError(Utils::ToLocal(message)); |
743 } else { | 743 } else { |
744 isolate_->Throw( | 744 isolate_->Throw( |
745 *isolate_->factory()->NewError(isolate_->error_function(), message)); | 745 *isolate_->factory()->NewError(isolate_->error_function(), message)); |
746 } | 746 } |
| 747 if (isolate_->has_scheduled_exception()) { |
| 748 isolate_->PromoteScheduledException(); |
| 749 } |
747 } | 750 } |
748 | 751 |
749 ValueDeserializer::ValueDeserializer(Isolate* isolate, | 752 ValueDeserializer::ValueDeserializer(Isolate* isolate, |
750 Vector<const uint8_t> data) | 753 Vector<const uint8_t> data) |
751 : isolate_(isolate), | 754 : isolate_(isolate), |
752 position_(data.start()), | 755 position_(data.start()), |
753 end_(data.start() + data.length()), | 756 end_(data.start() + data.length()), |
754 id_map_(Handle<SeededNumberDictionary>::cast( | 757 id_map_(Handle<SeededNumberDictionary>::cast( |
755 isolate->global_handles()->Create( | 758 isolate->global_handles()->Create( |
756 *SeededNumberDictionary::New(isolate, 0)))) {} | 759 *SeededNumberDictionary::New(isolate, 0)))) {} |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 if (stack.size() != 1) { | 1482 if (stack.size() != 1) { |
1480 isolate_->Throw(*isolate_->factory()->NewError( | 1483 isolate_->Throw(*isolate_->factory()->NewError( |
1481 MessageTemplate::kDataCloneDeserializationError)); | 1484 MessageTemplate::kDataCloneDeserializationError)); |
1482 return MaybeHandle<Object>(); | 1485 return MaybeHandle<Object>(); |
1483 } | 1486 } |
1484 return scope.CloseAndEscape(stack[0]); | 1487 return scope.CloseAndEscape(stack[0]); |
1485 } | 1488 } |
1486 | 1489 |
1487 } // namespace internal | 1490 } // namespace internal |
1488 } // namespace v8 | 1491 } // namespace v8 |
OLD | NEW |