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

Bare reference to window.console in IE #1209

Closed
mightyiam opened this issue Oct 11, 2014 · 6 comments · Fixed by #1318 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132
Closed

Bare reference to window.console in IE #1209

mightyiam opened this issue Oct 11, 2014 · 6 comments · Fixed by #1318 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132

Comments

@mightyiam
Copy link

Perhaps I'm missing something.

This line has window.console.log reference, which, in IE8—and perhaps in other IEs—isn't available.

So, there's an exception. I'm not even sure that this causes issues but perhaps it does?

@maksimr
Copy link
Contributor

maksimr commented Oct 11, 2014

@mightyiam yup but this is debug page on this page we output test
info to console.

@mightyiam
Copy link
Author

@maksimr oh, right. In most cases, then, the console would have been open. But, using Microsoft Visual Web Developer 2010 Express, like I do, apparently, while debugging, the window.console does not exist.
screenshot from 2014-10-12 10 39 59

@freethejazz
Copy link
Contributor

@mightyiam @maksimr What do you think would be acceptable alternative behavior? Should the log message be swallowed if console isn't present? Should it be replaced with an alert instead?

@maksimr
Copy link
Contributor

maksimr commented Feb 18, 2015

@freethejazz
I think we should not print message in console.log on debug page if console does not exist

@mightyiam
Copy link
Author

@freethejazz, I agree with @maksimr. Use console only when it exists. I think it can be a simple if (window.console).

freethejazz added a commit to freethejazz/karma that referenced this issue Feb 18, 2015
Shielding a reference to `window.console.log`. Fixes the ability to use this page in IE without the inspector open. Fixes karma-runner#1209.
freethejazz added a commit to freethejazz/karma that referenced this issue Feb 18, 2015
Shield a reference to `window.console.log` with a simple if statement.
Fix the ability to use this page in IE without the inspector open. This
 was particularly an issue for developers running karma from within a
Microsoft-based IDE. The log message will just be swallowed on
environments that don't support `window.console`.

Closes karma-runner#1209
@mightyiam
Copy link
Author

Thank you, @freethejazz and @maksimr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants