Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8639

Show
Ignore:
Timestamp:
01/14/08 01:22:37 (9 months ago)
Author:
tobie
Message:

prototype: Make Object.inspect more robust.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r8591 r8639  
    11*SVN* 
     2 
     3* Make Object.inspect more robust. [Tobie Langel] 
    24 
    35* Add a description to :test and :dist rake tasks. [Christoph Sturm] 
  • spinoffs/prototype/trunk/src/base.js

    r8149 r8639  
    7272      if (Object.isUndefined(object)) return 'undefined'; 
    7373      if (object === null) return 'null'; 
    74       return object.inspect ? object.inspect() : object.toString(); 
     74      return object.inspect ? object.inspect() : String(object); 
    7575    } catch (e) { 
    7676      if (e instanceof RangeError) return '...'; 
  • spinoffs/prototype/trunk/test/unit/base.html

    r8572 r8639  
    267267      assertEqual("'foo\\\\b\\\'ar'", Object.inspect('foo\\b\'ar')); 
    268268      assertEqual('[]', Object.inspect([])); 
     269      assertNothingRaised(function() { Object.inspect(window.Node) }); 
    269270    }}, 
    270271