mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Change the way parseStack returns the stack to be fiber-aware
This commit is contained in:
@@ -433,7 +433,13 @@ var error = function (message, options) {
|
||||
|
||||
if ('useMyCaller' in info) {
|
||||
if (info.useMyCaller) {
|
||||
info.stack = parseStack.parse(new Error()).slice(2);
|
||||
const {
|
||||
insideFiber,
|
||||
outsideFiber
|
||||
} = parseStack.parse(new Error());
|
||||
|
||||
// Concatenate and get rid of lines about Future and buildmessage
|
||||
info.stack = outsideFiber.concat(insideFiber).slice(2);
|
||||
if (typeof info.useMyCaller === 'number') {
|
||||
info.stack = info.stack.slice(info.useMyCaller);
|
||||
}
|
||||
|
||||
@@ -1805,7 +1805,7 @@ var runTests = function (options) {
|
||||
testList.notifyFailed(test);
|
||||
|
||||
if (failure instanceof TestFailure) {
|
||||
var frames = parseStack.parse(failure);
|
||||
var frames = parseStack.parse(failure).outsideFiber;
|
||||
var relpath = files.pathRelative(files.getCurrentToolsDir(),
|
||||
frames[0].file);
|
||||
Console.rawError(" => " + failure.reason + " at " +
|
||||
|
||||
@@ -38,9 +38,10 @@ export function parse(err) {
|
||||
const outsideFiber = parseStackFrames(frames);
|
||||
const insideFiber = parseStackFrames(frames.slice(indexOfFiberSplit + 1));
|
||||
|
||||
// Put the frames below the split at the top of the printed stack trace, since
|
||||
// they are more likely to contain the code that actually threw the error.
|
||||
return insideFiber.concat(outsideFiber);
|
||||
return {
|
||||
insideFiber,
|
||||
outsideFiber
|
||||
};
|
||||
}
|
||||
|
||||
// Decorator. Mark the point at which a stack trace returned by
|
||||
|
||||
Reference in New Issue
Block a user