Comments (8)
Do have you sample code to illustrate that this is a bug?
from ofxlua.
Yes, but it is embedded in a large project, so it is not very practical to send you this.
But for instance try ofxLua::isFuction on a function in a table. Without the suggested modification you will end up in the ofLogWarning part, when the requested name in reality is a function. If you want, I can create a small example. Only not now, but later this day.
from ofxlua.
I ask because I don't completely understand the Lua stack api 100%, so I'm curious why this is an issue as it seems to work fine. I also noticed it also seems to work fine if I change all calls within the else statement to LUA_STACK_TOP-1.
from ofxlua.
Ok, later this day I'll try to send you a little example. But it boils down to this. The lua_getfield pushes the object on the stack that you want to test if it is a object with the requested type or not. The line after that, you want to test if the previous top of the stack is a table. But you test the current top, not the previous one.
from ofxlua.
I se the issue using the read test script in luaExample and the following:
// check if testing existence within a table works
lua.pushTable("atable");
ofLogNotice() << "is atable.afunction a function?: " << lua.isFunction("afunction");
lua.popTable();
from ofxlua.
Let me now if you find any other stack issues like this as I imagine there might be another somewhere.
from ofxlua.
Thanks for the correction, I'll keep you informed if I come across other issues.
from ofxlua.
This fix is also merged into the number
branch.
from ofxlua.
Related Issues (20)
- ofBindings.cpp not compiling anymore on linux, HOT 5
- Cannot build ofxLua on Android Studio HOT 4
- How to call OF functions that take pointer argument HOT 3
- ofFboSettings ignored? HOT 2
- Cannot include "glm/gtc/functions.hpp" in OF 0.11.0 HOT 8
- ofxLua projects compiled for debugging crashes on start HOT 10
- Problem adding vertex to mesh HOT 4
- error getting unique faces from 3D primitive HOT 3
- Compile error on pi3b+ ofxLuaBindings HOT 11
- bad swig reference? HOT 1
- example not compiling on linux debian buster HOT 13
- Semantic issue: ofxLuaBindings.cpp No viable overloaded '=' HOT 15
- getErrorMessage() is not defined anymore HOT 4
- fails to compile on Arch (Manjaro) due to Boost version? HOT 1
- Compile Error on ofxLuaFileWriter.cpp ofToDataPath() HOT 1
- of::filesystem::path HOT 11
- ostringstream instead of stringstream HOT 4
- wrap oF 0.12 additions
- luaL_openlibs() does work with ofxLua but not with ofxOfelia since the update to Lua 5.4.6
- luaExample Visual Studio getAsTimespec() HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxlua.