define method

void define(
  1. String name,
  2. Object? value
)

Defines a new variable or function in this environment.

name The name of the variable or function. value The value to bind to the name.

If a name is already defined or conflicts with a bridged type, a warning will be logged.

Implementation

void define(String name, Object? value) {
  if (_values.containsKey(name) ||
      _bridgedClasses.containsKey(name) ||
      _bridgedEnums.containsKey(name)) {
    // CHECK: Also check bridged enums
    Logger.warn("Redefining variable or colliding with bridged type: $name");
  }
  _values[name] = value;
}