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

Sanitized the global scope by deleting the timers properties #990

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

codenirvana
Copy link
Member

Extends #605

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.65%. Comparing base (53b4ac3) to head (6677305).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #990   +/-   ##
========================================
  Coverage    59.65%   59.65%           
========================================
  Files           12       12           
  Lines          575      575           
  Branches       140      140           
========================================
  Hits           343      343           
  Misses         232      232           
Flag Coverage Δ
unit 59.65% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -82,13 +82,17 @@ const /**
isGlobalClearAvailable = (new Function(`return typeof clear${name} === 'function'`))();

if (isGlobalSetterAvailable) {
// eslint-disable-next-line no-new-func
timers[('set' + name)] = (new Function(`return function (fn, ms) { return set${name}(fn, ms); }`))();
Copy link
Member

Choose a reason for hiding this comment

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

Why were we wrapping it in a function before if it was available globally?

@codenirvana codenirvana merged commit 6919e1f into develop Apr 1, 2024
9 checks passed
@codenirvana codenirvana deleted the feature/sanitize-timers branch April 1, 2024 07:52
codenirvana added a commit that referenced this pull request Apr 5, 2024
Sanitized the global scope by deleting the timers properties
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.

3 participants