Skip to content

Commit 82c5c2e

Browse files
committed
Get the [[Enumerable]] and [[Configurable]] attributes before removing a property.
Related issue: #115 JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
1 parent 5c012a1 commit 82c5c2e

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

jerry-core/ecma/operations/ecma-objects-general.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,9 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
747747
return ecma_reject (is_throw);
748748
}
749749

750+
bool was_enumerable = ecma_is_property_enumerable (current_p);
751+
bool was_configurable = ecma_is_property_configurable (current_p);
752+
750753
ecma_delete_property (obj_p, current_p);
751754

752755
if (is_current_data_descriptor)
@@ -757,8 +760,8 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
757760
property_name_p,
758761
NULL,
759762
NULL,
760-
ecma_is_property_enumerable (current_p),
761-
ecma_is_property_configurable (current_p));
763+
was_enumerable,
764+
was_configurable);
762765
}
763766
else
764767
{
@@ -767,8 +770,8 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
767770
current_p = ecma_create_named_data_property (obj_p,
768771
property_name_p,
769772
false,
770-
ecma_is_property_enumerable (current_p),
771-
ecma_is_property_configurable (current_p));
773+
was_enumerable,
774+
was_configurable);
772775
}
773776
}
774777
else if (is_property_desc_data_descriptor && is_current_data_descriptor)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2015 Samsung Electronics Co., Ltd.
2+
// Copyright 2015 University of Szeged.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
var v_1 = [,];
17+
Object.defineProperty(v_1, "0", {
18+
set: function() {},
19+
});

0 commit comments

Comments
 (0)