mshtml/tests: Add test for multiple JS scope instances.

Based on a patch by Jacek Caban.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-06-18 15:50:20 +03:00 committed by Alexandre Julliard
parent e73cf60a74
commit bb12dbb892

View file

@ -1319,3 +1319,25 @@ sync_test("declaration_let", function() {
ok(a == 3, "a != 3");
});
sync_test("let scope instances", function() {
var a = [], i;
for(i = 0; i < 3; i++) {
a[i] = function() { return v; };
let v = i;
}
for(i = 0; i < 3; i++)
ok(a[i]() == i, "a[" + i + "]() = " + a[i]());
ok(typeof f == 'undefined', "f is defined");
for(i = 0; i < 3; i++) {
function f() { return v; }
a[i] = f;
let v = i;
}
for(i = 0; i < 3; i++)
ok(a[i]() == i, "a[" + i + "]() = " + a[i]());
ok(f() == 2, "f() = " + f());
});