2
|
1 |
|
|
2 |
|
|
3 |
function ArrayTest() {
|
|
4 |
}
|
|
5 |
|
|
6 |
ArrayTest.prototype.getLength = function(properties, prop) {
|
|
7 |
return properties[prop].length;
|
|
8 |
}
|
|
9 |
|
|
10 |
|
|
11 |
ArrayTest.prototype.setElementAt = function(properties, prop, idx, val) {
|
|
12 |
properties[prop][idx] = val;
|
|
13 |
}
|
|
14 |
|
|
15 |
ArrayTest.prototype.getElementAt = function(properties, prop, idx) {
|
|
16 |
return properties[prop][idx]
|
|
17 |
}
|
|
18 |
|
|
19 |
ArrayTest.prototype.setElementAtSub = function(properties, prop, idx, sub, val) {
|
|
20 |
properties[prop][idx][sub] = val;
|
|
21 |
|
|
22 |
// don't crash, even though "sub" isn't a real property
|
|
23 |
properties[prop][idx].sub = val;
|
|
24 |
}
|
|
25 |
|
|
26 |
ArrayTest.prototype.getElementAtSub = function(properties, prop, idx, sub) {
|
|
27 |
return properties[prop][idx][sub];
|
|
28 |
}
|
|
29 |
|
|
30 |
ArrayTest.prototype.resizeAndCheck = function(properties, prop, size) {
|
|
31 |
properties[prop].length = size;
|
|
32 |
return properties[prop].length;
|
|
33 |
}
|