ecma262

What is the name of this technique?

I just finished writing a date parser for my ECMAScript implementation. Previously I had written a regular expressions compiler and I was really impressed with the way the spec described the process. Essentially the input is passed through a series of continuations that test each portion of the string. My date parser is loosely based aro...

Why is ECMAScript still not a recommendation of W3C?

In theory browsers could support several programming languages for client-side scripting of web pages. In practice, ECMAScript is the only one widely implemented and used in all browsers. So for most people, it is an integral part of the web. However, it has never been promoted as a recommendation by the W3C for web page scripting. And ...

What's a valid left-hand-side expression in JavaScript grammar?

Okay, we all know what the valid left-hand-side expressions are. Kind of.* But, looking at the definition from the ECMA-Script standard, I'm very confused: LeftHandSideExpression : NewExpression CallExpression Is that just an error in the definition, or am I getting something wrong here? I mean, doesn't that actually mean tha...

Object.defineProperty in ES5?

I'm seeing posts about a 'new' Object.create that makes enumeration configurable. However, it relies on a Object.defineProperty method. I can't find a cross browser implementation for this method. Are we stuck writing for the old Object.create? I can't write things that won't work in IE6/7. ...

Precedence of function object expression in ECMAScript

In order to implement a tiny compiler that emits ECMAScript I need to know how strong a function object expression binds, i.e. what is the precedence of the "operator" function(a1, a2, ...) { ... }? For example, how is function(a1, a2, ...) { ... } (b1, b2, ...) supposed to be parsed? To get the wished for result, namely the application...

ECMA- / Javascripts Array.prototype.forEach

Hi Folks, Javascript (ECMAscript) supports the Array.prototype.forEach method since version 1.6 (ECMAscript edition 3, 2005). So quite a lot of browser already support that method and it's incredibly fast in comparison to jQuery's $.each() method for instance. (Actually it beats all implementations, regardless which Javascript library) ...

How to make sure ES3 programs will run in an ES5 engine?

So ECMAScript 5 introduces some incompatibilities with ECMAScript 3. Example: Many articles have been written stating that this === null || this === undefined is possible in ES5 strict mode: "use strict"; (function () { alert(this); // null }).call(null); But, what the standard really suggests is that ES5 engines also allow th...