LuaObject.variable constructor

LuaObject.variable(
  1. String id,
  2. Object? value, [
  3. String? attr
])

Constructs a lua object with id for its variable name in scope with some initial value. Adopts the attribute attr.

Implementation

LuaObject.variable(this.id, Object? value, [this.attr]) : super() {
  if (value is LuaFieldsMap) {
    _fields = value;
  } else if (value is LuaObject) {
    this.value = value.deref();
  } else {
    this.value = value;
  }
}