@@ -1595,9 +1595,11 @@ void AppendExceptionLine(Environment* env,
15951595 ScriptOrigin origin = message->GetScriptOrigin ();
15961596 node::Utf8Value filename (env->isolate (), message->GetScriptResourceName ());
15971597 const char * filename_string = *filename;
1598- int linenum = message->GetLineNumber ();
1598+ int linenum = message->GetLineNumber (env-> context ()). FromJust ( );
15991599 // Print line of source code.
1600- node::Utf8Value sourceline (env->isolate (), message->GetSourceLine ());
1600+ MaybeLocal<String> source_line_maybe = message->GetSourceLine (env->context ());
1601+ node::Utf8Value sourceline (env->isolate (),
1602+ source_line_maybe.ToLocalChecked ());
16011603 const char * sourceline_string = *sourceline;
16021604 if (strstr (sourceline_string, " node-do-not-add-exception-line" ) != nullptr )
16031605 return ;
@@ -1745,7 +1747,7 @@ static void ReportException(Environment* env,
17451747 name.IsEmpty () ||
17461748 name->IsUndefined ()) {
17471749 // Not an error object. Just print as-is.
1748- String::Utf8Value message (er);
1750+ String::Utf8Value message (env-> isolate (), er);
17491751
17501752 PrintErrorString (" %s\n " , *message ? *message :
17511753 " <toString() threw exception>" );
@@ -1797,13 +1799,13 @@ static Local<Value> ExecuteString(Environment* env,
17971799 exit (3 );
17981800 }
17991801
1800- Local <Value> result = script.ToLocalChecked ()->Run ();
1802+ MaybeLocal <Value> result = script.ToLocalChecked ()->Run (env-> context () );
18011803 if (result.IsEmpty ()) {
18021804 ReportException (env, try_catch);
18031805 exit (4 );
18041806 }
18051807
1806- return scope.Escape (result);
1808+ return scope.Escape (result. ToLocalChecked () );
18071809}
18081810
18091811
0 commit comments