@@ -1606,9 +1606,11 @@ void AppendExceptionLine(Environment* env,
16061606 ScriptOrigin origin = message->GetScriptOrigin ();
16071607 node::Utf8Value filename (env->isolate (), message->GetScriptResourceName ());
16081608 const char * filename_string = *filename;
1609- int linenum = message->GetLineNumber ();
1609+ int linenum = message->GetLineNumber (env-> context ()). FromJust ( );
16101610 // Print line of source code.
1611- node::Utf8Value sourceline (env->isolate (), message->GetSourceLine ());
1611+ MaybeLocal<String> source_line_maybe = message->GetSourceLine (env->context ());
1612+ node::Utf8Value sourceline (env->isolate (),
1613+ source_line_maybe.ToLocalChecked ());
16121614 const char * sourceline_string = *sourceline;
16131615
16141616 // Because of how node modules work, all scripts are wrapped with a
@@ -1752,7 +1754,7 @@ static void ReportException(Environment* env,
17521754 name.IsEmpty () ||
17531755 name->IsUndefined ()) {
17541756 // Not an error object. Just print as-is.
1755- String::Utf8Value message (er);
1757+ String::Utf8Value message (env-> isolate (), er);
17561758
17571759 PrintErrorString (" %s\n " , *message ? *message :
17581760 " <toString() threw exception>" );
@@ -1800,13 +1802,13 @@ static Local<Value> ExecuteString(Environment* env,
18001802 exit (3 );
18011803 }
18021804
1803- Local <Value> result = script.ToLocalChecked ()->Run ();
1805+ MaybeLocal <Value> result = script.ToLocalChecked ()->Run (env-> context () );
18041806 if (result.IsEmpty ()) {
18051807 ReportException (env, try_catch);
18061808 exit (4 );
18071809 }
18081810
1809- return scope.Escape (result);
1811+ return scope.Escape (result. ToLocalChecked () );
18101812}
18111813
18121814
0 commit comments