bind method

LoxFunction bind(
  1. LoxInstance instance
)

Implementation

LoxFunction bind(LoxInstance instance) {
  Environment environment = Environment(closure);
  environment.define("this", instance);
  return LoxFunction(declaration, environment, isInitializer);
}