| 138 | } |
| 139 | |
| 140 | Ref<ValueArray> Marshaller::toArray() { |
| 141 | auto n = size(); |
| 142 | |
| 143 | auto out = ValueArray::make(static_cast<size_t>(n)); |
| 144 | |
| 145 | for (int i = 0; i < n; i++) { |
| 146 | auto value = get(i); |
| 147 | if (!_exceptionTracker) { |
| 148 | return nullptr; |
| 149 | } |
| 150 | |
| 151 | out->emplace(static_cast<size_t>(i), std::move(value)); |
| 152 | } |
| 153 | |
| 154 | return out; |
| 155 | } |
| 156 | |
| 157 | std::string Marshaller::toString(bool indent) { |
| 158 | auto array = toArray(); |