Skip to content

Implement lexic scope #327

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions