Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrap enhancer in an anon IIFE #181

Closed
wants to merge 2 commits into from
Closed

fix: wrap enhancer in an anon IIFE #181

wants to merge 2 commits into from

Conversation

chicharr
Copy link
Collaborator

@chicharr chicharr commented May 30, 2024

When RUM is used in Standalone mode and the script is not loaded with type="module" the function sampleRUM is defined in the global scope.
Same happens with enhancer. Which declares a variable sampleRUM in the global scope.
As both scripts are declaring an object with same name in the global scope a JS error is triggered
This PR wraps enhancer in a function, to keep variables defined in its own scope

@chicharr chicharr requested review from kptdobe and trieloff May 30, 2024 16:17
Copy link
Contributor

@kptdobe kptdobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to document in the PR why you are doing this...

Copy link

This PR will trigger a patch release when merged.

@chicharr chicharr closed this Jun 4, 2024
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.

2 participants