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

Alexandre Julliard julliard at winehq.org
Fri Jun 18 14:45:53 CDT 2021


Module: wine
Branch: master
Commit: bb12dbb892ee7a616038d77ac670ddb044133195
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bb12dbb892ee7a616038d77ac670ddb044133195

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Fri Jun 18 15:50:20 2021 +0300

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

Based on a patch by Jacek Caban.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 2fb115556e5..dd6ea76c77a 100644
--- a/dlls/mshtml/tests/es5.js
+++ b/dlls/mshtml/tests/es5.js
@@ -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());
+});




More information about the wine-cvs mailing list