8015855: test/script/basic/JDK-8012164.js fails on Windows
authorsundar
Tue, 04 Jun 2013 17:33:14 +0530
changeset 17977 b7b3454fa026
parent 17976 5615a31822a1
child 17978 750d0582d8e2
8015855: test/script/basic/JDK-8012164.js fails on Windows Reviewed-by: hannesw, lagergren, jlaskey
nashorn/test/script/basic/JDK-8012164.js
--- a/nashorn/test/script/basic/JDK-8012164.js	Mon Jun 03 12:57:53 2013 -0300
+++ b/nashorn/test/script/basic/JDK-8012164.js	Tue Jun 04 17:33:14 2013 +0530
@@ -38,9 +38,18 @@
       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 + ')'); 
+}