mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-01 10:49:03 +08:00
This CL introduces a basic ESLint rule for tracking the calls to context.save and context.restore. It does this by using two stacks, one to track scopes, and another to track save() and restore() calls within those scopes. If when we exit a scope we have an unbalanced stack of calls, we know the user has not properly ensured that every save() call is restore()'d properly. Bug: 1450569 Change-Id: I5d632a0e0cd17b6f755e3b725146314db408b3bd Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4580487 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Andres Olivares <andoli@chromium.org>