The recursive function would be nice if it was self contained instead of trying to create a "private" function in JS. ROSLIB.Ros.prototype.decodeTypeDefs should have a base case to make this possible so that only that function exists. Also, be sure to see the comment on camel cased variables.