facebookarchive/prepack
在 GitHub 查看Review/enforce possible values / types of tracked object properties
Open
#1,124 创建于 2017年11月1日
bootcampeddesign neededhelp wantedlevel 3 (medium)test needed
仓库指标
- Star
- (14,268 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
In ObjectValue.js, there's a list of trackedPropertyNames.
Tracked objects must be void or a (subtype of a) Value. After state joins, an AbstractValue may appear (encoding a conditional expression), or possibly other Value kinds due to simplification rules. Maybe there's some special logic in place for arrays (otherwise, how does $MapData and $SetData and $WeakMapData and $WeakSetData work as tracked objects?)
We should...
- Document the actual requirements where
trackedPropertyNamesis defined - Consider including type information in
trackedPropertyNamesand issuing type invariant checks as part of the property injection insetupTrackedPropertyAccessors. - Manually review all static Flow types of tracked properties to check if they conform