Skip to content

Commit 1ef9696

Browse files
matedabisrepasics
authored andcommitted
Increase branch coverage: ecma_op_array_get_to_string_at_index (jerryscript-project#9)
Branch coverage: Before: 5/6 After: 6/6 JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu
1 parent e0281de commit 1ef9696

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/jerry/array-prototype-join.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,16 @@ obj_2[3] = 4;
7474
obj_2.join = Array.prototype.join;
7575

7676
assert (obj_2.join() === "1,2,3");
77+
78+
/* ES v5.1 15.4.4.5.7.
79+
Checking behavior when an element throws error */
80+
try {
81+
var f = function () { throw new TypeError("ooo");};
82+
var arr = [0, 1, 2, 3];
83+
Object.defineProperty(arr, '0', { 'get' : f });
84+
Array.prototype.join.call(arr);
85+
assert(false);
86+
} catch (e) {
87+
assert(e instanceof TypeError);
88+
assert(e.message == "ooo");
89+
}

0 commit comments

Comments
 (0)