diff --git a/js/src/jit-test/tests/basic/exception-column-number.js b/js/src/jit-test/tests/basic/exception-column-number.js index f83274a0e936..c1dc99a31ee4 100644 --- a/js/src/jit-test/tests/basic/exception-column-number.js +++ b/js/src/jit-test/tests/basic/exception-column-number.js @@ -3,6 +3,9 @@ try { } catch (e) { assertEq(e.columnNumber, 5); // Filter the filename from the stack, since we have no clue what - // to expect there. - assertEq(e.stack.replace(/[^:]*/, ""), ":2:5\n"); + // to expect there. Search for ':' from the end, because the file + // path may contain ':' in it. + var lastColon = e.stack.lastIndexOf(':'); + var afterPath = e.stack.lastIndexOf(':', lastColon - 1); + assertEq(e.stack.substring(afterPath), ":2:5\n"); }