{"action":"created","issue":{"url":"https://api.github.com/repos/dracupid/light-promise/issues/3","repository_url":"https://api.github.com/repos/dracupid/light-promise","labels_url":"https://api.github.com/repos/dracupid/light-promise/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/dracupid/light-promise/issues/3/comments","events_url":"https://api.github.com/repos/dracupid/light-promise/issues/3/events","html_url":"https://github.com/dracupid/light-promise/issues/3","id":156925991,"number":3,"title":"Promise not triggering on Android through wechat","user":{"login":"astik","id":572233,"avatar_url":"https://avatars.githubusercontent.com/u/572233?v=3","gravatar_id":"","url":"https://api.github.com/users/astik","html_url":"https://github.com/astik","followers_url":"https://api.github.com/users/astik/followers","following_url":"https://api.github.com/users/astik/following{/other_user}","gists_url":"https://api.github.com/users/astik/gists{/gist_id}","starred_url":"https://api.github.com/users/astik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astik/subscriptions","organizations_url":"https://api.github.com/users/astik/orgs","repos_url":"https://api.github.com/users/astik/repos","events_url":"https://api.github.com/users/astik/events{/privacy}","received_events_url":"https://api.github.com/users/astik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-26T07:59:05Z","updated_at":"2016-05-26T14:00:26Z","closed_at":null,"body":"When using the library on wechat on Android (4.4.2), the timeout is not firing. When debugging, we can see that setTimeout is undefined.\r\n\r\nBy looking at the dist livbrary :\r\n\r\n```js\r\nvar STATE, isFun, isObj, redEnd, redStart, setTimeout, unCaughtError,\r\n  bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\r\n```\r\n\r\nsetTimeout is overriden in this configuration and it is set to undefined.\r\nAs I know that i am not using nextTick on this website (frontend only), I remove the setTimeout from the declared variable list. Everything went back in order.\r\n\r\nSupposed faulty hash : 9a4140c32d61e885af666cdfdcb80d80e9cf1c3e\r\nVersion affected : 0.0.4\r\nPlatform : Android 4.4.2 + wechat\r\n\r\nA solution for the dist library will be to wrap all the code into an IIFE :\r\n\r\n```js\r\n(function(setTimeout){\r\n  ...\r\n}( (process && process.nextTick) || setTimeout));\r\n```\r\n\r\nAlso this will avoid all variable to go global.\r\n\r\nI have to go back from 0.0.4 to 0.0.3 only for this issue ='(\r\n"},"comment":{"url":"https://api.github.com/repos/dracupid/light-promise/issues/comments/221878941","html_url":"https://github.com/dracupid/light-promise/issues/3#issuecomment-221878941","issue_url":"https://api.github.com/repos/dracupid/light-promise/issues/3","id":221878941,"user":{"login":"dracupid","id":5706703,"avatar_url":"https://avatars.githubusercontent.com/u/5706703?v=3","gravatar_id":"","url":"https://api.github.com/users/dracupid","html_url":"https://github.com/dracupid","followers_url":"https://api.github.com/users/dracupid/followers","following_url":"https://api.github.com/users/dracupid/following{/other_user}","gists_url":"https://api.github.com/users/dracupid/gists{/gist_id}","starred_url":"https://api.github.com/users/dracupid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dracupid/subscriptions","organizations_url":"https://api.github.com/users/dracupid/orgs","repos_url":"https://api.github.com/users/dracupid/repos","events_url":"https://api.github.com/users/dracupid/events{/privacy}","received_events_url":"https://api.github.com/users/dracupid/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T14:00:26Z","updated_at":"2016-05-26T14:00:26Z","body":"As for `root.Promise != null`, I feel so sorry. I reversed the equation for debugging, but forgot to change it back."}}
{"actor":{"display_login":"dracupid"}}