зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1300133 - Fix js-ctypes test harness to print assertion failure message and stack properly. r=bholley
This commit is contained in:
Родитель
fd9e045dcb
Коммит
70a2171f15
|
@ -18,17 +18,31 @@ var Components = {
|
|||
};
|
||||
|
||||
function do_throw(message, stack) {
|
||||
do_print("error: " + message);
|
||||
do_print("stack: " + (stack ? stack : new Error().stack));
|
||||
throw message;
|
||||
}
|
||||
|
||||
function do_check_neq(left, right, stack) {
|
||||
if (left == right)
|
||||
if (left == right) {
|
||||
var text = "do_check_neq failed";
|
||||
try {
|
||||
text += ": " + left + " == " + right;
|
||||
} catch (e) {
|
||||
}
|
||||
do_throw(text, stack);
|
||||
}
|
||||
}
|
||||
|
||||
function do_check_eq(left, right, stack) {
|
||||
if (left != right)
|
||||
if (left != right) {
|
||||
var text = "do_check_eq failed";
|
||||
try {
|
||||
text += ": " + left + " != " + right;
|
||||
} catch (e) {
|
||||
}
|
||||
do_throw(text, stack);
|
||||
}
|
||||
}
|
||||
|
||||
function do_check_true(condition, stack) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче