Skip to content

Commit b289c55

Browse files
committed
fixup! fixup! src: align FFI error handling with Node.js source
1 parent 16ead68 commit b289c55

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/ffi/data.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ Maybe<std::pair<uint8_t*, size_t>> GetValidatedPointerAndOffset(
194194
return Just(std::make_pair(reinterpret_cast<uint8_t*>(raw_ptr), offset));
195195
}
196196

197-
struct PointerValueAndOffset {
197+
struct PointerOffsetAndValue {
198198
uint8_t* ptr;
199199
size_t offset;
200200
Local<Value> value;
201201
};
202202

203-
Maybe<PointerValueAndOffset> GetValidatedPointerValueAndOffset(
203+
Maybe<PointerOffsetAndValue> GetValidatedPointerOffsetAndValue(
204204
Environment* env, const FunctionCallbackInfo<Value>& args) {
205205
size_t offset;
206206
Local<Value> value;
@@ -242,7 +242,7 @@ Maybe<PointerValueAndOffset> GetValidatedPointerValueAndOffset(
242242
value = args[2];
243243

244244
uint8_t* ptr = reinterpret_cast<uint8_t*>(static_cast<uintptr_t>(raw_ptr));
245-
return Just(PointerValueAndOffset{ptr, offset, value});
245+
return Just(PointerOffsetAndValue{ptr, offset, value});
246246
}
247247

248248
template <typename T>
@@ -292,9 +292,9 @@ template <typename T>
292292
void SetValue(const FunctionCallbackInfo<Value>& args) {
293293
Environment* env = Environment::GetCurrent(args);
294294
THROW_IF_INSUFFICIENT_PERMISSIONS(env, permission::PermissionScope::kFFI, "");
295-
PointerValueAndOffset data;
295+
PointerOffsetAndValue data;
296296

297-
if (!GetValidatedPointerValueAndOffset(env, args).To(&data)) {
297+
if (!GetValidatedPointerOffsetAndValue(env, args).To(&data)) {
298298
return;
299299
}
300300
auto [ptr, offset, value] = data;

0 commit comments

Comments
 (0)