js/src/tests/js1_5/extensions/regress-381304.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 381304;
     8 var summary = 'getter/setter with keywords';
     9 var actual = '';
    10 var expect = '';
    13 //-----------------------------------------------------------------------------
    14 test();
    15 //-----------------------------------------------------------------------------
    17 function test()
    18 {
    19   enterFunc ('test');
    20   printBugNumber(BUGNUMBER);
    21   printStatus (summary);
    23   var obj;
    25   print('1');
    27   obj = {
    28     set inn(value) {this.for = value;}, 
    29     get inn() {return this.for;}
    30   };
    32   expect = '({get inn() { return this.for; }, set inn(value) { this.for = value; } })';
    33   actual = obj.toSource();
    34   compareSource(expect, actual, summary + ': 1');
    36   print('2');
    38   obj = {
    39     set in(value) {this.for = value;}, 
    40     get in() {return this.for;}
    41   };
    43   expect = '({ get in() { return this.for; }, set in(value) { this.for = value; } })';
    44   actual = obj.toSource();
    45   compareSource(expect, actual, summary + ': 2');
    47   print('3');
    49   obj = {
    50     set inn(value) {this.for = value;}, 
    51     get in() {return this.for;}
    52   };
    54   expect = '({ set inn(value) { this.for = value; }, get in() { return this.for; } })';
    55   actual = obj.toSource();
    56   compareSource(expect, actual, summary + ': 4');
    58   print('4');
    60   obj = {
    61     set in(value) {this.for = value;}, 
    62     get inn() {return this.for;}
    63   };
    65   expect = ' ({ set in(value) { this.for = value; }, get inn() { return this.for; } })';
    66   actual = obj.toSource();
    67   compareSource(expect, actual, summary + ': 5');
    68   exitFunc ('test');
    69 }

mercurial