diff --git a/src/node_contextify.cc b/src/node_contextify.cc index f7ddf866b206f4..1819c5f21d7bc3 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -524,7 +524,7 @@ class ContextifyScript : public BaseObject { else if (produce_cached_data) compile_options = ScriptCompiler::kProduceCodeCache; - Local v8_script = ScriptCompiler::CompileUnbound( + MaybeLocal v8_script = ScriptCompiler::CompileUnboundScript( env->isolate(), &source, compile_options); @@ -536,7 +536,8 @@ class ContextifyScript : public BaseObject { try_catch.ReThrow(); return; } - contextify_script->script_.Reset(env->isolate(), v8_script); + contextify_script->script_.Reset(env->isolate(), + v8_script.ToLocalChecked()); if (compile_options == ScriptCompiler::kConsumeCodeCache) { args.This()->Set(