DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
504 stars 63 forks source link

Fix implementation of the `Debug` trait of `Value` #171

Closed MaxXSoft closed 1 year ago

MaxXSoft commented 1 year ago
if let Err(Error::Exception) = ctx.eval::<(), _>("throw 3") {
  println!("{:?}", ctx.catch());
}

The result of the above code is Int'('3')' but not Int(3).

Similarly, the result of the following code

if let Err(Error::Exception) = ctx.eval::<(), _>(r#"throw "3""#) {
  println!("{:?}", ctx.catch());
}

is String"(\""Ok("3")"\")" but not String(Ok("3")).

This PR fixes above issues.

DelSkayn commented 1 year ago

Thanks for the PR, merging!