зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1165533 - Make Mochitest's repr() functionality better distinguish values: include an explicit sign in zero representations, and escape and quote strings to distinguish them from their contents. r=Ms2ger
--HG-- extra : rebase_source : 195eb6c4924627da64afb536e9b77858b498c5c6
This commit is contained in:
Родитель
9f7e9fa682
Коммит
04b22e3bcf
|
@ -86,8 +86,15 @@ if (typeof(repr) == 'undefined') {
|
|||
}
|
||||
} catch (e) {
|
||||
}
|
||||
var ostring;
|
||||
try {
|
||||
var ostring = (o + "");
|
||||
if (o === 0) {
|
||||
ostring = (1 / o > 0) ? "+0" : "-0";
|
||||
} else if (typeof o === "string") {
|
||||
ostring = JSON.stringify(o);
|
||||
} else {
|
||||
ostring = (o + "");
|
||||
}
|
||||
} catch (e) {
|
||||
return "[" + typeof(o) + "]";
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче