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

Multiple issues with Model #1034

Closed
ghost opened this Issue Jun 1, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@ghost

ghost commented Jun 1, 2014

From the code model.js

line 1099:

if (fullName !== "string")
// should be 
if (typeof(fullName) !== 'string')

line 1099:

 if (typeof(fullName) !== "string") {    //this is already corrected according to 1.
    protoProps = staticProps;
    staticProps = fullName;
}

if there is no full name specified proto properties will become static properties and static properties will become null (for some reason fullName is always provided even if it is null)
This will lead to the problem with parseModel/parseModels:
I think that code should no longer be there.

line 1228:

// If there was no prototype, or no `model` and no `parseModel`,
// we'll have to create a `parseModel`.
else if (!protoProps || (!protoProps[name] && !protoProps[parseName])) {
    can.Construct._overwrite(self, base, parseName, parsers[parseName]());
}

protoProps should be replaced with staticProps since parseModel/parseModels seats in static properties, not proto properties.

@ghost ghost changed the title from typo in model.js breaks functionality to Multiple issues with Model Jun 1, 2014

@daffl daffl added this to the 2.1.2 milestone Jun 2, 2014

@daffl daffl modified the milestones: 2.1.3, 2.1.2 Jun 11, 2014

@daffl daffl added the Bug label Jun 13, 2014

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jun 18, 2014

Contributor

@Yaroslavtsev I have time to work on this today. Do you have second to go over this with me. Ping me on skype at justinbmeyer. Thanks!

Contributor

justinbmeyer commented Jun 18, 2014

@Yaroslavtsev I have time to work on this today. Do you have second to go over this with me. Ping me on skype at justinbmeyer. Thanks!

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer
Contributor

justinbmeyer commented Jun 18, 2014

@daffl daffl modified the milestones: 2.1.3, 2.1.4 Jun 18, 2014

@daffl daffl closed this in #1099 Jun 19, 2014

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