Alex Monk has uploaded a new change for review.
https://gerrit.wikimedia.org/r/235387
Change subject: Make ve.ui.Sequence#execute return false if the command is
missing
......................................................................
Make ve.ui.Sequence#execute return false if the command is missing
Bug: T106060
Change-Id: If4b466865f12a6b256c85b9a23d29a51c5125910
---
M src/ui/ve.ui.Sequence.js
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/87/235387/1
diff --git a/src/ui/ve.ui.Sequence.js b/src/ui/ve.ui.Sequence.js
index 9721fc4..fe3f428 100644
--- a/src/ui/ve.ui.Sequence.js
+++ b/src/ui/ve.ui.Sequence.js
@@ -64,7 +64,6 @@
*
* @param {ve.ui.Surface} surface surface
* @return {boolean} The command executed
- * @throws {Error} Command not found
*/
ve.ui.Sequence.prototype.execute = function ( surface, range ) {
var stripRange, executed, stripFragment, selection,
@@ -72,7 +71,7 @@
command = ve.init.target.commandRegistry.lookup(
this.getCommandName() );
if ( !command ) {
- throw new Error( 'Command not found: ' + this.getCommandName()
) ;
+ return false;
}
if ( this.strip ) {
--
To view, visit https://gerrit.wikimedia.org/r/235387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4b466865f12a6b256c85b9a23d29a51c5125910
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits