Commit bb12dbb8 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

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

Based on a patch by Jacek Caban. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e73cf60a
......@@ -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());
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment