Closed STRML closed 7 years ago
In loose mode, transform-es2015-for-of generates the following code:
async function run(languages) {
const fileContents = await readFileAsync(filePath, 'utf8');
for (var _iterator = fileContents, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
const field = _ref;
}
}
I can confirm the breakage on the nodent example page.
Continued in https://github.com/MatAtBread/nodent/issues/67
This only occurs in combination with
transform-es2015-for-of
in loose mode.This code:
Compiles to:
Notice the error in the top line and the very odd
for()
syntax..babelrc: