Talk:Rhino (JavaScript engine): Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 22:
s = S.readLine();
if (s) System.out.println(s.toUpperCase());
}
</source>
-- Very verbose code. Shouldn't this be sufficient (and more readable):
<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']) );
 
while (S.readLine()){
System.out.println(s.toUpperCase());
}
</source>