TemplateToolkit doesn't support .defined on objects. Also, stringify objects early to avoid trying to apply .replace, etc, on them.

This commit is contained in:
ian%hixie.ch 2003-01-10 00:19:47 +00:00
Родитель 3f21fb08d5
Коммит f45fb75c09
1 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

@ -109,16 +109,19 @@ sub getDefaultString {
debugDumpVarsVariables.\${key} = 'empty array';
END;
ELSE;
IF (!variable.defined);
IF (!variable.ref and !variable.defined);
debugDumpVarsVariables.\${key} = 'undefined';
ELSIF (variable.search('^[0-9]+(?:\\\\.[0+9]+)?\$'));
debugDumpVarsVariables.\${key} = variable;
ELSE;
debugDumpVarsVariables.\${key} =
'\\'' _
variable.replace('\\\\\\\\', '\\\\\\\\')
.replace('\\'', '\\\\\\'') _
'\\'';
variable = "\$variable";
IF (variable.search('^[0-9]+(?:\\\\.[0+9]+)?\$'));
debugDumpVarsVariables.\${key} = variable;
ELSE;
debugDumpVarsVariables.\${key} =
'\\'' _
variable.replace('\\\\\\\\', '\\\\\\\\')
.replace('\\'', '\\\\\\'') _
'\\'';
END;
END;
END;
IF key.length > debugDumpVarsMaxLength;