JE, version 0.020

JE is a pure-Perl ECMAScript (JavaScript) engine. Here are some of its
advantages:

    - Easy to install (no C compiler necessary)
    - Compatible with Data::Dump::Streamer, so the runtime environment
      can be serialised
    - The parser can be extended/customised to support extra (or
      fewer) language features (not yet complete)
    - All JavaScript datatypes can be manipulated directly from Perl
      (they all have overloaded operators)

Here are its main weakness:
    - It's slow (well, what did you expect?).
    - It uses lots of memory.
    - It leaks memory (to be fixed).

This is still an alpha release. The core objects are not yet complete,
but as long as you don't need dates or methods of regular expressions,
this module is actually usable.

If  you have the time and the interest,  please experiment  with  this
module (or maybe even lend a hand :-). If you have any ideas as to how
the API could be improved or reworked, please e-mail me.


CHANGES IN THIS RELEASE

• Bug fixes (see the Changes file)
• The Date object has been added, though it is far from complete. Only
  the Date object itself  (which does not yet parse strings)  and  the
  prototype’s getTime, getYear, getMonth, getDate and
  to(GMT|UTC)String methods have been added.
• The escape and unescape functions have been added.
• String.prototype.substr has been added.
• JE::String now has a value16 method that returns the internal UTF-16
  version of the string.
• JE::String also has now a ‘class’ method, that returns ‘String.’
  This is intended primarily for internal use.
• If  JE::Object::Function->new  is called with  no_proto => 1,  the
  resulting function will now die when called as a constructor. This
  fixes  an  inconsistency  with  the  spec.  for  all  such  built-
  in functions.
• A string passed to JE::Object’s prop method’s autoload parameter is
  now evaluated in the package that called prop.


TO DO

- Make the parser extensible/customisable
- Finish the core object classes (Date and RegExp need to be finished)
- Add more helpful error messages
- Determine some logical way of dealing with locale settings (for
  String.prototype.localeCompare, et al.)
- Finish writing tests
- Make tainted JS code run safely
- Deal with circular references
- Finish making built-in JS properties load lazily
- Optimise JS functions by turning them into Perl subs (but run bench-
  marks first to see whether this would actually speed things up) (I'm
  having second thoughts about this one)
- Other optimisations


INSTALLATION

The easiest way to install this module is to use the CPAN module or
the cpan script:

    [sudo] perl -MCPAN -e "install JE"

    [sudo] cpan
    cpan> install JE

Or you can use the following:

    perl Makefile.PL
    make
    make test
    [sudo] make install


DEPENDENCIES

This module requires perl 5.8.0 or later and the following modules:
• Scalar::Util version 1.08 or later
• Exporter 5.57 or later
• The TimeDate distribution (more precisely, Time::Zone, Date::Format
  and Date::Parse)

For perl versions earlier than 5.9.4 it also requires
Tie::RefHash::Weak.

If you are using perl 5.8.5 or lower, you will need to upgrade Encode.

Later it will probably require Unicode::Collate.


DOCUMENTATION

After installing, you can find documentation for this module with the 
perldoc command.

    perldoc JE

Or try using man (it's faster, in my experience):

    man JE


ACKNOWLEDGEMENTS

Thanks to Max Maischein [ webmaster  corion net ] for letting me use
his tests,

to Andy Armstrong [ andy        hexten net ] and
   Yair Lenga     [ yair lenga  gmail com  ] for their suggestions,

and to the CPAN Testers for their helpful reports.


COPYRIGHT AND LICENCE

Copyright (C) 2007 Father Chrysostomos

This program is free software; you may redistribute it and/or modify
it under the same terms as perl.
