Skip to content

Align this.<prop> rewriting with wabac.js's cleaner implementation - #404

Merged
benoit74 merged 1 commit into
mainfrom
benoit74/backport-wabac-398-this-prop
Nov 13, 2026
Merged

benoit74 merged 1 commit into
mainfrom
benoit74/backport-wabac-398-this-prop

Conversation

@benoit74

Copy link
Copy Markdown
Collaborator

Summary

We proposed webrecorder/wabac.js#395 for the newline/dot detection bug in replaceThisProp (backported to replace_this_prop here in #381), but wabac.js landed webrecorder/wabac.js#398 instead: a cleaner fix for the same bug, with slightly different edge-case behavior. This aligns our implementation with it:

  • A leading this.<prop> at the very start of a script is now rewritten too (previously treated the start of the script like a blocking ./$ prefix).
  • A preceding $ now only blocks the rewrite when directly adjacent to this (no whitespace in between); a preceding . still blocks it regardless of the amount of whitespace in between.

We proposed webrecorder/wabac.js#395 for the newline/dot detection bug
in replace_this_prop, but wabac.js landed webrecorder/wabac.js#398
instead, a cleaner fix for the same bug with slightly different edge
case behavior: a leading `this.<prop>` at the very start of a script
is now rewritten too, and a preceding `$` only blocks the rewrite
when directly adjacent (a `.` still blocks it regardless of the
amount of whitespace in between).
@benoit74 benoit74 self-assigned this Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6a5e576) to head (f006ef1).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #404   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         2952      2954    +2     
  Branches       452       453    +1     
=========================================
+ Hits          2952      2954    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74
benoit74 merged commit c04cbc0 into main Nov 13, 2026
13 of 14 checks passed
@benoit74
benoit74 deleted the benoit74/backport-wabac-398-this-prop branch November 13, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant