mattbierner / khepri

ECMAScript derived programming language
http://khepri-lang.com/
MIT License
67 stars 3 forks source link

Let Expression Binding Seeing own pattern #60

Closed mattbierner closed 10 years ago

mattbierner commented 10 years ago

Currently the evaluation:

var x; let x = x * 3 in x;

produces undefined * 3;

since the generated code is:

var x;
var x0 = x0 * 3;
x0;

Although this is useful when the bound value is a function, this is incorrect in other cases. The generated code should be:

var x;
var x0 = x * 3;
x0;