8015855: test/script/basic/JDK-8012164.js fails on Windows

Reviewed-by: hannesw, lagergren, jlaskey
This commit is contained in:
Athijegannathan Sundararajan 2013-06-04 17:33:14 +05:30
parent fcf3353ddf
commit 5817f439ab

View File

@ -38,9 +38,18 @@ function error() {
throw new Error('foo');
} catch (e) {
for (i in e.stack) {
print(e.stack[i]);
printFrame(e.stack[i]);
}
}
}
func();
// See JDK-8015855: test/script/basic/JDK-8012164.js fails on Windows
// Replace '\' to '/' in class and file names of StackFrameElement objects
function printFrame(stack) {
var fileName = stack.fileName.replace(/\\/g, '/');
var className = stack.className.replace(/\\/g, '/');
print(className + '.' + stack.methodName + '(' +
fileName + ':' + stack.lineNumber + ')');
}