mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 1253859
- Properly stringify thrown symbol in console. r=fitzgen
This commit is contained in:
parent
0ec9e41aa6
commit
a9ce01a3e6
@ -888,7 +888,7 @@ WebConsoleActor.prototype =
|
||||
error.unsafeDereference();
|
||||
errorMessage = unsafeDereference && unsafeDereference.toString
|
||||
? unsafeDereference.toString()
|
||||
: "" + error;
|
||||
: String(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,21 @@ function onAttach(aState, aResponse)
|
||||
});
|
||||
});
|
||||
|
||||
let symbolTestValues = [
|
||||
["Symbol.iterator", "Symbol(Symbol.iterator)"],
|
||||
["Symbol('foo')", "Symbol(foo)"],
|
||||
["Symbol()", "Symbol()"],
|
||||
];
|
||||
symbolTestValues.forEach(function([expr, message]) {
|
||||
tests.push(function() {
|
||||
aState.client.evaluateJS("throw " + expr + ";", function(aResponse) {
|
||||
is(aResponse.exceptionMessage, message,
|
||||
"response.exception for throw " + expr);
|
||||
nextTest();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
runTests(tests, endTest.bind(null, aState));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user