facebookarchive/prepack

Review/enforce possible values / types of tracked object properties

Open

#1.124 aberto em 1 de nov. de 2017

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (520 forks)batch import
bootcampeddesign neededhelp wantedlevel 3 (medium)test needed

Métricas do repositório

Stars
 (14.268 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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 trackedPropertyNames is defined
  • Consider including type information in trackedPropertyNames and issuing type invariant checks as part of the property injection in setupTrackedPropertyAccessors.
  • Manually review all static Flow types of tracked properties to check if they conform

Guia do colaborador