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: Be defensive when iteration over object properties #1521

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

kamilogorek
Copy link
Contributor

Fixes #1168

@codecov-io
Copy link

codecov-io commented Sep 11, 2018

Codecov Report

Merging #1521 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1521   +/-   ##
=======================================
  Coverage   73.69%   73.69%           
=======================================
  Files          45       45           
  Lines        1361     1361           
  Branches      257      257           
=======================================
  Hits         1003     1003           
  Misses        350      350           
  Partials        8        8

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea3b09d...f90128d. Read the comment docs.

@kamilogorek kamilogorek merged commit 36ec575 into master Sep 11, 2018
@kamilogorek kamilogorek deleted the defensive-iteration branch September 11, 2018 16:08
@atk
Copy link

atk commented Jan 23, 2019

This still breaks integration when an external module iterates over the properties of the console methods or other wrapped functions. I would suggest adding the additional properties as not enumerable, i.e.

Object.defineProperties(wrapped, {
  __sentry__: { value: true, enumerable: false },
  __sentry_original__: { value: original, enumerable: false },
  __sentry_wrapped__: { value: wrapped, enumerable: false }
});

instead of

wrapped.__sentry__ = true;
wrapped.__sentry_original__ = original;
wrapped.__sentry_wrapped__ = wrapped;

@kamilogorek
Copy link
Contributor Author

@atk you're absolutely right. Created an issue for that – #1849

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.

None yet

4 participants