File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,15 @@ using v8::Integer;
115
115
using v8::Isolate;
116
116
using v8::Local;
117
117
using v8::Locker;
118
+ using v8::MaybeLocal;
118
119
using v8::Message;
119
120
using v8::Number;
120
121
using v8::Object;
121
122
using v8::ObjectTemplate;
122
123
using v8::Promise;
123
124
using v8::PromiseRejectMessage;
124
125
using v8::PropertyCallbackInfo;
126
+ using v8::ScriptOrigin;
125
127
using v8::SealHandleScope;
126
128
using v8::StackFrame;
127
129
using v8::StackTrace;
@@ -1610,13 +1612,15 @@ static Local<Value> ExecuteString(Environment* env,
1610
1612
// we will handle exceptions ourself.
1611
1613
try_catch.SetVerbose (false );
1612
1614
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);
1614
1618
if (script.IsEmpty ()) {
1615
1619
ReportException (env, try_catch);
1616
1620
exit (3 );
1617
1621
}
1618
1622
1619
- Local<Value> result = script->Run ();
1623
+ Local<Value> result = script. ToLocalChecked () ->Run ();
1620
1624
if (result.IsEmpty ()) {
1621
1625
ReportException (env, try_catch);
1622
1626
exit (4 );
Original file line number Diff line number Diff line change @@ -167,9 +167,8 @@ class ContextifyContext {
167
167
" }\n "
168
168
" })" );
169
169
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 ();
173
172
clone_property_method = Local<Function>::Cast (script->Run ());
174
173
CHECK (clone_property_method->IsFunction ());
175
174
}
@@ -262,10 +261,10 @@ class ContextifyContext {
262
261
}
263
262
264
263
Context::Scope context_scope (debug_context);
265
- Local <Script> script = Script::Compile (script_source);
264
+ MaybeLocal <Script> script = Script::Compile (debug_context, script_source);
266
265
if (script.IsEmpty ())
267
266
return ; // Exception pending.
268
- args.GetReturnValue ().Set (script->Run ());
267
+ args.GetReturnValue ().Set (script. ToLocalChecked () ->Run ());
269
268
}
270
269
271
270
You can’t perform that action at this time.
0 commit comments