30 Jul 2008 02:42:58 UTC
- Distribution: JE
- Module version: 0.024
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (54 / 7 / 3)
- KwaliteeBus factor: 0
- License: unknown
- Activity24 month
- Download (212.66KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
JE::Code - ECMAScript parser and code executor for JE
use JE; $j = new JE; $code = $j->compile('1+1'); # returns a JE::Code object $code->execute;
- $code->execute($this, $scope, $code_type);
executemethod of a parse tree executes it. All the arguments are optional.
The first argument will be the 'this' value of the execution context. The global object will be used if it is omitted or undef.
The second argument is the scope chain. A scope chain containing just the global object will be used if it is omitted or undef.
evalfunction, which has nothing to do with JE's
evalmethod, which runs global code). Variables created with
varand function declarations inside eval code can be deleted, whereas such variables in global or function code cannot. A value of 2 means function code, which requires an explicit
returnstatement for a value to be returned.
If an error occurs,
undefwill be returned and
$@will contain the error message. If no error occurs,
$@will be a null string.
- JE::Code::add_line_number($message, $code_object, $position)
WARNING: The parameter list is still subject to change.
This routine append a string such as 'at file, line 76.' to the error message passed to it, unless it ends with a line break already.
$code_objectis a code object as returned by JE's or JE::Parser's
parsemethod. If it is omitted, the current value of
$JE::Code::codewill be used (this is set while JS code is running). If
$JE::Code::codeturns out to be undefined, then
$messagewill be returned unchanged (this is subject to change; later I might make it use Carp to add a Perl file and line number).
$positionis the position within the source code, which will be used to determine the line number. If this is omitted, $JE::Code::pos will be used.
add_line_numbercan optionally be exported.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1436:
=over without closing =back