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

Make can.Construct work with getter / setters (and super plugin) #1337

Closed
justinbmeyer opened this Issue Nov 21, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@justinbmeyer
Contributor

justinbmeyer commented Nov 21, 2014

I want something like:

        get x5Instance(){
            return $.data(this.domnode.ownerDocument, "X5DomainObject");
        },

in my prototype definition

@justinbmeyer justinbmeyer added the bug label Nov 21, 2014

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 21, 2014

Contributor
can.Construct._inherit = function (newProps, oldProps, addTo) {
        addTo = addTo || newProps;
        for (var name in newProps) {
            if(Object.getOwnPropertyDescriptor ) {
                var descriptor = Object.getOwnPropertyDescriptor(newProps,name );
                if(descriptor.get || descriptor.set) {
                    Object.defineProperty(addTo, name, descriptor );
                    continue;
                }
            }
            can.Construct._overwrite(addTo, oldProps, name, newProps[name]);
        }
    };
Contributor

justinbmeyer commented Nov 21, 2014

can.Construct._inherit = function (newProps, oldProps, addTo) {
        addTo = addTo || newProps;
        for (var name in newProps) {
            if(Object.getOwnPropertyDescriptor ) {
                var descriptor = Object.getOwnPropertyDescriptor(newProps,name );
                if(descriptor.get || descriptor.set) {
                    Object.defineProperty(addTo, name, descriptor );
                    continue;
                }
            }
            can.Construct._overwrite(addTo, oldProps, name, newProps[name]);
        }
    };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment