11.1.5-0-1.js (660B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 it isn't clear what specific requirements of the specificaiton are being tested here. This test should 7 probably be replaced by some more targeted tests. AllenWB 8 es5id: 11.1.5-0-1 9 description: Object literal - get set property 10 ---*/ 11 12 var s1 = "In getter"; 13 var s2 = "In setter"; 14 var s3 = "Modified by setter"; 15 var o; 16 eval("o = {get foo(){ return s1;},set foo(arg){return s2 = s3}};"); 17 18 assert.sameValue(o.foo, s1, 'o.foo'); 19 20 o.foo=10; 21 22 assert.sameValue(s2, s3, 's2'); 23 24 reportCompare(0, 0);