Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/jit/tests/common.rs`:
- Around line 276-279: The wildcard match arm in crates/jit/tests/common.rs
currently treats all remaining MakeFunctionFlag variants as no-ops and simply
pushes StackValue::Function(func), which ignores Closure, Defaults,
KwOnlyDefaults, and TypeParams and diverges from the VM behavior; update the
match in the function that assembles functions to either implement handling for
MakeFunctionFlag::Closure, ::Defaults, ::KwOnlyDefaults, and ::TypeParams to
mutate the function state the same way as crates/vm/src/builtins/function.rs
does, or replace the wildcard arm with an explicit panic/unreachable for
unhandled MakeFunctionFlag variants so tests fail-fast (refer to the
MakeFunctionFlag enum, the code that constructs a
Function/StackValue::Function(func), and the function-building logic in this
module to mirror the VM behavior).
---
Nitpick comments:
In `@crates/codegen/src/compile.rs`:
- Around line 4344-4400: The repeated branches setting SetFunctionAttribute for
each MakeFunctionFlag should be replaced with a single ordered iteration: create
an ordered array of the flags (e.g., bytecode::MakeFunctionFlag::Closure,
::Annotations, ::Annotate, ::KwOnlyDefaults, ::Defaults, ::TypeParams), then
loop over that array and for each flag call if flags.contains(&flag) {
emit!(self, Instruction::SetFunctionAttribute { flag }) }; this preserves the
explicit order, removes duplicated emit logic, and keeps the behavior of
SetFunctionAttribute in one place.