|
1 // Copyright 2009 the Sputnik authors. All rights reserved. |
|
2 // This code is governed by the BSD license found in the LICENSE file. |
|
3 |
|
4 /** |
|
5 * Primitive types are passed by value |
|
6 * |
|
7 * @path ch13/13.2/S13.2.1_A6_T2.js |
|
8 * @description Declaring a function with "__func = function(arg1, arg2)" |
|
9 */ |
|
10 |
|
11 __func = function(arg1, arg2){ |
|
12 arg1++; |
|
13 arg2+="BA"; |
|
14 }; |
|
15 |
|
16 var x=1; |
|
17 y=2; |
|
18 var a="AB" |
|
19 b="SAM"; |
|
20 |
|
21 __func(x,a); |
|
22 __func(y,b); |
|
23 |
|
24 ////////////////////////////////////////////////////////////////////////////// |
|
25 //CHECK#1 |
|
26 if (x!==1 || y!==2 || a!=="AB" || b!=="SAM") { |
|
27 $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); |
|
28 } |
|
29 // |
|
30 ////////////////////////////////////////////////////////////////////////////// |
|
31 |