Skip to content

Problem with https://github.com/nodejs/node-addon-api/pull/874 #1158

Description

@mhdawson

Issue raised in closed PR - #874

Report is that PR breaks existing code:

From @ShenHongFei

This commit breaks the following code:

    void foo (const CallbackInfo& info) {
        const Object obj = info[0].As<Object>();
        obj["xxx"].As<Boolean>();
    }

because the following methods were deleted in this commit

    /// Gets or sets an indexed property or array element.
    PropertyLValue<Value> operator[](Value index  /// Property / element index
    ) const;

    /// Gets a named property.
    MaybeOrValue<Value> operator[](
        const char* utf8name  ///< UTF-8 encoded null-terminated property name
    ) const;

    /// Gets a named property.
    MaybeOrValue<Value> operator[](
        const std::string& utf8name  ///< UTF-8 encoded property name
    ) const;

    /// Gets an indexed property or array element.
    MaybeOrValue<Value> operator[](uint32_t index  ///< Property / element index
    ) const;

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