Bug 952708 - console.log escapes special characters. r=vporof

This commit is contained in:
Mihai Sucan 2014-01-07 22:50:30 +02:00
parent 2688233a2a
commit 61a08a1e90
6 changed files with 10 additions and 10 deletions

View File

@ -3219,7 +3219,7 @@ VariablesView.stringifiers.byType = {
if (noStringQuotes) {
return aGrip;
}
return uneval(aGrip);
return '"' + aGrip + '"';
},
longString: function({initial}, {noStringQuotes, noEllipsis}) {
@ -3227,7 +3227,7 @@ VariablesView.stringifiers.byType = {
if (noStringQuotes) {
return initial + ellipsis;
}
let result = uneval(initial);
let result = '"' + initial + '"';
if (!ellipsis) {
return result;
}

View File

@ -118,7 +118,7 @@ function testJSTerm(hud)
jsterm.clearOutput();
jsterm.execute("pprint({b:2, a:1})");
checkResult("\" b: 2\\n a: 1\"", "pprint()");
checkResult("\" b: 2\n a: 1\"", "pprint()");
yield undefined;
// check instanceof correctness, bug 599940
@ -154,7 +154,7 @@ function testJSTerm(hud)
// bug 614561
jsterm.clearOutput();
jsterm.execute("pprint('hi')");
checkResult("\" 0: \\\"h\\\"\\n 1: \\\"i\\\"\"", "pprint('hi')");
checkResult("\" 0: \"h\"\n 1: \"i\"\"", "pprint('hi')");
yield undefined;
// check that pprint(function) shows function source, bug 618344

View File

@ -22,14 +22,14 @@ let inputTests = [
// 0
{
input: "'hello \\nfrom \\rthe \\\"string world!'",
output: "\"hello \\nfrom \\rthe \\\"string world!\"",
output: "\"hello \nfrom \rthe \"string world!\"",
},
// 1
{
// unicode test
input: "'\xFA\u1E47\u0129\xE7\xF6d\xEA \u021B\u0115\u0219\u0165'",
output: "\"\\xFA\\u1E47\\u0129\\xE7\\xF6d\\xEA \\u021B\\u0115\\u0219\\u0165\"",
output: "\"\xFA\u1E47\u0129\xE7\xF6d\xEA \u021B\u0115\u0219\u0165\"",
},
// 2
@ -81,7 +81,7 @@ let inputTests = [
{
input: "/foo?b*\\s\"ar/igym",
output: "/foo?b*\\s\"ar/gimy",
printOutput: "/foo?b*\\\\s\\\"ar/gimy",
printOutput: "/foo?b*\\s\"ar/gimy",
inspectable: true,
},

View File

@ -12,7 +12,7 @@ let inputTests = [
{
input: "document.getElementById",
output: "function getElementById()",
printOutput: "function getElementById() {\\n [native code]\\n}",
printOutput: "function getElementById() {\n [native code]\n}",
inspectable: true,
variablesViewLabel: "getElementById()",
},

View File

@ -126,7 +126,7 @@ let inputTests = [
// 13
{
input: "document.body.dataset",
output: 'DOMStringMap {preview: "zuzu\\"<a>foo"}',
output: 'DOMStringMap {preview: "zuzu"<a>foo"}',
printOutput: "[object DOMStringMap]",
inspectable: true,
variablesViewLabel: "DOMStringMap[1]",

View File

@ -50,7 +50,7 @@ let inputTests = [
{
input: "testDOMException()",
output: 'DOMException [SyntaxError: "An invalid or illegal string was specified"',
printOutput: '[Exception... \\"An invalid or illegal string was specified\\"',
printOutput: '[Exception... "An invalid or illegal string was specified"',
inspectable: true,
variablesViewLabel: "SyntaxError",
},