Fix construction of Arguments object: add handler for 'caller' property that throws TypeError upon read or write access.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-29 22:30:47 +03:00
parent ec02ace0e9
commit 71bac03d51
2 changed files with 21 additions and 2 deletions
+13
View File
@@ -109,6 +109,19 @@ fn_expr = function (a, b, c)
assert (arguments[0] === 'new value');
assert (arguments[1] === 'p');
assert (arguments[2] === 'q');
function check_type_error_for_property (obj, prop) {
try {
var v = obj[prop];
assert (false);
}
catch (e) {
assert (e instanceof TypeError);
}
}
check_type_error_for_property (arguments, 'caller');
check_type_error_for_property (arguments, 'callee');
}
fn_expr (1);