Skip to content

class X extends Buffer: inherited statics missing (MyBuf.from undefined) — native-base subclass family #6924

Description

@proggeramlug

Repro (fails identically on pristine main fb2ca94 and current branches):

class MyBuf extends Buffer {}
console.log(typeof (MyBuf as any).from);      // node: function — perry: undefined
console.log((MyBuf as any).from("ab").length); // node: 2 — perry: TypeError (reading 'length')

Node inherits static methods through the class chain (MyBuf.from === Buffer.from via prototype-of-constructor). Perry's try_native_static_method_in_proto_chain (object/class_registry/parent_static.rs) handles the dispatch of a static CALL through the chain, but the plain property READ MyBuf.from resolves to undefined before any call happens.

Found while probe-testing the NmNamespaceOps work on branch size/nm-constants-devirt (initially misattributed to the new hook; pristine-main verification shows it pre-exists). Same family as the earlier native-base subclassing defects (extends keyed on literal name).

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