bennyxqg / lua-alchemy

Automatically exported from code.google.com/p/lua-alchemy
0 stars 0 forks source link

lua_wrapper.gg(162): dirty state stack #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Can we call lua.doString inside another lua.doString call? 

Tried to call lua.doString("as3.enable_sugar_autoconversion()\r\n" + 
scriptChild.getScript()); inside the function call of 
lua.doString("as3.enable_sugar_autoconversion()\r\n" + 
scriptParent.getScript()); but no success.

What is the expected output? What do you see instead?

Both parent and child script should be executed successfully.

However, the following error shown up:
Lua error:
lua_wrapper.gg(162): dirty state stack
{5} -nil - `nil'
[4] - number - `3'
[3] - string - `Update'
[2] - string - `showDetailForm'
[1] - userdata - `userdata: 0x126254'

stack traceback:
    [C]: in function 'old_fn'
    builtin://lua_alchemy/as3/sugar.lua:227: in function 'call'
    builtin://lua_alchemy/as3/sugar.lua:129: in function 'showDetailForm'
    luaDoString:6: in main chunk

What version of the product are you using? On what operating system?

Windows XP + falsh-builder 4.5 + blackberry playbook SDK 1.1.1 + 
lua-alchemy-0.3.swc

Please provide any additional information below.

Original issue reported on code.google.com by jxyi...@yahoo.ca on 8 Nov 2011 at 4:41

GoogleCodeExporter commented 9 years ago
That's a bug in need of fixing, thank you for reporting.

But why would you want to do that? There is a loadstring() function in Lua, if 
you want to load some generated code.

Original comment by aglad...@gmail.com on 12 Nov 2011 at 12:40

GoogleCodeExporter commented 9 years ago
Thanks for your response. Could you let me know when will be the ETA for the 
fixing? 

I will also give loastring a shot.

Btw, do you know how can I implement "stop and wait" during the lua script 
execution. For example, in lua script, I want to show an Actionscript dialog 
box, and based on user's selection (Yes/No) to continue the next step, but I do 
not know how to implement this with lua-alchemy.

Thanks

Original comment by jxyi...@yahoo.ca on 14 Nov 2011 at 2:37

GoogleCodeExporter commented 9 years ago
No ETA, sorry, unless someone contributes the patch or sponsors this fix. I 
believe that loadstring is sufficient for your problem. (If not — please 
explain more details in the mailing list: 
https://groups.google.com/group/lua-alchemy-dev I will try to help you)

About stop and wait — sorry, this is offtopic for this ticket. Please post a 
question to the mailing list and I'll help.

Original comment by aglad...@gmail.com on 14 Nov 2011 at 11:38

GoogleCodeExporter commented 9 years ago
Could you please let us know what will be the cost for getting this issue 
addressed? please send an email to: yliu@seregon.com

Thanks.

Original comment by jxyi...@gmail.com on 28 Jan 2012 at 1:45

GoogleCodeExporter commented 9 years ago

Original comment by aglad...@gmail.com on 6 Feb 2012 at 11:33

GoogleCodeExporter commented 9 years ago
NB: Details on this issue: 
https://groups.google.com/group/lua-alchemy-dev/browse_thread/thread/55a496a5ac3
58d8f

Original comment by aglad...@gmail.com on 20 Feb 2012 at 12:14

GoogleCodeExporter commented 9 years ago
Note, BTW, that it is sufficient to call as3.enable_sugar_autoconversion() once 
per state (i.e. per lua variable in your example), no need to call it in each 
doString(). (This should not cause this error, of course.)

Original comment by aglad...@gmail.com on 20 Feb 2012 at 12:18

GoogleCodeExporter commented 9 years ago
Note also that doString is deprecated. You should use doStringAsync instead.

Original comment by aglad...@gmail.com on 25 Feb 2012 at 1:47

GoogleCodeExporter commented 9 years ago
To clarify: following comment 8 wouldn't fix the bug. But you should not use 
deprecated functions anyway.

Original comment by aglad...@gmail.com on 25 Feb 2012 at 4:10

GoogleCodeExporter commented 9 years ago
Hmm. Actually, hold the code conversion to the doStringAsync. Maybe I found a 
bug there.

Original comment by aglad...@gmail.com on 25 Feb 2012 at 6:00

GoogleCodeExporter commented 9 years ago
OK, reentrant doStringAsync crashes horribly if used incorrectly, so do not 
call it from Lua — disregard comment 8, in your case you should stick with 
doString. (I will code a protection from accidental calls.)

Original comment by aglad...@gmail.com on 25 Feb 2012 at 6:11