written in Java.
FESI implements few language extensions and try to follow
the standard as much as possible. This is unlike most implementation of
However to be useful at all EcmaScript must be extended, at least to
link it to some host application. Because many applications have some
FESI extensions can be build as libraries and loaded on demand, using
Java dynamic loading capability. A host program will usually list the
extensions as part of its initialization (see the
FESI Java library
). The extensions only add host objects and functions as prescribe the
EcmaScript standard, they do not change existing functions or extend
The builtin extensions are capabilities always present on the
interpreter. They include the following capabilities:
- The interactive interpreter add the global array variables args
, which contains the arguments of the command line after the option -A
, if any. This is not present in the called interpreter (unless the
progammer implements it).
- The possibility to call FESI
from the Bean Scripting Framework.
- the tryEval routine, described below.
- The capability of calling methods of Java objects (if such
object is returned by some other extension or if the
JavaAccess extension is loaded). This is explained as part of the
- The capability to use Java beans as EcmaScript objects (mapping
bean properties and EcmaScript properties).
- The capability to add event handlers
to Java objects (if such an object is returned by some other extension
if the JavaAccess extension is loaded).
- tryEval evaluates the parameter as
eval, but returns an object with two properties: value
and error. If the evaluation is successful, the value
contains the result of the evaluation and the error property
is null (which tests as false). If the evaluation
in an error, the the value property is either the value of the default
parameter (if specified) or undefined, and the error
contains an object describing the error, which is guaranteed to test as
true. The error object string representation is some description
the error. In the future more detailed error information may be
- throwError throws and exception.
parameter is converted to a string, and added as an exception parameter
it is a Throwable.
The following extensions are all loaded by default by the
interactive interpreter. However they may or may not be loaded by a
user program using the interpreter as an embedded language, depending
on the caller.
Provide basic documentand windowbased IO to enable
some scripts with interpreter hosted in browsers.
Allows to created Java objects and provide access to any public
Java class and function from an EcmaScript program.
Provides text file IO and directory manipulation functions to
Provides simple database access functions (via JDBC) to EcmaScript
Provides regular expression base search and replace, based on the Java
regular expression pacakage or, if not available, on the Apache ORO or
Return to the main page
Jean-Marc Lugrin 1998-2003 - Under LGPL license
||Last update: 26 August 2003