-
Notifications
You must be signed in to change notification settings - Fork 27.4k
"int" is a reserved word and will cause a compiler error when using closure compiler #1304
Comments
Err, we compile with closure compiler and it works. Can you be more specific about the line number you are reffering to. Closing in the meantime. |
I'm trying to compile angular 1.0.2 with closure just using SIMPLE_OPTIMIZATIONS and I'm getting the same error. |
The solution is to use --language_in ECMASCRIPT5_STRICT as an option to the closure compiler. |
Hi guys. Thanks for doing an awesome job on AngularJS! I have struck this same error when trying to compile 'angular.js' (1.0.3) with Apache Rhino (1.7R2). It complains with the following errors: 'identifier is a reserved word' (it's talking about 'int' being used as a function name) on the following lines: #60: msie = int(( 'identifier is a reserved word' (it's talking about 'short') on the following line: #9155: short: 'M/d/yy h:mm a' Is there any way we could avoid using reserved words in angular.js? It seems like a minor change and would improve cross-JavaScript Interpreter compatibility? If I fix these errors manually Rhino is happy. Regards, Richard. |
Thanks for the tip! |
srcspider: no probs. Can you reopen this issue, then? |
@kennardconsulting I believe @mhevery would have to reopen it. As the one who started the issue my rights on open/close only go as far as closing an issue I have opened (not vise versa). |
FYI: This same problem also impacts angular-scenario.js |
@kennardconsulting There's been some es5 updates to rhino since 1.7R2 try updating to 1.7R4 that may fix your issue. |
Yes that worked! Brilliant, thanks. |
The same problem occurs when I try to minify Angular with newest (2.4.8) YUIComporessor. It would be really nice if Angular wouldn't use reserved keywords as @kennardconsulting mentioned. @mhevery any chances for reopening this issue? |
If someone wants to rename the reserved words that angular uses and send a PR of that, I'm pretty sure it would get merged. |
+1 to merge this PR. using a so common reserved word is potentially very annoying. |
@stefanofornari seems to have been done #10591 :) |
"int" is a reserved word
http://msdn.microsoft.com/en-us/library/ttyab5c8.aspx
I see it's merely used as syntactic sugar for
parseInt(value, 10)
. It would be nice if it was removed or refactored into some other name so the unminified version works when compiling with closure compiler.The text was updated successfully, but these errors were encountered: