bindMemberScope method

void bindMemberScope()

作为内部定义类型的实例来绑定实例成员的相关作用域,注意:在调用前需要先调用bindStaticScope绑定静态作用域

Implementation

void bindMemberScope() {
  final target = _valueData;
  if (target is VmValue) {
    target.bindMemberScope();
  } else {
    if (_staticScope == null) throw ('Please call bindStaticScope before calling bindMemberScope: $identifier');
    //遍历子类字段来绑定作用域
    (target as VmSuper)._childPropertyMap.forEach((key, value) {
      value._staticScope ??= _staticScope;
      value._instanceScope ??= this;
    });
  }
}