Merge branch 'master' into 2011-09-09-CxScript
This commit is contained in:
commit
9162b02ce9
19
unittests/pass_by_reference.chai
Normal file
19
unittests/pass_by_reference.chai
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
def f(x) { x+= 2; }
|
||||||
|
|
||||||
|
var i = 1;
|
||||||
|
|
||||||
|
assert_equal(i, 1);
|
||||||
|
|
||||||
|
f(i);
|
||||||
|
|
||||||
|
assert_equal(i, 3);
|
||||||
|
|
||||||
|
def g(x) { x+= " World"; }
|
||||||
|
|
||||||
|
var s = "Hello";
|
||||||
|
|
||||||
|
assert_equal(s, "Hello");
|
||||||
|
|
||||||
|
g(s);
|
||||||
|
|
||||||
|
assert_equal(s, "Hello World");
|
Loading…
x
Reference in New Issue
Block a user