VmValue.forFunction constructor

VmValue.forFunction({
  1. String identifier = '___anonymousVmFunction___',
  2. bool? isIniter,
  3. bool? isStatic,
  4. bool? isGetter,
  5. bool? isSetter,
  6. List<VmHelper>? listArguments,
  7. List<VmHelper>? nameArguments,
  8. List<Map<VmKeys, dynamic>?>? initTree,
  9. Map<VmKeys, dynamic>? bodyTree,
  10. required dynamic staticListener(
    1. List? positionalArguments,
    2. Map<Symbol, dynamic>? namedArguments,
    3. VmClass staticScope,
    4. List<Map<VmKeys, dynamic>>? instanceFields,
    5. VmValue method,
    ),
  11. required dynamic instanceListener(
    1. List? positionalArguments,
    2. Map<Symbol, dynamic>? namedArguments,
    3. VmClass? staticScope,
    4. VmValue? instanceScope,
    5. VmValue method,
    ),
})

创建函数值

Implementation

factory VmValue.forFunction({
  String identifier = '___anonymousVmFunction___',
  bool? isIniter,
  bool? isStatic,
  bool? isGetter,
  bool? isSetter,
  List<VmHelper>? listArguments,
  List<VmHelper>? nameArguments,
  List<Map<VmKeys, dynamic>?>? initTree,
  Map<VmKeys, dynamic>? bodyTree,
  required dynamic Function(List<dynamic>? positionalArguments, Map<Symbol, dynamic>? namedArguments, VmClass staticScope, List<Map<VmKeys, dynamic>>? instanceFields, VmValue method) staticListener,
  required dynamic Function(List<dynamic>? positionalArguments, Map<Symbol, dynamic>? namedArguments, VmClass? staticScope, VmValue? instanceScope, VmValue method) instanceListener,
}) {
  return VmValue._(
    identifier: identifier,
    metaType: VmMetaType.internalApply,
    metaData: VmMetaData(
      isIniter: isIniter ?? false,
      isStatic: isStatic ?? false,
      isGetter: isGetter ?? false,
      isSetter: isSetter ?? false,
      listArguments: listArguments ?? const [],
      nameArguments: nameArguments ?? const [],
      initTree: initTree ?? const [],
      bodyTree: bodyTree ?? const {},
      staticListener: staticListener,
      instanceListener: instanceListener,
    ),
    valueType: VmClass._getClassByTypeName(VmClass.functionTypeName),
    valueData: null,
  );
}