|
1 /// Copyright (c) 2012 Ecma International. All rights reserved. |
|
2 /// Ecma International makes this code available under the terms and conditions set |
|
3 /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the |
|
4 /// "Use Terms"). Any redistribution of this code must retain the above |
|
5 /// copyright and this notice and otherwise comply with the Use Terms. |
|
6 /** |
|
7 * it isn't clear what specific requirements of the specificaiton are being tested here. This test should |
|
8 * probably be replaced by some more targeted tests. AllenWB |
|
9 * |
|
10 * @path ch11/11.1/11.1.5/11.1.5-0-2.js |
|
11 * @description Object literal - multiple get set properties |
|
12 */ |
|
13 |
|
14 |
|
15 function testcase() { |
|
16 var s1 = "First getter"; |
|
17 var s2 = "First setter"; |
|
18 var s3 = "Second getter"; |
|
19 eval("var o = {get foo(){ return s1;},set foo(arg){return s2 = s3}, get bar(){ return s3}, set bar(arg){ s3 = arg;}};"); |
|
20 if(o.foo !== s1) |
|
21 return false; |
|
22 o.foo = 10; |
|
23 if(s2 !== s3) |
|
24 return false; |
|
25 if(o.bar !== s3) |
|
26 return false; |
|
27 o.bar = "Second setter"; |
|
28 if(o.bar !== "Second setter") |
|
29 return false; |
|
30 return true; |
|
31 } |
|
32 runTestCase(testcase); |