Based on a patch by Jacek Caban.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v2: - added patch.
dlls/mshtml/tests/es5.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index a40ff05dbbb..a46d2096b8e 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1363,3 +1363,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()); +});