leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

Check on window breaks IE8/IE9 compatibility #121

Closed tagliala closed 9 years ago

tagliala commented 9 years ago

https://github.com/leshill/handlebars_assets/commit/434358274df058abb1f0109f7d76f477a4d65331#diff-f14ca9959ff06f3ca2ee6b9564866954L26

This change breaks IE8/IE9.

image

Version 0.18 is fine

More details to come

AlexRiedler commented 9 years ago

@tagliala ouch, if you have a better replacement that would be awesome... the problem is handlbars doesn't use a proper wrapper that you can use in a non-window context that is needed for compilation. I could hard-wire in a fix to add that bit of code on the compile though.

tagliala commented 9 years ago

@akshayrawat apparently, a try-catch block works with IE9 but doesn't work with IE8.

I don't know how to help. Meanwhile I will stick to 0.18

AlexRiedler commented 9 years ago

@tagliala I have an idea :)

tagliala commented 9 years ago

I also tried typeof window !== "undefined" && window !== null; but I got the same error

AlexRiedler commented 9 years ago

@tagliala pushed gem version 0.20.0 try it out :)

tagliala commented 9 years ago

I confirm it works with both IE8 and IE9

Closed via e1102a795d6d47ef2ce8c26e098c4faa1d7e1291

Thanks! :+1: