Skip to content

Fix tracker: hasOwnProperty guard, hash idiom, deprecated substr#2

Merged
dannyshmueli merged 1 commit intomainfrom
fix/tracker-hygiene
Feb 21, 2026
Merged

Fix tracker: hasOwnProperty guard, hash idiom, deprecated substr#2
dannyshmueli merged 1 commit intomainfrom
fix/tracker-hygiene

Conversation

@dannyshmueli
Copy link
Member

Summary

  • Add hasOwnProperty checks to for..in loops in baseProps() to prevent picking up extended Object.prototype properties from third-party scripts on host pages
  • Replace non-standard hash & hash with idiomatic hash |= 0 for 32-bit integer coercion in experiment bucketing
  • Replace deprecated substr(2, 9) with slice(2, 11) in anon/session ID generation

Test plan

  • All 118 core tests pass (npm test)
  • Minified tracker rebuilt (npm run build)

🤖 Generated with Claude Code

- Add hasOwnProperty checks to for..in loops in baseProps() to prevent
  picking up extended Object.prototype properties from third-party scripts
- Replace non-standard `hash & hash` with idiomatic `hash |= 0` for
  32-bit integer coercion in experiment bucketing
- Replace deprecated substr(2, 9) with slice(2, 11) in ID generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dannyshmueli dannyshmueli merged commit 5e01882 into main Feb 21, 2026
2 checks passed
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