@@ -2108,7 +2108,8 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
21082108 {
21092109 if (!is_array_indices_only )
21102110 {
2111- ecma_op_external_function_list_lazy_property_names (opts ,
2111+ ecma_op_external_function_list_lazy_property_names (obj_p ,
2112+ opts ,
21122113 prop_names_p ,
21132114 skipped_non_enumerable_p );
21142115 }
@@ -2160,6 +2161,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
21602161#endif /* ENABLED (JERRY_ES2015) */
21612162
21622163 ecma_value_t * buffer_p = prop_names_p -> buffer_p ;
2164+ uint32_t lazy_prop_name_count = prop_names_p -> item_count ;
21632165
21642166 const size_t own_names_hashes_bitmap_size = ECMA_OBJECT_HASH_BITMAP_SIZE / bitmap_row_size ;
21652167 JERRY_VLA (uint32_t , own_names_hashes_bitmap , own_names_hashes_bitmap_size );
@@ -2392,6 +2394,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
23922394
23932395 uint32_t array_index_name_pos = 0 ;
23942396 uint32_t string_name_pos = string_named_properties_count ;
2397+ uint32_t lazy_string_name_pos = 0 ;
23952398#if ENABLED (JERRY_ES2015 )
23962399 uint32_t symbol_name_pos = symbol_named_properties_count ;
23972400#endif /* ENABLED (JERRY_ES2015) */
@@ -2453,12 +2456,19 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
24532456 JERRY_ASSERT (string_name_pos > 0 );
24542457 JERRY_ASSERT (string_name_pos <= string_named_properties_count );
24552458
2456- string_names_p [-- string_name_pos ] = name_p ;
2459+ if (i < lazy_prop_name_count )
2460+ {
2461+ string_names_p [lazy_string_name_pos ++ ] = name_p ;
2462+ }
2463+ else
2464+ {
2465+ string_names_p [-- string_name_pos ] = name_p ;
2466+ }
24572467 }
24582468 }
24592469
24602470 JERRY_ASSERT (array_index_name_pos == array_index_named_properties_count );
2461- JERRY_ASSERT (string_name_pos == 0 );
2471+ JERRY_ASSERT (string_name_pos - lazy_string_name_pos == 0 );
24622472#if ENABLED (JERRY_ES2015 )
24632473 JERRY_ASSERT (symbol_name_pos == 0 );
24642474#endif /* ENABLED (JERRY_ES2015) */
0 commit comments