From cddf3eda285b0b6f5455d1eab302919e9a4e2d85 Mon Sep 17 00:00:00 2001 From: Keyhan Vakil Date: Tue, 2 Aug 2022 21:04:53 -0700 Subject: [PATCH] src: remove usages of GetBackingStore in modules This removes all usages of GetBackingStore in modules. See the linked issue for an explanation. Refs: https://github.com/nodejs/node/issues/32226 Refs: https://github.com/nodejs/node/pull/43921 PR-URL: https://github.com/nodejs/node/pull/44076 Reviewed-By: Darshan Sen Reviewed-By: Feng Yu Reviewed-By: Matteo Collina Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Anna Henningsen Reviewed-By: Santiago Gimeno --- src/module_wrap.cc | 4 ++-- src/node_contextify.cc | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index b445189d388036..f4557ee9915c65 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -178,8 +178,8 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { if (!args[5]->IsUndefined()) { CHECK(args[5]->IsArrayBufferView()); Local cached_data_buf = args[5].As(); - uint8_t* data = static_cast( - cached_data_buf->Buffer()->GetBackingStore()->Data()); + uint8_t* data = + static_cast(cached_data_buf->Buffer()->Data()); cached_data = new ScriptCompiler::CachedData(data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 95ba72c3db268c..969296656b1059 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -746,8 +746,7 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { ScriptCompiler::CachedData* cached_data = nullptr; if (!cached_data_buf.IsEmpty()) { - uint8_t* data = static_cast( - cached_data_buf->Buffer()->GetBackingStore()->Data()); + uint8_t* data = static_cast(cached_data_buf->Buffer()->Data()); cached_data = new ScriptCompiler::CachedData( data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); } @@ -1068,8 +1067,7 @@ void ContextifyContext::CompileFunction( // Read cache from cached data buffer ScriptCompiler::CachedData* cached_data = nullptr; if (!cached_data_buf.IsEmpty()) { - uint8_t* data = static_cast( - cached_data_buf->Buffer()->GetBackingStore()->Data()); + uint8_t* data = static_cast(cached_data_buf->Buffer()->Data()); cached_data = new ScriptCompiler::CachedData( data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); }