Skip to content

Let the code work on classes as well #14

Description

@perdevpernull

I suggest changing line 31
'- var prototype = Object.getPrototypeOf(object)

'+ var prototype;
switch (typeof object) {
case 'function': // class
prototype = object.prototype;
break;
case 'object': // instance of a class
prototype = Object.getPrototypeOf(object);
break;
default:
throw new Error('The argument has to be a class or an instance of a class.');
}

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions