rawTableIsMetatable static method

bool rawTableIsMetatable(
  1. Object? table
)

Whether this raw table is currently used as a metatable. Writes to such tables must preserve Value wrappers because metamethod dispatch observes their type and metadata directly.

Implementation

static bool rawTableIsMetatable(Object? table) {
  if (table is! Map) return false;
  try {
    return _metatableObjects[table] ?? false;
  } catch (_) {
    return false;
  }
}