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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user