Change deprecation extension to use Firebug's console.warn and console.error. [Andrew Dupont, Tobie Langel]

This commit is contained in:
Andrew Dupont 2008-02-12 19:04:26 +00:00
parent 93d359f543
commit 54a20847c8
3 changed files with 9 additions and 9 deletions

View File

@ -1,3 +1,5 @@
* 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]
* Avoid breaking Element.prototype in browsers which support it. Closes #11004. [cfis, Tobie Langel]

View File

@ -5,7 +5,7 @@
* terms as Prototype (MIT-style license).
* For details, see the Prototype web site: http://www.prototypejs.org/
*
* Include this file right below prototype.js. All warning message
* Include this file right below prototype.js. All warning messages
* will be logged to the console.
*
* Note: You can turn off deprecation messages (and log only removal and
@ -46,7 +46,7 @@ var DeprecationNotifier = {
message: message,
stack: this.getStack(),
type: type.capitalize()
}));
}), type);
return true;
},
@ -55,13 +55,15 @@ var DeprecationNotifier = {
throw new Error("stack");
} catch(e) {
return e.stack.match(this.Regexp).reject(function(path) {
return /(prototype|unittest|deprecation)\.js/.test(path)
return /(prototype|unittest|deprecation)\.js/.test(path);
}).join("\n");
}
},
log: function(message) {
console.log(message)
log: function(message, type) {
if (type === 'removal') {
console.error(message);
} else console.warn(message);
}
};

View File

@ -35,10 +35,6 @@
log.type.push(type);
});
DeprecationNotifier.log = function(message) {
console.log(message.replace(/@[^\n]+/, ''))
}
Array.prototype.beforeLast = function() {
return this[this.length - 2];
}