Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring assignment bug #232

Closed
FGRibreau opened this issue Oct 30, 2016 · 1 comment
Closed

Destructuring assignment bug #232

FGRibreau opened this issue Oct 30, 2016 · 1 comment
Labels
bug Confirmed bug
Milestone

Comments

@FGRibreau
Copy link

FGRibreau commented Oct 30, 2016

const a = {
  lol: (input) => {
      const [hello, world] = input.split('|');
      if (hello === 't' || hello === 'top') {
        return 'top';
      }
      return 'bottom';
    }
}

Becomes (see babel repl):

'use strict';var a={lol:function lol(b){return b.split('|'),'t'===c||'top'===c?'top':'bottom'}};

Bug: c is never declared

Note: babel output is correct, the issue came only when babili was activated

@boopathi boopathi added the bug Confirmed bug label Oct 30, 2016
@boopathi
Copy link
Member

I fixed this in #155 ... Looks like I missed a spot.

boopathi added a commit that referenced this issue Oct 30, 2016
Related previous fix - #155 does
the same thing except for a different case - the binding.constant is
true for that and for the current fix binding is not referenced but is
an array pattern or an object pattern.

+ (close #232)
@boopathi boopathi added this to the 0.0.8 milestone Oct 30, 2016
@hzoo hzoo closed this as completed in e6fc16e Oct 30, 2016
kangax pushed a commit that referenced this issue Nov 2, 2016
Related previous fix - #155 does
the same thing except for a different case - the binding.constant is
true for that and for the current fix binding is not referenced but is
an array pattern or an object pattern.

+ (close #232)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants