Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit aefe787

Browse files
author
Kamil Piechaczek
committed
Docs: Fixed invalid error docs. [skip ci]
1 parent de60dcf commit aefe787

File tree

10 files changed

+34
-51
lines changed

10 files changed

+34
-51
lines changed

src/model/document.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default class Document {
195195
/**
196196
* Root with specified name already exists.
197197
*
198-
* @error document-createRoot-name-exists
198+
* @error model-document-createRoot-name-exists
199199
* @param {module:engine/model/document~Document} doc
200200
* @param {String} name
201201
*/
@@ -254,7 +254,7 @@ export default class Document {
254254
/**
255255
* Root with specified name does not exist.
256256
*
257-
* @error document-getRoot-root-not-exist
257+
* @error model-document-getRoot-root-not-exist
258258
* @param {String} name
259259
*/
260260
throw new CKEditorError(

src/model/markercollection.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,6 @@ class Marker {
268268
*/
269269
getStart() {
270270
if ( !this._liveRange ) {
271-
/**
272-
* Operating on destroyed marker instance.
273-
*
274-
* @error marker-destroyed
275-
*/
276271
throw new CKEditorError( 'marker-destroyed: Operating on destroyed marker instance.' );
277272
}
278273

@@ -286,11 +281,6 @@ class Marker {
286281
*/
287282
getEnd() {
288283
if ( !this._liveRange ) {
289-
/**
290-
* Operating on destroyed marker instance.
291-
*
292-
* @error marker-destroyed
293-
*/
294284
throw new CKEditorError( 'marker-destroyed: Operating on destroyed marker instance.' );
295285
}
296286

@@ -311,11 +301,6 @@ class Marker {
311301
*/
312302
getRange() {
313303
if ( !this._liveRange ) {
314-
/**
315-
* Operating on destroyed marker instance.
316-
*
317-
* @error marker-destroyed
318-
*/
319304
throw new CKEditorError( 'marker-destroyed: Operating on destroyed marker instance.' );
320305
}
321306

@@ -352,3 +337,9 @@ class Marker {
352337
}
353338

354339
mix( Marker, EmitterMixin );
340+
341+
/**
342+
* Operating on destroyed marker instance.
343+
*
344+
* @error marker-destroyed
345+
*/

src/model/node.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ export default class Node {
8484
}
8585

8686
if ( ( pos = this.parent.getChildIndex( this ) ) === null ) {
87-
/**
88-
* The node's parent does not contain this node.
89-
*
90-
* @error node-not-found-in-parent
91-
*/
9287
throw new CKEditorError( 'model-node-not-found-in-parent: The node\'s parent does not contain this node.' );
9388
}
9489

@@ -113,11 +108,6 @@ export default class Node {
113108
}
114109

115110
if ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {
116-
/**
117-
* The node's parent does not contain this node.
118-
*
119-
* @error node-not-found-in-parent
120-
*/
121111
throw new CKEditorError( 'model-node-not-found-in-parent: The node\'s parent does not contain this node.' );
122112
}
123113

@@ -411,3 +401,9 @@ export default class Node {
411401
* @returns {Boolean}
412402
*/
413403
}
404+
405+
/**
406+
* The node's parent does not contain this node.
407+
*
408+
* @error model-node-not-found-in-parent
409+
*/

src/model/position.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class Position {
4747
/**
4848
* Position root invalid.
4949
*
50-
* @error position-root-invalid.
50+
* @error model-position-root-invalid.
5151
*/
5252
throw new CKEditorError( 'model-position-root-invalid: Position root invalid.' );
5353
}
@@ -56,7 +56,7 @@ export default class Position {
5656
/**
5757
* Position path must be an Array with at least one item.
5858
*
59-
* @error position-path-incorrect
59+
* @error model-position-path-incorrect
6060
* @param path
6161
*/
6262
throw new CKEditorError( 'model-position-path-incorrect: Position path must be an Array with at least one item.', { path } );
@@ -688,10 +688,10 @@ export default class Position {
688688
/**
689689
* You can not make position after root.
690690
*
691-
* @error position-after-root
691+
* @error model-position-after-root
692692
* @param {module:engine/model/item~Item} root
693693
*/
694-
throw new CKEditorError( 'model-position-after-root: You can not make position after root.', { root: item } );
694+
throw new CKEditorError( 'model-position-after-root: You cannot make a position after root.', { root: item } );
695695
}
696696

697697
return this.createFromParentAndOffset( item.parent, item.endOffset );
@@ -708,10 +708,10 @@ export default class Position {
708708
/**
709709
* You can not make position before root.
710710
*
711-
* @error position-before-root
711+
* @error model-position-before-root
712712
* @param {module:engine/model/item~Item} root
713713
*/
714-
throw new CKEditorError( 'model-position-before-root: You can not make position before root.', { root: item } );
714+
throw new CKEditorError( 'model-position-before-root: You cannot make a position before root.', { root: item } );
715715
}
716716

717717
return this.createFromParentAndOffset( item.parent, item.startOffset );
@@ -729,7 +729,7 @@ export default class Position {
729729
/**
730730
* Position parent have to be a model element or model document fragment.
731731
*
732-
* @error position-parent-incorrect
732+
* @error model-position-parent-incorrect
733733
*/
734734
throw new CKEditorError( 'model-position-parent-incorrect: Position parent have to be a element or document fragment.' );
735735
}
@@ -766,7 +766,7 @@ export default class Position {
766766
/**
767767
* Cannot create position for document. Root with specified name does not exist.
768768
*
769-
* @error position-fromjson-no-root
769+
* @error model-position-fromjson-no-root
770770
* @param {String} rootName
771771
*/
772772
throw new CKEditorError(

src/model/selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ export default class Selection {
717717
/**
718718
* Trying to add a range that intersects with another range from selection.
719719
*
720-
* @error selection-range-intersects
720+
* @error model-selection-range-intersects
721721
* @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
722722
* @param {module:engine/model/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
723723
*/

src/model/treewalker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default class TreeWalker {
4040
/**
4141
* Neither boundaries nor starting position have been defined.
4242
*
43-
* @error tree-walker-no-start-position
43+
* @error model-tree-walker-no-start-position
4444
*/
4545
throw new CKEditorError( 'model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
4646
}

src/view/position.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ export default class Position {
352352
/**
353353
* You can not make a position after a root.
354354
*
355-
* @error position-after-root
355+
* @error view-position-after-root
356356
* @param {module:engine/view/node~Node} root
357357
*/
358358
throw new CKEditorError( 'view-position-after-root: You can not make position after root.', { root: item } );
@@ -377,7 +377,7 @@ export default class Position {
377377
/**
378378
* You cannot make a position before a root.
379379
*
380-
* @error position-before-root
380+
* @error view-position-before-root
381381
* @param {module:engine/view/node~Node} root
382382
*/
383383
throw new CKEditorError( 'view-position-before-root: You can not make position before root.', { root: item } );

src/view/selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ export default class Selection {
605605
/**
606606
* Trying to add a range that intersects with another range from selection.
607607
*
608-
* @error selection-range-intersects
608+
* @error view-selection-range-intersects
609609
* @param {module:engine/view/range~Range} addedRange Range that was added to the selection.
610610
* @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
611611
*/

src/view/treewalker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default class TreeWalker {
4040
/**
4141
* Neither boundaries nor starting position have been defined.
4242
*
43-
* @error tree-walker-no-start-position
43+
* @error view-tree-walker-no-start-position
4444
*/
4545
throw new CKEditorError( 'view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
4646
}

src/view/writer.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,6 @@ export function move( sourceRange, targetPosition ) {
470470
*/
471471
export function wrap( range, attribute ) {
472472
if ( !( attribute instanceof AttributeElement ) ) {
473-
/**
474-
* Attribute element need to be instance of attribute element.
475-
*
476-
* @error view-writer-wrap-invalid-attribute
477-
*/
478473
throw new CKEditorError( 'view-writer-wrap-invalid-attribute' );
479474
}
480475

@@ -537,11 +532,6 @@ export function wrap( range, attribute ) {
537532
*/
538533
export function wrapPosition( position, attribute ) {
539534
if ( !( attribute instanceof AttributeElement ) ) {
540-
/**
541-
* Attribute element need to be instance of attribute element.
542-
*
543-
* @error view-writer-wrap-invalid-attribute
544-
*/
545535
throw new CKEditorError( 'view-writer-wrap-invalid-attribute' );
546536
}
547537

@@ -665,6 +655,12 @@ export function rename( viewElement, newName ) {
665655
return newElement;
666656
}
667657

658+
/**
659+
* Attribute element need to be instance of attribute element.
660+
*
661+
* @error view-writer-wrap-invalid-attribute
662+
*/
663+
668664
// Returns first parent container of specified {@link module:engine/view/position~Position Position}.
669665
// Position's parent node is checked as first, then next parents are checked.
670666
// Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.

0 commit comments

Comments
 (0)