mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
<HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Author" CONTENT="Vladimir Livshits"> <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en]C-NSCP (WinNT; U) [Netscape]"> <TITLE>Specification for the JavaScript shell</TITLE> </HEAD> <BODY> <CENTER> <H3> Object hierarchy for JS Shell:</H3></CENTER> <CENTER><TABLE BORDER=3 COLS=3 WIDTH="650" > <TR ALIGN=CENTER VALIGN=TOP> <TD ALIGN=CENTER VALIGN=TOP HEIGHT="100%"> <TABLE BORDER=0 WIDTH="100%" > <TR> <TD BGCOLOR="#C0C0C0"><B> System </B></TD> </TR> <TR> <TD> <CENTER><B><FONT COLOR="#FF0000">Methods</FONT></B></CENTER> <UL> <LI> <B><TT>chdir</TT></B></LI> <LI> <B><TT>pipe</TT></B></LI> <LI> <B><TT>script</TT></B></LI> <LI> <B><TT>exit</TT></B></LI> <LI> <B><TT>system</TT></B></LI> <LI> <B><TT>gc</TT></B></LI> <LI> <TT><B>call </B>(executes an external script)</TT></LI> <LI> <TT><B>use</B> (make methods of the script you pass available. I.e. if you say <B>use('Foo','Bar')</B>, you can now call Foo.f() and Bar.f(). Foo.eval() will evaluate all the code)</TT></LI> </UL> <CENTER><B><FONT COLOR="#FF0000">Properties</FONT></B></CENTER> <UL> <LI> <B><TT><FONT COLOR="#330033">stdout</FONT></TT></B></LI> <LI> <B><TT><FONT COLOR="#330033">stdin</FONT></TT></B></LI> <LI> <B><TT><FONT COLOR="#330033">stderr </FONT></TT></B></LI> <LI> <TT><FONT COLOR="#330033"><B>platform </B>('PC', 'UNIX', 'MAC')</FONT></TT></LI> <LI> <TT><FONT COLOR="#330033"><B>ARGV </B>(arguments passed to the script)</FONT></TT></LI> </UL> <B><FONT COLOR="#330033">Notes: <TT>pipe</TT> </FONT></B><FONT COLOR="#330033">works like backticks in Perl; <B><TT>script</TT></B> works the other way around, that is, you give it an array and it feeds the array to the executable you specify (somewhat similar to the script command on <TT>UNIX</TT>).</FONT></TD> </TR> </TABLE> </TD> <TD> <TABLE BORDER=0 COLS=1 WIDTH="100%" > <TR> <TD BGCOLOR="#C0C0C0"><B>Environment</B></TD> </TR> <TR> <TD HEIGHT="100%"> <CENTER><B><FONT COLOR="#FF0000">Properties</FONT></B></CENTER> <P><FONT COLOR="#330033">All environment variables become properties of <B><TT>Environment</TT></B>. Assigning to them actually changes the environment.</FONT></TD> </TR> </TABLE> </TD> <TD> <TABLE BORDER=0 COLS=1 WIDTH="100%" > <TR> <TD BGCOLOR="#C0C0C0"><B>File</B></TD> </TR> <TR> <TD> <TABLE BORDER=0 COLS=2 WIDTH="100%" > <TR> <TD> <CENTER><B><FONT COLOR="#FF0000">Properties</FONT></B></CENTER> <CENTER> </CENTER> <LI> <B><TT>currentDir</TT></B></LI> <LI> <B><TT>length </TT></B></LI> <LI> <B><TT>parent </TT></B></LI> <LI> <B><TT>path </TT></B></LI> <LI> <B><TT>name </TT></B></LI> <LI> <B><TT>isDirectory</TT></B></LI> <LI> <B><TT>isFile </TT></B></LI> <LI> <B><TT>exists </TT></B></LI> <LI> <B><TT>canRead </TT></B></LI> <LI> <B><TT>canWrite </TT></B></LI> <LI> <B><TT>opened </TT></B></LI> <LI> <B><TT>type </TT></B></LI> <LI> <B><TT>mode </TT></B></LI> <LI> <B><TT>creationTime</TT></B></LI> <LI> <B><TT>lastModified</TT></B></LI> <LI> <B><TT>size </TT></B></LI> <LI> <B><TT>randomAccess</TT></B></LI> <LI> <B><TT>position</TT></B></LI> </TD> <TD VALIGN=TOP> <CENTER><B><FONT COLOR="#FF0000">Methods</FONT></B></CENTER> <CENTER> </CENTER> <LI> <B><TT>open </TT></B></LI> <LI> <B><TT>close </TT></B></LI> <LI> <B><TT>remove </TT></B></LI> <LI> <B><TT>copyTo </TT></B></LI> <LI> <B><TT>renameTo</TT></B></LI> <LI> <B><TT>flush </TT></B></LI> <LI> <B><TT>skip </TT></B></LI> <LI> <B><TT>read </TT></B></LI> <LI> <B><TT>readln </TT></B></LI> <LI> <B><TT>readAll </TT></B></LI> <LI> <B><TT>write </TT></B></LI> <LI> <B><TT>writeln </TT></B></LI> <LI> <B><TT>writeAll</TT></B></LI> <LI> <B><TT>list </TT></B></LI> <LI> <B><TT>mkdir </TT></B></LI> </TD> </TR> </TABLE> <I>(Henri's stuff)</I> <BR> </TD> </TR> </TABLE> </TD> </TR> </TABLE></CENTER> <BR> </BODY> </HTML>