Jump to content

Talk:Rhino (JavaScript engine)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Socramus (talk | contribs) at 14:41, 22 April 2010. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconJava Stub‑class
WikiProject iconThis article is within the scope of WikiProject Java, a collaborative effort to improve the coverage of Java on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Note icon
This article has been automatically rated by a bot or other tool as Stub-class because it uses a stub template. Please ensure the assessment is correct before removing the |auto= parameter.
WikiProject iconComputing: Software Stub‑class
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software.
Note icon
This article has been automatically rated by a bot or other tool as Stub-class because it uses a stub template. Please ensure the assessment is correct before removing the |auto= parameter.

I believe that Rhino 1.6 implements JavaScript 1.6, but the Rhino doc I saw was not 100% consistent... Any clarification welcome, would be useful to mention language version implemented.

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? —Preceding unsigned comment added by Rammyramkumar (talkcontribs) 09:35, 22 March 2008 (UTC)[reply]


The second example is buggy: At EOF, S.readLine() will return null, so S.readLine().toUpperCase() throws an exception. better:

// 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());
}

-- Shouldn't this be sufficient (and more readable):

// 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 = S.readLine()){
    System.out.println(s.toUpperCase());
}

Socramus (talk) 14:41, 22 April 2010 (UTC)[reply]