Fix invalid / unhandled this_literal cases. (#3696)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-04-27 14:54:21 +02:00
committed by GitHub
parent 4e8dac8ce1
commit f254b1a8b7
2 changed files with 32 additions and 11 deletions
+28 -1
View File
@@ -56,10 +56,37 @@ function f() {
try {
eval ("g(this, 'a' = 1)");
assert (false)
assert (false);
} catch (e) {
assert (e instanceof ReferenceError);
}
try {
eval ("g(this, 'a' += 1)");
assert (false);
} catch (e) {
assert (e instanceof ReferenceError);
}
assert (a === 0);
}
f();
function g(a, b)
{
assert(b === "undefined");
}
g(this, typeof undeclared_var)
function h()
{
var done = false;
var o = { a: function () { done = (this === o) } }
function f() {}
with (o) {
f(this, a());
}
assert(done);
}
h();