Closed
Bug 1165807
Opened 9 years ago
Closed 9 years ago
Show entries for WeakMap and WeakSet in console
Categories
(DevTools :: Console, defect)
DevTools
Console
Tracking
(firefox45 fixed)
RESOLVED
FIXED
Firefox 45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: 446240525, Assigned: tromey)
References
Details
(Whiteboard: [polish-backlog][difficulty=medium])
Attachments
(1 file, 8 obsolete files)
21.29 KB,
patch
|
tromey
:
review+
|
Details | Diff | Splinter Review |
Just like we did for Map and Set. And both Chrome and Safari(webkit nightly) already support this.
Updated•9 years ago
|
Whiteboard: [polish-backlog][difficulty=medium]
Comment 2•9 years ago
|
||
Note: For iterating weak map items (it feels gross just saying that), one can use the Cu.getJSTestingFunctions().nondeterministicGetWeakMapKeys function.
Assignee | ||
Comment 3•9 years ago
|
||
I'm making them show up in the console and deferring the variables view change to bug 1172920.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
This patch works but I think it should probably have more tests for the new JS API, not just via the webconsole tests.
Assignee | ||
Comment 6•9 years ago
|
||
I added a simple test in xpconnect.
Attachment #8682693 -
Attachment is obsolete: true
Assignee | ||
Comment 7•9 years ago
|
||
git add the test
Attachment #8682724 -
Attachment is obsolete: true
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8682729 [details] [diff] [review] display WeakSet and WeakMap contents in console This adds display of the contents of WeakSet and WeakMap to the console. To make this work for WeakSet, I had to add a new API to JS to fetch the keys of the WeakSet object. I exposed this in xpconnect where the equivalent for WeakMap is exposed.
Attachment #8682729 -
Flags: review?(nfitzgerald)
Attachment #8682729 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8682729 [details] [diff] [review] display WeakSet and WeakMap contents in console Cancelling the review while I work on the precursor bug first.
Attachment #8682729 -
Flags: review?(nfitzgerald)
Attachment #8682729 -
Flags: review?(bzbarsky)
Comment 10•9 years ago
|
||
Comment on attachment 8682729 [details] [diff] [review] display WeakSet and WeakMap contents in console Review of attachment 8682729 [details] [diff] [review]: ----------------------------------------------------------------- Would prefer attaching nondeterministicBlahBlahBlah to ThreadSafeChromeUtils.webidl since we can use that in workers and we are trying to get the console + debugger properly supported on workers. My hope is that it wouldn't be too difficult, but if it turns out to be then feel free to push it off as a follow up. The rest of the changes look A+ to me. ::: devtools/client/webconsole/test/test-console-table.html @@ +45,5 @@ > mySet.add(null); > mySet.add(undefined); > + > + var bunnies = new String("bunnies"); > + var lizards = new String("lizards"); And we know these will still be around when we preview the weak set because these are global variables and therefore can't be reclaimed by the GC? Might deserve a quick note.
Attachment #8682729 -
Flags: feedback+
Comment 11•9 years ago
|
||
Comment on attachment 8682729 [details] [diff] [review] display WeakSet and WeakMap contents in console (Sorry to revive from the dead!)
Attachment #8682729 -
Attachment is obsolete: true
Assignee | ||
Comment 12•9 years ago
|
||
Updated to follow bug 1221292.
Assignee | ||
Comment 13•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8686243 -
Attachment is obsolete: true
Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8686254 [details] [diff] [review] display WeakSet and WeakMap contents in console Updated per initial review, and to follow bug 1221292.
Attachment #8686254 -
Flags: review?(nfitzgerald)
Attachment #8686254 -
Flags: review?(bzbarsky)
Comment 15•9 years ago
|
||
Comment on attachment 8686254 [details] [diff] [review] display WeakSet and WeakMap contents in console r=me on the dom/base and dom/webidl changes.
Attachment #8686254 -
Flags: review?(bzbarsky) → review+
Comment 16•9 years ago
|
||
Comment on attachment 8686254 [details] [diff] [review] display WeakSet and WeakMap contents in console Review of attachment 8686254 [details] [diff] [review]: ----------------------------------------------------------------- Looks great!
Attachment #8686254 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 17•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec5f17b177dc
Assignee | ||
Comment 18•9 years ago
|
||
Add r= to commit message.
Attachment #8686254 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8686669 -
Flags: review+
Assignee | ||
Comment 19•9 years ago
|
||
Naturally try points out that the test assumes a particular ordering of keys. Whoops. I will figure out what to do about the test.
Assignee | ||
Comment 20•9 years ago
|
||
Update tests to allow "out-of-order" results.
Attachment #8686669 -
Attachment is obsolete: true
Assignee | ||
Comment 21•9 years ago
|
||
Comment on attachment 8687267 [details] [diff] [review] display WeakSet and WeakMap contents in console I changed the tests to allow the results to appear in any order. I wasn't sure if this was big enough to warrant re-review, so erring on the side of caution.
Attachment #8687267 -
Flags: review?(nfitzgerald)
Updated•9 years ago
|
Attachment #8687267 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 22•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7c15d8b012ac
Assignee | ||
Comment 23•9 years ago
|
||
Typo in one of the expected results.
Attachment #8687267 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8687408 -
Flags: review+
Assignee | ||
Comment 24•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b67a145d508f
Assignee | ||
Comment 25•9 years ago
|
||
A silly slip of the keys snuck in. Someday this will make it through. One thing that occurred to me that is odd about this patch is that if a user prints a WeakSet on the console, then that will keep the elements alive. This may be unexpected.
Attachment #8687408 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8687936 -
Flags: review+
Assignee | ||
Comment 26•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=98278885a078
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 27•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/4e0d0bf80b36
Keywords: checkin-needed
Comment 28•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4e0d0bf80b36
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 45
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•