Bug 1300133 - Fix js-ctypes test harness to print assertion failure message and stack properly. r=bholley

This commit is contained in:
Tooru Fujisawa 2016-09-28 14:12:54 +09:00
Родитель fd9e045dcb
Коммит 70a2171f15
1 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -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) {