-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
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:
// <...>
"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.
Metadata
Metadata
Assignees
Labels
No labels