Change Function::apply to catch the result

We don't know whether it'll throw or not!
This commit is contained in:
Alex Crichton
2018-07-20 12:44:21 -07:00
parent 75215134a5
commit f3d4a20ec7
3 changed files with 4 additions and 9 deletions

View File

@ -20,7 +20,7 @@ fn apply() {
args.push(1.into());
args.push(2.into());
args.push(3.into());
assert_eq!(MAX.apply(&JsValue::undefined(), &args), 3);
assert_eq!(MAX.apply(&JsValue::undefined(), &args).unwrap(), 3);
let arr = JsValue::from(Array::new());
let args = Array::new();