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

Bug in new demo #21

Open
encocan opened this issue Oct 26, 2018 · 1 comment
Open

Bug in new demo #21

encocan opened this issue Oct 26, 2018 · 1 comment

Comments

@encocan
Copy link

encocan commented Oct 26, 2018

const x = 'a';

const y = () => {
    const x = 'b';
    
    console.log(x);
}

y();

Output is right in the demo online ('b'), but when I build the code, the demo output is 'a'.

Thought I would let you know.

@encocan
Copy link
Author

encocan commented Dec 4, 2019

@basicer The latest version now has a different error:

> yarn repl
yarn run v1.19.2
$ node contrib/cli.js -i
js> const x = 'a';
UndefinedValue { serial: 0 }
js> const y = () => { const x = 'b'; console.log(x); }
UndefinedValue { serial: 0 }
js> y();
SyntaxError: Identifier 'x' has already been declared
    at VariableDeclaration (<src>:1:18)
    at y(...) (<src>:1:0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant