|
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-1.js |
|
11 * @description Object literal - get set property |
|
12 */ |
|
13 |
|
14 |
|
15 function testcase() { |
|
16 var s1 = "In getter"; |
|
17 var s2 = "In setter"; |
|
18 var s3 = "Modified by setter"; |
|
19 eval("var o = {get foo(){ return s1;},set foo(arg){return s2 = s3}};"); |
|
20 if(o.foo !== s1) |
|
21 return false; |
|
22 o.foo=10; |
|
23 if(s2 !== s3) |
|
24 return false; |
|
25 return true; |
|
26 } |
|
27 runTestCase(testcase); |