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:
Ruben Ayrapetyan
2015-06-29 23:42:49 +03:00
committed by Evgeny Gavrin
parent 7b90d54490
commit 0422e2230d
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -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 () {}");