@@ -1414,11 +1414,17 @@ ecma_builtin_native_handler_list_lazy_property_names (ecma_object_t *object_p, /
14141414void
14151415ecma_builtin_routine_list_lazy_property_names (ecma_object_t * object_p , /**< a built-in object */
14161416 ecma_collection_t * prop_names_p , /**< prop name collection */
1417- ecma_property_counter_t * prop_counter_p ) /**< prop counter */
1417+ ecma_property_counter_t * prop_counter_p , /**< property counters */
1418+ jerry_property_filter_t filter ) /**< name filters */
14181419{
14191420 JERRY_ASSERT (ecma_get_object_type (object_p ) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION );
14201421 JERRY_ASSERT (ecma_builtin_function_is_routine (object_p ));
14211422
1423+ if (filter & JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS )
1424+ {
1425+ return ;
1426+ }
1427+
14221428#if JERRY_ESNEXT
14231429 ecma_extended_object_t * ext_func_p = (ecma_extended_object_t * ) object_p ;
14241430
@@ -1456,7 +1462,8 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
14561462void
14571463ecma_builtin_list_lazy_property_names (ecma_object_t * object_p , /**< a built-in object */
14581464 ecma_collection_t * prop_names_p , /**< prop name collection */
1459- ecma_property_counter_t * prop_counter_p ) /**< prop counter */
1465+ ecma_property_counter_t * prop_counter_p , /**< property counters */
1466+ jerry_property_filter_t filter ) /**< name filters */
14601467{
14611468 JERRY_ASSERT (ecma_get_object_type (object_p ) != ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION
14621469 || !ecma_builtin_function_is_routine (object_p ));
@@ -1477,57 +1484,91 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
14771484
14781485 JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT );
14791486
1480- const ecma_builtin_property_descriptor_t * curr_property_p = ecma_builtin_property_list_references [builtin_id ];
1481-
1482- uint32_t index = 0 ;
1483- uint8_t bitset = built_in_props_p -> u2 .instantiated_bitset [0 ];
1484-
14851487#if JERRY_BUILTIN_REALMS
14861488 uint8_t * bitset_p = built_in_props_p -> u2 .instantiated_bitset + 1 + sizeof (ecma_value_t );
14871489#else /* !JERRY_BUILTIN_REALMS */
14881490 uint8_t * bitset_p = built_in_props_p -> u2 .instantiated_bitset + 1 ;
14891491#endif /* JERRY_BUILTIN_REALMS */
14901492
1491- while (curr_property_p -> magic_string_id != LIT_MAGIC_STRING__COUNT )
1493+ #if JERRY_ESNEXT
1494+ uint8_t * symbol_bitset_p = bitset_p ;
1495+ bool has_symbol = true;
1496+ #endif /* JERRY_BUILTIN_REALMS */
1497+
1498+ if (!(filter & JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS ))
14921499 {
1493- if (index == 8 )
1494- {
1495- bitset = * bitset_p ++ ;
1496- index = 0 ;
1497- }
1500+ const ecma_builtin_property_descriptor_t * curr_property_p = ecma_builtin_property_list_references [builtin_id ];
1501+ uint8_t bitset = built_in_props_p -> u2 .instantiated_bitset [0 ];
1502+ uint32_t index = 0 ;
14981503
1499- uint32_t bit_for_index = (uint32_t ) 1u << index ;
1504+ #if JERRY_ESNEXT
1505+ has_symbol = false;
1506+ #endif /* JERRY_BUILTIN_REALMS */
15001507
1501- if (curr_property_p -> magic_string_id > LIT_NON_INTERNAL_MAGIC_STRING__COUNT )
1508+ while (curr_property_p -> magic_string_id != LIT_MAGIC_STRING__COUNT )
15021509 {
1503- #if JERRY_ESNEXT
1504- if (LIT_IS_GLOBAL_SYMBOL (curr_property_p -> magic_string_id ))
1510+ if (index == 8 )
15051511 {
1506- ecma_string_t * name_p = ecma_op_get_global_symbol (curr_property_p -> magic_string_id );
1512+ bitset = * bitset_p ++ ;
1513+ index = 0 ;
1514+ }
1515+
1516+ uint32_t bit_for_index = (uint32_t ) 1u << index ;
15071517
1508- if (!(bitset & bit_for_index ))
1518+ if (!(bitset & bit_for_index ))
1519+ {
1520+ #if JERRY_ESNEXT
1521+ if (JERRY_LIKELY (curr_property_p -> magic_string_id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT ))
15091522 {
1510- ecma_value_t name = ecma_make_symbol_value (name_p );
1523+ #endif /* JERRY_ESNEXT */
1524+ ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t ) curr_property_p -> magic_string_id );
15111525 ecma_collection_push_back (prop_names_p , name );
1512- prop_counter_p -> symbol_named_props ++ ;
1526+ prop_counter_p -> string_named_props ++ ;
1527+ #if JERRY_ESNEXT
15131528 }
15141529 else
15151530 {
1516- ecma_deref_ecma_string (name_p );
1531+ JERRY_ASSERT (LIT_IS_GLOBAL_SYMBOL (curr_property_p -> magic_string_id ));
1532+ has_symbol = true;
15171533 }
1518- }
15191534#endif /* JERRY_ESNEXT */
1535+ }
1536+
1537+ curr_property_p ++ ;
1538+ index ++ ;
15201539 }
1521- else if (!(bitset & bit_for_index ))
1540+ }
1541+
1542+ #if JERRY_ESNEXT
1543+ if (has_symbol && !(filter & JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS ))
1544+ {
1545+ const ecma_builtin_property_descriptor_t * curr_property_p = ecma_builtin_property_list_references [builtin_id ];
1546+ uint8_t bitset = built_in_props_p -> u2 .instantiated_bitset [0 ];
1547+ uint32_t index = 0 ;
1548+
1549+ while (curr_property_p -> magic_string_id != LIT_MAGIC_STRING__COUNT )
15221550 {
1523- ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t ) curr_property_p -> magic_string_id );
1524- ecma_collection_push_back (prop_names_p , name );
1525- prop_counter_p -> string_named_props ++ ;
1526- }
1551+ if (index == 8 )
1552+ {
1553+ bitset = * symbol_bitset_p ++ ;
1554+ index = 0 ;
1555+ }
15271556
1528- curr_property_p ++ ;
1529- index ++ ;
1557+ uint32_t bit_for_index = (uint32_t ) 1u << index ;
1558+
1559+ if (curr_property_p -> magic_string_id > LIT_NON_INTERNAL_MAGIC_STRING__COUNT
1560+ && !(bitset & bit_for_index ))
1561+ {
1562+ ecma_string_t * name_p = ecma_op_get_global_symbol (curr_property_p -> magic_string_id );
1563+ ecma_collection_push_back (prop_names_p , ecma_make_symbol_value (name_p ));
1564+ prop_counter_p -> symbol_named_props ++ ;
1565+ }
1566+
1567+ curr_property_p ++ ;
1568+ index ++ ;
1569+ }
15301570 }
1571+ #endif /* JERRY_ESNEXT */
15311572} /* ecma_builtin_list_lazy_property_names */
15321573
15331574/**
0 commit comments