Devtool extension authoring: EvalOnDartLibrary, how to recursively inspect an Object without causing `Sentinel <expired>` due to race conditions?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 EvalOnDartLibrary API 以及 issue 中描述的两种评估模式开始。复现递归检查场景,并比较 Sentinel 过期、私有成员访问和 late 字段行为。完成的条件是有 maintainer 确认的解决方案或范围明确的新能力,并在调查后确定测试或文档。
由索引模型根据 Issue 内容生成。
描述
Hello!
I think I'm missing something with regards to EvalOnDartLibrary. I fail to see how it is possible to fully map out an object without ever risking an <expired> Sentinel or not loosing the ability to inspect private members.
I am aware that one trick is to do (pseudo code):
final id = eval('globalMap.register(<expression to evaluate>)')
try {
final content = eval('globalMap.get("$id").<field I want to read>');
} finally {
eval('globalMap.unregister("$id")');
}
This prevents the <expired>. But afaik, prevents reading private members on the inspected object, due to globalMap and the private members being defined in different libraries.
(also, this will forcibly trigger late fields ; which can be undesired)
If we instead do:
final value= eval('<expression to evaluate>')
final content = eval('that.<field I want to read>', scope: {'that': value.id});
Then we risk that value will expire before content is resolved.
Is there something I'm missing here? Or do we need a new feature to solve this?
- 主要语言
- Dart
- 星标
- 1.7k
- 派生
- 420
- 平均合并
- 3 天 11 小时
- 30 天内合并 PR
- 29
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flutter/devtools 的其他 Issue
-
Check for modern web libraries to determine if an app is a web app可能已有人在做 @hkarmoush 于 36 天前认领。 未关闭P1 type-code-health
难度 2/5 1-3 小时 新手友好度 85/100
flutter/devtools#9973 · 4 条评论 ·
维护者通常 1 天内回复
-
P2 type-code-health
难度 2/5 1-3 小时 新手友好度 68/100
flutter/devtools#9942 · 3 条评论 ·
维护者通常 1 天内回复
-
[Inspector V2] Widget properties tab highlight extends past its rounded edge可能重新可做 @theprantadutta 于 195 天前认领,目前没有进行中的 PR。 未关闭contributions welcome cross-screen inspector-2.0-polish P2
难度 2/5 1-3 小时 新手友好度 65/100
flutter/devtools#8936 · 3 条评论 ·
维护者通常 1 天内回复
-
cross-screen P3
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
documentation good first issue P2
难度 1/5 1 小时以内 新手友好度 88/100
flutter/devtools#8293 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 60/100
hiddify/hiddify-app#2668 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
toyota-connected/emb_cli#358 ·
维护者通常 1 天内回复
-
area: import beta cluster: callers box improvements severity: minor status: confirmed type: bug
难度 2/5 1-3 小时 新手友好度 62/100
ibanner56/CallersCompendium#2366 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ccch1mneyyy/dsh-Go#1777 ·
维护者通常 1 天内回复
-
area: mobile documentation good first issue
难度 2/5 1-3 小时 新手友好度 76/100
CommandLineCoding/Elephant#383 ·
维护者通常 1 天内回复