tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

regress-381303.js (1050B)


      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 = 381303;
     11 var summary = 'object toSource when a property has both a getter and a setter';
     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  var obj = {set inn(value) {this.for = value;}, get inn() {return this.for;}};
     26  expect = '({' +
     27    'get inn() {return this.for;}' + 
     28    ', ' + 
     29    'set inn(value) {this.for = value;}' + 
     30    '})';
     31  actual = obj.toSource();
     32 
     33  compareSource(expect, actual, summary);
     34 }