Closed NhatMinh0208 closed 8 months ago
Apparently program environments have been created with currentEnvironment
as tail instead of the global environment.
This causes the check in the code above to not work properly.
On further inspection, it appears that prelude environments are given the name 'programEnvironment' instead of a unique name that indicates the prelude. As a result, the check in the code above picks up the first program environment erroneously.
When running a program, the CSE machine visualization shows unreferenced globals instead of only referenced ones:
Investigation
It appears the bug was caused by #1584; more specifically, these changes to
interpreter.js
which causes some globals to be referenced by the program environment.