Closed Bug 1468384 Opened 6 years ago Closed 6 years ago

Debugger: Add Debugger.Script.isModule

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: evilpie, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Add Debugger.Script.isModule (obsolete) — Splinter Review
      No description provided.
Attachment #8985053 - Attachment is patch: true
Attachment #8985053 - Attachment mime type: text/x-patch → text/plain
Tom, should you ask Jim for review?
Flags: needinfo?(evilpies)
Priority: -- → P3
Jason Laster said that the devtools team would like to take this, I think.
Flags: needinfo?(evilpies)
(based on comment 2)
Flags: needinfo?(jlaster)
Comment on attachment 8990457 [details]
Bug 1468384 - Add an .isModule getter to Debugger.Script.

https://reviewboard.mozilla.org/r/255530/#review262540

This needs a few more things, I hope minor.

- a line or two of documentation in js/src/doc/Debugger/Debugger.Script.md

- tests for what this should return in function and direct-eval code within a module.

- Please make the test use the onNewScript hook rather than the onDebuggerStatement hook. It happens earlier, so more chance to catch badness. You can avoid the `g.eval()` in isModule-01 by doing `g.parseModule("...");` instead.


Make sure that a test failure actually counts as a failure; onNewScript is special in that it can't throw exceptions, but they should be reported and logged as test failures anyway. If not, it's a bug (which can be filed and added to our backlog--not pressing).
Attachment #8990457 - Flags: review?(jorendorff)
Comment on attachment 8990457 [details]
Bug 1468384 - Add an .isModule getter to Debugger.Script.

https://reviewboard.mozilla.org/r/255530/#review265218

r=me. Thanks!

::: js/src/jit-test/tests/debug/Script-isModule-01.js:11
(Diff revision 2)
> +    assertEq(script.isModule, true);
> +};
> +const m = g.parseModule("");
> +m.declarationInstantiation();
> +m.evaluation();
> +

Assert that the onNewScript hook actually hit.
Attachment #8990457 - Flags: review?(jorendorff) → review+
Attachment #8985053 - Attachment is obsolete: true
Flags: needinfo?(jlaster)
Should this be landed?
Flags: needinfo?(loganfsmyth)
r?jimb because Phabricator wants a review and doesn't want me to review a patch I posted.
Flags: needinfo?(loganfsmyth)
Attachment #8990457 - Attachment is obsolete: true
Comment on attachment 9007588 [details]
Bug 1468384 - Add Debugger.Script.isModule. r=jorendorff

Jim Blandy :jimb has approved the revision.
Attachment #9007588 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/309721897c1c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Assignee: nobody → jorendorff
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: