| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = 'array-008-n.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: array-008-n.js |
| 10 | Description: |
| 11 | |
| 12 | JavaArrays should have a length property that specifies the number of |
| 13 | elements in the array. |
| 14 | |
| 15 | JavaArray elements can be referenced with the [] array index operator. |
| 16 | |
| 17 | This attempts to access an array index that is out of bounds. It should |
| 18 | fail with a JS runtime error. |
| 19 | |
| 20 | @author [email protected] |
| 21 | @version 1.00 |
| 22 | */ |
| 23 | var SECTION = "LiveConnect"; |
| 24 | var VERSION = "1_3"; |
| 25 | var TITLE = "Java Array to JavaScript JavaArray object"; |
| 26 | |
| 27 | startTest(); |
| 28 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 29 | |
| 30 | dt = new Packages.com.netscape.javascript.qa.liveconnect.DataTypeClass; |
| 31 | |
| 32 | var ba_length = dt.PUB_ARRAY_BYTE.length; |
| 33 | |
| 34 | DESCRIPTION = "dt.PUB_ARRAY_BYTE.length = "+ ba_length; |
| 35 | EXPECTED = "error"; |
| 36 | |
| 37 | new TestCase( |
| 38 | SECTION, |
| 39 | "dt.PUB_ARRAY_BYTE.length = "+ ba_length, |
| 40 | "error", |
| 41 | dt.PUB_ARRAY_BYTE[ba_length] ); |
| 42 | |
| 43 | test(); |