[ 4 posts ]

Pablo Vidal

  • Username: pablovidal85
  • Joined: Wed Sep 14, 2011 1:22 am
  • Posts: 2
  • GitHub: pabloPXL
  • Gists: pabloPXL
  • IRC: pwk0
  • Offline
  • Profile

Is this a bug?

Post Posted: Wed Sep 14, 2011 1:32 am
+0-
Hi, I think I found a very strange behavior, I didn't look at the code of YUI Compressor, but something tells me that has something to do with Java.

java -jar /usr/local/sbin/yuic --charset utf-8 --type js <(echo "var long = 'test';") <-- error
java -jar /usr/local/sbin/yuic --charset utf-8 --type js <(echo "var lang = 'test';") <-- ok

It only happens when using the word 'long' as a variable, as an object property or as an unquoted json field.

Can somebody confirm that 'long' is not a reserved word in javascript? I tested in several engines and looks like they don't have a problem with it.

Regards

Pablo Vidal

  • Username: pablovidal85
  • Joined: Wed Sep 14, 2011 1:22 am
  • Posts: 2
  • GitHub: pabloPXL
  • Gists: pabloPXL
  • IRC: pwk0
  • Offline
  • Profile

Re: Is this a bug?

Post Posted: Wed Sep 14, 2011 7:41 am
+0-
Sorry, but just after that I found that 'long' is a very old javascript reserved word, so YUI Compressor is doing its job right. It's a pity to have reserved words like this that will be never used again, but it's also great that this library is backwards compatible with the oldest javascript code too.

Congrats for the nice tool :)

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Is this a bug?

Post Posted: Wed Sep 14, 2011 8:31 am
+0-
long is a reserved word. JavaScript has many more reserved words that those actually in use.

Sachin

  • Username: sachink6
  • Joined: Sat Mar 10, 2012 10:53 pm
  • Posts: 1
  • IRC: Sachin
  • Offline
  • Profile

Re: Is this a bug?

Post Posted: Sat Mar 10, 2012 10:58 pm
+0-
I have an issue with YUI Java script file compression. We have an Ant task to build the project from SVN repository. Whenever a JS file is modified in SVN and build is run, that file is not compressed properly. Compressed file is appended with the original non compressed file...Any idea??



Thanks in advance!!!
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum