Created
January 4, 2011 20:20
-
-
Save probablycorey/765346 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function runString_debug(s, d) | |
| local u,v=loadstring(s) | |
| if (v~=nil) then | |
| print(v) | |
| else | |
| -- Set up a debug hook. | |
| if d==1 then | |
| local function callb() | |
| print("called callb") | |
| error() | |
| end | |
| debug.sethook(callb,"l") | |
| end | |
| print "DOES THE CODE EVER GET HERE?" | |
| local status, err=pcall(u) | |
| print(status) | |
| print(err) | |
| end | |
| end | |
| runString_debug("for i=1,10 do print(i) end", 1) | |
| print "DOES IT GET HERE?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment