Enable tracing for property sets in VM (__set__ calls)#5136
Open
Maanvi212006 wants to merge 2 commits intoboa-dev:mainfrom
Open
Enable tracing for property sets in VM (__set__ calls)#5136Maanvi212006 wants to merge 2 commits intoboa-dev:mainfrom
Maanvi212006 wants to merge 2 commits intoboa-dev:mainfrom
Conversation
jedel1043
reviewed
Mar 18, 2026
| let result = (self.vtable().__set__)(self, key.clone(), value.clone(), receiver.clone(), context); | ||
| #[cfg(feature = "trace")] | ||
| if let Ok(true) = result { | ||
| println!("[TRACE] SET -> key: {:?}, value: {:?}", key, value); |
Member
There was a problem hiding this comment.
It's honestly fine to use tracing here. We just need to adjust our features so that tracing is disabled if the trace feature is not set
Member
There was a problem hiding this comment.
Maybe this is useful? https://docs.rs/tracing/latest/tracing/level_filters/index.html#compile-time-filters
Author
There was a problem hiding this comment.
Hi @jedel1043 ,
Thank you for your feedback. I’ve carefully reviewed your suggestions and made the following changes:
- Trace logging updated: Replaced manual println! traces with tracing::trace! macros for proper compile-time and runtime filtering.
- Cloning key/value for safe ownership: Fixed move/borrow issues by cloning key and value only when necessary to avoid multiple moves.
- ordinary_set cleanup: Removed duplicate calls and unnecessary code paths, ensuring proper handling of data descriptors and accessor descriptors.
- Feature-gated tracing: All debug output now respects the "trace" feature flag and does not affect normal execution.
- Unused variables and imports addressed: Prefixed _context and removed unused imports to clean warnings.
Test262 conformance changes
Tested main commit: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This Pull Request introduces logging for property sets in the JS engine.
It changes the following:
[TRACE] SETlogging in__set__forJsObjectproperties.core/engine/src/object/internal_methods/mod.rs.Screenshot
The screenshot demonstrates the new [TRACE] SET logging added in the JS engine.
-A JavaScript object x is created: let x = {};.
-A property b is assigned the value 20: x.b = 20;.
-The [TRACE] SET log prints the property key ("b") and the value being assigned (20) twice, showing the internal call flow.
The final 20 shows that the assignment completes successfully and the value is returned as expected.
This clearly illustrates that the new logging correctly captures property set operations in the VM without affecting normal execution.