@@ -1269,9 +1269,11 @@ void AppendExceptionLine(Environment* env,
12691269 ScriptOrigin origin = message->GetScriptOrigin ();
12701270 node::Utf8Value filename (env->isolate (), message->GetScriptResourceName ());
12711271 const char * filename_string = *filename;
1272- int linenum = message->GetLineNumber ();
1272+ int linenum = message->GetLineNumber (env-> context ()). FromJust ( );
12731273 // Print line of source code.
1274- node::Utf8Value sourceline (env->isolate (), message->GetSourceLine ());
1274+ MaybeLocal<String> source_line_maybe = message->GetSourceLine (env->context ());
1275+ node::Utf8Value sourceline (env->isolate (),
1276+ source_line_maybe.ToLocalChecked ());
12751277 const char * sourceline_string = *sourceline;
12761278 if (strstr (sourceline_string, " node-do-not-add-exception-line" ) != nullptr )
12771279 return ;
@@ -1419,7 +1421,7 @@ static void ReportException(Environment* env,
14191421 name.IsEmpty () ||
14201422 name->IsUndefined ()) {
14211423 // Not an error object. Just print as-is.
1422- String::Utf8Value message (er);
1424+ String::Utf8Value message (env-> isolate (), er);
14231425
14241426 PrintErrorString (" %s\n " , *message ? *message :
14251427 " <toString() threw exception>" );
@@ -1471,13 +1473,13 @@ static Local<Value> ExecuteString(Environment* env,
14711473 exit (3 );
14721474 }
14731475
1474- Local <Value> result = script.ToLocalChecked ()->Run ();
1476+ MaybeLocal <Value> result = script.ToLocalChecked ()->Run (env-> context () );
14751477 if (result.IsEmpty ()) {
14761478 ReportException (env, try_catch);
14771479 exit (4 );
14781480 }
14791481
1480- return scope.Escape (result);
1482+ return scope.Escape (result. ToLocalChecked () );
14811483}
14821484
14831485
0 commit comments