Please do not use “type” as a function parameter name…like:
function Map:getObjectsWithType(type)
as this will hide the system function type() within the scope of that function, which could lead to obscure bugs or crashes.
I just got bitten when I tried to add an extra test like if(type(ob==“string”) inside one of those functions, and it took me a while to figure out what was wrong and started seriously to doubt my own sanity before I finally found it… not sure about my sanity, but I am sure about the recommended best practice
The following function currently use type as a function parameter:
function Map:getObjectsWithType(type)
function Map:firePropertyListener(property, type, object)
function ObjectLayer:getObject(name, type)
function ObjectLayer:getObjects(name, type)
function ObjectLayer:getObjectsOfType(type)
Maybe use “atype” instead of “type” (?)
-FrankS
[import]uid: 8093 topic_id: 7427 reply_id: 307427[/import]