js/src/tests/ecma_5/Array/index-with-null-character.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_5/Array/index-with-null-character.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +/*
     1.5 + * Any copyright is dedicated to the Public Domain.
     1.6 + * http://creativecommons.org/licenses/publicdomain/
     1.7 + */
     1.8 +
     1.9 +var testArray = [1, 2, 3]
    1.10 +assertEq(testArray['0' + '\0'], undefined);
    1.11 +assertEq(testArray['1' + '\0' + 'aaaa'], undefined)
    1.12 +assertEq(testArray['\0' + '2'], undefined);
    1.13 +assertEq(testArray['\0' + ' 2'], undefined);
    1.14 +
    1.15 +testArray['\0'] = 'hello';
    1.16 +testArray[' \0'] = 'world';
    1.17 +assertEq(testArray['\0'], 'hello');
    1.18 +assertEq(testArray[' \0'], 'world');
    1.19 +
    1.20 +if (typeof reportCompare == 'function')
    1.21 +    reportCompare(true, true);

mercurial