Skip to content

Commit 1fa5971

Browse files
committed
chore: improve method finding
1 parent fa0aa52 commit 1fa5971

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

runtime/src/ns_proxy.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,9 @@ pub(crate) fn handle_named_property_getter(
464464
let clazz_dec = lock.as_any().downcast_ref::<ClassDeclaration>();
465465

466466
if let Some(clazz_dec) = clazz_dec {
467-
for method in collect_class_methods(clazz_dec) {
468-
let mut method_name = method.overload_name();
469-
if method_name.is_empty() {
470-
method_name = method.name();
471-
}
472-
473-
if method_name == name {
474-
let declaration = Arc::new(RwLock::new(method.clone()));
467+
if let Some(method) = find_class_method(clazz_dec, &name) {
468+
{
469+
let declaration = Arc::new(RwLock::new(method));
475470
let declaration =
476471
Box::into_raw(Box::new(DeclarationFFI::new_with_instance(
477472
declaration,

0 commit comments

Comments
 (0)