-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how directives e.g. strictness are handled for lazy
Summary: The current approach of handling directives limits what we can do, and the logic of computing strictness is duplicated and confusing. The goal of this diff is to first achieve parity with the previous strictness behaviors, and then migrate/implement other/new directives to this new approach in upper diffs. ### Status Quo Parser is reponsible to set strictness to ESTree Node 1. preParse records strictness for every function 2. lazyParse recovers info from preParse to maintain the invariant that parser can still set the strictness correctly (D25318752) Sematic validator then recompute the strictness again and verify/update the ESTree Node! 1. for non-lazy fn, it scan its body node to set FC 2. for lazy fn, it reuses the node strictness set by lazyParse to set FC (D25318752) ### Proposed Changes Parser is no longer responsible for setting strictness to node. It needs to know strictness only for the parsing purpose. 1. preParse collects seen directives for every function 2. lazyParse reconstruct the directive nodes in lazy function body Semantic validator is the source of truth for compute strictness (and any other directive information) going forward. (Note: this ignores all push blocking failures!) Reviewed By: avp Differential Revision: D29035883 fbshipit-source-id: fb79e5d1750c338cd3d3d7dcbf4659c24edf87e8
- Loading branch information
1 parent
9708fd0
commit 9a001f4
Showing
7 changed files
with
74 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters