Nathan-Wall / proto

A programming language derived from JavaScript which emphasizes prototypes, integrity, and syntax.
Other
12 stars 1 forks source link

Hoisted functions fail to recognize variables that are declared after them #64

Closed Nathan-Wall closed 10 years ago

Nathan-Wall commented 10 years ago

The following code results in an error because the foo function is trying to find bar in the global built-ins rather than in its own scope.

fn foo :{
  console.log('from foo');
  bar();
}

fn bar :{
  console.log('from bar');
}

foo();