@@ -2180,7 +2180,7 @@ ecma_op_object_get_enumerable_property_names (ecma_object_t *obj_p, /**< routine
2180
2180
ecma_enumerable_property_names_options_t option ) /**< listing option */
2181
2181
{
2182
2182
/* 2. */
2183
- ecma_collection_t * prop_names_p = ecma_op_object_own_property_keys (obj_p );
2183
+ ecma_collection_t * prop_names_p = ecma_op_object_own_property_keys (obj_p , JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS );
2184
2184
2185
2185
#if JERRY_BUILTIN_PROXY
2186
2186
if (JERRY_UNLIKELY (prop_names_p == NULL ))
@@ -2278,15 +2278,16 @@ ecma_op_object_get_enumerable_property_names (ecma_object_t *obj_p, /**< routine
2278
2278
static void
2279
2279
ecma_object_list_lazy_property_names (ecma_object_t * obj_p , /**< object */
2280
2280
ecma_collection_t * prop_names_p , /**< prop name collection */
2281
- ecma_property_counter_t * prop_counter_p ) /**< prop counter */
2281
+ ecma_property_counter_t * prop_counter_p , /**< property counters */
2282
+ jerry_property_filter_t filter ) /**< property name filter options */
2282
2283
{
2283
2284
switch (ecma_get_object_type (obj_p ))
2284
2285
{
2285
2286
case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION :
2286
2287
{
2287
2288
if (ecma_builtin_function_is_routine (obj_p ))
2288
2289
{
2289
- ecma_builtin_routine_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2290
+ ecma_builtin_routine_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2290
2291
break ;
2291
2292
}
2292
2293
/* FALLTHRU */
@@ -2295,7 +2296,7 @@ ecma_object_list_lazy_property_names (ecma_object_t *obj_p, /**< object */
2295
2296
case ECMA_OBJECT_TYPE_BUILT_IN_CLASS :
2296
2297
case ECMA_OBJECT_TYPE_BUILT_IN_ARRAY :
2297
2298
{
2298
- ecma_builtin_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2299
+ ecma_builtin_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2299
2300
break ;
2300
2301
}
2301
2302
case ECMA_OBJECT_TYPE_CLASS :
@@ -2306,19 +2307,19 @@ ecma_object_list_lazy_property_names (ecma_object_t *obj_p, /**< object */
2306
2307
{
2307
2308
case ECMA_OBJECT_CLASS_STRING :
2308
2309
{
2309
- ecma_op_string_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2310
+ ecma_op_string_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2310
2311
break ;
2311
2312
}
2312
2313
case ECMA_OBJECT_CLASS_ARGUMENTS :
2313
2314
{
2314
- ecma_op_arguments_object_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2315
+ ecma_op_arguments_object_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2315
2316
break ;
2316
2317
}
2317
2318
#if JERRY_BUILTIN_TYPEDARRAY
2318
2319
/* ES2015 9.4.5.1 */
2319
2320
case ECMA_OBJECT_CLASS_TYPEDARRAY :
2320
2321
{
2321
- ecma_op_typedarray_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2322
+ ecma_op_typedarray_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2322
2323
break ;
2323
2324
}
2324
2325
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -2327,23 +2328,26 @@ ecma_object_list_lazy_property_names (ecma_object_t *obj_p, /**< object */
2327
2328
}
2328
2329
case ECMA_OBJECT_TYPE_FUNCTION :
2329
2330
{
2330
- ecma_op_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2331
+ ecma_op_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2331
2332
break ;
2332
2333
}
2333
2334
case ECMA_OBJECT_TYPE_NATIVE_FUNCTION :
2334
2335
{
2335
- ecma_op_external_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2336
+ ecma_op_external_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2336
2337
break ;
2337
2338
}
2338
2339
case ECMA_OBJECT_TYPE_BOUND_FUNCTION :
2339
2340
{
2340
- ecma_op_bound_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p );
2341
+ ecma_op_bound_function_list_lazy_property_names (obj_p , prop_names_p , prop_counter_p , filter );
2341
2342
break ;
2342
2343
}
2343
2344
case ECMA_OBJECT_TYPE_ARRAY :
2344
2345
{
2345
- ecma_collection_push_back (prop_names_p , ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH ));
2346
- prop_counter_p -> string_named_props ++ ;
2346
+ if (!(filter & JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS ))
2347
+ {
2348
+ ecma_collection_push_back (prop_names_p , ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH ));
2349
+ prop_counter_p -> string_named_props ++ ;
2350
+ }
2347
2351
break ;
2348
2352
}
2349
2353
default :
@@ -2486,7 +2490,8 @@ ecma_object_sort_property_names (ecma_collection_t *prop_names_p, /**< prop name
2486
2490
* collection of property names - otherwise
2487
2491
*/
2488
2492
ecma_collection_t *
2489
- ecma_op_object_own_property_keys (ecma_object_t * obj_p ) /**< object */
2493
+ ecma_op_object_own_property_keys (ecma_object_t * obj_p , /**< object */
2494
+ jerry_property_filter_t filter ) /**< property name filter options */
2490
2495
{
2491
2496
#if JERRY_BUILTIN_PROXY
2492
2497
if (ECMA_OBJECT_IS_PROXY (obj_p ))
@@ -2497,13 +2502,13 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p) /**< object */
2497
2502
2498
2503
if (ecma_op_object_is_fast_array (obj_p ))
2499
2504
{
2500
- return ecma_fast_array_object_own_property_keys (obj_p );
2505
+ return ecma_fast_array_object_own_property_keys (obj_p , filter );
2501
2506
}
2502
2507
2503
2508
ecma_collection_t * prop_names_p = ecma_new_collection ();
2504
2509
ecma_property_counter_t prop_counter = {0 , 0 , 0 , 0 , 0 };
2505
2510
2506
- ecma_object_list_lazy_property_names (obj_p , prop_names_p , & prop_counter );
2511
+ ecma_object_list_lazy_property_names (obj_p , prop_names_p , & prop_counter , filter );
2507
2512
2508
2513
prop_counter .lazy_string_named_props = prop_names_p -> item_count - prop_counter .symbol_named_props ;
2509
2514
prop_counter .lazy_symbol_named_props = prop_counter .symbol_named_props ;
@@ -2595,7 +2600,7 @@ ecma_op_object_enumerate (ecma_object_t *obj_p) /**< object */
2595
2600
2596
2601
while (true)
2597
2602
{
2598
- ecma_collection_t * keys = ecma_op_object_own_property_keys (obj_p );
2603
+ ecma_collection_t * keys = ecma_op_object_own_property_keys (obj_p , JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS );
2599
2604
2600
2605
#if JERRY_ESNEXT
2601
2606
if (JERRY_UNLIKELY (keys == NULL ))
0 commit comments