diff options
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | tests/00_syntax/11_misc_literals | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -1361,7 +1361,7 @@ ut_execute_op(struct ut_state *state, uint32_t off) scope = ut_getref(state, off, &key); ut_putval(state->ctx); - state->ctx = json_object_get(scope); + state->ctx = NULL; val = ut_getval(scope, key); ut_putval(scope); @@ -1548,7 +1548,7 @@ ut_run(struct ut_state *state) if (!json_object_is_type(scope, json_type_object)) return UT_ERROR_EXCEPTION; - state->ctx = scope; + state->ctx = NULL; ut_globals_init(state, scope); ut_lib_init(state, scope); 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 }} |