SpiderMonkey Regrets

Is the most implemented ECMAScript.next specs SpiderMonkey as known as Firefox's JavaScript engine ?

Yes, indeed many of implementaions are available. I was watching and blogging the improvement. But some of things are launched for a long time ago, and these are becoming negative heritage.

Block scoped decralations

I know SpiderMonkey is the first engine implement ConstDeclaration. But it's not compatible for ES.next because doesn't support block scope.

Bug 611388 says:

2013-03-22 16:17:48 PDT
Trying this again after nearly a year.

V8 engine on experimental flag can use block scoped const, and I heared IE11's Chakra will support the declaration.
I'm afraid that SpiderMonkey will have been the latest engine implemented block scoped ConstDeclaration.

Generators and YieldExpression

Also I know SpiderMonkey is the first engine implement GneratorFunction and YieldExpression. But these are not compatible for ES.next's proposals.

Difference of GneratatorFunction syntax
SpiderMonkeyES.next
var g = function(){
  yield "OK";
}
var g = function * (){
  yield "OK";
}
Must add "*" after the "function" keyword.

Unfortunately, Firefox and also many of it's extensions are already using the wrong syntax of GneratorFunction. We will need some transition priod for fixing to the correct syntax.

ArrayComprehension and GeneratorComplehension

The same things can say to ArrayComprehension and GeneratorComplehension.

Difference of ArrayComplehenstion and GeneratorComplehenstion syntax
SpiderMonkeyES.next
[v for (v of list)];
[for (v of list) v];
(v for (v of list));
(for (v of list) v);

"__iterator__" magic property

var obj = {
  list: ["a", "b", "c"],
  __iterator__: function () {
    for (var i = 0; i < this.list.length; ++i) {
      yield this.list[i];
    }
  },
};
for (var v in obj) {
  console.log(v);
}
// "a"
// "b"
// "c"

We could iterate values with for-in statement instead of enumerating values. I loved this until for-of statement was launched. "__iterator__" has severe compatibility issue that for-of statement doesn't care of the property. Instead, Mozilla takes on "iterator" property which is not in ES.next specs.

The new code will be following:

var obj = {
  list: ["a", "b", "c"],
  iterator: function () {
    for (var i = 0; i < this.list.length; ++i) {
      yield this.list[i];
    }
  },
};
for (var v of obj) {
  console.log(v);
}
// "a"
// "b"
// "c"

Of couse, it's not compatible for ES.next. The correct way will use --Sory, I don't know the final consensus-- a iterator-symbol is not string property.
Anyway we shouldn't use this "iterator" property, I think this will be removed finally.

What on earth does Mozilla plan to deal with "iterator" and "__iterator__" ... ? I don't know at all.

Finally

I want Mozilla to fix those issues rather than implementing new methods of ES.next .