Skip to content

Commit babc213

Browse files
dorayakikunalexcrichton
authored andcommitted
Remove target_args from Array.find_index() (#479)
1 parent 89e8a45 commit babc213

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/js.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ extern "C" {
177177
///
178178
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
179179
#[wasm_bindgen(method, js_name = findIndex)]
180-
pub fn find_index(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool, this_arg: &JsValue) -> u32;
180+
pub fn find_index(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> u32;
181181

182182
/// The includes() method determines whether an array includes a certain
183183
/// element, returning true or false as appropriate.

tests/all/js_globals/Array.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,10 @@ fn find_index() {
908908
extern crate wasm_bindgen;
909909
use wasm_bindgen::prelude::*;
910910
use wasm_bindgen::js;
911-
use JsValue;
912911
913912
#[wasm_bindgen]
914913
pub fn array_find_first_even_number_index(array: &js::Array) -> u32 {
915-
array.find_index(&mut |el, _, _| el.as_f64().unwrap() % 2. == 0., &JsValue::undefined())
914+
array.find_index(&mut |el, _, _| el.as_f64().unwrap() % 2. == 0.)
916915
}
917916
"#,
918917
)

0 commit comments

Comments
 (0)