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

IE 8 patch #4

Closed
wants to merge 1 commit into from
Closed

IE 8 patch #4

wants to merge 1 commit into from

Conversation

AdrianTP
Copy link

IE 8 window.console.info, log, error, warn do not inherit from Function, and thus lack .apply() or .call().

IE 8 window.console.info, log, error, warn do not inherit from Function, and thus lack .apply() or .call().
@jonnyreeves
Copy link
Owner

Fantastic! Would probably be better to just always use Function.prototype in order to simplify the code?

@AdrianTP
Copy link
Author

I would think so, but Function.prototype.call.apply(hdlr, messages) throws Uncaught TypeError: Illegal invocation in Chrome. I'm sure there's a more elegant way to do this, but it's what worked for me at the time. :)

@georgiee
Copy link

This is not fixed yet, isn't it ? I just got the same issue in IE9. I didn't want so spend time on this so I grabbed the appropriate function call from here: https://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9

//var hdlr = console.log;
var hdlr = Function.prototype.bind.call(console.log, console);

This should be fixed, as the first thing I expect from a logger in default mode is to handle IE properly- as IE can fail so famous with console.log 👍

Regards George

@georgiee georgiee mentioned this pull request Apr 28, 2014
@AdrianTP
Copy link
Author

@georgiee - Does your Function.prototype.bind.call() patch work in Chrome? I remember my Function.prototype.call.apply() failed. If it works in Chrome/Firefox/whatever and IE 8/9/+, then @jonnyreeves I recommend closing my pull request and accepting @georgiee's.

@georgiee
Copy link

@AdrianTP works bind.call works for IE9. I use it all the time in the current project. But that project doesn't require IE8 so I could not test it. As get an error with the current solution it's worth a try.

It seems that John is not very active recently, so this could take some time until it's merged.

@jonnyreeves
Copy link
Owner

Sorry for my lack of action on this project (I have good reason - I just
became a dad :D) - I did try to merge these patches a few months back, but
got sidetracked to adding a gulpjs build process which ended up being a bit
of a rabit hole.

Let me put some time aside to get these merged and a maintenance release
pushed. It would be good to have a fix which works in both IE8 and IE9 if
someone could confirm it (I don't have access to such an environment :( )

On 14 May 2014 15:28, George notifications@github.com wrote:

@AdrianTP https://github.com/AdrianTP works bind.call works for IE9. I
use it all the time in the current project. But that project doesn't
require IE8 so I could not test it. As get an error with the current
solution it's worth a try.

It seems that John is not very active recently, so this could take some
time until it's merged.


Reply to this email directly or view it on GitHubhttps://github.com//pull/4#issuecomment-43087269
.

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.

None yet

3 participants