Méthode | Description | |
---|---|---|
DefineClass ( |
Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass. Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass. This method is defined as a JavaScript function. |
|
Deserialize ( |
||
Doctest ( |
Example: doctest("js> function f() {\n > return 3;\n > }\njs> f();\n3\n"); returns 2 (since 2 tests were executed). Example: doctest("js> function f() {\n > return 3;\n > }\njs> f();\n3\n"); returns 2 (since 2 tests were executed). |
|
Gc ( |
||
GetConsole ( |
||
GetErr ( ) : |
||
GetIn ( ) : Stream | ||
GetOut ( ) : |
||
GetPrompts ( |
||
Global ( ) : System | ||
Global ( |
||
Help ( |
Print a help message. Print a help message. This method is defined as a JavaScript function. |
|
Init ( |
||
Init ( ContextFactory factory ) : void | ||
InitQuitAction ( QuitAction quitAction ) : void |
Set the action to call from quit(). Set the action to call from quit(). |
|
InstallRequire ( |
||
IsInitialized ( ) : bool | ||
Load ( |
Load and execute a set of JavaScript source files. Load and execute a set of JavaScript source files. This method is defined as a JavaScript function. |
|
LoadClass ( |
Load and execute a script compiled to a class file. Load and execute a script compiled to a class file. This method is defined as a JavaScript function. When called as a JavaScript function, a single argument is expected. This argument should be the name of a class that implements the Script interface, as will any script compiled by jsc. |
|
Print ( |
Print the string values of its arguments. Print the string values of its arguments. This method is defined as a JavaScript function. Note that its arguments are of the "varargs" form, which allows it to handle an arbitrary number of arguments supplied to the JavaScript function. |
|
Quit ( |
Call embedding-specific quit action passing its argument as int32 exit code. Call embedding-specific quit action passing its argument as int32 exit code. This method is defined as a JavaScript function. |
|
ReadFile ( |
The readFile reads the given file content and convert it to a string using the specified character coding or default character coding if explicit coding argument is not given. The readFile reads the given file content and convert it to a string using the specified character coding or default character coding if explicit coding argument is not given. Usage: readFile(filePath) readFile(filePath, charCoding)The first form converts file's context to string using the default character coding. |
|
ReadUrl ( |
The readUrl opens connection to the given URL, read all its data and converts them to a string using the specified character coding or default character coding if explicit coding argument is not given. The readUrl opens connection to the given URL, read all its data and converts them to a string using the specified character coding or default character coding if explicit coding argument is not given. Usage: readUrl(url) readUrl(url, charCoding)The first form converts file's context to string using the default charCoding. |
|
RunCommand ( |
Execute the specified command with the given argument and options as a separate process and return the exit status of the process. Execute the specified command with the given argument and options as a separate process and return the exit status of the process. Usage: runCommand(command) runCommand(command, arg1, ..., argN) runCommand(command, arg1, ..., argN, options)All except the last arguments to runCommand are converted to strings and denote command name and its arguments. If the last argument is a JavaScript object, it is an option object. Otherwise it is converted to string denoting the last argument and options objects assumed to be empty. The following properties of the option object are processed:
|
|
RunDoctest ( |
||
Seal ( |
The seal function seals all supplied arguments. The seal function seals all supplied arguments. |
|
Serialize ( |
||
SetErr ( |
||
SetIn ( Stream @in ) : void | ||
SetOut ( |
||
SetSealedStdLib ( bool value ) : void | ||
Spawn ( |
The spawn function runs a given function or script in a different thread. The spawn function runs a given function or script in a different thread. js> function g() { a = 7; } js> a = 3; 3 js> spawn(g) Thread[Thread-1,5,main] js> a 3 |
|
Sync ( |
The sync function creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The sync function creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchronizes on the the second argument if it is defined, or otherwise the |
|
Toint32 ( |
Convert the argument to int32 number. Convert the argument to int32 number. |
|
Version ( |
Get and set the language version. Get and set the language version. This method is defined as a JavaScript function. |
Méthode | Description | |
---|---|---|
DoctestOutputMatches ( string expected, string actual ) : bool |
Compare actual result of doctest to expected, modulo some acceptable differences. Compare actual result of doctest to expected, modulo some acceptable differences. Currently just trims the strings before comparing, but should ignore differences in line numbers for error messages for example. |
|
GetCharCodingFromType ( string type ) : string | ||
GetClass ( object args ) : |
||
GetInstance ( System.Function function ) : |
||
LoadJLine ( |
||
Pipe ( bool fromProcess, Stream from, Stream to ) : void | ||
ReadReader ( TextReader reader ) : string | ||
ReadReader ( TextReader reader, int initialBufferSize ) : string | ||
ReadUrl ( string filePath, string charCoding, bool urlIsFile ) : string | ||
ReportRuntimeError ( string msgId ) : |
||
ReportRuntimeError ( string msgId, string msgArg ) : |
||
RunProcess ( string cmd, string environment, Stream @in, Stream @out, Stream err ) : int |
Runs the given process using Runtime.exec(). Runs the given process using Runtime.exec(). If any of in, out, err is null, the corresponding process stream will be closed immediately, otherwise it will be closed as soon as all data will be read from/written to process |
|
ToInputStream ( object value ) : Stream | ||
ToOutputStream ( object value ) : Stream |
public static DefineClass ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public static Deserialize ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Doctest ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Gc ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public GetConsole ( |
||
cs | ||
Résultat |
public GetPrompts ( |
||
cx | ||
Résultat | string[] |
public static Help ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public Init ( ContextFactory factory ) : void | ||
factory | ContextFactory | |
Résultat | void |
public InitQuitAction ( QuitAction quitAction ) : void | ||
quitAction | QuitAction | |
Résultat | void |
public InstallRequire ( |
||
cx | ||
modulePath | IList |
|
sandboxed | bool | |
Résultat |
public static Load ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public static LoadClass ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public static Print ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Quit ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public static ReadFile ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static ReadUrl ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static RunCommand ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public RunDoctest ( |
||
cx | ||
scope | Scriptable | |
session | string | |
sourceName | string | |
lineNumber | int | |
Résultat | int |
public static Seal ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public static Serialize ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | void |
public SetErr ( |
||
err | ||
Résultat | void |
public SetOut ( |
||
@out | ||
Résultat | void |
public SetSealedStdLib ( bool value ) : void | ||
value | bool | |
Résultat | void |
public static Spawn ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Sync ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Toint32 ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | object |
public static Version ( |
||
cx | ||
thisObj | Scriptable | |
args | object | |
funObj | System.Function | |
Résultat | double |