eval method

  1. @override
Future eval(
  1. String expression
)
override

Evaluate an expression and return the result.

This is the default action for non-command input. Supports await for async expressions.

Implementation

@override
Future<dynamic> eval(String expression) async {
  // Record to session if active
  _state.recordToSession(expression);

  // Handle await expressions
  final result = _d4rt.eval(expression);
  if (result is Future) {
    return await result;
  }
  return result;
}