]> git.proxmox.com Git - pve-manager.git/commitdiff
jslint: fix _ prefix and 'for in' over an object
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 29 Apr 2016 10:06:31 +0000 (12:06 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 29 Apr 2016 15:08:33 +0000 (17:08 +0200)
jslint does not like names that begin with _

also it complains when you do not filter
a for in statement with a hasOwnProperty(property) as first
if statement

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Toolkit.js

index f05f68b9b4a837ba3abc73a546c04a88ec6cd52c..85f1ed50d15afc3e10d3d12352fb4bc80501ebb4 100644 (file)
@@ -239,10 +239,12 @@ Ext.define('Ext.ux.IFrame', {
             try {
                 doc = this.getDoc();
                 if (doc) {
+                   /*jslint nomen: true*/
                     Ext.get(doc).un(this._docListeners);
-                    if (destroying) {
+                   /*jslint nomen: false*/
+                    if (destroying && doc.hasOwnProperty) {
                         for (prop in doc) {
-                            if (doc.hasOwnProperty && doc.hasOwnProperty(prop)) {
+                            if (doc.hasOwnProperty(prop)) {
                                 delete doc[prop];
                             }
                         }
@@ -264,6 +266,7 @@ Ext.define('Ext.ux.IFrame', {
                 // the event reaches listeners on elements like the document body. The effected
                 // mechanisms that depend on this bubbling behavior are listed to the right
                 // of the event.
+               /*jslint nomen: true*/
                 Ext.get(doc).on(
                     me._docListeners = {
                         mousedown: fn, // menu dismisal (MenuManager) and Window onMouseDown (toFront)
@@ -274,6 +277,7 @@ Ext.define('Ext.ux.IFrame', {
                         scope: me
                     }
                 );
+               /*jslint nomen: false*/
             } catch(e) {
                 // cannot do this xss
             }