oxc/crates/oxc_traverse
overlookmotel 2c7bb9f6c8 refactor(ast): pass final ScopeFlags into visit_function (#4283)
We have a strange workaround for `visit_function` where we pass in `ScopeFlags`, to support creating the scope inside `Function`, but setting different flags for `MethodDefinition`s.

Previously `visit_function` took `Option<ScopeFlags>` and then did `flags.unwrap_or(ScopeFlags::empty()) | ScopeFlags::Function` to it. Personally, I found this confusing. When I was looking at `MethodDefinition`, I was wondering "It's a function, why doesn't it set Function flag too?"

This changes makes it more explicit and clear what `ScopeFlags` everything has.
2024-07-16 07:22:07 +00:00
..
scripts refactor(traverse): separate #[scope] attr (#3901) 2024-06-26 05:43:10 +00:00
src refactor(ast): pass final ScopeFlags into visit_function (#4283) 2024-07-16 07:22:07 +00:00
tests feat(traverse): pass &mut TraverseCtx to visitors (#3312) 2024-05-16 16:21:23 +00:00
build.rs fix(traverse): do not publish the build script 2024-06-08 16:31:21 +08:00
Cargo.toml Release crates v0.20.0 (#4189) 2024-07-11 11:05:49 +08:00
CHANGELOG.md Release crates v0.20.0 (#4189) 2024-07-11 11:05:49 +08:00