LinqLover / SimulationStudio

A growing suite of applications and tools using code simulation in Squeak/Smalltalk
9 stars 1 forks source link

MirrorPrimitiveTests fail in the sandbox #20

Closed LinqLover closed 3 years ago

LinqLover commented 3 years ago

We carelessly overwrote the mirror primitive selectors in SandboxContext; however, this also affects their behavior when invoked from the simulated code, of course. Besides the MirrorPrimitiveTests, simple usage examples like the following fail, too:

| x |
x := #(1) copy.
Sandbox evaluate: [
    thisContext object: x basicAt: 1 put: 2.
    x at: 1]

Expected output: 2
Actual output: 1

As the usage of thisContext for invoking mirror primitives is already too much spread, it will probably be necessary to remove this overriding and replace all their senders in Context instead. Or would some metaprogramming such as "test simCustomizationLevel" or "test sender of the primitive" be possible, too?