Skip to content

fix: sandbox wrapper resolution and global property handling#58

Merged
nyariv merged 3 commits intomainfrom
fix/bug-fixes-2
Apr 25, 2026
Merged

fix: sandbox wrapper resolution and global property handling#58
nyariv merged 3 commits intomainfrom
fix/bug-fixes-2

Conversation

@nyariv
Copy link
Copy Markdown
Owner

@nyariv nyariv commented Apr 25, 2026

What changed

This PR fixes several sandbox runtime edge cases around function replacement resolution, global access, and compile-time execution context reuse.

Why it changed

A few code paths were still looking up replacements from the shared sandbox context instead of the per-execution evals map, which could lead to inconsistent behavior for wrapped globals and constructors. The branch also tightens own-property checks so inherited properties are not accidentally treated as declared globals or constants.

User impact

Users get more consistent behavior when accessing or invoking sandboxed globals such as Function, AsyncFunction, eval, and RegExp, along with safer property resolution for globals and scopes.

Root cause

Replacement factories had effectively moved to execution-scoped state, but some call sites and property access helpers were still reading from the old context-level path. A few in checks also allowed prototype-chain matches where own-property checks were intended.

Validation

  • npx jest --runInBand
  • 47 test suites passed
  • 1814 tests passed

@nyariv nyariv marked this pull request as ready for review April 25, 2026 11:50
@nyariv nyariv changed the title [codex] Fix sandbox wrapper resolution and global property handling fix: sandbox wrapper resolution and global property handling Apr 25, 2026
@nyariv nyariv merged commit 1e67856 into main Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant