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 @@ -114,13 +114,15 @@ using v8::Integer;
114114using v8::Isolate;
115115using v8::Local;
116116using v8::Locker;
117+ using v8::MaybeLocal;
117118using v8::Message;
118119using v8::Number;
119120using v8::Object;
120121using v8::ObjectTemplate;
121122using v8::Promise;
122123using v8::PromiseRejectMessage;
123124using v8::PropertyCallbackInfo;
125+ using v8::ScriptOrigin;
124126using v8::SealHandleScope;
125127using v8::StackFrame;
126128using v8::StackTrace;
@@ -1607,13 +1609,15 @@ static Local<Value> ExecuteString(Environment* env,
16071609 // we will handle exceptions ourself.
16081610 try_catch.SetVerbose (false );
16091611
1610- Local<v8::Script> script = v8::Script::Compile (source, filename);
1612+ ScriptOrigin origin (filename);
1613+ MaybeLocal<v8::Script> script =
1614+ v8::Script::Compile (env->context (), source, &origin);
16111615 if (script.IsEmpty ()) {
16121616 ReportException (env, try_catch);
16131617 exit (3 );
16141618 }
16151619
1616- Local<Value> result = script->Run ();
1620+ Local<Value> result = script. ToLocalChecked () ->Run ();
16171621 if (result.IsEmpty ()) {
16181622 ReportException (env, try_catch);
16191623 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 }
@@ -263,10 +262,10 @@ class ContextifyContext {
263262 }
264263
265264 Context::Scope context_scope (debug_context);
266- Local <Script> script = Script::Compile (script_source);
265+ MaybeLocal <Script> script = Script::Compile (debug_context, script_source);
267266 if (script.IsEmpty ())
268267 return ; // Exception pending.
269- args.GetReturnValue ().Set (script->Run ());
268+ args.GetReturnValue ().Set (script. ToLocalChecked () ->Run ());
270269 }
271270
272271
You can’t perform that action at this time.
0 commit comments