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

DefineMap.prototoype.get() excludes non-serializable props #100

Open
Bajix opened this issue Dec 9, 2016 · 4 comments
Open

DefineMap.prototoype.get() excludes non-serializable props #100

Bajix opened this issue Dec 9, 2016 · 4 comments

Comments

@Bajix
Copy link
Contributor

Bajix commented Dec 9, 2016

Assuming DefineMap.prototype.get() was intended to perform similarly to can.Map.prototype.attr(), then it should return a PJSO with the values of all enumerable props assigned. Instead, it is only returning all serializable props, essentially making this call signature identically to DefineMap.prototype.serialize().

See #99

@justinbmeyer
Copy link
Contributor

A virtual "getter" property like:

fullName: {
  get: function(){
    return this.first + " " + this.last;
  }
}

Map.prototype.attr will not include fullName

DefineMap.prototype.get will not include fullName

@justinbmeyer
Copy link
Contributor

justinbmeyer commented Dec 12, 2016

This JSBin shows the difference:

http://jsbin.com/semojes/1/edit?js,console

Map.prototype.attr will include serialize: false properties.

DefineMap.prototype.get will not include serialize: false properties.

In my opinion, it's time we add an enumerable property. This should be done in this issue: #63

@pYr0x
Copy link

pYr0x commented Dec 12, 2016

This is not the right jsbin, isn't it?

@justinbmeyer
Copy link
Contributor

@pYr0x updated

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

No branches or pull requests

3 participants