From 54a20847c8d37342800d43b625ed54bd02c3ca42 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 12 Feb 2008 19:04:26 +0000 Subject: [PATCH] Change deprecation extension to use Firebug's console.warn and console.error. [Andrew Dupont, Tobie Langel] --- CHANGELOG | 2 ++ ext/deprecation/deprecation.js | 12 +++++++----- ext/deprecation/deprecation_test.html | 4 ---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 631e7e7..51fd114 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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] diff --git a/ext/deprecation/deprecation.js b/ext/deprecation/deprecation.js index 3e625e3..e9596a6 100644 --- a/ext/deprecation/deprecation.js +++ b/ext/deprecation/deprecation.js @@ -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); } }; diff --git a/ext/deprecation/deprecation_test.html b/ext/deprecation/deprecation_test.html index aa7a0cd..3824323 100644 --- a/ext/deprecation/deprecation_test.html +++ b/ext/deprecation/deprecation_test.html @@ -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]; }