jenkins-bot has submitted this change and it was merged.

Change subject: Suppress jshint warnings about using 'new' for side-effects.
......................................................................


Suppress jshint warnings about using 'new' for side-effects.

jshint says:

  Some people like to call constructor functions without assigning its
  result to any variable:
    new MyConstructor();
  There is no advantage in this approach over simply calling
  MyConstructor since the object that the operator new creates isn't
  used anywhere so you should generally avoid constructors like this
  one.

However, that's not completely true: in this case the constructor uses
its 'this' object for local state.  So even though the TokenCollector
is discarded after running, you can't invoke TokenCollector directly:
it needs a state object.  Just suppress this warning.  We know what
we're doing here.

Change-Id: I525f5da39be8e90f5b4c3856dbcbe16642ed5d47
---
M js/lib/ext.core.NoIncludeOnly.js
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/js/lib/ext.core.NoIncludeOnly.js b/js/lib/ext.core.NoIncludeOnly.js
index e24dce7..08877d6 100644
--- a/js/lib/ext.core.NoIncludeOnly.js
+++ b/js/lib/ext.core.NoIncludeOnly.js
@@ -180,6 +180,7 @@
 }
 
 function NoInclude( manager, options ) {
+       /* jshint nonew:false */
        new Collector(
                        manager,
                        noIncludeHandler.bind(null, manager, options),
@@ -232,6 +233,7 @@
 // XXX: Preserve includeonly content in meta tag (data attribute) for
 // round-tripping!
 function IncludeOnly( manager, options ) {
+       /* jshint nonew:false */
        new Collector(
                        manager,
                        includeOnlyHandler.bind(null, manager, options),

-- 
To view, visit https://gerrit.wikimedia.org/r/60916
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I525f5da39be8e90f5b4c3856dbcbe16642ed5d47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <wikime...@cscott.net>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to