File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,15 @@ using v8::Integer;
115115using v8::Isolate;
116116using v8::Local;
117117using v8::Locker;
118+ using v8::MaybeLocal;
118119using v8::Message;
119120using v8::Number;
120121using v8::Object;
121122using v8::ObjectTemplate;
122123using v8::Promise;
123124using v8::PromiseRejectMessage;
124125using v8::PropertyCallbackInfo;
126+ using v8::ScriptOrigin;
125127using v8::SealHandleScope;
126128using v8::StackFrame;
127129using v8::StackTrace;
@@ -1610,13 +1612,15 @@ static Local<Value> ExecuteString(Environment* env,
16101612 // we will handle exceptions ourself.
16111613 try_catch.SetVerbose (false );
16121614
1613- Local<v8::Script> script = v8::Script::Compile (source, filename);
1615+ ScriptOrigin origin (filename);
1616+ MaybeLocal<v8::Script> script =
1617+ v8::Script::Compile (env->context (), source, &origin);
16141618 if (script.IsEmpty ()) {
16151619 ReportException (env, try_catch);
16161620 exit (3 );
16171621 }
16181622
1619- Local<Value> result = script->Run ();
1623+ Local<Value> result = script. ToLocalChecked () ->Run ();
16201624 if (result.IsEmpty ()) {
16211625 ReportException (env, try_catch);
16221626 exit (4 );
Original file line number Diff line number Diff line change @@ -167,9 +167,8 @@ class ContextifyContext {
167167 " }\n "
168168 " })" );
169169
170- Local<String> fname = FIXED_ONE_BYTE_STRING (env ()->isolate (),
171- " binding:script" );
172- Local<Script> script = Script::Compile (code, fname);
170+ Local<Script> script =
171+ Script::Compile (context, code).ToLocalChecked ();
173172 clone_property_method = Local<Function>::Cast (script->Run ());
174173 CHECK (clone_property_method->IsFunction ());
175174 }
@@ -262,10 +261,10 @@ class ContextifyContext {
262261 }
263262
264263 Context::Scope context_scope (debug_context);
265- Local <Script> script = Script::Compile (script_source);
264+ MaybeLocal <Script> script = Script::Compile (debug_context, script_source);
266265 if (script.IsEmpty ())
267266 return ; // Exception pending.
268- args.GetReturnValue ().Set (script->Run ());
267+ args.GetReturnValue ().Set (script. ToLocalChecked () ->Run ());
269268 }
270269
271270
You can’t perform that action at this time.
0 commit comments