fabiocaseri / dashing-js

Port of Dashing to node.js
MIT License
319 stars 151 forks source link

IE 10 Compatibility #17

Open liquiddc opened 10 years ago

liquiddc commented 10 years ago

These changes make dashing-js work with IE10

arabold commented 10 years ago

Thanks for this patch. I'll check it out, too. 2 comments though:

liquiddc commented 10 years ago

Thanks. Re the first point, I agree this needs tightening up, but * was the suggested fix that I found works in my environment. If there is a tighter way to specify this header, I will try it out.

Re the second point - creating a console object for IE in no-console mode is the way to go. I have no IE10 environment to test this in now, but adding the following line to application.coffee works in IE11:

console = console or {"log": () -> {}}

arabold commented 10 years ago

Just wanted to update you that this works perfectly on IE9, too.

pjeby commented 10 years ago

FYI, this line:

console = console or {"log": () -> {}}

Doesn't do what you think it does. It always disables logging, because it makes console into a local variable, which shadows the window.console. So the variable is always empty to start with, and then it's set to the dummy value.

You probably want:

window.console ?= log: ->

instead.