Sfoglia il codice sorgente

We don't need that much information about each error. Keep it short.

Piotrek Koszuliński 10 anni fa
parent
commit
847381c23b

+ 4 - 8
packages/ckeditor5-engine/src/document/document.js

@@ -59,14 +59,11 @@ CKEDITOR.define( [
 				 * Only operations with matching versions can be applied.
 				 *
 				 * @error document-applyOperation-wrong-version
-				 * @param {document.Document} doc
-				 * @param {document.operations.Operation} operation
-				 * @param {Number} baseVersion
-				 * @param {Number} documentVersion
+				 * @param {document.operations.Operation} op
 				 */
 				throw new CKEditorError(
 					'document-applyOperation-wrong-version: Only operations with matching versions can be applied.',
-					{ doc: this, operation: operation, baseVersion: operation.baseVersion, documentVersion: this.version } );
+					{ op: operation } );
 			}
 
 			operation._execute();
@@ -91,7 +88,7 @@ CKEDITOR.define( [
 				 */
 				throw new CKEditorError(
 					'document-createRoot-name-exists: Root with specified name already exists.',
-					{ doc: this, name: name }
+					{ name: name }
 				);
 			}
 
@@ -113,12 +110,11 @@ CKEDITOR.define( [
 				 * Root with specified name does not exist.
 				 *
 				 * @error document-createRoot-root-not-exist
-				 * @param {document.Document} doc
 				 * @param {String} name
 				 */
 				throw new CKEditorError(
 					'document-createRoot-root-not-exist: Root with specified name does not exist.',
-					{ doc: this, name: name }
+					{ name: name }
 				);
 			}
 

+ 3 - 6
packages/ckeditor5-engine/src/document/operations/changeoperation.js

@@ -68,13 +68,12 @@ CKEDITOR.define( [ 'document/operations/operation', 'ckeditorerror' ], function(
 				 * Old and new attributes should have the same keys.
 				 *
 				 * @error operation-change-different-keys
-				 * @param {document.operations.ChangeOperation} op
 				 * @param {document.Attribute} oldAttr
 				 * @param {document.Attribute} newAttr
 				 */
 				throw new CKEditorError(
 					'operation-change-different-keys: Old and new attributes should have the same keys.',
-					{ op: this, oldAttr: oldAttr, newAttr: newAttr } );
+					{ oldAttr: oldAttr, newAttr: newAttr } );
 			}
 
 			// Remove or change.
@@ -85,13 +84,12 @@ CKEDITOR.define( [ 'document/operations/operation', 'ckeditorerror' ], function(
 						 * The attribute which should be removed does not exists for the given node.
 						 *
 						 * @error operation-change-no-attr-to-remove
-						 * @param {document.operations.ChangeOperation} op
 						 * @param {document.Node} node
 						 * @param {document.Attribute} attr
 						 */
 						throw new CKEditorError(
 							'operation-change-no-attr-to-remove: The attribute which should be removed does not exists for given node.',
-							{ op: this, node: value.node, attr: oldAttr } );
+							{ node: value.node, attr: oldAttr } );
 					}
 
 					// There is no use in removing attribute if we will overwrite it later.
@@ -110,13 +108,12 @@ CKEDITOR.define( [ 'document/operations/operation', 'ckeditorerror' ], function(
 						 * The attribute with given key already exists for the given node.
 						 *
 						 * @error operation-change-attr-exists
-						 * @param {document.operations.ChangeOperation} op
 						 * @param {document.Node} node
 						 * @param {document.Attribute} attr
 						 */
 						throw new CKEditorError(
 							'operation-change-attr-exists: The attribute with given key already exists.',
-							{ op: this, node: value.node, attr: newAttr } );
+							{ node: value.node, attr: newAttr } );
 					}
 
 					value.node.setAttr( newAttr );

+ 4 - 12
packages/ckeditor5-engine/src/document/operations/moveoperation.js

@@ -65,33 +65,27 @@ CKEDITOR.define( [
 				 * Source position or target position is invalid.
 				 *
 				 * @error operation-move-position-invalid
-				 * @param {document.operations.MoveOperation} op
 				 */
 				throw new CKEditorError(
-					'operation-move-position-invalid: Source position or target position is invalid.',
-					{ op: this }
+					'operation-move-position-invalid: Source position or target position is invalid.'
 				);
 			} else if ( sourceOffset + this.howMany > sourceElement.getChildCount() ) {
 				/**
 				 * The nodes which should be moved do not exist.
 				 *
 				 * @error operation-move-nodes-do-not-exist
-				 * @param {document.operations.MoveOperation} op
 				 */
 				throw new CKEditorError(
-					'operation-move-nodes-do-not-exist: The nodes which should be moved do not exist.',
-					{ op: this }
+					'operation-move-nodes-do-not-exist: The nodes which should be moved do not exist.'
 				);
 			} else if ( sourceElement === targetElement && sourceOffset <= targetOffset && targetOffset < sourceOffset + this.howMany ) {
 				/**
 				 * Trying to move a range of nodes into the middle of that range.
 				 *
 				 * @error operation-move-range-into-itself
-				 * @param {document.operations.MoveOperation} op
 				 */
 				throw new CKEditorError(
-					'operation-move-range-into-itself: Trying to move a range of nodes to the inside of that range.',
-					{ op: this }
+					'operation-move-range-into-itself: Trying to move a range of nodes to the inside of that range.'
 				);
 			} else {
 				var sourcePath = this.sourcePosition.getParentPath();
@@ -105,11 +99,9 @@ CKEDITOR.define( [
 						 * Trying to move a range of nodes into one of nodes from that range.
 						 *
 						 * @error operation-move-node-into-itself
-						 * @param {document.operations.MoveOperation} op
 						 */
 						throw new CKEditorError(
-							'operation-move-node-into-itself: Trying to move a range of nodes into one of nodes from that range.',
-							{ op: this }
+							'operation-move-node-into-itself: Trying to move a range of nodes into one of nodes from that range.'
 						);
 					}
 				}