identifier is a reserved word

Jan 3, 2014 at 4:17 PM
Hi, is there a way to tell the compressor to ALLOW reserved words in the javascript?

I'm using angular.js and because of this line I cannot use compression:

msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);

...the problem is the "int" !

Please help!!! :-)
Jan 4, 2014 at 3:46 PM

This is not a problem with YUI per-se - it uses -an ECMA library which PureKrome maintains here: which parses the JavaScript and chucks out errors if any reserved words are being used where they shouldn't.
It is up to PureKrome to make changes to that library if he wishes to allow this sort of thing, so you should ask him nicely over on github I guess.

It sounds like you will have more issues than just this though:

That is a post from someone using the original yahoo YUI compressor which we closely mimic so any "problems" with the yahoo library are likely to manifest in ours also.

Another option/while you wait for PK to update the ECMAScript library is to put the offending bits in separate files and have them combined by YUI but not compressed - that way you still reduce network traffic with fewer files, and have most of it compressed.