Previously, in the REPL, the globals bound by one chunk would become
the "predeclared" bindings of the next chunk. However, this produced
the wrong result for [x = x + 1] because both occurrences of x would
resolve to the same global x, which was undefined when the right-hand
side expression was evaluated, leading to a dynamic error. It would
fail for [x += 1] for a similar reason.
This change extends the resolver to allow clients to provide it with a
non-empty set of module globals. Thus the globals of one chunk remain
the globals of the next chunk, and the predeclared set is always empty.
The new API functions are intended for use only by the REPL.
Previously, in the REPL, the globals bound by one chunk would become the "predeclared" bindings of the next chunk. However, this produced the wrong result for [x = x + 1] because both occurrences of x would resolve to the same global x, which was undefined when the right-hand side expression was evaluated, leading to a dynamic error. It would fail for [x += 1] for a similar reason.
This change extends the resolver to allow clients to provide it with a non-empty set of module globals. Thus the globals of one chunk remain the globals of the next chunk, and the predeclared set is always empty.
The new API functions are intended for use only by the REPL.
Fixes #233