aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-09 22:44:01 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-09 23:07:11 +0100
commit8ff278a383601e7370f40737b263f39606d3ba1c (patch)
tree64b23893e83c5bb05cc3b3fdd129afe67e6096b6 /lib/xixanta/src
parentae54968ec2e2cac6cace95b25958ed5550d2aad9 (diff)
downloadtools.nes-8ff278a383601e7370f40737b263f39606d3ba1c.tar.gz
tools.nes-8ff278a383601e7370f40737b263f39606d3ba1c.zip
Ignore GLOBAL_CONTEXT on force_context_switch()
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib/xixanta/src')
-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