Hi everybody,
i tried to minify a CSS class name, generated by an algorithm:
var classNormal = 'size-' + Math.round(Math.random()*10);
var classMinified = goog.getCssName(classNormal);
The Closure compiler throws an error, insists on a string literal:
ERROR - goog.getCssName called with invalid argument, string literal expected. Was "NAME".
I tried adding type declaration, but no effect.
Am I missing something? Isn't this a valid use case? Or does the compiler do the class replacement in compile time? What could be a workaround?