{"action":"closed","issue":{"url":"https://api.github.com/repos/adambom/parallel.js/issues/95","labels_url":"https://api.github.com/repos/adambom/parallel.js/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/adambom/parallel.js/issues/95/comments","events_url":"https://api.github.com/repos/adambom/parallel.js/issues/95/events","html_url":"https://github.com/adambom/parallel.js/issues/95","id":60381686,"number":95,"title":"Accessing variable from a require where spawned code is minified","user":{"login":"matb33","id":1038466,"avatar_url":"https://avatars.githubusercontent.com/u/1038466?v=3","gravatar_id":"","url":"https://api.github.com/users/matb33","html_url":"https://github.com/matb33","followers_url":"https://api.github.com/users/matb33/followers","following_url":"https://api.github.com/users/matb33/following{/other_user}","gists_url":"https://api.github.com/users/matb33/gists{/gist_id}","starred_url":"https://api.github.com/users/matb33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matb33/subscriptions","organizations_url":"https://api.github.com/users/matb33/orgs","repos_url":"https://api.github.com/users/matb33/repos","events_url":"https://api.github.com/users/matb33/events{/privacy}","received_events_url":"https://api.github.com/users/matb33/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-09T17:43:28Z","updated_at":"2015-04-14T01:35:13Z","closed_at":"2015-04-14T01:35:13Z","body":"I'm logging this under issues for discoverability only -- feel free to close:\r\n\r\nWhen in a situation where the code that is meant to run in the web worker has been minified and also relies on a `require` of an external library, it's quite likely that references to functions/variables in the worker code have been renamed.\r\n\r\nFor example, for worker code such as:\r\n```\r\nfunction doWork() {\r\n  return _.find(...);\r\n}\r\n```\r\n\r\nand where one may have done a `p.require(\"underscore.js\")`, then the worker code may have been minified to a point where `_` has been renamed to something else.\r\n\r\nA simple workaround:\r\n```\r\nfunction doWork() {\r\n  var _ = self[\"_\"];\r\n  return _.find(...);\r\n}\r\n```\r\n\r\nHope this helps someone!"}}