Keep stylesLoaded out of global context #4194
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moved the dialog plugin's stylesLoaded variable into the IIFE to prevent the stylesLoaded variable from being included (and editable) in the global context. This also required moving the "CKEDITOR.plugins.add( 'dialog', { ..." call into the IIFE - where it should have been to begin with.
What is the purpose of this pull request?
Bug fix. The stylesLoaded variable referenced by the dialog plugin was placed on the global scope, which creates two major issues:
Does your PR contain necessary tests?
This PR does NOT contain tests. The ideal test should check for the existence of ANY non-essential global variables after fully loading CKEditor (including all plugins and non-core code) - passing if there are none and failing if there are any. This may need to be a manual test for now
This PR contains
Did you follow the CKEditor 4 code style guide?
PR is consistent with the code style guide
What is the proposed changelog entry for this pull request?
What changes did you make?
Moved all relevant code for the dialog plugin into the IIFE to prevent global context contamination.
Which issues does your PR resolve?
Unknown if it closes any existing issues. This was just an issue caught by my local testing and it was easy to fix so I created a PR for it.