@@ -1269,9 +1269,12 @@ void AppendExceptionLine(Environment* env,
1269
1269
ScriptOrigin origin = message->GetScriptOrigin ();
1270
1270
node::Utf8Value filename (env->isolate (), message->GetScriptResourceName ());
1271
1271
const char * filename_string = *filename;
1272
- int linenum = message->GetLineNumber ();
1272
+ Maybe<int > line_number_maybe = message->GetLineNumber (env->context ());
1273
+ int linenum = line_number_maybe.FromJust ();
1273
1274
// Print line of source code.
1274
- node::Utf8Value sourceline (env->isolate (), message->GetSourceLine ());
1275
+ MaybeLocal<String> source_line_maybe = message->GetSourceLine (env->context ());
1276
+ node::Utf8Value sourceline (env->isolate (),
1277
+ source_line_maybe.ToLocalChecked ());
1275
1278
const char * sourceline_string = *sourceline;
1276
1279
if (strstr (sourceline_string, " node-do-not-add-exception-line" ) != nullptr )
1277
1280
return ;
@@ -1419,7 +1422,7 @@ static void ReportException(Environment* env,
1419
1422
name.IsEmpty () ||
1420
1423
name->IsUndefined ()) {
1421
1424
// Not an error object. Just print as-is.
1422
- String::Utf8Value message (er);
1425
+ String::Utf8Value message (env-> isolate (), er);
1423
1426
1424
1427
PrintErrorString (" %s\n " , *message ? *message :
1425
1428
" <toString() threw exception>" );
@@ -1471,13 +1474,13 @@ static Local<Value> ExecuteString(Environment* env,
1471
1474
exit (3 );
1472
1475
}
1473
1476
1474
- Local <Value> result = script.ToLocalChecked ()->Run ();
1477
+ MaybeLocal <Value> result = script.ToLocalChecked ()->Run (env-> context () );
1475
1478
if (result.IsEmpty ()) {
1476
1479
ReportException (env, try_catch);
1477
1480
exit (4 );
1478
1481
}
1479
1482
1480
- return scope.Escape (result);
1483
+ return scope.Escape (result. ToLocalChecked () );
1481
1484
}
1482
1485
1483
1486
0 commit comments