[gjs] coverage: Throw an Error, not a string.



commit 78fd5a17c8da5c59b9215f2c14c93ea6505ffef9
Author: Sam Spilsbury <smspillaz gmail com>
Date:   Thu Jan 15 14:37:36 2015 +0800

    coverage: Throw an Error, not a string.
    
    Error gives us a backtrace.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743009

 installed-tests/js/testCoverage.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/installed-tests/js/testCoverage.js b/installed-tests/js/testCoverage.js
index eed37dc..9aa0810 100644
--- a/installed-tests/js/testCoverage.js
+++ b/installed-tests/js/testCoverage.js
@@ -8,9 +8,9 @@ function parseScriptForExpressionLines(script) {
 
 function assertArrayEquals(actual, expected, assertion) {
     if (actual.length != expected.length)
-        throw "Arrays not equal length. Actual array was " +
-                actual.length + " and Expected array was " +
-                expected.length;
+        throw new Error("Arrays not equal length. Actual array was " +
+                        actual.length + " and Expected array was " +
+                        expected.length);
 
     for (let i = 0; i < actual.length; i++) {
         assertion(expected[i], actual[i]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]