Skip to content

Fix global variable assignment in JS test suite#21974

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
cxcorp:fix-js-test-globals
May 12, 2022
Merged

Fix global variable assignment in JS test suite#21974
opencv-pushbot merged 1 commit intoopencv:3.4from
cxcorp:fix-js-test-globals

Conversation

@cxcorp
Copy link
Copy Markdown
Contributor

@cxcorp cxcorp commented May 11, 2022

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 PR adds let to the statement, so that the variable is scoped to the test block.

Before:
image

After:
image

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builder=Custom
build_image:Custom=javascript
buildworker:Custom=linux-f1

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.
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@opencv-pushbot opencv-pushbot added this to the 3.4.18 milestone May 12, 2022
@opencv-pushbot opencv-pushbot merged commit 4af8e5c into opencv:3.4 May 12, 2022
@cxcorp cxcorp deleted the fix-js-test-globals branch May 12, 2022 08:45
@cxcorp cxcorp restored the fix-js-test-globals branch May 12, 2022 08:45
@opencv-pushbot opencv-pushbot mentioned this pull request May 14, 2022
@alalek alalek mentioned this pull request Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants