'use strict'
[1,2,3,4].find(x => x > 1)
When the above code is executed with Node.js 5.0.0, it gives the following error:
TypeError: "use strict"[(((1 , 2) , 3) , 4)].find is not a function
at Object.<anonymous> (C:\src\nodejs\ecma6.js:2:11)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:457:10)
at startup (node.js:136:18)
at node.js:972:3
The error goes away if I add a semicolon after 'use strict'.
This looks like a bug... Or is there anything deeper - meaning whether there is a list of exceptional cases in the language specification, in which a semicolon is required.
The language specification does list exceptional cases, in which explicit semicolons are required.
[
which is one of the characters in the JS spec that prevent this autocorrection.