puma icon indicating copy to clipboard operation
puma copied to clipboard

ECMA 6 - Implement Let and Const Declarations

Open pemattio opened this issue 7 years ago • 0 comments

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 avatar Jun 04 '18 16:06 pemattio