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

Changeset 8930

Show
Ignore:
Timestamp:
02/26/08 12:53:41 (6 months ago)
Author:
tobie
Message:

prototype: improvements to deprecation.js.

Files:

Legend:

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

    r8859 r8930  
     1* deprecation extension: mark Class.create() used without arguments as deprecated. [Tobie Langel] 
     2 
     3* deprecation extension: mark Event.unloadCache as removed rather than deprecated. [Tobie Langel] 
     4 
     5* deprecation extension: log everything *but* deprecations with console.error. [Tobie Langel] 
     6 
    17* Change deprecation extension to use Firebug's console.warn and console.error. [Andrew Dupont, Tobie Langel] 
    28 
  • spinoffs/prototype/trunk/ext/deprecation/deprecation_test.html

    r8859 r8930  
    213213    testEvent: function(){ with(this) { 
    214214      Event.unloadCache(); 
    215       assertDeprecationNotified('Event.unloadCache has been deprecated.') 
     215      assertRemovalNotified('Event.unloadCache has been deprecated.') 
    216216    }}, 
    217217     
     
    255255      assertRespondsTo('toJSON', h) 
    256256    }}, 
     257 
     258    testClass: function(){ with(this) { 
     259      Class.create(); 
     260      assertDeprecationNotified('The class API has been fully revised and now allows for mixins and inheritance.\n' +  
     261        'You can find more about it here: http://prototypejs.org/learn/class-inheritance'); 
     262      Class.create({}); 
     263      assertNotNotified(); 
     264    }}, 
    257265     
    258266    testLogDeprecationOption: function(){ with(this) { 
  • spinoffs/prototype/trunk/ext/deprecation/deprecation.js

    r8859 r8930  
    6262   
    6363  log: function(message, type) { 
    64     if (type === 'removal') { 
     64    if (type !== 'deprecation') { 
    6565      console.error(message); 
    6666    } else console.warn(message); 
     
    296296    methodName: 'unloadCache', 
    297297    namespace: Event, 
    298     message: 'Event.unloadCache has been deprecated.' 
     298    message: 'Event.unloadCache has been deprecated.', 
     299    type: 'removal' 
     300  }, 
     301   
     302  { 
     303    methodName: 'create', 
     304    namespace: Class, 
     305    message: 'The class API has been fully revised and now allows for mixins and inheritance.\n' +  
     306      'You can find more about it here: http://prototypejs.org/learn/class-inheritance', 
     307    condition: function() { 
     308      return !arguments.length; 
     309    } 
    299310  } 
    300311]);