diff --git a/crates/generate/src/quickjs.rs b/crates/generate/src/quickjs.rs index d02781f9..99e77397 100644 --- a/crates/generate/src/quickjs.rs +++ b/crates/generate/src/quickjs.rs @@ -95,10 +95,27 @@ impl Console { Type::Module => "module".to_string(), Type::BigInt => v.get::().unwrap_or_else(|_| "BigInt".to_string()), Type::Unknown => "unknown".to_string(), + Type::Array => { + let js_vals = v + .as_array() + .unwrap() + .iter::>() + .filter_map(|x| x.ok()) + .map(|x| { + if x.is_string() { + format!("'{}'", Self::format_args(&[x])) + } else { + Self::format_args(&[x]) + } + }) + .collect::>() + .join(", "); + + format!("[ {js_vals} ]") + } Type::Symbol | Type::Object | Type::Proxy - | Type::Array | Type::Function | Type::Constructor | Type::Promise