Ok, I had a thought. I realize that all your replies and tests are using the cfscript style of coding, where my style is the original cfml. So I wrote 2 tests:
Thanks for pointing this out. This is another thing different from OpenBlueDragon. I can send a number string via cfinvokeargument and with the type=“numeric” it converts it to a number.
I do not know if this is a bug in Lucee or not. Why does the cfscript return it properly, but not the cfml?
I took my above test 1 step further since you noted this. and sent
<cfscript>
obj= createObject("component","cfc.old");
a = invoke( obj, "testNumbers", {tStr="a string to test", tNum=1234});
writeDump(a);
</cfscript>
And that returns as number. So why what makes calling cfinvoke different from invoke()? Should they not act the same?
That looks like indeed a bug, generally speaking, Lucee only checks that an argument can be cast to the specified type, it doesn’t actually convert the type (less GC! faster code, ymmv, except with primitive types).
But there are edge cases and this is one.
With Lucee 7 we recently fixed cfproperty to preserve types and allow complex types as default, previously everything was being converted to strings
So now for the fun stuff, if you have java support enabled in your vs code, you can drag the lucee generated bytecode classes from cfclasses into vscode and it will automatically decode the bytecode into java.
Yeah, I never jumped onto the cfscript bus when it drove by. It is something I am going to be getting into, as I like the cleaner code look and javascript style. The slow take up is a lack of time to get into cfscript.
As for vscode, I use sublime text 4. But I may look into vscode some day.