diff options
Diffstat (limited to 'tests/02_runtime/05_closure_scope')
-rw-r--r-- | tests/02_runtime/05_closure_scope | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tests/02_runtime/05_closure_scope b/tests/02_runtime/05_closure_scope deleted file mode 100644 index c59a433..0000000 --- a/tests/02_runtime/05_closure_scope +++ /dev/null @@ -1,35 +0,0 @@ -Testing closure scopes. - - -1. Ensure that the declaring scope is retained in functions. - --- Expect stdout -- -Make function with x=1 -Make function with x=2 -Make function with x=3 -x is 1 -x is 2 -x is 3 --- End -- - --- Testcase -- -{% - let count=0; - - function a() { - let x = ++count; - print("Make function with x=", x, "\n"); - return function() { - print("x is ", x, "\n"); - }; - } - - let fn1 = a(); - let fn2 = a(); - let fn3 = a(); - - fn1(); - fn2(); - fn3(); -%} --- End -- |