{"action":"created","issue":{"url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/545","repository_url":"https://api.github.com/repos/aldeed/meteor-simple-schema","labels_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/545/comments","events_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/545/events","html_url":"https://github.com/aldeed/meteor-simple-schema/issues/545","id":129750458,"number":545,"title":"Error with objects and prototypes","user":{"login":"sebakerckhof","id":88471,"avatar_url":"https://avatars.githubusercontent.com/u/88471?v=3","gravatar_id":"","url":"https://api.github.com/users/sebakerckhof","html_url":"https://github.com/sebakerckhof","followers_url":"https://api.github.com/users/sebakerckhof/followers","following_url":"https://api.github.com/users/sebakerckhof/following{/other_user}","gists_url":"https://api.github.com/users/sebakerckhof/gists{/gist_id}","starred_url":"https://api.github.com/users/sebakerckhof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebakerckhof/subscriptions","organizations_url":"https://api.github.com/users/sebakerckhof/orgs","repos_url":"https://api.github.com/users/sebakerckhof/repos","events_url":"https://api.github.com/users/sebakerckhof/events{/privacy}","received_events_url":"https://api.github.com/users/sebakerckhof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-29T12:16:19Z","updated_at":"2016-03-16T13:49:49Z","closed_at":null,"body":"Weird behavior with objects that don't directly inherit from Object.\r\n\r\nSteps to reproduce:\r\nrun:\r\n```js\r\nvar schema = new SimpleSchema({\r\nfoo:{type:String},\r\nbar:{type:String}\r\n});\r\nvar parent = {notFoo:\"trala\"};\r\nvar obj = Object.create(parent);\r\nobj.notBar = \"lala\";\r\ncheck(obj,schema);\r\n```\r\n\r\nResulting behavior:\r\nDoesn't throw an error\r\n\r\nExpected behavior:\r\nShould throw an error since neither `foo` or `bar` is defined on the object"},"comment":{"url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/comments/197340780","html_url":"https://github.com/aldeed/meteor-simple-schema/issues/545#issuecomment-197340780","issue_url":"https://api.github.com/repos/aldeed/meteor-simple-schema/issues/545","id":197340780,"user":{"login":"samicemalone","id":3998242,"avatar_url":"https://avatars.githubusercontent.com/u/3998242?v=3","gravatar_id":"","url":"https://api.github.com/users/samicemalone","html_url":"https://github.com/samicemalone","followers_url":"https://api.github.com/users/samicemalone/followers","following_url":"https://api.github.com/users/samicemalone/following{/other_user}","gists_url":"https://api.github.com/users/samicemalone/gists{/gist_id}","starred_url":"https://api.github.com/users/samicemalone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samicemalone/subscriptions","organizations_url":"https://api.github.com/users/samicemalone/orgs","repos_url":"https://api.github.com/users/samicemalone/repos","events_url":"https://api.github.com/users/samicemalone/events{/privacy}","received_events_url":"https://api.github.com/users/samicemalone/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T13:49:49Z","updated_at":"2016-03-16T13:49:49Z","body":"I have also come across this issue. I currently work around it by using ```Object.assign({}, document)```"}}