instanceMemberGet method

  1. @override
dynamic instanceMemberGet(
  1. dynamic instance,
  2. String id, {
  3. bool ignoreUndefined = false,
})
override

Default HTExternalClass constructor. Fetch a instance member of the Dart class by the id, in the form of

object.key

Implementation

@override
dynamic instanceMemberGet(dynamic instance, String id,
    {bool ignoreUndefined = false}) {
  switch (id) {
    case 'then':
      return ({object, positionalArgs, namedArgs}) {
        HTFunction func = positionalArgs.first;
        return object.then((value) => func.call(positionalArgs: [value]));
      };
    default:
      throw HTError.undefined(id);
  }
}