From 52ac5c3f4b086415dedcff90ddec871f970335cc Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 15 Sep 2020 22:26:07 +0200 Subject: eval: only set "this" scope for functions being object members Signed-off-by: Jo-Philipp Wich --- tests/00_syntax/11_misc_literals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/00_syntax/11_misc_literals') diff --git a/tests/00_syntax/11_misc_literals b/tests/00_syntax/11_misc_literals index 8a654e1..4b33a78 100644 --- a/tests/00_syntax/11_misc_literals +++ b/tests/00_syntax/11_misc_literals @@ -9,7 +9,8 @@ The "false" keyword represents a false boolean value: false -- End -- -- Testcase -- -The "this" keyword refers to the current function context: {{ type(this) }} +{% local t = { f: function() { return this; } } %} +The "this" keyword refers to the current function context: {{ type(t.f()) }} The "null" keyword represents the null value: {{ "" + null }} The "true" keyword represents a true boolean value: {{ true }} The "false" keyword represents a false boolean value: {{ false }} -- cgit v1.2.3