Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 514ff08183a0a4464afd6a37974c2476da1cc44a..09a8524e9304f5e0edf5e293bf3dc16504c03cfb 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -2194,9 +2194,10 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context, |
} |
has_pending_exception = result.is_null(); |
if (has_pending_exception) isolate->ReportPendingMessages(); |
- RETURN_ON_FAILED_EXECUTION(Script); |
- source->info->clear_script(); // because script goes out of scope. |
+ source->Release(); |
+ |
+ RETURN_ON_FAILED_EXECUTION(Script); |
Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result); |
if (generic.IsEmpty()) return Local<Script>(); |