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

var hoisting #167

Closed
boopathi opened this issue Sep 28, 2016 · 0 comments
Closed

var hoisting #167

boopathi opened this issue Sep 28, 2016 · 0 comments
Labels
bug Confirmed bug

Comments

@boopathi
Copy link
Member

Input:

function foo() {
  a = 1;
  return a;
  var a;
}

Actual Output:

No var decl.

function foo(){return b=1,b}

REPL

Expected:

vars should be hoisted

and the output should become function foo(){return 1}

@boopathi boopathi added the bug Confirmed bug label Sep 28, 2016
boopathi added a commit that referenced this issue Sep 29, 2016
Fix bug where var declarations after compleition statements are
deadcode eliminated - vars are hoisted in JS and need to be preserved
like function declarations

(Close #167)
boopathi added a commit that referenced this issue Sep 29, 2016
Fix bug where var declarations after compleition statements are
deadcode eliminated - vars are hoisted in JS and need to be preserved
like function declarations

(Close #167)
kangax pushed a commit that referenced this issue Sep 30, 2016
Fix bug where var declarations after compleition statements are
deadcode eliminated - vars are hoisted in JS and need to be preserved
like function declarations

(Close #167)
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

1 participant