Bustage fix: frame.filename can be null, and the async stack dump can then fail (which causes other problems)

This commit is contained in:
Justin Dolske 2008-06-24 19:39:58 -07:00
Родитель d0b90b39c3
Коммит 8dae69c9e8
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -293,7 +293,9 @@ Generator.prototype = {
function formatFrame(frame) {
// FIXME: sort of hackish, might be confusing if there are multiple
// extensions with similar filenames
let tmp = frame.filename.replace(/^file:\/\/.*\/([^\/]+.js)$/, "module:$1");
let tmp = "<file:unknown>";
if (frame.filename)
tmp = frame.filename.replace(/^file:\/\/.*\/([^\/]+.js)$/, "module:$1");
tmp += ":" + frame.lineNumber + " :: " + frame.name;
return tmp;
}