get<T> method

T get<T>(
  1. int index
)

Reads bool, int, double, num, String, BigInt or a JS value without coercion.

int accepts only finite integral Numbers within JavaScript's safe range. Nullable types accept null; undefined remains undefined.

Implementation

T get<T>(int index) {
  if (!_scope.active) {
    throw StateError('JavaScript arguments left their scope');
  }
  if (index < 0 || index >= _values.length) {
    throw ArgumentError('Missing argument at index $index');
  }
  return _env._decode<T>(_values[index]);
}