{"action":"created","issue":{"url":"https://api.github.com/repos/pygy/require.lua/issues/6","labels_url":"https://api.github.com/repos/pygy/require.lua/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/pygy/require.lua/issues/6/comments","events_url":"https://api.github.com/repos/pygy/require.lua/issues/6/events","html_url":"https://github.com/pygy/require.lua/pull/6","id":109355579,"number":6,"title":"correctly handle module that only set package.loaded","user":{"login":"boucman","id":1793617,"avatar_url":"https://avatars.githubusercontent.com/u/1793617?v=3","gravatar_id":"","url":"https://api.github.com/users/boucman","html_url":"https://github.com/boucman","followers_url":"https://api.github.com/users/boucman/followers","following_url":"https://api.github.com/users/boucman/following{/other_user}","gists_url":"https://api.github.com/users/boucman/gists{/gist_id}","starred_url":"https://api.github.com/users/boucman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boucman/subscriptions","organizations_url":"https://api.github.com/users/boucman/orgs","repos_url":"https://api.github.com/users/boucman/repos","events_url":"https://api.github.com/users/boucman/events{/privacy}","received_events_url":"https://api.github.com/users/boucman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-01T18:23:43Z","updated_at":"2015-11-03T08:52:09Z","closed_at":"2015-11-01T00:44:50Z","pull_request":{"url":"https://api.github.com/repos/pygy/require.lua/pulls/6","html_url":"https://github.com/pygy/require.lua/pull/6","diff_url":"https://github.com/pygy/require.lua/pull/6.diff","patch_url":"https://github.com/pygy/require.lua/pull/6.patch"},"body":"running these two scripts yield different results\r\n(these assume you have luasec installed, apt-get install lua-sec under debian)\r\n```lua\r\nprint(require(\"ssl.https\"))\r\n```\r\nwill print table: 0x25ef070 (or similar)\r\n```lua\r\nrequire = require(\"require\").require\r\nprint(require(\"ssl.https\"))\r\n```\r\nwill print nil\r\n\r\n\r\nThis is because ssl.https uses the \"module\" function and that function sets package.loaded[\"ssl.https\"] which, in turn, means the function doesn't have to return anything.\r\n\r\nAccording to lua documentation (and the way the original require works) this is a legal thing to do and require should return the value of package.loaded[\"ssl.https\"] in that case\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pygy/require.lua/issues/comments/153289993","html_url":"https://github.com/pygy/require.lua/pull/6#issuecomment-153289993","issue_url":"https://api.github.com/repos/pygy/require.lua/issues/6","id":153289993,"user":{"login":"tst2005","id":1117821,"avatar_url":"https://avatars.githubusercontent.com/u/1117821?v=3","gravatar_id":"","url":"https://api.github.com/users/tst2005","html_url":"https://github.com/tst2005","followers_url":"https://api.github.com/users/tst2005/followers","following_url":"https://api.github.com/users/tst2005/following{/other_user}","gists_url":"https://api.github.com/users/tst2005/gists{/gist_id}","starred_url":"https://api.github.com/users/tst2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tst2005/subscriptions","organizations_url":"https://api.github.com/users/tst2005/orgs","repos_url":"https://api.github.com/users/tst2005/repos","events_url":"https://api.github.com/users/tst2005/events{/privacy}","received_events_url":"https://api.github.com/users/tst2005/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T08:52:09Z","updated_at":"2015-11-03T08:52:09Z","body":"@pygy ok, see https://github.com/pygy/require.lua/pull/7"}}