Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use unique_ptr for CachedData in ContextifyScript::New #33113

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/node_contextify.cc
Expand Up @@ -764,8 +764,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
env->cached_data_rejected_string(),
Boolean::New(isolate, source.GetCachedData()->rejected)).Check();
} else if (produce_cached_data) {
const ScriptCompiler::CachedData* cached_data =
ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked());
std::unique_ptr<ScriptCompiler::CachedData> cached_data {
ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()) };
bool cached_data_produced = cached_data != nullptr;
if (cached_data_produced) {
MaybeLocal<Object> buf = Buffer::Copy(
Expand Down