commit 1cf11cd1f67b40768582604c8a4801aac79b29c2
parent 949cbbe58647170e57e035ad7f9162f0181abb7d
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Sun, 12 Sep 2010 21:36:14 +0200
Aaaaaaaah toString pour les noeuds, que le débogage devient facile \o/ .
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/editeur.js b/editeur.js
@@ -400,8 +400,17 @@ var créerDocument = function(schémasTypesNoeud) {
créerVue: function(typeVue) {
return this.type().vue.call(this, typeVue);
}
- }
+ };
+ var supplément_toString = {
+ toString: function() {
+ info = "[" + this.nbEnfants() + "]";
+ var t = this.propriété("texte");
+ if (t) info += ' "' + t.get() + '"';
+ return this.type().nom + info;
+ }
+ };
+
function clôture_document(privé_schémasTypesNoeud) {
var privé_pressePapier = null;
@@ -419,7 +428,8 @@ var créerDocument = function(schémasTypesNoeud) {
clôture_type(type),
clôture_propriétés(privé_schémasTypesNoeud[type].propriétés),
supplément_manipulation,
- supplément_vue
+ supplément_vue,
+ supplément_toString
);
}
};