Frame.parseFirefox constructor Null safety
- String frame
Parses a string representation of a Firefox stack frame.
Implementation
factory Frame.parseFirefox(String frame) => _catchFormatException(frame, () {
var match = _firefoxSafariFrame.firstMatch(frame);
if (match == null) return UnparsedFrame(frame);
if (match[3]!.contains(' line ')) {
return Frame._parseFirefoxEval(frame);
}
// Normally this is a URI, but in a jsshell trace it can be a path.
var uri = _uriOrPathToUri(match[3]!);
var member = match[1];
if (member != null) {
member +=
List.filled('/'.allMatches(match[2]!).length, '.<fn>').join();
if (member == '') member = '<fn>';
// Some Firefox members have initial dots. We remove them for
// consistency with other platforms.
member = member.replaceFirst(_initialDot, '');
} else {
member = '<fn>';
}
var line = match[4] == '' ? null : int.parse(match[4]!);
var column =
match[5] == null || match[5] == '' ? null : int.parse(match[5]!);
return Frame(uri, line, column, member);
});