Skip to content

Commit fce74e4

Browse files
committed
replay ErrorUtils::FormatStackTrace
1 parent df7e6cd commit fce74e4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/execution/messages.cc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ MessageLocation::MessageLocation(Handle<Script> script, int start_pos,
4444
start_pos_(start_pos),
4545
end_pos_(end_pos),
4646
bytecode_offset_(-1),
47-
shared_(shared) {
48-
recordreplay::AssertMaybeEventsDisallowed(
47+
shared_(shared) {
48+
recordreplay::Print(
4949
"[PRO-1150] MessageLocation::MessageLocation B %d %d %d",
5050
script->id(), start_pos, end_pos);
5151
}
@@ -58,14 +58,14 @@ MessageLocation::MessageLocation(Handle<Script> script,
5858
end_pos_(-1),
5959
bytecode_offset_(bytecode_offset),
6060
shared_(shared) {
61-
recordreplay::AssertMaybeEventsDisallowed(
61+
recordreplay::Print(
6262
"[PRO-1150] MessageLocation::MessageLocation C %d",
6363
script->id());
6464
}
6565

6666
MessageLocation::MessageLocation()
6767
: start_pos_(-1), end_pos_(-1), bytecode_offset_(-1) {
68-
recordreplay::AssertMaybeEventsDisallowed(
68+
recordreplay::Print(
6969
"[PRO-1150] MessageLocation::MessageLocation D");
7070
}
7171

@@ -453,7 +453,14 @@ MaybeHandle<Object> ErrorUtils::FormatStackTrace(Isolate* isolate,
453453
}
454454
}
455455

456-
return builder.Finish();
456+
MaybeHandle<String> rv = builder.Finish();
457+
if (recordreplay::IsRecordingOrReplaying("ErrorUtils::FormatStackTrace")) {
458+
// [PRO-1150] Replay error stack.
459+
std::string str = rv.ToHandleChecked()->ToCString().get();
460+
recordreplay::RecordReplayString("ErrorUtils::FormatStackTrace", str);
461+
rv = isolate->factory()->NewStringFromUtf8(base::CStrVector(str.c_str()));
462+
}
463+
return rv;
457464
}
458465

459466
Handle<String> MessageFormatter::Format(Isolate* isolate, MessageTemplate index,

0 commit comments

Comments
 (0)