js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-0-2.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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-2.js
    11  * @description Object literal - multiple get set properties
    12  */
    15 function testcase() {
    16   var s1 = "First getter";
    17   var s2 = "First setter";
    18   var s3 = "Second getter";
    19   eval("var o = {get foo(){ return s1;},set foo(arg){return s2 = s3}, get bar(){ return s3}, set bar(arg){ s3 = arg;}};");
    20   if(o.foo !== s1) 
    21     return false;
    22   o.foo = 10;
    23   if(s2 !== s3) 
    24     return false;
    25   if(o.bar !== s3)
    26     return false;
    27   o.bar = "Second setter";
    28   if(o.bar !== "Second setter")
    29     return false;
    30   return true;
    31  }
    32 runTestCase(testcase);

mercurial