diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-08 21:40:46 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-21 08:29:26 +0300 |
commit | 1a92c884185bc3e01c6d64aae55ea5a947d82840 (patch) | |
tree | df5f0a195866bf94bf0f7d90827817adfb859f1e /src/util.h | |
parent | f17c794faf7892ee385d10bba8c11c9df4b45778 (diff) |
src: migrate off ArrayBuffer::GetContents
V8 deprecates `GetContents()` in favour of `GetBackingStore()`.
Update our code to reflect that.
V8 also deprecates `Externalize()` and `IsExternal()`; we should
be able to remove all usage of this once V8 8.0 is there.
PR-URL: https://github.com/nodejs/node/pull/30339
Refs: https://github.com/v8/v8/commit/bfe3d6bce734e596e312465e207bcfd55a59fe34
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.h b/src/util.h index f2d3f355f9f..2f6c17fc321 100644 --- a/src/util.h +++ b/src/util.h @@ -488,11 +488,12 @@ class BufferValue : public MaybeStackBuffer<char> { #define SPREAD_BUFFER_ARG(val, name) \ CHECK((val)->IsArrayBufferView()); \ v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>(); \ - v8::ArrayBuffer::Contents name##_c = name->Buffer()->GetContents(); \ + std::shared_ptr<v8::BackingStore> name##_bs = \ + name->Buffer()->GetBackingStore(); \ const size_t name##_offset = name->ByteOffset(); \ const size_t name##_length = name->ByteLength(); \ char* const name##_data = \ - static_cast<char*>(name##_c.Data()) + name##_offset; \ + static_cast<char*>(name##_bs->Data()) + name##_offset; \ if (name##_length > 0) \ CHECK_NE(name##_data, nullptr); |