ArticleTarget: Fix return of getVisualDiffGeneratorPromise

The promise is supposed to return a function that can be used
to lazily generate the visual diff, not the visual diff itself.
This was broken when switching to arrow functions.

Bug: T364635
Change-Id: Ifa971333aa22af346bb62d031dc20afc8979992c
This commit is contained in:
Ed Sanders 2024-05-10 20:53:35 +01:00 committed by Bartosz Dziewoński
parent ee05f4fb9e
commit b247c70a22

View file

@ -1069,7 +1069,7 @@ ve.init.mw.ArticleTarget.prototype.getVisualDiffGeneratorPromise = function () {
return mw.libs.ve.diffLoader.getVisualDiffGeneratorPromise( this.originalDmDocPromise, newRevPromise ); return mw.libs.ve.diffLoader.getVisualDiffGeneratorPromise( this.originalDmDocPromise, newRevPromise );
} else { } else {
return this.originalDmDocPromise.then( return this.originalDmDocPromise.then(
( originalDmDoc ) => new ve.dm.VisualDiff( originalDmDoc, this.getSurface().getModel().getAttachedRoot() ) ( originalDmDoc ) => () => new ve.dm.VisualDiff( originalDmDoc, this.getSurface().getModel().getAttachedRoot() )
); );
} }
} ); } );