There's only one refInRefProcessor

* Avoid the unnecessary binding.

Change-Id: I80e558a86eb7197ce39a07062499ec58f170a3af
This commit is contained in:
Arlo Breault 2017-10-23 17:35:49 -04:00 committed by Subramanya Sastry
parent 23db74cd9c
commit 27799ea9b5

View file

@ -385,8 +385,10 @@ References.prototype.tokenHandler = function(manager, pipelineOpts, refsTok, cb)
});
};
References.prototype.extractRefFromNode = function(node, refsData,
refInRefProcessor, referencesAboutId, referencesGroup, nestedRefsHTML) {
var _processRefs;
References.prototype.extractRefFromNode = function(node, refsData, cite,
referencesAboutId, referencesGroup, nestedRefsHTML) {
var nestedInReferences = referencesAboutId !== undefined;
var dp = DU.getDataParsoid(node);
// SSS FIXME: Need to clarify semantics here.
@ -407,7 +409,7 @@ References.prototype.extractRefFromNode = function(node, refsData,
if (dp.hasRefInRef) {
var html = DU.ppToDOM(content);
refInRefProcessor(html);
_processRefs(cite, refsData, html);
content = DU.ppToXML(html, { innerXML: true });
}
@ -637,9 +639,7 @@ References.prototype.serialHandler = {
* <references> <ref>foo</ref> </references>
* <references> <ref>bar</ref> </references>
* -------------------------------------------- */
var _processRefs, _processRefsInReferences;
_processRefsInReferences = function(cite, refsData, node, referencesId,
var _processRefsInReferences = function(cite, refsData, node, referencesId,
referencesGroup, nestedRefsHTML) {
var child = node.firstChild;
while (child !== null) {
@ -647,8 +647,7 @@ _processRefsInReferences = function(cite, refsData, node, referencesId,
if (DU.isElt(child)) {
var typeOf = child.getAttribute('typeof');
if ((/(?:^|\s)mw:Extension\/ref\/Marker(?=$|\s)/).test(typeOf)) {
cite.references.extractRefFromNode(child, refsData,
_processRefs.bind(null, cite, refsData),
cite.references.extractRefFromNode(child, refsData, cite,
referencesId, referencesGroup, nestedRefsHTML);
} else if (child.hasChildNodes()) {
_processRefsInReferences(cite, refsData,
@ -667,8 +666,7 @@ _processRefs = function(cite, refsData, node) {
if (DU.isElt(child)) {
var typeOf = child.getAttribute('typeof');
if ((/(?:^|\s)mw:Extension\/ref\/Marker(?=$|\s)/).test(typeOf)) {
cite.references.extractRefFromNode(child, refsData,
_processRefs.bind(null, cite, refsData));
cite.references.extractRefFromNode(child, refsData, cite);
} else if ((/(?:^|\s)mw:Extension\/references(?=$|\s)/).test(typeOf)) {
var referencesId = child.getAttribute("about");
var referencesGroup = DU.getDataParsoid(child).group;