New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 618780 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

[Custom Formatters] provided config object should "bubble" through standard formatters

Reported by antonin....@gmail.com, Jun 9 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36

Steps to reproduce the problem:
Please look at this repro case:
https://gist.github.com/darwin/0df1f9bbf9dadf8af5c0ce653fff6a91

The goal here is to augment formatting of function objects, but fall back to standard formatter in body. Expanding standard formatters can lead to display of other function objects recursively. Config object is a great mechanism for passing state to child formatters - that is how we prevent custom-formatting recursion in the example and we know when to fall back to standard formatter.

But the problem is that this custom config object does not survive standard formatters. It won't get passed form them to child formatters which could use some state info.

What is the expected behavior?

What went wrong?
I'd like to have a mechanism how to pass state to my deeply nested custom formatters even through standard custom formatters and formatters from other parties.

My proposal would be to assign a unique id to each custom formatter invocation. And enhance config object to contain a "call stack path" - e.g an array of ids which lead to current invocation (note that this path is not direct call stack - user can click CF expansion at will and expand this path asynchronously).

This way I could do some independent book-keeping and determine child formatter state even if there were arbitrary number for foreign or standard formatters potentially clobbering the config object. I believe I could use WeakMap to keep the records, so they would get garbage collected automatically when given custom formatter gets removed (assuming CF subsystem would keep config objects I specified in the template during CF-instance life-time in the UI)

Did this work before? No 

Chrome version: 53.0.2763.0  Channel: canary
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 21.0 r0
 
Here is current screenshot of the repro case:
https://dl.dropboxusercontent.com/u/559047/cf-config-bubbling.png

I would like __proto__ to use standard formatters because I once specified preventRecursion in the config object and that setting should persist arbitrary number of standard formatters before it gets to custom formatter rendering in deeper levels.

Comment 2 by l...@chromium.org, Jun 9 2016

Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Archived (was: Assigned)
Bulk DevTools triage, closing low priority issues with no action plan.

Sign in to add a comment