Skip to content

Commit 570c9df

Browse files
committed
patch for electron
1 parent 303bd22 commit 570c9df

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

nan_typedarray_contents.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ class TypedArrayContents {
3434
// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13
3535
// using 7.8 till 13.2.0.
3636
#if (V8_MAJOR_VERSION >= 8)
37-
data = static_cast<char*>(buffer->GetBackingStore()->Data()) + byte_offset;
37+
v8::Isolate *isolate = v8::Isolate::GetCurrent();
38+
39+
v8::Local<v8::Object> local;
40+
node::Buffer::New(isolate, buffer, 0, buffer->ByteLength()).ToLocal(&local);
41+
data = static_cast<char*>(node::Buffer::Data(local)) + byte_offset;
3842
#else
3943
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
4044
#endif

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "nan",
2+
"name": "@electron-prebuilds/nan",
33
"version": "2.22.2",
44
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 22 compatibility",
55
"main": "include_dirs.js",
66
"repository": {
77
"type": "git",
8-
"url": "git://github.com/nodejs/nan.git"
8+
"url": "git://github.com/FileMap/nan.git"
99
},
1010
"scripts": {
1111
"test": "tap --gc --stderr test/js/*-test.js",

0 commit comments

Comments
 (0)