Revision history for JE
0.010 9 May, 2007
Added two features:
- &{} overloading for JE::Object::Function
- numeric overloading for JE::Object
- 'exists' method for JE::Object and JE::Object::Array
One bug fix:
- JE::Object::Array's is_enum now correctly returns false for
the length property
0.009 8 May, 2007
Yet another alpha release. Here are the usual lists:
New features/API changes:
- Added numeric overloading to JE::Null.
- Added compile as an alias for parse.
- Added the 'exists' and 'class' methods to JE::Number
Fixes:
- JE::LValue's overloading was very buggy with anything other
than simple conversion. I've fixed it and written a
test script.
- Corrected the bitshift operators such that numbers > 31 for
the right operand now have % 32 applied, and are no longer
simply treated as 31.
- Corrected JE::Null->to_boolean so it returns a JE::Boolean,
not a JE::String.
- Stopped surrogate escape sequences in string literals from
producing warnings.
- Corrected JE::Number's stringification overloading to match
the stringification in JavaScript (for NaN and Infinity)
- A JE::Number that has a value of NaN now boolifies in Perl
as false, as in JavaScript.
- Fixed the constructors for the various subclasses of Error,
so that they no longer throw TypeErrors when called ('new
TypeError' would actually cause the whole script to die)
- Corrected 'instanceof' so it throws an error if its right
operand is an object but not a function
- Corrected the 'prototype' properties of the various sub-
classes of Error such that they now actually inherit from
Error.prototype instead of directly from Object.prototype.
- Fixed the << operator so it now works correctly on
64-bit machines
0.008 22 April, 2007
New features and API changes in this release:
- Added JE::LValue's can method
- new_function has been moved from JE to JE::Object, to make
it more versatile
- new_method has been written as a method of JE::Object
- Changed the interface of JE::Code's 'execute' method, so that
the third arg has three possible values for indicating the
type of code, and is no longer a boolean
- Changed the delete method of JS values to support a second
arg (see JE::Types)
- Renamed the 'props' method to 'keys'
- Renamed JE::compile to JE::parse
- Added the 'exists' and 'class' methods to JE::Boolean
- Added numification overloading to JE::Boolean
Bug fixes:
- Fixed the ~ operator so it works on 64-bit platforms
- Changed most calls to 'UNIVERSAL::isa($thing, UNIVERSAL)' to
'defined Scalar::Util::blessed $thing', since the former also
works with strings containing package names (and does not
necessarily tell whether something is blessed). This bug was
causing strange errors.
- Fixed a bug that was making errors thrown by JS functions
called from within JavaScript cause lots of warnings and a
nonsensical ReferenceError.
- String.prototype.substring now works instead of
always dying.
- function and var declarations now work in else blocks and
labelled statements
- continue <label> now works within a labelled switch or iter-
ation statement
- JS functions now return undefined when there is no explicit
'return' statement. Before, the return value of the last
statement that returned one was being used, as with JS's
'eval' function (oops!). This required changing the interface
of JE::Code slightly.
- function declarations now clobber attributes of
existing vars
- Code run by JS's eval now inherits the scope chain from the
caller (before, it was getting its own, just like the body
of a JS function)
- var declarations no longer make existing vars undeletable
- JE::Scope::new_var now looks for the first object in the
scope chain that is a call object (it used to use the first
object, whatever it was)
- Calling an lvalue that has a call (activation) object as its
base object now works instead of just dying.
- arguments.length is now a number, not a string
- arguments objects are no longer given extra properties cor-
responding to the function's parameters if there aren't that
many args.
- Functions written in Perl that return an empty list now
return 'undefined' to JS, instead of producing lots of warn-
ings and dying. In fact, they are called in scalar context
now, rather than list context.
- Fixed array literals so that elided elements do not exist.
(Before, they would exist, but still be undefined.)
- Hopefully fixed the bug that was causing isNaN to fail
on OpenBSD.
- Corrected the comma, assignment, conditional (? :), || and
&& operators so they no longer return lvalues.
- Function.prototype.apply now puts its error in $@ when it
dies. It used to leave $@ empty. It no longer dies when
called with just one argument.
- Fixed Array.prototype.toString and Array.prototype.
toLocaleString such that they produce a sensible error mes-
sage when invoked upon an object other than an array, rather
than the nonsensical 'Can't locate object method "prop" via
package "Object is not an Array"'
- String.prototype.split now actually works.
- JE::Code::parse now stringifies its input, avoiding the
potential problem of pos() being unreliable on a stringified
object, and solving the problem with $obj =~ /(...)/ man-
gling $1 in perl 5.8.5.
0.007 April Fool's Day, 2007
Alpha release. New features/fixes:
- Added the RegExp constructor and RegExp.prototype.exec
- Added the rest of the string methods
- Added the Boolean, Number and ReferenceError classes
- Added the Math object
- Fixed 'return' without an argument, so it returns undefined,
rather than a null Perl string (which was causing weird
errors elsewhere).
- 'break' called from within a labelled statement was produc-
ing warnings (fixed)
- 'throw' without an argument now throws undefined, rather
than 'Died at /usr/local/lib/perl5/5.8.8/JE/Code.pm
line 387'
- 'continue' now works with a do-while loop
- instanceof now works instead of just dying
- Assigning to a writeable property used to overwrite the
dontenum attribute and make the property enumerable (fixed)
- Fixed lvalues such that 'null.var = val' no longer creates a
global property. 'null.var' in void context now throws a
TypeError.
- Fixed the null and undefined classes, so they don't try to
rebless the same scalar as each other.
- Fixed the boolean class's to_string method, so it no longer
gives 'true' for false and 'false' for true (!).
0.006 29 March, 2007
Alpha release.
- Added TypeError and RangeError classes
- Finished the Function and Array classes (except for
Function.prototype.toString)
- JE::String now has an exportable 'surrogify' function
- Added some methods (toString, valueOf, charAt, charCodeAt,
concat, indexOf, lastIndexOf, localeCompare) to String
objects, and added the String constructor to the
global object
- Found and fixed quite a few bugs in the parser:
o || && were parsing as | | and & &
o Hexadecimal literals would cause syntax errors
o The parser would create a garbage tree when certain infix
ops were followed by compound expressions that could con-
tain the same op (i.e., [], {}, () and function literals).
(I fell into the 'sub foo { /regex(.*)/; foo(); print $1}'
trap.)
o Bracketed subscripts did not allow whitespace before the
closing bracket
o "a++\nb++" without a semicolon between the two statements
was causing a syntax error because -- and ++ were gobbling
up trailing whitespace.
o <<= and >>= and >>>= were causing syntax errors
o for loops with variable declarations in the header
weren't parsing
o continue/throw/break/return were not parsing correctly
when followed by a line break
o 'with' was parsing as 'while' (!)
o switch and try blocks weren't parsing correctly
0.005 5 March, 2007
Alpha release. Changes and additions:
- The parser has been rewritten completely with recursive sub-
routines. It is now faster than before, and doesn't cause
bus errors.
- The Error and SyntaxError classes now actually work. Before
I just threw them together without even testing them.
- The Object constructor is now according to spec.
- URI-handling functions and the URIError class
- Added the rest of Object.prototype's properties
0.004 19 February, 2007
Alpha release. New features and bug fixes in this
release include:
- Support for all JavaScript statements, not just expression
statements
- JE::String now provides a desurrogify function.
- JE::upgrade now supports coderefs and makes '0' into a num-
ber, as the docs say it does.
- The JE::new_function method has been added.
- Overloading for JE::LValue objects
- JE::Object::props now returns the names of the object's pro-
totype's properties as well as the object's own
- Error and SyntaxError classes
- Function literals and declarations
- '==' in JS now does string comparison if at least one oper-
and is a string (it used to determine that it should do
string comparison and then do numeric equals anyway,
because I typed '==' by mistake instead of 'eq'!)
0.003 14 February, 2007
Alpha release. All JavaScript operators are now supported. JS
numbers now use Perl's nan and inf. A few bugs in the object
classes have been fixed. A bug preventing the expansion of
backslash escapes in string literals has been fixed.
0.002 7 February, 2007
Still a pre-alpha version with almost no features and lots of
bugs. A lot of work has been done on the object classes. The
parser is half-written, but the code that actually executes
the parse tree is far from complete. The only really noticea-
ble new features are that array and object literals and iden-
tifiers are now parsed and interpreted.
0.001 24 January, 2007
Pre-alpha version, with almost no features and lots of bugs.
The man pages describe many features that have not been imple-
mented, so it's all just talk.