summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_5/Array/index-with-null-character.js
blob: 51e71bc8a96b8d92323ce527361ab05e471a4901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);