Use console.warn for JS deprecation notices so that the user can see a stack trace

This commit is contained in:
Kijin Sung 2023-08-30 22:38:41 +09:00
parent 0d8b8a51dd
commit 79dd9ae45e
2 changed files with 10 additions and 10 deletions

View file

@ -5,8 +5,8 @@
**/
function xDeprecate(funcName) {
var msg = 'DEPRECATED : '+funcName+'() is deprecated in Rhymix.';
if (typeof console == 'object' && typeof console.log == 'function') {
console.log(msg);
if (typeof console == 'object' && typeof console.warn == 'function') {
console.warn(msg);
}
}

View file

@ -31,8 +31,8 @@
window.exec_xml = $.exec_xml = function(module, act, params, callback_success, return_fields, callback_success_arg, fo_obj) {
// Display deprecation notice.
if (typeof console == "object" && typeof console.log == "function") {
console.log("DEPRECATED : exec_xml() is deprecated in Rhymix. Use exec_json() instead.");
if (typeof console == "object" && typeof console.warn == "function") {
console.warn("DEPRECATED : exec_xml() is deprecated in Rhymix. Use exec_json() instead.");
}
// Define callback functions.
@ -86,8 +86,8 @@
if (data.error != "0") {
// This way of calling an error handler is deprecated. Do not use it.
if ($.isFunction($.exec_xml.onerror)) {
if (typeof console == "object" && typeof console.log == "function") {
console.log("DEPRECATED : $.exec_xml.onerror() is deprecated in Rhymix.");
if (typeof console == "object" && typeof console.warn == "function") {
console.warn("DEPRECATED : $.exec_xml.onerror() is deprecated in Rhymix.");
}
return $.exec_xml.onerror(module, act, data, callback_success, return_fields, callback_success_arg, fo_obj);
}
@ -337,8 +337,8 @@
* Function for compatibility with XE's exec_html()
*/
window.exec_html = $.fn.exec_html = function() {
if (typeof console == "object" && typeof console.log == "function") {
console.log("DEPRECATED : exec_html() is obsolete in Rhymix.");
if (typeof console == "object" && typeof console.warn == "function") {
console.warn("DEPRECATED : exec_html() is obsolete in Rhymix.");
}
};
@ -451,8 +451,8 @@
function send_by_form(url, params) {
// This function is deprecated!
if (typeof console == "object" && typeof console.log == "function") {
console.log("DEPRECATED : send_by_form() is deprecated in Rhymix.");
if (typeof console == "object" && typeof console.warn == "function") {
console.warn("DEPRECATED : send_by_form() is deprecated in Rhymix.");
}
// Create the hidden iframe.