Hello. I made a minimal example demonstrating the problem: https://github.com/Katarn/fast-async-bug. Code from this file: https://github.com/Katarn/fast-async-bug/blob/master/src/index.js transpiled in the following code: ```js // <...> "use strict"; // <...> var MyClass = function () { function MyClass() { _classCallCheck(this, MyClass); } _createClass(MyClass, [{ key: "run", value: function run() { return new Promise(function ($return, $error) { if (false) {} else { if (false) {} else { return Promise.resolve(console.log("if block 3")).then(function ($await_5) { try { return $If_2.call(this); } catch ($boundEx) { return $error($boundEx); } }.bind(this), $error); } function $If_2() { return $If_1.call(this); } } function $If_1() { return $return(); } }); } }]); return MyClass; }(); // <...> ``` When I run it in an old browser that the `@babel/preset-env` polyfill is intended for, I get the following error in the console: ``` Uncaught SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function. ``` You can reproduce the bug on Chromium build 205xxx and less, for example, from here: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win/. There are builds for other operating systems also.
Activity
[-]Broken code is generated in strict mode[/-][+]Broken code for strict mode is generated[/+]