#3487: getText() not always returns string
-----------------------------+----------------------------------------------
  Reporter:  tobiasz.cudnik  |       Owner:  tobiasz.cudnik   
      Type:  Bug             |      Status:  closed           
  Priority:  Normal          |   Milestone:  CKEditor 3.0     
 Component:  General         |     Version:  SVN (CKEditor)   
Resolution:  fixed           |    Keywords:  Confirmed Review+
-----------------------------+----------------------------------------------
Changes (by tobiasz.cudnik):

  * status:  new => closed
  * resolution:  => fixed


Old description:

> For empty nodes, getText() will return undefined instead of empty string.
> According to jsdoc, this method returns string.
>
> === Sample testcase ===
>  1. Using "Replace Textarea by code" example, fill editor with content:
> {{{
> <h1></h1>
> }}}
>  2. Evaluate this code:
> {{{
> var e = CKEDITOR.instances.editor1;
> var text = e.document.getBody().getChild( 0 ).getText();
> console.log(typeof text);
> CKEDITOR.tools.trim(text);
> }}}
>  3. Results in "TypeError: str is undefined" from CKEDITOR.tools.trim
>
> Please correct me if my point of view is incorrect.

New description:

 For empty nodes, getText() will return undefined instead of empty string.
 According to jsdoc, this method returns string.

 === Sample testcase ===
  1. Using "Replace Textarea by code" example, fill editor with content:
 {{{
 <h1></h1>
 }}}
  2. Evaluate this code:
 {{{
 var e = CKEDITOR.instances.editor1;
 var text = e.document.getBody().getChild( 0 ).getText();
 console.log(typeof text);
 CKEDITOR.tools.trim(text);
 }}}
  3. Results in "TypeError: str is undefined" from CKEDITOR.tools.trim

 Please correct me if my point of view is incorrect.

--

Comment:

 Fixed with [3469].

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/3487#comment:>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to