Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of global values #1482

Merged
merged 5 commits into from
Nov 27, 2020
Merged

Refactor of global values #1482

merged 5 commits into from
Nov 27, 2020

Conversation

piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented Nov 27, 2020

Motivation

Using many global values is not a good practise. Global values can be changed everywhere and it makes potential debugging difficult. Local scope is also better for memory usage.

Changes

  • I removed _updatePropsJS() from global scope and moved it to local scope.
  • I changed _globalSetter() na _setGlobalConsole() because this setter was used only to add console to global object, code here. This blocks the possibility to create global values in runtime, we have control on content of global scope now.

Copy link
Member

@jakub-gonet jakub-gonet left a comment

Choose a reason for hiding this comment

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

JS looks good, can't really assess the correctness of C++ and plugin code.

Copy link
Contributor

@karol-bisztyga karol-bisztyga left a comment

Choose a reason for hiding this comment

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

Please wait for @jakub-gonet to approve, for me it looks alright

@piaskowyk piaskowyk marked this pull request as ready for review November 27, 2020 16:04
@piaskowyk piaskowyk merged commit 4b7b180 into master Nov 27, 2020
@piaskowyk piaskowyk deleted the refactor_global_values branch November 27, 2020 20:56
@rpavlovs rpavlovs mentioned this pull request Nov 29, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants