[Custom Formatters] provided config object should "bubble" through standard formatters
Reported by
antonin....@gmail.com,
Jun 9 2016
|
|||
Issue descriptionUserAgent: 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
,
Jun 9 2016
,
Oct 5 2017
Bulk DevTools triage, closing low priority issues with no action plan. |
|||
►
Sign in to add a comment |
|||
Comment 1 by antonin....@gmail.com
, Jun 9 2016