Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seeden opened this issue Sep 22, 2016 · 3 comments
Open

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

seeden opened this issue Sep 22, 2016 · 3 comments
Assignees

Comments

@seeden
Copy link

seeden commented Sep 22, 2016

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

@seeden
Copy link
Author

seeden commented Oct 2, 2016

is this repo dead ?

@unclechu
Copy link
Owner

unclechu commented Oct 2, 2016

@seeden this lib isn't supposed to be used to clone some class instances (if it's not Date, RegExp, Buffer or Array).

P.S. Sorry about delay.

@unclechu
Copy link
Owner

unclechu commented Oct 2, 2016

@seeden Actually I'm going to implement custom cloning strategies in new major version, but can't say when I do it.

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

No branches or pull requests

2 participants