You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/06/18 15:35:19 UTC
[GitHub] [cordova-plugin-screen-orientation] GedasGa commented on a change
in pull request #51: Convert jshint to eslint
GedasGa commented on a change in pull request #51: Convert jshint to eslint
URL: https://github.com/apache/cordova-plugin-screen-orientation/pull/51#discussion_r294695960
##########
File path: tests/tests.js
##########
@@ -139,23 +137,23 @@ exports.defineAutoTests = function() {
});
});
};
-exports.defineManualTests = function(contentEl, createActionButton) {
+exports.defineManualTests = function (contentEl, createActionButton) {
- createActionButton('Listen to orientationchange events', function() {
- window.addEventListener("orientationchange", function(){
- contentEl.innerHTML += '<p>Orientation changed! ' + screen.orientation.type + '</p>';
+ createActionButton('Listen to orientationchange events', function () {
+ window.addEventListener('orientationchange', function () {
+ contentEl.innerHTML += '<p>Orientation changed! ' + window.screen.orientation.type + '</p>';
Review comment:
> What are all these functional changes here that add `window.` before existing code?
It does not change functionality. `screen` is attached to the `window` object. In this case, `eslint` does not recognize the `screen` object, however, it only knows the `window` object and that the `screen` is a part of it. On the other hand, it is also possible to add `screen` as an exception, but I would prefer the following assignment instead.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org