Skip to content

extending of "old" javascript classes is broken | bug #30

Description

@seeden

When I try

function BearerStrategy() {
}

BearerStrategy.prototype.authenticate = function () {
};

const extended = deepExtend({}, { strategies: [
  new BearerStrategy(),
] });

extended.strategies.forEach((s) => {
  console.log('extended', s.authenticate);
});

const s = new BearerStrategy();
console.log('original', s.authenticate);

The output will be:

extended undefined
original [Function]

which is totally wrong

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions