{"action":"closed","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/860","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/860/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/860/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/860/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/860","id":122931322,"number":860,"title":"dofile() doesn't works if file name become from variable","user":{"login":"pastukhov","id":3490616,"avatar_url":"https://avatars.githubusercontent.com/u/3490616?v=3","gravatar_id":"","url":"https://api.github.com/users/pastukhov","html_url":"https://github.com/pastukhov","followers_url":"https://api.github.com/users/pastukhov/followers","following_url":"https://api.github.com/users/pastukhov/following{/other_user}","gists_url":"https://api.github.com/users/pastukhov/gists{/gist_id}","starred_url":"https://api.github.com/users/pastukhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pastukhov/subscriptions","organizations_url":"https://api.github.com/users/pastukhov/orgs","repos_url":"https://api.github.com/users/pastukhov/repos","events_url":"https://api.github.com/users/pastukhov/events{/privacy}","received_events_url":"https://api.github.com/users/pastukhov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-18T11:25:45Z","updated_at":"2015-12-18T11:30:32Z","closed_at":"2015-12-18T11:30:32Z","body":"Hi!\r\nI'm trying to make some dofile() wraper : \r\n```lua\r\nfunction dolc(filename,data)\r\n    if  file.open(filename..'.lua') then\r\n        file.close()\r\n        print('Compiling:', filename..'.lua')\r\n        node.compile(filename..'.lua')\r\n        file.remove(filename..'.lua')\r\n        dofile(filename .. '.lc')(data)\r\n    elseif file.open(filename..'.lc') then\r\n        file.close()\r\n        dofile(filename .. '.lc')(data)\r\n    else\r\n        print('Can`t find '..filename.. ' to exec')\r\n    end\r\nend\r\n```\r\nBut i'm getting \r\n```\r\ninit.lua:10: attempt to call a nil value\r\nstack traceback:\r\n\tinit.lua:10: in function 'dolc'\r\n\tinit.lua:32: in main chunk\r\n\t[C]: in function 'dofile'\r\n\tstdin:1: in main chunk\r\n```\r\nLine 10 is ```dofile(filename .. '.lc')(data)```\r\nand 32 : ```dolc('splash')```\r\nIs it dofile() bug or my code problem?"}}