Talk:Rhino (JavaScript engine): Difference between revisions

Content deleted Content added
Xenobot Mk V (talk | contribs)
m Bot) Assessing for WP:JAVA (Plugin++) class=Stub, auto=yes.
No edit summary
Line 4:
 
yeah iam currently working in that. i dont see mozilla documents are not really helpful in guiding devolpers. i need to know how to specify the src script attribute here in Rhino. does anyone know? <small>—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Rammyramkumar|Rammyramkumar]] ([[User talk:Rammyramkumar|talk]] • [[Special:Contributions/Rammyramkumar|contribs]]) 09:35, 22 March 2008 (UTC)</small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
 
 
The second example is buggy: At EOF, S.readLine() will return null, so S.readLine().toUpperCase() throws an exception. better:
 
<source lang="javascript">
// The same as: import java.io.*;
importPackage(java.io);
importPackage(java.lang);
 
// "in" is a keyword in Javascript.
// In Rhino you could query for an attribute using [] syntax:
// Ex: System['out']
S = new BufferedReader( new InputStreamReader(System['in']) );
s = true;
 
while (s){
s = S.readLine();
if (s) System.out.println(s.toUpperCase());
}
</source>