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

ECMA 6 - Implement Let and Const Declarations #141

Open
pemattio opened this issue Jun 4, 2018 · 0 comments
Open

ECMA 6 - Implement Let and Const Declarations #141

pemattio opened this issue Jun 4, 2018 · 0 comments

Comments

@pemattio
Copy link
Contributor

pemattio commented Jun 4, 2018

The runtime need to has the visitor for the let and const statements.
For this implementation please check this link related to current supported specification.

Examples of errors

const pi=3.14
const pi=3.14

SyntaxError: redeclaration of const pi

const pi=3.14
pi=3.14

TypeError: invalid assignment to const `pi'

if(true) {let a = 2} a;

ReferenceError: a is not defined

let a=1; if(true) {console.log(a); let a=2}

ReferenceError: can't access lexical declaration `a' before initialization

@pemattio pemattio changed the title ECMA 6: implement Let and Const Declarations ECMA 6 - Implement Let and Const Declarations Jun 4, 2018
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