Skip to content

built-ins that make virtual calls #7

Description

@michaelficarra

There are some built-ins that make virtual calls, meaning invoking that built-in on objects that are completely under your control could still invoke user code (other than through the usual toString/valueOf). Is this surprising to language users? Are there scenarios where this would lead to a programming trap with security consequences? An example is Array.prototype.toString making a virtual call to Array.prototype.join.

edit: I open this because we were discussing whether we should encourage this pattern to better support the subclassing of built-ins, and @syg suggested there might be security reasons why we would want to avoid it.

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