js/src/tests/test262/ch13/13.2/S13.2.1_A6_T1.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch13/13.2/S13.2.1_A6_T1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +// Copyright 2009 the Sputnik authors.  All rights reserved.
     1.5 +// This code is governed by the BSD license found in the LICENSE file.
     1.6 +
     1.7 +/**
     1.8 + * Primitive types are passed by value
     1.9 + *
    1.10 + * @path ch13/13.2/S13.2.1_A6_T1.js
    1.11 + * @description Declaring a function with "function __func(arg1, arg2)"
    1.12 + */
    1.13 +
    1.14 +function __func(arg1, arg2){
    1.15 +    arg1++;
    1.16 +    arg2+="BA";
    1.17 +};
    1.18 +
    1.19 +var x=1;
    1.20 +y=2;
    1.21 +var a="AB"
    1.22 +b="SAM";
    1.23 +
    1.24 +__func(x,a);
    1.25 +__func(y,b);
    1.26 +
    1.27 +//////////////////////////////////////////////////////////////////////////////
    1.28 +//CHECK#1
    1.29 +if (x!==1 || y!==2 || a!=="AB" || b!=="SAM") {
    1.30 +	$ERROR('#1: x === 1 and y === 2 and a === "AB" and b === "SAM". Actual: x ==='+x+' and y ==='+y+' and a ==='+a+' and b ==='+b);
    1.31 +}
    1.32 +//
    1.33 +//////////////////////////////////////////////////////////////////////////////
    1.34 +

mercurial