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

Multiple issues with Model #1034

Closed
ghost opened this issue Jun 1, 2014 · 2 comments · Fixed by #1099
Closed

Multiple issues with Model #1034

ghost opened this issue Jun 1, 2014 · 2 comments · Fixed by #1099
Assignees
Labels
Milestone

Comments

@ghost
Copy link

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 typo in model.js breaks functionality 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
Copy link
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!

@justinbmeyer
Copy link
Contributor

I showed how I fixed this here: https://www.youtube.com/watch?v=56DoykBew38&feature=autoshare

@daffl daffl modified the milestones: 2.1.3, 2.1.4 Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants