prototype: improvements to deprecation.js.
This commit is contained in:
parent
54a20847c8
commit
088c049885
|
@ -1,3 +1,9 @@
|
|||
* deprecation extension: mark Class.create() used without arguments as deprecated. [Tobie Langel]
|
||||
|
||||
* deprecation extension: mark Event.unloadCache as removed rather than deprecated. [Tobie Langel]
|
||||
|
||||
* deprecation extension: log everything *but* deprecations with console.error. [Tobie Langel]
|
||||
|
||||
* Change deprecation extension to use Firebug's console.warn and console.error. [Andrew Dupont, Tobie Langel]
|
||||
|
||||
* Make tagName comparisons XHTML-compliant. Closes #11012, #11013, #11014. [cfis, Tobie Langel]
|
||||
|
|
|
@ -61,7 +61,7 @@ var DeprecationNotifier = {
|
|||
},
|
||||
|
||||
log: function(message, type) {
|
||||
if (type === 'removal') {
|
||||
if (type !== 'deprecation') {
|
||||
console.error(message);
|
||||
} else console.warn(message);
|
||||
}
|
||||
|
@ -295,7 +295,18 @@ DeprecationNotifier.init([
|
|||
{
|
||||
methodName: 'unloadCache',
|
||||
namespace: Event,
|
||||
message: 'Event.unloadCache has been deprecated.'
|
||||
message: 'Event.unloadCache has been deprecated.',
|
||||
type: 'removal'
|
||||
},
|
||||
|
||||
{
|
||||
methodName: 'create',
|
||||
namespace: Class,
|
||||
message: 'The class API has been fully revised and now allows for mixins and inheritance.\n' +
|
||||
'You can find more about it here: http://prototypejs.org/learn/class-inheritance',
|
||||
condition: function() {
|
||||
return !arguments.length;
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
|
||||
testEvent: function(){ with(this) {
|
||||
Event.unloadCache();
|
||||
assertDeprecationNotified('Event.unloadCache has been deprecated.')
|
||||
assertRemovalNotified('Event.unloadCache has been deprecated.')
|
||||
}},
|
||||
|
||||
testHash: function(){ with(this) {
|
||||
|
@ -254,6 +254,14 @@
|
|||
h.set('toJSON', 'arg'); // make sure hash methods are not overwritten
|
||||
assertRespondsTo('toJSON', h)
|
||||
}},
|
||||
|
||||
testClass: function(){ with(this) {
|
||||
Class.create();
|
||||
assertDeprecationNotified('The class API has been fully revised and now allows for mixins and inheritance.\n' +
|
||||
'You can find more about it here: http://prototypejs.org/learn/class-inheritance');
|
||||
Class.create({});
|
||||
assertNotNotified();
|
||||
}},
|
||||
|
||||
testLogDeprecationOption: function(){ with(this) {
|
||||
DeprecationNotifier.logDeprecation = false;
|
||||
|
|
Loading…
Reference in New Issue