createID method

String createID(
  1. String id
)

Forwards call to current's Scope.createID. Exception: metamethods have their IDs preserved

Implementation

String createID(String id) {
  const List<String> meta = [
    '__newindex',
    '__index',
    '__call',
    '__add',
    '__sub',
    '__band',
    '__bnot',
    '__bor',
    '__bxor',
    '__call',
    '__concat',
    '__div',
    '__eq',
    '__idiv',
    '__le',
    '__lt',
    '__len',
    '__mod',
    '__mul',
    '__pow',
    '__shl',
    '__shr',
    '__unm',
  ];

  if(meta.contains(id)) {
    current.ids[id] = id;
    return id;
  }

  return current.createID(id);
}