$new static method

$JsonDecoder $new(
  1. Runtime runtime,
  2. $Value? target,
  3. List<$Value?> args
)

Implementation

static $JsonDecoder $new(
    Runtime runtime, $Value? target, List<$Value?> args) {
  final reviver = args[0]?.$value as EvalCallable?;
  return $JsonDecoder.wrap(JsonDecoder(reviver == null
      ? null
      : (key, value) {
          return reviver.call(runtime, null, [
            runtime.wrapPrimitive(key) ?? key as $Value?,
            runtime.wrapPrimitive(value) ?? value as $Value?
          ])?.$value;
        }));
}