| 104 | }; |
| 105 | |
| 106 | void CppMarshaller::marshall(ExceptionTracker& exceptionTracker, const BytesView& value, Value& out) { |
| 107 | auto existingTypedArray = castOrNull<ValueTypedArray>(value.getSource()); |
| 108 | if (existingTypedArray != nullptr && existingTypedArray->getBuffer().isStrictlyIdenticalTo(value)) { |
| 109 | out = Value(existingTypedArray); |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | out = Value(makeShared<ValueTypedArray>(TypedArrayType::Uint8Array, value)); |
| 114 | } |
| 115 | |
| 116 | void CppMarshaller::unmarshall(ExceptionTracker& exceptionTracker, const Value& value, BytesView& out) { |
| 117 | auto typedArray = value.checkedTo<Ref<ValueTypedArray>>(exceptionTracker); |
nothing calls this directly
no test coverage detected