Missed Javascript hack?

Sep 6, 2011 at 8:10 AM
Edited Sep 6, 2011 at 8:13 AM

Hello, Ron

Failed the build if we're using the following hack

if (/*@cc_on!@*/false) {
    // IE stuff

Just want to know whether this can be added as a valid statement?

Sep 6, 2011 at 4:56 PM

AjaxMin does not support expression-level conditional-compilation at this time. It only supports statement-level conditional-compilation (around entire statements), and one specific var-statement scenario. For instance, you can define a variable using a similar conditional-compilation trick, and then use that as your condition:

var ie/*@cc_on=1@*/;
if (ie) {
    // IE stuff

I'll see what I can do about special-casing your specific instance, but I can't guarantee a speedy fix for it. Expression-level conditional-compilation has been troublesome in the past. I think this one is probably doable, though.

Sep 7, 2011 at 1:19 AM

Okay, for version 4.29, we also special-case just a !-operator inside a conditional-compilation comment inside an expression. This will enable the code scenario you have above.

Sep 7, 2011 at 1:37 AM

I just released 4.29. Let me know if that works for you.

Sep 7, 2011 at 9:34 AM

Thanks for your quick response.

Yes, the !-operator is working now! Good job!

Looking forward to have fully supporting on expression level conditional-compilation if possible!