Improve eval call parsing. (#3330)

Eval calls are recognised when the eval identifier is encapsulated in brackets.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-11-19 15:55:53 +01:00
committed by Robert Fancsik
parent a1189cfb62
commit 70566a52fb
5 changed files with 270 additions and 22 deletions
+30
View File
@@ -122,3 +122,33 @@ catch(e)
code = 'eval("(function (){})")';
code = "eval ('" + code + "')";
eval (code);
// Eval enclosed in brackets is still an eval.
var p1 = 0;
function f3() {
var p1 = 5;
(eval)("assert(p1 === 5)");
}
f3();
function f4() {
var p1 = 6;
((eval))("assert(p1 === 6)");
}
f4();
function f5() {
var p1 = 7;
(((((eval)))("assert(p1 === 7)")));
}
f5();
function f6() {
var p1 = 8;
var e = eval;
e("assert(p1 === 0)");
(((((e)))("assert(p1 === 0)")));
}
f6();