{"action":"opened","number":11,"pull_request":{"created_at":"2011-12-13T07:01:18Z","state":"open","review_comments":0,"changed_files":1,"_links":{"review_comments":{"href":"https://api.github.com/repos/brianmcd/contextify/pulls/11/comments"},"comments":{"href":"https://api.github.com/repos/brianmcd/contextify/issues/11/comments"},"html":{"href":"https://github.com/brianmcd/contextify/pull/11"},"self":{"href":"https://api.github.com/repos/brianmcd/contextify/pulls/11"}},"updated_at":"2011-12-13T07:01:18Z","patch_url":"https://github.com/brianmcd/contextify/pull/11.patch","issue_url":"https://github.com/brianmcd/contextify/issues/11","comments":0,"user":{"gravatar_id":"a62b87a36bfc29a7207bc73f3aac960b","id":5158,"url":"https://api.github.com/users/assaf","login":"assaf","avatar_url":"https://secure.gravatar.com/avatar/a62b87a36bfc29a7207bc73f3aac960b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"merged":false,"body":"In JavaScript, this results in an `ReferenceError: y is not defined`:\r\n\r\n```\r\nx = y\r\n```\r\n\r\nOTOH a variable declared with no value is set to `undefined`, and so this sets x to `undefined`:\r\n\r\n```\r\nvar y\r\nx = y\r\n```\r\n\r\nThis pull requests provides two tests, one with a sandbox property (`x`) set to `undefined` and one with a global variable (`z`) declared as `undefined`.\r\n\r\nThis seems to fix the first test, by returning the sandbox property if defined, regardless of value:\r\n\r\n```\r\nLocal<Value> rv = sandbox->Get(property);\r\nif (sandbox->GetRealNamedProperty(property))\r\n    return scope.Close(rv);\r\n\r\n// Next, check the global object (things like Object, Array, etc).\r\n// This needs to call GetRealNamedProperty or else we'll get stuck in\r\n// an infinite loop here.\r\nrv = info->global->GetRealNamedProperty(property);\r\n```\r\n\r\nI am not sure if this is correct, or how to go about fixing the second test.","deletions":0,"mergeable":null,"commits":2,"id":587030,"merged_by":null,"base":{"user":{"gravatar_id":"e87947ffbd98bc4ad6aa0abf1e67d0ed","id":691451,"url":"https://api.github.com/users/brianmcd","login":"brianmcd","avatar_url":"https://secure.gravatar.com/avatar/e87947ffbd98bc4ad6aa0abf1e67d0ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"repo":{"created_at":"2011-07-30T18:47:19Z","pushed_at":"2011-10-10T01:10:09Z","clone_url":"https://github.com/brianmcd/contextify.git","private":false,"updated_at":"2011-12-13T05:54:23Z","watchers":18,"name":"contextify","master_branch":null,"svn_url":"https://svn.github.com/brianmcd/contextify","language":"JavaScript","forks":4,"owner":{"gravatar_id":"e87947ffbd98bc4ad6aa0abf1e67d0ed","id":691451,"url":"https://api.github.com/users/brianmcd","login":"brianmcd","avatar_url":"https://secure.gravatar.com/avatar/e87947ffbd98bc4ad6aa0abf1e67d0ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2129739,"homepage":"","description":"","git_url":"git://github.com/brianmcd/contextify.git","html_url":"https://github.com/brianmcd/contextify","url":"https://api.github.com/repos/brianmcd/contextify","size":108,"ssh_url":"git@github.com:brianmcd/contextify.git","open_issues":1,"fork":false},"sha":"3db83c7375fcdac5f732c594666deaf0d7d40e71","ref":"master","label":"brianmcd:master"},"number":11,"additions":21,"title":"Declared global variables treated as undefined","head":{"user":{"gravatar_id":"a62b87a36bfc29a7207bc73f3aac960b","id":5158,"url":"https://api.github.com/users/assaf","login":"assaf","avatar_url":"https://secure.gravatar.com/avatar/a62b87a36bfc29a7207bc73f3aac960b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"repo":{"created_at":"2011-12-13T05:54:23Z","pushed_at":"2011-12-13T06:56:19Z","clone_url":"https://github.com/assaf/contextify.git","private":false,"updated_at":"2011-12-13T06:56:19Z","watchers":1,"name":"contextify","master_branch":null,"svn_url":"https://svn.github.com/assaf/contextify","language":"JavaScript","forks":0,"owner":{"gravatar_id":"a62b87a36bfc29a7207bc73f3aac960b","id":5158,"url":"https://api.github.com/users/assaf","login":"assaf","avatar_url":"https://secure.gravatar.com/avatar/a62b87a36bfc29a7207bc73f3aac960b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2970208,"homepage":"","description":"","git_url":"git://github.com/assaf/contextify.git","html_url":"https://github.com/assaf/contextify","url":"https://api.github.com/repos/assaf/contextify","size":108,"ssh_url":"git@github.com:assaf/contextify.git","open_issues":0,"fork":true},"sha":"ca986f908811c68273a18eae6fdbaa472476680b","ref":"master","label":"assaf:master"},"html_url":"https://github.com/brianmcd/contextify/pull/11","closed_at":null,"diff_url":"https://github.com/brianmcd/contextify/pull/11.diff","url":"https://api.github.com/repos/brianmcd/contextify/pulls/11","merged_at":null}}