nashorn/test/script/assert.js
changeset 20929 f2bd18181940
parent 16151 97c1e756ae1e
child 24719 f726e9d67629
--- a/nashorn/test/script/assert.js	Wed Oct 09 17:53:22 2013 +0200
+++ b/nashorn/test/script/assert.js	Thu Oct 10 11:48:56 2013 +0200
@@ -61,3 +61,22 @@
         }
     }
 });
+
+Object.defineProperty(this, "printError", {
+    configuable: true,
+    enumerable: false,
+    writable: true,
+    value: function (e) {
+        var msg = e.message;
+        var str = e.name + ':';
+        if (e.lineNumber > 0) {
+            str += e.lineNumber + ':';
+        }
+        if (e.columnNumber > 0) {
+            str += e.columnNumber + ':';
+        }
+        str += msg.substring(msg.indexOf(' ') + 1);
+        print(str);
+    }
+});
+