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

mapping fails if value = "constructor" #196

Open
ale33 opened this issue Jul 9, 2014 · 2 comments · May be fixed by #201
Open

mapping fails if value = "constructor" #196

ale33 opened this issue Jul 9, 2014 · 2 comments · May be fixed by #201

Comments

@ale33
Copy link

ale33 commented Jul 9, 2014

data = 
{
   "cId":9595,
   "histories":[
      {
         "cId":9595,
         "jobTitle":"lifeguard",
         "jobDesc":"watch people and the pool, cleaning the pool"
      },
      {
         "cId":9595,
         "jobTitle":"constructor",
         "jobDesc":"I lay down pavement marking on road. this means thermoplastic, tape, and paint."
      }
   ]
}

function FormData (data) {
    var self = this;
    ko.mapping.fromJS(data, {}, self);
}

It fails because the "jobTitle":"constructor". It works if "jobTitle":"SOMETHING ELSE"

@nyothecat
Copy link

Nice one! Have you tried "prototype", "proto", stuff like that? I guess it should fail too

@ghost
Copy link

ghost commented Nov 11, 2014

I fixed it in commit d897ded

@ghost ghost linked a pull request Nov 11, 2014 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants