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

To concisely answer your question, everything beneath the LeftHandSideExpression production is a valid LeftHandSideExpression. I think the question you are really asking is: What is a valid LeftHandSideExpression and also assignable? The answer to that is anything that resolves to a Reference which is a well defined concept in the specification. In your example new … Read more

Why was ECMAScript 4th edition completely scrapped?

Simply put, there was no ECMAScript 4th Edition. From the 5th edition specification: Significant work was done to develop a fourth edition of ECMAScript. Although that work was not completed and not published as the fourth edition of ECMAScript, it informs continuing evolution of the language. The present fifth edition of ECMAScript (published as ECMA-262 … Read more

Object.defineProperty in ES5?

There are several things that you can’t emulate from the ECMAScript 5 Object.create method on an ECMAScript 3 environment. As you saw, the properties argument will give you problems since in E3-based implementations there is no way to change the property attributes. The Object.defineProperty method as @Raynos mentioned, works on IE8, but partially, it can … Read more

Can I disable ECMAscript strict mode for specific functions?

No, you can’t disable strict mode per function. It’s important to understand that strict mode works lexically; meaning — it affects function declaration, not execution. Any function declared within strict code becomes a strict function itself. But not any function called from within strict code is necessarily strict: (function(sloppy) { “use strict”; function strict() { … Read more