GeezerVison is showing github.com — src: replace uses of deprecated v8::External APIs · nodejs/node@2dc1d20
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node_ffi.cc +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -191,7 +191,8 @@ MaybeLocal<Function> DynamicLibrary::CreateFunction( |
191 | 191 |
|
192 | 192 | FFIFunctionInfo* info = new FFIFunctionInfo(); |
193 | 193 | info->fn = fn; |
194 | | - Local<External> data = External::New(isolate, info); |
| 194 | + Local<External> data = |
| 195 | + External::New(isolate, info, v8::kExternalPointerTypeTagDefault); |
195 | 196 | MaybeLocal<Function> maybe_ret = |
196 | 197 | Function::New(env->context(), DynamicLibrary::InvokeFunction, data); |
197 | 198 | Local<Function> ret; |
@@ -274,8 +275,8 @@ void DynamicLibrary::Close(const FunctionCallbackInfo<Value>& args) { |
274 | 275 |
|
275 | 276 | void DynamicLibrary::InvokeFunction(const FunctionCallbackInfo<Value>& args) { |
276 | 277 | Environment* env = Environment::GetCurrent(args); |
277 | | - FFIFunctionInfo* info = |
278 | | - static_cast<FFIFunctionInfo*>(args.Data().As<External>()->Value()); |
| 278 | + FFIFunctionInfo* info = static_cast<FFIFunctionInfo*>( |
| 279 | + args.Data().As<External>()->Value(v8::kExternalPointerTypeTagDefault)); |
279 | 280 | FFIFunction* fn = info->fn.get(); |
280 | 281 |
|
281 | 282 | if (fn == nullptr || fn->closed || fn->ptr == nullptr) { |
|