-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement console.assert
wrapping for console plugin.
#654
Conversation
Disclaimer: I've done minimal testing with this and haven't tested on older browsers. |
@getsentry/javascript |
@frewsxcv – are you actually using My concern with this patch is that it creates |
Yes. It's specified by the WHATWG Console Spec. It's also available in all modern browsers (including IE11). |
Would you prefer I check if it already exists at the global level before creating it? |
I understand that it's specified, but I'm curious if you're actually using this live, and if so, how. BTW, any idea why MDN is saying this at the top?
|
For example: var $someElement = $(".element-class");
console.assert($someElement.length); // make sure the selector is valid or $.get(url, function (data) {
var name = data.name;
console.assert(_.isString(name) && name.length);
...
}); |
It looks like that header was added in 2014 when the initial write of that wiki page happened, which presumably predates the WHATWG standard. |
Yes. I'd also prefer if you created a method, Thanks. |
Ah, yeah, I'm super lazy and really should have just looked at that :) But I'd encourage you to submit an edit to this page citing the addition to the spec. |
Latest commit has these changes. |
Okay, so, to be good internet citizens, Secondly, this PR also requires some kind of test. Take a look at test/plugins/console.test.js. Sorry for the asks – this is the pain of developing for Raven ^_^ |
Sorry, I don't think I can spend any more time looking into this. Feel free to close this if you don't either. |
Yep, totally understandable. I'll pick it up at some point. |
Fixes #653.
This change is