You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous isValuelessArg trait in web-idl.h only handled TypeHandler and Arguments, missing InjectConfiguration types like CompatibilityFlags::Reader. Instead of maintaining a manual list, thread TypeWrapper through requiredArgumentCount and use the ValueLessParameter
concept to automatically detect all injected parameter types.
Only the two places we already identified. This is clean.
Let me now think through the overall review:
Correctness: The refactor correctly replaces a manually maintained list (isValuelessArg for TypeHandler<T> and Arguments<T>) with a concept-based approach (ValueLessParameter) that automatically detects all injected types. The Arguments<T> special case is correctly preserved via isArguments<>().
Template instantiation ordering: The comment in the PR correctly explains that RequiredArgCount_ specializations in type-wrapper.h will be visible when resource.h templates are instantiated, because type-wrapper.h includes resource.h (so resource.h is parsed first with only the forward declaration), and by the time the resource.h templates are actually instantiated (deferred until after the whole TU is parsed), the specializations will be visible. This is standard C++ two-phase lookup behavior.
Tests: The tests are well-written, covering TypeHandler<T>, Arguments<T>, the new InjectConfiguration case (via FakeConfig), and the ValueLessParameter concept directly. The MockTypeWrapper approach is clean and self-contained.
Backward compatibility: No behavioral changes to external APIs — this is purely internal template metaprogramming. The .length property on functions will now correctly account for InjectConfiguration parameters, which was previously a bug (they would have been incorrectly counted as required JS arguments).
No compat flag needed: This is a bugfix to an internal mechanism. The incorrect .length was an implementation defect, not an intentional behavior.
No security concerns: No sandbox or capability changes.
No wire format changes: No .capnp schema changes.
The PR is clean. The design is sound, the test coverage is thorough, and the migration is complete.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous isValuelessArg trait in web-idl.h only handled TypeHandler and Arguments, missing InjectConfiguration types like CompatibilityFlags::Reader. Instead of maintaining a manual list, thread TypeWrapper through requiredArgumentCount and use the ValueLessParameter
concept to automatically detect all injected parameter types.