Fix memory leak in ecma_op_object_get_enumerable_property_names (#4136)

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
This commit is contained in:
Csaba Osztrogonác
2020-08-13 13:46:50 +02:00
committed by GitHub
parent ea07052869
commit 409ead7415
3 changed files with 27 additions and 6 deletions
+12
View File
@@ -132,3 +132,15 @@ assert(entries[0][0] === "b");
assert(entries[0][1] === "bar");
assert(handlers.length === 3);
assert(handlers.toString() === "D,D,G");
// exception during enumeration
var obj = {
get a() { throw "error" },
get b() { throw "shouldn't run" }
};
try {
Object.entries(obj);
} catch (err) {
assert(err == "error")
}
+12
View File
@@ -125,3 +125,15 @@ assert(values.length === 1);
assert(values[0] === "bar")
assert(handlers.length === 3);
assert(handlers.toString() === "D,D,G");
// exception during enumeration
var obj = {
get a() { throw "error" },
get b() { throw "shouldn't run" }
};
try {
Object.values(obj);
} catch (err) {
assert(err == "error")
}