提交 5e99fd36 编写于 作者: S sundar

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

Reviewed-by: hannesw, lagergren, jlaskey
上级 ae72e33a
...@@ -38,9 +38,18 @@ function error() { ...@@ -38,9 +38,18 @@ function error() {
throw new Error('foo'); throw new Error('foo');
} catch (e) { } catch (e) {
for (i in e.stack) { for (i in e.stack) {
print(e.stack[i]); printFrame(e.stack[i]);
} }
} }
} }
func(); 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 + ')');
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册