@@ -747,6 +747,9 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
747
747
return ecma_reject (is_throw);
748
748
}
749
749
750
+ bool was_enumerable = ecma_is_property_enumerable (current_p);
751
+ bool was_configurable = ecma_is_property_configurable (current_p);
752
+
750
753
ecma_delete_property (obj_p, current_p);
751
754
752
755
if (is_current_data_descriptor)
@@ -757,8 +760,8 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
757
760
property_name_p,
758
761
NULL ,
759
762
NULL ,
760
- ecma_is_property_enumerable (current_p) ,
761
- ecma_is_property_configurable (current_p) );
763
+ was_enumerable ,
764
+ was_configurable );
762
765
}
763
766
else
764
767
{
@@ -767,8 +770,8 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
767
770
current_p = ecma_create_named_data_property (obj_p,
768
771
property_name_p,
769
772
false ,
770
- ecma_is_property_enumerable (current_p) ,
771
- ecma_is_property_configurable (current_p) );
773
+ was_enumerable ,
774
+ was_configurable );
772
775
}
773
776
}
774
777
else if (is_property_desc_data_descriptor && is_current_data_descriptor)
@@ -819,28 +822,28 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
819
822
// 12.
820
823
if (property_desc_p->is_value_defined )
821
824
{
822
- JERRY_ASSERT (is_current_data_descriptor );
825
+ JERRY_ASSERT (current_p-> type == ECMA_PROPERTY_NAMEDDATA );
823
826
824
827
ecma_named_data_property_assign_value (obj_p, current_p, property_desc_p->value );
825
828
}
826
829
827
830
if (property_desc_p->is_writable_defined )
828
831
{
829
- JERRY_ASSERT (is_current_data_descriptor );
832
+ JERRY_ASSERT (current_p-> type == ECMA_PROPERTY_NAMEDDATA );
830
833
831
834
ecma_set_property_writable_attr (current_p, property_desc_p->is_writable );
832
835
}
833
836
834
837
if (property_desc_p->is_get_defined )
835
838
{
836
- JERRY_ASSERT (is_current_accessor_descriptor );
839
+ JERRY_ASSERT (current_p-> type == ECMA_PROPERTY_NAMEDACCESSOR );
837
840
838
841
ecma_set_named_accessor_property_getter (obj_p, current_p, property_desc_p->get_p );
839
842
}
840
843
841
844
if (property_desc_p->is_set_defined )
842
845
{
843
- JERRY_ASSERT (is_current_accessor_descriptor );
846
+ JERRY_ASSERT (current_p-> type == ECMA_PROPERTY_NAMEDACCESSOR );
844
847
845
848
ecma_set_named_accessor_property_setter (obj_p, current_p, property_desc_p->set_p );
846
849
}
0 commit comments