diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-11-29 17:00:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-29 17:00:18 +0100 |
commit | 1323a272b6f0dff9445c111c0e47e5633288a39d (patch) | |
tree | a9e37aca9c94fa5ec3ed90c589d6881bf6dad173 /tests | |
parent | 3408edf99bf214792ea17ff3d67b08890701c2b4 (diff) | |
parent | ed5ce8f490188f3c528c7dd5db09ec0470377283 (diff) |
Merge pull request #246 from jow-/fix-upvalue-resolve
vm: resolve upvalues before pushing them onto the stack
Diffstat (limited to 'tests')
-rw-r--r-- | tests/custom/99_bugs/50_missing_upvalue_resolving | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/50_missing_upvalue_resolving b/tests/custom/99_bugs/50_missing_upvalue_resolving new file mode 100644 index 0000000..5e96634 --- /dev/null +++ b/tests/custom/99_bugs/50_missing_upvalue_resolving @@ -0,0 +1,27 @@ +Commit e5fe6b1 ("treewide: refactor vector usage code") accidentially dropped +the upvalue resolving logic from uc_vm_stack_push(), leading to unresolved +upvalues leaking into the script execution context. + +-- File test.uc -- +export let obj = { foo: true, bar: false }; +-- End -- + +-- Testcase -- +import * as test from "./files/test.uc"; + +printf("%.J\n", [ + type(test.obj), + test.obj.foo +]); +-- End -- + +-- Args -- +-R +-- End -- + +-- Expect stdout -- +[ + "object", + true +] +-- End -- |