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