We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45b7003 commit 8fba5a2Copy full SHA for 8fba5a2
src/value.rs
@@ -878,15 +878,13 @@ mod tests {
878
arguments: &[JSValue],
879
) -> Result<JSValue, JSException> {
880
if arguments.len() != 2 {
881
- return Err(JSException {
882
- value: JSValue::new_string(ctx, "must receive 2 arguments"),
883
- });
+ return Err(JSValue::new_string(ctx, "must receive 2 arguments").into());
884
}
885
886
let x = arguments[0].as_number()?;
887
let y = arguments[1].as_number()?;
888
889
- Ok(JSValue::new_number(&ctx, x + y))
+ Ok(JSValue::new_number(ctx, x + y))
890
891
892
let sum = JSValue::new_function(&ctx, "awesome_sum", Some(sum)).as_object()?;
sum.wasm
147 Bytes
0 commit comments