Fix global variable assignment in JS test suite
authorJoona Heikkilä <21111572+cxcorp@users.noreply.github.com>
Wed, 11 May 2022 20:15:34 +0000 (23:15 +0300)
committerJoona Heikkilä <21111572+cxcorp@users.noreply.github.com>
Wed, 11 May 2022 20:15:34 +0000 (23:15 +0300)
In test_imgproc.js, the test_filter suite's last test assigns a variable
to `size` without declaring it with `let`, polluting the global scope.
This commit adds `let` to the statement, so that the variable is scoped
to the test block.

modules/js/test/test_imgproc.js

index 9ba5cd4..e643388 100644 (file)
@@ -948,7 +948,7 @@ QUnit.test('test_filter', function(assert) {
 
         cv.rotate(src, dst, cv.ROTATE_90_CLOCKWISE);
 
-        size = dst.size();
+        let size = dst.size();
         assert.equal(size.height, 2, "ROTATE_HEIGHT");
         assert.equal(size.width, 3, "ROTATE_WIGTH");