Open Bug 1604428 Opened 5 years ago Updated 2 years ago

Cached console message stacktrace don't have promise callback asyncCause (but do have setTimeout ones)

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

Details

Steps to reproduce

  1. Apply https://phabricator.services.mozilla.com/D57441?id=208975
  2. Run the test

Expected results

The test passes

Actual results

The test fails, as the stacktraces are missing frames:

Got:

onTimeout
(Async: setTimeout handler)
timeout
onPromiseThen

Expected

onTimeout
(Async: setTimeout handler)
timeout
onPromiseThen
(Async: promise callback)
promiseThen
<anonymous>

Here's the script to generate the trace:

function timeout(cb, delay) {
  setTimeout(cb, delay);
}

function promiseThen(cb) {
  Promise.resolve().then(cb);
}

const onTimeout = () => {
  console.trace("Trace message");
  console.error("console error message");
  throw new Error("Thrown error message");
};
const onPromiseThen = () => timeout(onTimeout, 1);
promiseThen(onPromiseThen);
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.