Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use GetBackingStore() instead GetContents() #888

Merged
merged 2 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ env:
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="2.0.18"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="3.1.13"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="4.2.12"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="5.0.11"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="6.1.2"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="7.0.0"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="5.0.13"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="6.1.9"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="7.1.14"
- TRAVIS_NODE_VERSION="lts/*" ELECTRON_VERSION="8.0.3"
matrix:
exclude:
- os: osx
Expand Down
8 changes: 7 additions & 1 deletion nan_typedarray_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ class TypedArrayContents {
v8::Local<v8::ArrayBuffer> buffer = array->Buffer();

length = byte_length / sizeof(T);
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13
// using 7.8 till 13.2.0.
#if (V8_MAJOR_VERSION >= 8)
data = static_cast<char*>(buffer->GetBackingStore()->Data()) + byte_offset;
#else
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
#endif
}

#else
Expand Down