jenkins-bot has submitted this change and it was merged. Change subject: Replace abstract functions that just throw with null ......................................................................
Replace abstract functions that just throw with null Per Timo, this avoids us having pointless code that is never executed, and the replacement notification to the user (that ve.blah.UnicornAnnotation.foo is null and not a method) is sufficiently clear that the issue lies in the lack of existence of the ve.blah.UnicornAnnotation#foo method. Only ones in this repo appear to be in ve.init.mw.ApiResponseCache. Bug: T54482 Change-Id: If44b8d63b8e7b2a5c289fe7278ad54e722b185fa --- M modules/ve-mw/init/ve.init.mw.ApiResponseCache.js 1 file changed, 9 insertions(+), 6 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/ve.init.mw.ApiResponseCache.js b/modules/ve-mw/init/ve.init.mw.ApiResponseCache.js index 6c3058f..ae29d29 100644 --- a/modules/ve-mw/init/ve.init.mw.ApiResponseCache.js +++ b/modules/ve-mw/init/ve.init.mw.ApiResponseCache.js @@ -83,12 +83,14 @@ /** * Fired when a new entry is added to the cache. + * * @event add * @param {Object} entries Cache entries that were added. Object mapping names to data objects. */ /** * Add entries to the cache. + * * @param {Object} entries Object keyed by page title, with the values being data objects * @fires add */ @@ -109,26 +111,27 @@ /** * Get an API request promise to deal with a list of titles + * * @abstract + * @method * @param subqueue * @return {jQuery.Promise} */ - ve.init.mw.ApiResponseCache.prototype.getRequestPromise = function () { - throw new Error( 'Stub, override in subclass' ); - }; + ve.init.mw.ApiResponseCache.prototype.getRequestPromise = null; /** * Process each page in the response of an API request + * * @abstract + * @method * @param {Object} page The page object * @return {Object|undefined} Any relevant info that we want to cache and return. */ - ve.init.mw.ApiResponseCache.prototype.processPage = function () { - throw new Error( 'Stub, override in subclass' ); - }; + ve.init.mw.ApiResponseCache.prototype.processPage = null; /** * Perform any scheduled API requests. + * * @private * @fires add */ -- To view, visit https://gerrit.wikimedia.org/r/203246 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If44b8d63b8e7b2a5c289fe7278ad54e722b185fa Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits