Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Does the Rhino javascript engine consider byte a keyword?

Posted on 2009-03-31
5
Medium Priority
?
392 Views
Last Modified: 2012-05-06
I'm using the yui compressor and it fails to compile the following chunk of javascript.  Any ideas?

[ERROR] 43:11:missing name after . operator

Here is line 43
this.byte = this.bit = 0;

Thanks!
0
Comment
Question by:nategilman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 41

Expert Comment

by:HonorGod
ID: 24029660
What does it display for:

alert( typeof( byte ) )
0
 
LVL 18

Assisted Solution

by:Morcalavin
Morcalavin earned 668 total points
ID: 24030725
byte is a reserved word in javascript.

http://javascript.about.com/library/blreserved.htm
0
 
LVL 41

Assisted Solution

by:HonorGod
HonorGod earned 332 total points
ID: 24030791
http://javascript.about.com/od/reference/g/rbyte.htm

... The plan to allow specific data types in Javascript no longer exists and byte is therefore no longer on the reserved word list in the latest standards. ...
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 668 total points
ID: 24030802
What version of rhino are you using?  byte is still in the reserved word list for backwards compatibility reason.  I don't think the ECMAscript specifications use it anymore.  These seems to work fine for me:
window.bit = 'bar';
window.byte = window.bit = 0;
alert(window.byte);

It may be that yui still doesn't allow byte for some reason.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24059177
Thanks for the assist, and the points.

Good luck & have a great day
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question