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

browser: Fixed that no logs output on IE8/9 #166

Merged
merged 2 commits into from
Dec 29, 2014
Merged

Conversation

mooyoul
Copy link
Contributor

@mooyoul mooyoul commented Dec 29, 2014

@TooTallNate
Copy link
Contributor

Maybe we just check for console.log truthiness instead? (i.e. ditch the typeof for console.log)

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

I think that's not necessary because if console.log really plain Object,
An error will be thrown during execute below line:

Function.prototype.apply.call(console.log, console, arguments);

Like this:
2014-12-30 3 15 56

@TooTallNate
Copy link
Contributor

Sure, but typeof conslole.log == 'object' will still be true with your patch as well.

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

Hmm, What you think about replacing typeof for console.log to truthiness check?

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

... and Removing return keyword from https://github.com/visionmedia/debug/blob/master/browser.js#L106 ?

I think it is not necessary because that statement (below code / https://github.com/visionmedia/debug/blob/master/browser.js#L108) always returns undefined.

Function.prototype.apply.call(console.log, console, arguments);

So, I think that return keyword to be deleted...

@TooTallNate
Copy link
Contributor

Hmm, What you think about replacing typeof for console.log to truthiness check?

Yes, that's what I mentioned up above 😄

@TooTallNate
Copy link
Contributor

Let's not worry about the return part for now. Though you're technically correct, let's stay focused on the IE fix here.

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

Agree 👍 I'll commit that changes :)

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

Okay, I just committed that change, and tested on major web browsers. (IE8, IE9, IE10, IE11, Chrome Latest, Chrome Canary Latest, Firefox Latest, Safari Latest, Android 2.3.3, iOS 7, iOS 8, IE Mobile 11, etc...)
It works like a charm. and code looks more DRY 😄

TooTallNate added a commit that referenced this pull request Dec 29, 2014
browser: Fixed that no logs output on IE8/9
@TooTallNate TooTallNate merged commit 3a285be into debug-js:master Dec 29, 2014
@TooTallNate
Copy link
Contributor

Thanks!

@mooyoul
Copy link
Contributor Author

mooyoul commented Dec 29, 2014

You're welcome. Thank you!

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

Successfully merging this pull request may close these issues.

No logs output in IE9
2 participants