Skip to content

Simplify captured intrinsic calls with uncurryThis #2

Description

@mcollina

The implementation captures intrinsics and repeatedly invokes methods through saved Reflect.apply references. @naugtur suggested using an uncurryThis helper to make this defensive code shorter and easier to review.

Review SES's approach to intrinsic capture and determine where receiver-first wrappers would simplify the existing code without changing its security assumptions. Capture any helper and method references before guest execution; document the exceptions where direct Reflect.apply remains appropriate. Validate that the refactor preserves behavior when guest-visible built-ins are modified.

This is a maintainability proposal, not a claim that the existing captured-Reflect.apply approach is incorrect.

Reference: SES intrinsic capture and uncurryThis.

Based on review feedback from @naugtur, shared in a discussion with the maintainer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions