Fix syntax check for case 'eval' or 'arguments' identifiers are used for name of function in strict mode.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
7b90d54490
commit
0422e2230d
@@ -23,3 +23,16 @@ assert ((function() {
|
||||
}
|
||||
return f();
|
||||
})() === 'bar');
|
||||
|
||||
function check_syntax_error (s) {
|
||||
try {
|
||||
eval (s);
|
||||
assert (false);
|
||||
}
|
||||
catch (e) {
|
||||
assert (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
|
||||
check_syntax_error ("'use strict'; function arguments () {}");
|
||||
check_syntax_error ("'use strict'; var l = function arguments () {}");
|
||||
|
||||
Reference in New Issue
Block a user