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

Commit

Permalink
'DowncastWriter#rename()' method params order changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Sep 10, 2018
1 parent 7be0e23 commit e50028e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/view/downcastwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,10 @@ export default class DowncastWriter {
*
* Since this function creates a new element and removes the given one, the new element is returned to keep reference.
*
* @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
* @param {String} newName New name for element.
* @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
*/
rename( viewElement, newName ) {
rename( newName, viewElement ) {
const newElement = new ContainerElement( newName, viewElement.getAttributes() );

this.insert( Position.createAfter( viewElement ), newElement );
Expand Down
4 changes: 2 additions & 2 deletions tests/view/downcastwriter/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe( 'DowncastWriter', () => {
it( 'should rename given element by inserting a new element in the place of the old one', () => {
const text = foo.getChild( 0 );

writer.rename( foo, 'bar' );
writer.rename( 'bar', foo );

const bar = root.getChild( 0 );

Expand All @@ -35,7 +35,7 @@ describe( 'DowncastWriter', () => {
} );

it( 'should return a reference to the inserted element', () => {
const bar = writer.rename( foo, 'bar' );
const bar = writer.rename( 'bar', foo );

expect( bar ).to.equal( root.getChild( 0 ) );
} );
Expand Down

0 comments on commit e50028e

Please sign in to comment.