Skip to content

Implement lexic scope #327

@jespa007

Description

@jespa007

like javascript does, local function inside functions captures all local variables and it stores in a "environment" as extern scope,

Example,

function f1(){
  var i=0;

  return function(){
        i++;
        Console::outln(i)
  }

}

var f=f1();
f(); // <-- it prints 1
f();// <-- it prints 2

So if the variable is not found as local, then it tries to find it in its environment.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions