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

Changeset 6614

Show
Ignore:
Timestamp:
04/28/07 22:26:01 (1 year ago)
Author:
sam
Message:

Fix logging in the event branch functional tests for Safari.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/branches/event/src/base.js

    r6194 r6614  
    2121      if (object === undefined) return 'undefined'; 
    2222      if (object === null) return 'null'; 
    23       return object.inspect ? object.inspect() : object.toString(); 
     23      return object.inspect ? object.inspect() :  
     24        object.toString ? object.toString() : '<unknown>'; 
    2425    } catch (e) { 
    2526      if (e instanceof RangeError) return '...'; 
  • spinoffs/prototype/branches/event/test/functional/event.html

    r6613 r6614  
    6464  <script type="text/javascript"> 
    6565    Element.addMethods({ 
    66       passed: function(el, message)
    67         el = $(el) 
    68         el.className = 'passed' 
    69         el.update(message || 'Test passed!') 
     66      passed: function(el, message)
     67        el = $(el); 
     68        el.className = 'passed'; 
     69        el.update(message || 'Test passed!'); 
    7070      }, 
    71       failed: function(el, message){ 
    72         el = $(el) 
    73         el.className = 'failed' 
    74         el.update(message || 'Test failed') 
     71       
     72      failed: function(el, message) { 
     73        el = $(el); 
     74        el.className = 'failed'; 
     75        el.update(message || 'Test failed'); 
    7576      } 
    76     }) 
     77    }); 
    7778     
    78     function log(obj){ 
    79       var line, all = [] 
    80       for(prop in obj){ 
    81         if (/^[A-Z]|[XY]$/.test(prop) || typeof obj[prop] == 'function') continue 
    82         line = prop + ": " 
    83         line += typeof obj[prop] == 'function' ? '<i>(function)</i>' : obj[prop] 
    84         all.push(line) 
     79    function log(obj) { 
     80      var line, all = []; 
     81      for (prop in obj) { 
     82        if (/^[A-Z]|[XY]$/.test(prop) || typeof obj[prop] == 'function') continue; 
     83        line = prop + ": " + Object.inspect(obj[prop]); 
     84        all.push(line.escapeHTML()); 
    8585      } 
    86       $('log').update(all.join('<br />')) 
     86      $('log').update(all.join('<br />')); 
    8787    } 
    8888  </script>