mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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
This commit is contained in:
parent
96c2588dae
commit
c12fcd1e60
@ -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) + "]";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user