tests(patches): pin main-world evaluation of statements (#631)#692
Open
neuregex wants to merge 1 commit into
Open
tests(patches): pin main-world evaluation of statements (#631)#692neuregex wants to merge 1 commit into
neuregex wants to merge 1 commit into
Conversation
Camoufox evaluates page scripts through its own main-world path, which has to wrap a bare statement (if/let/block) so it still yields a value. daijro#631 reported that any script containing an if statement failed with "Execution context was destroyed" on 0.4.11; that symptom is gone on current builds. Adds a regression test covering expressions and statements across both main_world_eval modes, so a Juggler rebase cannot silently reintroduce it. Verified green against v152.0.4-beta.25 (pythonlib 0.5.4).
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.
Related Issue
Closes #631
Description
Camoufox evaluates page scripts through its own main-world path (the
main_world_evallaunch flag and the Juggler evaluation handler) rather than Playwright's default isolated world. That path has to wrap whatever string it is handed so a bare statement —if (...) { ... },let x = 1;, a block — still produces a value instead of erroring out.#631 reported that any script containing an
ifstatement failed withExecution context was destroyedon camoufox 0.4.11, while the equivalent ternary worked. That symptom is gone on current builds (report below), so this PR adds a regression test rather than a fix — the issue looks resolved somewhere between 0.4.11 and 0.5.4, and this pins it so a future Juggler rebase can't silently reintroduce it. The failure mode is a hard error on the caller's side that nothing in the build catches, which is exactly the class of regressiontests/patches/exists for.Follows the existing convention in that directory (standalone script,
main()returning 0/1,CAMOUFOX_EXECUTABLE_PATHsupport, positive cases in both modes) — same shape ashumanize-mouse-trajectory.py.If you'd rather keep #631 open until the original reporter confirms, feel free to drop the
Closes— the test stands on its own either way.Type of Change
pythonlib/behaviour touched)Testing
Verified against v152.0.4-beta.25 (pythonlib 0.5.4, Python 3.12, Windows):
Fingerprint Report
This PR adds a single test file and changes no patches, no browser source and no
pythonlib/behaviour, so there is no fingerprint surface for it to affect. Happy to run both suites anyway if you'd like them attached.