Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-str committed Nov 3, 2024
1 parent b74a521 commit 3a8bf86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/engine/src/builtins/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl Map {
/// 2. Perform ? RequireInternalSlot(M, [[MapData]]).
/// 3. If IsCallable(callbackfn) is false, throw a TypeError exception.
/// ```
pub(crate) fn rust_for_each<F>(this: &JsValue, mut f: F) -> JsResult<()>
pub(crate) fn for_each_native<F>(this: &JsValue, mut f: F) -> JsResult<()>
where
F: FnMut(JsValue, JsValue) -> JsResult<()>,
{
Expand Down
4 changes: 2 additions & 2 deletions core/engine/src/object/builtins/jsmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ impl JsMap {

/// Executes the provided callback function for each key-value pair within the [`JsMap`].
#[inline]
pub fn rust_for_each<F>(&self, f: F) -> JsResult<()>
pub fn for_each_native<F>(&self, f: F) -> JsResult<()>
where
F: FnMut(JsValue, JsValue) -> JsResult<()>,
{
let this = self.inner.clone().into();
Map::rust_for_each(&this, f)
Map::for_each_native(&this, f)
}

/// Returns a new [`JsMapIterator`] object that yields the `value` for each element within the [`JsMap`] in insertion order.
Expand Down
4 changes: 2 additions & 2 deletions core/engine/src/value/conversions/try_from_js/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
// JsMap case
if let Ok(js_map) = JsMap::from_object(object.clone()) {
let mut map = Self::default();
js_map.rust_for_each(|key, value| {
js_map.for_each_native(|key, value| {
map.insert(
K::try_from_js(&key, context)?,
V::try_from_js(&value, context)?,
Expand Down Expand Up @@ -65,7 +65,7 @@ where
// JsMap case
if let Ok(js_map) = JsMap::from_object(object.clone()) {
let mut map = Self::default();
js_map.rust_for_each(|key, value| {
js_map.for_each_native(|key, value| {
map.insert(
K::try_from_js(&key, context)?,
V::try_from_js(&value, context)?,
Expand Down

0 comments on commit 3a8bf86

Please sign in to comment.