summaryrefslogtreecommitdiffhomepage
path: root/tests/02_runtime/02_this
diff options
context:
space:
mode:
Diffstat (limited to 'tests/02_runtime/02_this')
-rw-r--r--tests/02_runtime/02_this22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/02_runtime/02_this b/tests/02_runtime/02_this
index d41be7f..e1efd80 100644
--- a/tests/02_runtime/02_this
+++ b/tests/02_runtime/02_this
@@ -23,3 +23,25 @@ true
print(o.test(), "\n");
%}
-- End --
+
+Test that the context is properly restored if function call arguments are
+dot or bracket expressions as well.
+
+-- Expect stdout --
+true
+true
+-- End --
+
+-- Testcase --
+{%
+ local o = {
+ test: function() {
+ return (this === o);
+ }
+ };
+
+ local dummy = { foo: true, bar: false };
+
+ print(o.test(dummy.foo, dummy.bar), "\n");
+ print(o.test(dummy.foo, o.test(dummy.foo, dummy.bar)), "\n");
+%}