Skip to content

Commit cbafa9c

Browse files
committed
fixup! module: fix the leak in SourceTextModule and ContextifySript
1 parent 3f9dce6 commit cbafa9c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/module_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ModuleWrap::ModuleWrap(Environment* env,
5858
: BaseObject(env, object),
5959
module_(env->isolate(), module),
6060
module_hash_(module->GetIdentityHash()) {
61-
object->SetInternalField(kModuleSlot, module);
61+
object->SetInternalFieldForNodeCore(kModuleSlot, module);
6262
object->SetInternalField(kURLSlot, url);
6363
object->SetInternalField(kSyntheticEvaluationStepsSlot,
6464
synthetic_evaluation_step);

src/node_contextify.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
858858

859859
contextify_script->script_.Reset(isolate, v8_script);
860860
contextify_script->script_.SetWeak();
861-
contextify_script->object()->SetInternalField(kUnboundScriptSlot, v8_script);
861+
contextify_script->object()->SetInternalFieldForNodeCore(kUnboundScriptSlot,
862+
v8_script);
862863

863864
std::unique_ptr<ScriptCompiler::CachedData> new_cached_data;
864865
if (produce_cached_data) {

0 commit comments

Comments
 (0)