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

Changeset 7032

Show
Ignore:
Timestamp:
06/15/07 22:08:44 (1 year ago)
Author:
mislav
Message:

Prototype: Event instance methods are now prepared with #methodize. In functional tests, don't have an element with id "inspect" because window.inspect will then reference it and Object.inspect(window) will fail with hillarious consequences. (Just kidding, they are not hillarious.)

Files:

Legend:

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

    r7029 r7032  
    133133 
    134134  var instanceMethods = $H(Event.Methods).inject({}, function(methods, pair) { 
    135     methods[pair.key] = function() { 
    136       return pair.value.apply(null, [this].concat($A(arguments))); 
    137     }; 
     135    methods[pair.key] = pair.value.methodize(); 
    138136    return methods; 
    139137  }); 
  • spinoffs/prototype/branches/event/test/functional/event.html

    r6999 r7032  
    266266  </script> 
    267267   
    268   <p id="inspect"><code>Object.inspect(event)</code> test</p> 
    269    
    270   <script type="text/javascript"> 
    271     $('inspect').observe('click', function(e){ 
    272       el = $('inspect') 
     268  <p id="obj_inspect"><code>Object.inspect(event)</code> test</p> 
     269   
     270  <script type="text/javascript"> 
     271    $('obj_inspect').observe('click', function(e){ 
     272      el = $('obj_inspect') 
    273273      try { el.passed(Object.inspect(e)) } 
    274274      catch (err) { el.failed('Failed! Error thrown') }