Skip to content

Commit

Permalink
src: remove unused variable
Browse files Browse the repository at this point in the history
PR-URL: nodejs#25481
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
cjihrig authored and antsmartian committed Feb 7, 2019
1 parent e81c6c8 commit 945cef5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@ void NativeModuleLoader::GetCacheUsage(

void NativeModuleLoader::SourceObjectGetter(
Local<Name> property, const PropertyCallbackInfo<Value>& info) {
Local<Context> context = info.GetIsolate()->GetCurrentContext();
info.GetReturnValue().Set(
per_process::native_module_loader.GetSourceObject(context));
Isolate* isolate = info.GetIsolate();

const NativeModuleRecordMap& source_ =
per_process::native_module_loader.source_;
std::vector<Local<Value>> ids;
ids.reserve(source_.size());

for (auto const& x : source_) {
ids.push_back(OneByteString(isolate, x.first.c_str(), x.first.size()));
}

info.GetReturnValue().Set(Array::New(isolate, ids.data(), ids.size()));
}

void NativeModuleLoader::ConfigStringGetter(
Expand Down

0 comments on commit 945cef5

Please sign in to comment.