Skip to content

Bug in new demo #21

Open
Open

Description

@encocan
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.

Activity

  1. encocan commented on Dec 4, 2019

    @encocan
    Author

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions