aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xixanta')
-rw-r--r--lib/xixanta/src/object.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/xixanta/src/object.rs b/lib/xixanta/src/object.rs
index c16ddb0..5b4b235 100644
--- a/lib/xixanta/src/object.rs
+++ b/lib/xixanta/src/object.rs
@@ -398,6 +398,12 @@ impl Context {
// Clear the context stack as we will set it manually.
self.stack.truncate(0);
+ // If the given name turns out to be just the global one, skip the push
+ // for the stack.
+ if name == GLOBAL_CONTEXT {
+ return;
+ }
+
// Forcing a context switch is not as simple as pushing the given name,
// but we have to make sure that the whole scope hierarchy is laid out
// so the code that fetches variables continues to work (e.g. if