Skip to content

Regression from alpha.17 #6025

Closed
Closed

Description

@hzoo

Tried to make a smaller repo from a file in our codebase: (this is with env no loose mode)

might just be our setup though, need to check when we get the alpha.17 repl

Input

for (let path of c) {
  path;
  () => path;
}

if (true) {
  let path = false;
}

Output

var _loop = function _loop(_path) {
  path; // should be _path

  (function () {
    return path;
  });
};

var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;

try {
  for (var _iterator = c[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
    var _path = _step.value;

    _loop(_path);
  }
} catch (err) {
  _didIteratorError = true;
  _iteratorError = err;
} finally {
  try {
    if (!_iteratorNormalCompletion && _iterator.return) {
      _iterator.return();
    }
  } finally {
    if (_didIteratorError) {
      throw _iteratorError;
    }
  }
}

if (true) {
  var path = false;
}

Activity

  1. hzoo commented on Jul 28, 2017

    @hzoo
    MemberAuthor

    Is it possible it came from #5745 @peey?

  2. peey commented on Jul 30, 2017

    @peey
    Contributor

    It shouldn't be, because that only affects bindings and not references. I'll still run this example before and after #5745 to see if it makes a difference.

    For that, can you share your env please? Either that or names of plugins / presets being used if you can figure that out.

  3. hzoo commented on Jul 31, 2017

    @hzoo
    MemberAuthor

    basically using https://github.com/behance/babel-preset-behance

    https://github.com/hzoo/babel-issue-6025 repo - (wish we had infra so that you didn't have to make a repo locally)

    edit: this is good in alpha.15 (preset-env)

    var _loop = function _loop(path) {
      path;
    
      (function () {
        return path;
      });
    };
  4. hzoo commented on Aug 3, 2017

    @hzoo
    MemberAuthor

    Fixed by #6046

  5. added
    outdated
    on May 4, 2018
  6. locked as resolved and limited conversation to collaborators on May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions