| Page 1 of 1 | [ 4 posts ] |
|
Hi all,
I have a problem when using YUI compressor for compressing JS files. I Have a switch statement including a .final() tag on it Code: switch (weekOfMonth.toString()) { case '1': // First week outputDate = begda.first(); break; case '2': // Second week outputDate = begda.second(); break; case '3': // Third week outputDate = begda.third(); break; case '4': // Fourth week outputDate = begda.fourth(); break; case '5': // Last week outputDate = [b]begda.final();[/b] break; } If I try to compress that code YUI is returning an error (even using the online version http://refresh-sf.com/yui/) If I remove only the last 'l' in the word "final" then it works fine so if I have: Code: switch (weekOfMonth.toString()) { case '1': // First week outputDate = begda.first(); break; case '2': // Second week outputDate = begda.second(); break; case '3': // Third week outputDate = begda.third(); break; case '4': // Fourth week outputDate = begda.fourth(); break; case '5': // Last week outputDate = [b]begda.fina();[/b] break; } It works!!! Do you have an idea on what's happening? Thanks for your time. Kr, Jose |
|
"final" is a reserved keyword, and should not be used as a function name:
https://developer.mozilla.org/en-US/doc ... rved_Words |
|
I see finally as reserved word but not final... I think is something else.
Thanks a lot for your time. Kr, Jose |
|
Others claim there are more reserved keywords:
http://javascript.about.com/library/blreserved.htm http://www.javascripter.net/faq/reserved.htm |
| Page 1 of 1 | [ 4 posts ] |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group