{"action":"opened","issue":{"url":"https://api.github.com/repos/svaarala/duktape-wiki/issues/49","labels_url":"https://api.github.com/repos/svaarala/duktape-wiki/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape-wiki/issues/49/comments","events_url":"https://api.github.com/repos/svaarala/duktape-wiki/issues/49/events","html_url":"https://github.com/svaarala/duktape-wiki/issues/49","id":107331517,"number":49,"title":"Add howto for persistent native references to Duktape heap object","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-19T13:04:14Z","updated_at":"2015-09-19T13:04:14Z","closed_at":null,"body":"Typical scenario is e.g. a timer API implementation:\r\n\r\n```\r\nsetTimeout(function () { print('timed out'); }, 1000);\r\n```\r\n\r\nHow to implement `setTimeout()` natively so that a persistent reference to the function argument can be kept until the timeout.\r\n\r\nThere are various methods to do this, so cover the most common alternatives, and explain the garbage collection issues involved."}}