-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Using Conditional Compilation With Closure Compiler
Michael Zhou edited this page Feb 12, 2016
·
3 revisions
Closure Compiler does not natively support Internet Explorer's conditional compilation, however it is still possible to use them in a limited way.
IE's conditional compilation can not be used directly, but they can be used in eval conditions. As an example, one common use is to detect Internet Explorer:
var is_ie = /*@cc_on!@*/false;
This can be rewritten to be compatible with Closure Compiler in this way:
var is_ie = eval("/*@cc_on!@*/false");
The rules for using this solution are the same for the use of eval in general.