Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tofu: support class properties #1098

Closed
boneskull opened this issue Mar 12, 2024 · 0 comments · Fixed by #1099 or #1059
Closed

tofu: support class properties #1098

boneskull opened this issue Mar 12, 2024 · 0 comments · Fixed by #1099 or #1059
Assignees
Labels
bug Something isn't working

Comments

@boneskull
Copy link
Contributor

boneskull commented Mar 12, 2024

It looks like lavamoat-tofu is now considering some things to be globals which were not previously considered globals, and by all accounts aren't actually globals. This is likely related to changes merged in #809 or #810

Ex: https://github.com/MetaMask/metamask-extension/pull/23423/files#diff-7c92d6ad2a8a25dea901b4d2d1399d086251e96be25bafbbecf7389c95d92be4R2224-R2245

Diagnose & fix

This is because lavamoat-tofu does not know anything about ClassProperty-type Nodes, e.g.:

class Foo {
  bar;
  baz = 1;
}

Ensure ClassProperty-type Nodes are not considered globals in lavamoat-tofu.

@boneskull boneskull added the bug Something isn't working label Mar 12, 2024
@boneskull boneskull self-assigned this Mar 12, 2024
@boneskull boneskull changed the title tofu: over-eager global detection in policy generation tofu: support class properties Mar 12, 2024
boneskull added a commit that referenced this issue Mar 12, 2024
Adds an exception to `findGlobals()` for AST nodes of type `ClassProperty`.

Closes #1098
boneskull added a commit that referenced this issue Mar 12, 2024
Adds an exception to `findGlobals()` for AST nodes of type `ClassProperty`.

Closes #1098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant