Re: javascript 2.0 release???
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: javascript 2.0 release???

From: Lasse Reichstein Nielsen <lrn@hotpop.com>
Date: Wed Nov 30 2005 - 19:10:58 CET

Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:

> However, from <URL:http://www.opera.com/docs/specs/js/ecma/> ISTM now
> that Opera's language implementation is pretty close to qualify as
> "ECMA-262 (Edition 3) and nothing less and nothing more", maybe even
> matching that. Lasse?

Well, that page sums it up pretty well. There is one extra method on a
language object (RegExp.prototype.compile), and a few extra global
functions (anchor, link, etc.), but apart from that, all the
implemented functions *in that list* are from the ECMAScript standard.

There is still the odd bug in the implementation, but I don't know of
any that you would hit in normal use. (Example:

  var a = [,,,,,,,1];
  alert([0 in a,1 in a,2 in a,3 in a,4 in a,5 in a,6 in a,7 in a]);
  // alerts false,false,false,false,false,false,false,true.
  a.sort();
  alert([0 in a,1 in a,2 in a,3 in a,4 in a,5 in a,6 in a,7 in a]);
  // should alert: true,false,false,false,false,false,false,false
  // alerts: true,true,true,true,true,true,true,false

There seems to have to be at least 8 elements in the array for the bug
to appear, and the order is also important. Obscure indeed :)

Still, the implementation of the core language isn't really that
interesting. It's the DOM that, i.e., the runtime environment, that
really defines what you can do with Javascript, and there the browsers
still differ quite a lot. DOM 0 really is an extension to ECMAScript,
in that it extends the global object with extra properties (like
"document"), so no browser will ever be pure ECMAScript.

/L

-- 
Lasse Reichstein Nielsen  -  lrn@hotpop.com
 DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
  'Faith without judgement merely degrades the spirit divine.'
Received on Sat Dec 3 04:33:45 2005