Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/224747
Change subject: Remove Processor parameter in fetchExpandedTpl() ...................................................................... Remove Processor parameter in fetchExpandedTpl() It was always PreprocessorRequest. The code is easier to read when the class is named. Also fix a potentially offensive comment. Change-Id: I0e4970452d2626f17d6549c480da2cec6aa8ff4a --- M lib/ext.core.TemplateHandler.js M lib/mediawiki.ApiRequest.js 2 files changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/47/224747/1 diff --git a/lib/ext.core.TemplateHandler.js b/lib/ext.core.TemplateHandler.js index 2703ee3..b5b60ec 100644 --- a/lib/ext.core.TemplateHandler.js +++ b/lib/ext.core.TemplateHandler.js @@ -149,8 +149,7 @@ accumReceiveToksFromChild); // Fetch and process the template expansion this.fetchExpandedTpl( env.page.name || '', - text, PreprocessorRequest, - accumReceiveToksFromSibling, srcHandler); + text, accumReceiveToksFromSibling, srcHandler); } } else { // We don't perform recursive template expansion- something @@ -1129,9 +1128,8 @@ /** * Fetch the preprocessed wikitext for a template-like construct. - * (The 'Processor' argument is a constructor, hence the capitalization.) */ -TemplateHandler.prototype.fetchExpandedTpl = function( title, text, Processor, parentCB, cb ) { +TemplateHandler.prototype.fetchExpandedTpl = function( title, text, parentCB, cb ) { var env = this.manager.env; if ( text in env.pageCache ) { // XXX: store type too (and cache tokens/x-mediawiki) @@ -1146,7 +1144,7 @@ // Start a new request if none is outstanding if ( env.requestQueue[text] === undefined ) { env.tp( 'Note: Starting new request for ' + text ); - env.requestQueue[text] = new Processor( env, title, text ); + env.requestQueue[text] = new PreprocessorRequest( env, title, text ); } // append request, process in document order env.requestQueue[text].once( 'src', cb ); diff --git a/lib/mediawiki.ApiRequest.js b/lib/mediawiki.ApiRequest.js index 517a217..69aae9e 100644 --- a/lib/mediawiki.ApiRequest.js +++ b/lib/mediawiki.ApiRequest.js @@ -903,7 +903,7 @@ } if ( data && data.query ) { - // The API indexes its response by page ID. That's stupid. + // The API indexes its response by page ID. That's inconvenient. newpages = {}; pagenames = {}; pages = data.query.pages; -- To view, visit https://gerrit.wikimedia.org/r/224747 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e4970452d2626f17d6549c480da2cec6aa8ff4a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Tim Starling <tstarl...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits