test/script/basic/NASHORN-109.js

Print this page

        

@@ -31,12 +31,13 @@
 try {
     if (typeof foo == 'undefined') {
         throw new Error("error");
     }
 } catch (e) {
-    for (i in e.stack) { 
-        print(e.stack[i].methodName + ' ' + e.stack[i].lineNumber);
+    var frames = e.getStackTrace();
+    for (i in frames) {
+        print(frames[i].methodName + ' ' + frames[i].lineNumber);
     }
 }
 
 // just some code at the end.. original test involved
 // line numer of the last line always. Just to check the same..