Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: wcpan, Unassigned)

Tracking

Trunk
mozilla47
Points:
---

Firefox Tracking Flags

(firefox46 affected, firefox47 fixed)

Details

Attachments

(1 attachment)

Add a test to ensure bug 1208641 do not fail.
An uncaught exception will cause the test fail, but unfortunately it's what I need to test.

Maybe we need something like "except_exception = MyException" in mochitest.
I could help writing devtools test against that. Also I already wrote more low level test in xpconnect.
We already assert for valid stacks for common web exception.
In what precise scenarios should we see new stack appear on exceptions?

If I follow correctly, last patch from bug 1208641 is going to focus on window-related exceptions,
so it won't show JSM stacks yet?
(In reply to Alexandre Poirot [:ochameau] from comment #2)
> I could help writing devtools test against that. Also I already wrote more
> low level test in xpconnect.
> We already assert for valid stacks for common web exception.
> In what precise scenarios should we see new stack appear on exceptions?
>
> If I follow correctly, last patch from bug 1208641 is going to focus on
> window-related exceptions,
> so it won't show JSM stacks yet?

Yes, if a JSM throws an exception which created by Components.Exception, then the stack won't show in console.

I've tried to throw exception in the mochitest, but I can't seem to reproduce the problem.

Here is how I reproduce bug 1208641 on B2G:
1. modify some frequently used js module, e.g. BrowserElementParent.js
2. throw Components.Exception in every method
3. use adb logcat to observe B2G logs, some exceptions won't print the stack
> An uncaught exception will cause the test fail, but unfortunately it's what I need to test.

SimpleTest.expectUncaughtException() will solve this problem for you.  But from inside a mochitest it may not be trivial to tell what the console sees, so a devtools test is likely better.

> In what precise scenarios should we see new stack appear on exceptions?

  <script>
  function f() {
    throw new DOMException("Hello");
  }
  f();
  </script>
No longer blocks: 1208641
Created attachment 8721980 [details] [diff] [review]
patch v1

Here is a patch varifying that stacks now appear on following code:
  document.querySelector("broken;selector");
  throw new DOMException("plop"); // <= may be this one is redundant?
Attachment #8721980 - Flags: review?(vporof)
Attachment #8721980 - Flags: review?(vporof) → review+

Comment 8

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/138f7c7856b6
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox47: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.