@@ -32,7 +32,7 @@ pub unsafe extern "C" fn get_own_property_names(out: &mut Local, env: Env, objec
3232 }
3333
3434 let raw_names = raw_names. assume_init ( ) ;
35- let mut fixed_names = fixed_names. assume_init ( ) ;
35+ let fixed_names = fixed_names. assume_init ( ) ;
3636
3737 * out = fixed_names;
3838
@@ -47,17 +47,6 @@ pub unsafe extern "C" fn get_own_property_names(out: &mut Local, env: Env, objec
4747 continue ;
4848 }
4949
50- let mut is_own_property = false ;
51- // May return a non-OK status if `key` is not a string or a Symbol, but here it is always
52- // a string.
53- if napi:: napi_has_own_property ( env, object, property_name, & mut is_own_property as * mut _ ) != napi:: napi_status:: napi_ok {
54- return false ;
55- }
56-
57- if !is_own_property {
58- continue ;
59- }
60-
6150 // Before https://github.com/nodejs/node/pull/27524, `napi_get_property_names` would return
6251 // numbers for numeric indices instead of strings.
6352 // Make sure we always return strings.
@@ -72,6 +61,17 @@ pub unsafe extern "C" fn get_own_property_names(out: &mut Local, env: Env, objec
7261 property_name
7362 } ;
7463
64+ let mut is_own_property = false ;
65+ // May return a non-OK status if `key` is not a string or a Symbol, but here it is always
66+ // a string.
67+ if napi:: napi_has_own_property ( env, object, property_name, & mut is_own_property as * mut _ ) != napi:: napi_status:: napi_ok {
68+ return false ;
69+ }
70+
71+ if !is_own_property {
72+ continue ;
73+ }
74+
7575 let mut dummy = false ;
7676 // If we can't convert assign to this array, something went wrong.
7777 if !set_index ( & mut dummy, env, fixed_names, fixed_len, property_name) {
0 commit comments