js/src/tests/test262/ch08/8.7/S8.7_A7.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 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * Passing arguments by reference do change values of reference to be passed
     6  *
     7  * @path ch08/8.7/S8.7_A7.js
     8  * @description Add new property to original variable inside function
     9  */
    11 var n = {};
    12 var m = n;
    14 //////////////////////////////////////////////////////////////////////////////
    15 //CHECK#1
    16 if (typeof m !== "object") {
    17   $ERROR('#1: var n = {}; var m = n; typeof m === "object". Actual: ' + (typeof m));
    18 }
    19 //
    20 //////////////////////////////////////////////////////////////////////////////
    22 function populateAge(person){person.age = 50;}
    24 populateAge(m);
    26 //////////////////////////////////////////////////////////////////////////////
    27 //CHECK#2
    28 if (n.age !== 50) {
    29   $ERROR('#2: var n = {}; var m = n; function populateAge(person){person.age = 50;} populateAge(m); n.age === 50. Actual: ' + (n.age));
    30 }
    32 //
    33 //////////////////////////////////////////////////////////////////////////////

mercurial