Skip to content

[ddc] Super calls are broken in a library after it has been hot reloaded #59628

@nshahan

Description

@nshahan

Background:
The JavaScript super keyword binds to the class where it was defined in the source code.

  • If that classes prototype chain is updated to point to a different superclass, the super keyword works as expected and dispatches along the new prototype chain. This is good!
  • If the member containing a super call is copied into a different class, the super call is still bound to the prototype chain of the class where it was originally defined. This is bad!

The current hot reload behavior is to copy members from a new temporary class where they are defined, into the existing class from the previous generation during the initialization phase of a library. Later in the link phase the class hierarchies are connected by updating the prototype chains. This handling is causing super calls to be broken in a library that is hot reloaded, even if the diff is completely unrelated to the super call or even the class that contains it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions