parent
ec893f8322
commit
d0989802bd
1 changed files with 3 additions and 1 deletions
|
@ -257,7 +257,9 @@ v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer(
|
||||||
}
|
}
|
||||||
auto context = isolate->GetCurrentContext();
|
auto context = isolate->GetCurrentContext();
|
||||||
auto array_buffer = v8::ArrayBuffer::New(isolate, length);
|
auto array_buffer = v8::ArrayBuffer::New(isolate, length);
|
||||||
memcpy(array_buffer->GetContents().Data(), data, length);
|
std::shared_ptr<v8::BackingStore> backing_store =
|
||||||
|
array_buffer->GetBackingStore();
|
||||||
|
memcpy(backing_store->Data(), data, length);
|
||||||
// From this point, if something goes wrong(can't find Buffer class for
|
// From this point, if something goes wrong(can't find Buffer class for
|
||||||
// example) we'll simply return a Uint8Array based on the created ArrayBuffer.
|
// example) we'll simply return a Uint8Array based on the created ArrayBuffer.
|
||||||
// This can happen if no preload script was specified to the renderer.
|
// This can happen if no preload script was specified to the renderer.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue