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

Avoid recursion when using the console plugin #370

Merged
merged 1 commit into from
Aug 19, 2015
Merged

Avoid recursion when using the console plugin #370

merged 1 commit into from
Aug 19, 2015

Conversation

mattrobenolt
Copy link
Contributor

Store a global reference to window.console before the console plugin gets a chance to monkey patch, avoiding it recursing on itself.

Fixes #320 #364 #369

@benvinegar
Copy link
Contributor

Seems like it'd be easier to just store var originalConsole = console at the top of raven.js.

@benvinegar
Copy link
Contributor

👍

benvinegar added a commit that referenced this pull request Aug 19, 2015
Avoid recursion when using the console plugin
@benvinegar benvinegar merged commit cf4e81a into master Aug 19, 2015
@benvinegar benvinegar deleted the console branch August 19, 2015 21:39
@benoitg
Copy link
Contributor

benoitg commented Aug 19, 2015

Humm, actually, I either spoke too soon or am too tired. Here my original test case still doesn't pass on chrome:

<script src="./dist/raven.js"></script>
<script src="./plugins/console.js"></script>

<script>
Raven.debug = true;
console.error("Something");
Raven.captureException('test');
</script>

Does it work for you guys?

@benvinegar
Copy link
Contributor

Yeah, you're right. The problem is that console itself doesn't get replaced – it's the methods on console. So we didn't fix anything.

We'll likely need to preserve all of the console methods.

@mattrobenolt
Copy link
Contributor Author

Ugh. :(

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