Closed Bug 1581418 Opened 2 years ago Closed 2 years ago

Include more properties when logging objects


(Core Graveyard :: Web Replay, enhancement)

Not set


(firefox71 fixed)

Tracking Status
firefox71 --- fixed


(Reporter: bhackett1024, Assigned: bhackett1024)




(1 file)

When logging objects to the console with console.log() or with logpoints, we try to retain enough information about the object's properties to show a one-line inline preview for the logged object. There are a couple problems with this approach:

  • We don't necessarily have enough information for custom object previewers to work, and a more generic previewer will be used. The results can be pretty lame: for example, logging an event while not replaying shows the event kind, target DOM object, coordinates of mouse events, etc., while when replaying we end up with a nearly empty MouseEvent preview.

  • Expanding the object does not show anything, because we don't retain all the object's properties and report an empty set when the server asks to enumerate all of them.

The associated patch improves both of these situations: Event objects (though not all others with custom previews) show up with appropriate contents in the inline preview, and logged objects can be expanded to see their properties. We aren't able to support all the custom previewers (in particular, those for DOM nodes), and aren't able to show all the contents of objects like sets/maps, but this patch also performs a fair amount of cleanup to make these easier to support in the future.

Pushed by
Include more properties when logging objects, r=jlast.
Backout by
Backed out changeset ece44b8f51e4 for causing xpcshell failures.
Pushed by
Include more properties when logging objects, r=jlast.
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Flags: needinfo?(bhackett1024)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.