Skip to content

Commit

Permalink
fixup! module: fix the leak in SourceTextModule and ContextifySript
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Sep 26, 2023
1 parent 3f9dce6 commit cbafa9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ModuleWrap::ModuleWrap(Environment* env,
: BaseObject(env, object),
module_(env->isolate(), module),
module_hash_(module->GetIdentityHash()) {
object->SetInternalField(kModuleSlot, module);
object->SetInternalFieldForNodeCore(kModuleSlot, module);
object->SetInternalField(kURLSlot, url);
object->SetInternalField(kSyntheticEvaluationStepsSlot,
synthetic_evaluation_step);
Expand Down
3 changes: 2 additions & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {

contextify_script->script_.Reset(isolate, v8_script);
contextify_script->script_.SetWeak();
contextify_script->object()->SetInternalField(kUnboundScriptSlot, v8_script);
contextify_script->object()->SetInternalFieldForNodeCore(kUnboundScriptSlot,
v8_script);

std::unique_ptr<ScriptCompiler::CachedData> new_cached_data;
if (produce_cached_data) {
Expand Down

0 comments on commit cbafa9c

Please sign in to comment.