regress-379566.js (1149B)
1 // |reftest| skip-if(!Object.prototype.toSource) 2 3 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 9 //----------------------------------------------------------------------------- 10 var BUGNUMBER = 379566; 11 var summary = 'Keywords after get|set'; 12 var actual = ''; 13 var expect = ''; 14 15 16 //----------------------------------------------------------------------------- 17 test(); 18 //----------------------------------------------------------------------------- 19 20 function test() 21 { 22 printBugNumber(BUGNUMBER); 23 printStatus (summary); 24 25 expect = '({' + 26 'get in() { return this.for; }, ' + 27 'set in(value) { this.for = value; }' + 28 '})'; 29 try 30 { 31 var obj = eval('({ ' + 32 'get in() { return this.for; }, ' + 33 'set in(value) { this.for = value; } ' + 34 '})'); 35 actual = obj.toSource(); 36 37 } 38 catch(ex) 39 { 40 actual = ex + ''; 41 } 42 43 compareSource(expect, actual, summary); 44 }