From: Greg Burri Date: Wed, 16 Jul 2008 20:01:31 +0000 (+0000) Subject: DEL fichier de debug debug.js :'( X-Git-Tag: 1.1.0~82 X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=2a717d2ba853bc11778d5bc9772604e0f0e22dc0;p=euphorik.git DEL fichier de debug debug.js :'( --- diff --git a/js/debug.js b/js/debug.js deleted file mode 100644 index c598eed..0000000 --- a/js/debug.js +++ /dev/null @@ -1,90 +0,0 @@ -// coding: utf-8 -// Copyright 2008 Grégory Burri -// -// This file is part of Euphorik. -// -// Euphorik is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Euphorik is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Euphorik. If not, see . - -/** - * Affiche un objet quelconque sur la sortie du navigateur. - */ -var dumpObj = function(obj, name) -{ - if (typeof(dump) == "undefined") - return - - dump("---" + (name == undefined ? "" : " : " + name) + "\n") - dump(obj2text(obj)) - dump("\n---\n") -} - -var obj2text = function(obj, curDepth) -{ - if (curDepth == undefined) - curDepth = 0; - - var acc = "" - - if (obj == undefined) - { - acc += "" - } - else if (typeof(obj) == "string") - { - acc += "\"" + obj + "\"" - } - else if (obj.length != undefined) // array - { - acc += "[" - - var i = 0 - for (; i < obj.length; i++) - { - if (i != 0) acc += "," - acc += "\n" + indent(curDepth + 1, obj2text(obj[i], curDepth + 1)) - } - - acc += (i == 0 ? "]" : "\n" + indent(curDepth, "]")) - } - else if (typeof(obj) == "object") - { - acc += "{" - var i = 0 - for (prop in obj) - { - if (i != 0) acc += "," - acc += "\n" + indent(curDepth + 1, prop + " : " + obj2text(obj[prop], curDepth + 1)) - i += 1 - } - acc += "\n" + indent(curDepth, "}") - } - else if (typeof(obj) == "function") - { - acc += "" - } - else // value - { - acc += obj - } - - return acc -} - -var indent = function(depth, text) -{ - var indentText = "" - for (var i = 0; i < depth * 3; i++) - indentText += " " - return indentText + text -}