diff -r 000000000000 -r 6474c204b198 js/src/tests/ecma_5/Array/index-with-null-character.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/tests/ecma_5/Array/index-with-null-character.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,18 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +var testArray = [1, 2, 3] +assertEq(testArray['0' + '\0'], undefined); +assertEq(testArray['1' + '\0' + 'aaaa'], undefined) +assertEq(testArray['\0' + '2'], undefined); +assertEq(testArray['\0' + ' 2'], undefined); + +testArray['\0'] = 'hello'; +testArray[' \0'] = 'world'; +assertEq(testArray['\0'], 'hello'); +assertEq(testArray[' \0'], 'world'); + +if (typeof reportCompare == 'function') + reportCompare(true, true);