"use strict"; now allows duplicate properties?

I just found that in recent versions of Chrome 42 and FF 37.0.2 these lines of code are completely legal

"use strict"; var o = { p: 1, p: 2 }; 

(copied from MDN )

In IE 10-11 and Opera 28.0.1750, it throws an error as expected.

In the same time

 abc=0; 

raises an error (undeclared variable) as expected.

Does anyone know what caused these changes?

+5
source share
1 answer

There is a Bugzilla ticket here . From what I am collecting (here and on the other pages that I have reviewed), duplicate properties are legal in ECMAScript version 6, unlike ES5, where it is forbidden in strict mode.

+12
source

All Articles