Bug 627609 followup 2: add missing helper for tests, r=orange
authorDavid Mandelin <dmandelin@mozilla.com>
Mon, 31 Jan 2011 16:41:45 -0800
changeset 61712 68e341f7ac4ec233e953716c038e97d68dd8e8e6
parent 61711 0f340f13b1714b8080e224b0b1d1d5f7df6749e3
child 61713 9459c4b15890ed138e044da121ccd73a7b7c683b
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersorange
bugs627609
milestone2.0b11pre
Bug 627609 followup 2: add missing helper for tests, r=orange
js/src/jit-test/lib/eqArrayHelper.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/lib/eqArrayHelper.js
@@ -0,0 +1,17 @@
+function assertEqArray(actual, expected) {
+    if (actual.length != expected.length) {
+        throw new Error(
+            "array lengths not equal: got " +
+            uneval(actual) + ", expected " + uneval(expected));
+    }
+
+    for (var i = 0; i < actual.length; ++i) {
+        if (actual[i] != expected[i]) {
+        throw new Error(
+            "arrays not equal at element " + i + ": got " +
+            uneval(actual) + ", expected " + uneval(expected));
+        }
+    }
+}
+
+