richgilbank / Scratch-JS

Run ES6, CoffeeScript and LiveScript on any page from Chrome's DevTools!
MIT License
350 stars 50 forks source link

Add "High compliancy" mode #78

Open ova2 opened 8 years ago

ova2 commented 8 years ago

Please add "High compliancy" mode as in Babel (checkbox here https://babeljs.io/repl/). Currently this ES6 code

if (true) {
  console.log(typeof value);  // ReferenceError!  
  let value = "blue";         // Temporal Dead Zone
}

is transpiled to

"use strict";

if (true) {
  console.log(typeof value);  // ReferenceError!
  var value = "blue";         // Temporal Dead Zone
}

and does not throw ReferenceError.