8000 Fix read only property assign by andreyluiz · Pull Request #2110 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

Fix read only property assign #2110

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

Merged
merged 2 commits into from
Jun 7, 2019
Merged

Fix read only property assign #2110

merged 2 commits into from
Jun 7, 2019

Conversation

andreyluiz
Copy link
Contributor
@andreyluiz andreyluiz commented Jun 6, 2019

This code has been causing errors on WebOS 2.0 (LG TVs). For some weird reason, the Object.defineProperty stopped raising an exception and was causing the application to crash. Check the log:

https://pastebin.com/aJcU5Bf6

This is the snippet that generated the log above:

// Restore original function name (not all browsers allow that)
try {
    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor
    console.log('Is Name configurable: ' + descriptor.configurable);
    Object.defineProperty(sentryWrapped, 'name', {
        get(): string {
            return fn.name;
        },
    });
} catch (_oO) {
    console.log('ERROR --------')
    /*no-empty*/
}

Notice that after some point, the catch does not execute anymore and the error pops out. But the property is still read-only.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@andreyluiz andreyluiz requested a review from kamilogorek as a code owner June 6, 2019 16:42
Copy link
Member
@BYK BYK left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kamilogorek kamilogorek merged commit 0d1c971 into getsentry:master Jun 7, 2019
@kamilogorek
Copy link
Contributor

Thanks!

@andreyluiz
Copy link
Contributor Author

Thank you, guys. Do you know when the next release will be released?

@kamilogorek
Copy link
Contributor

@andreyluiz we'll definitely do it this week, probably Wednesday/Thursday.

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
0