diff -r 000000000000 -r 6474c204b198 js/src/tests/ecma_5/RegExp/shell.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/tests/ecma_5/RegExp/shell.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,21 @@ +function makeExpectedMatch(arr, index, input) { + var expectedMatch = { + index: index, + input: input, + length: arr.length, + }; + + for (var i = 0; i < arr.length; ++i) + expectedMatch[i] = arr[i]; + + return expectedMatch; +} + +function checkRegExpMatch(actual, expected) { + assertEq(actual.length, expected.length); + for (var i = 0; i < actual.length; ++i) + assertEq(actual[i], expected[i]); + + assertEq(actual.index, expected.index); + assertEq(actual.input, expected.input); +}