Monday, February 26, 2007

New Features in this Release 1.5

JavaScript version 1.5 provides the following new features and enhancements:

Runtime errors. Runtime errors are now reported as exceptions.

Number formatting enhancements. Number formatting has been enhanced to include
Number.prototype.toExponential,
Number.protoytpe.toFixed and
Number.prototype.toPrecision methods.

Regular expression enhancements. The following regular expression enhancements have been added:
Quantifiers
— +, *, ? and {} — can now be followed by a
? to force them to be
non-greedy.

Non-capturing parentheses,
(?:x) can be used instead of capturing parentheses(x). When non-capturing parentheses are used, matched subexpressions are not available as back-references.

Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched.

The
m flag has been added to specify that the regular expression should match over multiple lines.
Conditional function declarations.
Functions can now be declared inside an if clause.

Function expressions.
Functions can now be declared inside an expression.


Multiple catch clauses. Multiple catch clauses in a try...catch statement are supported.



Getters and Setters. JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript.


Constants. Read only named constants are supported. This feature is available only in the C implementation of JavaScript.

No comments :