findOnSelf method

LuaObject? findOnSelf(
  1. String field, {
  2. Object? or,
})

First finds field inside object "self" in Scope. If neither can be found, or is returned cast toLua. If or is not provided, null is returned.

Otherwise if "self" is found, then returns the property with name field with the same name as a LuaObject.

Implementation

LuaObject? findOnSelf(String field, {Object? or}) {
  return findVar('self')?.readField(field)?.toLua(field) ?? or?.toLua(field);
}