arrayset.js revision 877:cf4d2252d444
1235368Sgnn/*
2235368Sgnn * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3235368Sgnn * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4235368Sgnn *
5235368Sgnn * This code is free software; you can redistribute it and/or modify it
6235368Sgnn * under the terms of the GNU General Public License version 2 only, as
7235368Sgnn * published by the Free Software Foundation.
8235368Sgnn *
9235368Sgnn * This code is distributed in the hope that it will be useful, but WITHOUT
10235368Sgnn * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11235368Sgnn * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12235368Sgnn * version 2 for more details (a copy is included in the LICENSE file that
13235368Sgnn * accompanied this code).
14235368Sgnn *
15235368Sgnn * You should have received a copy of the GNU General Public License version
16235368Sgnn * 2 along with this work; if not, write to the Free Software Foundation,
17235368Sgnn * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18235368Sgnn *
19235368Sgnn * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20235368Sgnn * or visit www.oracle.com if you need additional information or have any
21235368Sgnn * questions.
22235368Sgnn */
23235368Sgnn
24235368Sgnn/**
25235368Sgnn * Tests setting an array element
26235368Sgnn *
27235368Sgnn * @test
28235368Sgnn * @run
29235368Sgnn */
30235368Sgnn
31235368Sgnnvar arr = [];
32235368Sgnnprint(arr.length);
33235368Sgnnprint(arr.hasOwnProperty(10000));
34235368Sgnnprint(arr.hasOwnProperty(10));
35235368Sgnnarr[10000] = 13;
36235368Sgnnprint(arr.length);
37235368Sgnnprint(arr.hasOwnProperty(10000));
38235368Sgnnprint(arr.hasOwnProperty(10));
39235368Sgnn
40235368Sgnn