{"action":"created","issue":{"url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/126","labels_url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/126/comments","events_url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/126/events","html_url":"https://github.com/jakearchibald/es6-promise/pull/126","id":94403602,"number":126,"title":"Prevents polyfill by default in cases that support module.exports.","user":{"login":"owenallenaz","id":1087603,"avatar_url":"https://avatars.githubusercontent.com/u/1087603?v=3","gravatar_id":"","url":"https://api.github.com/users/owenallenaz","html_url":"https://github.com/owenallenaz","followers_url":"https://api.github.com/users/owenallenaz/followers","following_url":"https://api.github.com/users/owenallenaz/following{/other_user}","gists_url":"https://api.github.com/users/owenallenaz/gists{/gist_id}","starred_url":"https://api.github.com/users/owenallenaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owenallenaz/subscriptions","organizations_url":"https://api.github.com/users/owenallenaz/orgs","repos_url":"https://api.github.com/users/owenallenaz/repos","events_url":"https://api.github.com/users/owenallenaz/events{/privacy}","received_events_url":"https://api.github.com/users/owenallenaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-10T22:11:59Z","updated_at":"2015-07-11T01:27:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jakearchibald/es6-promise/pulls/126","html_url":"https://github.com/jakearchibald/es6-promise/pull/126","diff_url":"https://github.com/jakearchibald/es6-promise/pull/126.diff","patch_url":"https://github.com/jakearchibald/es6-promise/pull/126.patch"},"body":"Generally within systems that support `module.exports` such as Node, it's a bad idea in NPM packages to ever alter the global state. Thus, it seems in Node we shouldn't execute the Polyfill by default.\r\n\r\nFrom the docs itself it says \r\n\r\n```js\r\nvar Promise = require('es6-promise').Promise;\r\n```\r\n\r\nWhile if you did\r\n```js\r\nvar fake = require('es6-promise').Promise;\r\nconsole.log(Promise === undefined); // false, What, where did this come from? I set it to fake.\r\n```\r\n\r\nYou would still end up with Promise defined, that to me seems incorrect. I've altered the `module.exports` portion of the UMD to no longer leak the promise and execute the polyfill."},"comment":{"url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/comments/120559697","html_url":"https://github.com/jakearchibald/es6-promise/pull/126#issuecomment-120559697","issue_url":"https://api.github.com/repos/jakearchibald/es6-promise/issues/126","id":120559697,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-07-11T01:27:15Z","updated_at":"2015-07-11T01:27:15Z","body":"I'm suggesting we change he API to explicitly do one or the other. Not sometimes, in node don't polyfil but other times do.  two explicit paths that a user chooses seems best\n\nIt is also worth noting, this library only smashes the global when the global is missing or broken "}}