2
|
1 |
|
|
2 |
// this test gets everything through strange accessors methods
|
|
3 |
|
|
4 |
function Test() {
|
|
5 |
}
|
|
6 |
|
|
7 |
Test.prototype.getInstance = function() {
|
|
8 |
return instance;
|
|
9 |
}
|
|
10 |
|
|
11 |
Test.prototype.getProperties = function() {
|
|
12 |
return instance != undefined ? instance.properties : undefined;
|
|
13 |
}
|
|
14 |
|
|
15 |
Test.prototype.getNamePlusFoo = function() {
|
|
16 |
props = instance["properties"]
|
|
17 |
return props["name"] + "foo";
|
|
18 |
}
|
|
19 |
|
|
20 |
Test.prototype.getSizeFormatted = function() {
|
|
21 |
size = instance.properties.size
|
|
22 |
return size.x + "," + size["y"];
|
|
23 |
}
|
|
24 |
|