John Varady
03/01/2022, 5:10 PMwritedump(isObject(url.get('bogus')));
returns YES
--- shouldn't it return NO
for undefined
?Tim
03/01/2022, 5:19 PMbdw429s
03/01/2022, 5:25 PMisObject(javaCast('null',''))
It seems isObject()
returns true
when passed a null
.bdw429s
03/01/2022, 5:25 PMbdw429s
03/01/2022, 5:27 PMurl
scope? in CF 2018, the url
scope is an instance of the coldfusion.filter.UrlScope
class, so when you call get()
you're just calling an undocumented method on that java class.Tim
03/01/2022, 5:27 PMwriteDump(isObject(StructGet("url.bogus")))
does return false.bdw429s
03/01/2022, 5:27 PMStructGet("url.bogus")
returns a structTim
03/01/2022, 5:27 PMbdw429s
03/01/2022, 5:27 PMAdam Cameron
bdw429s
03/01/2022, 5:28 PMAdam Cameron
get
method is a method of the underlying URL scope implementationAdam Cameron
Tim
03/01/2022, 5:28 PMkeyExists
works. Accessing vai struct notation works.bdw429s
03/01/2022, 5:29 PMTim
03/01/2022, 5:29 PMAdam Cameron
keyExists
method. This is just... OOPAdam Cameron
class UrlImpl implements Structish {}
And I am guessing the initial scope implementation has its own get method alreadyAdam Cameron
Adam Cameron
Adam Cameron
Tim
03/01/2022, 5:34 PMScope implements Structish
, they could maybe go all the way, and Scope implements Struct
and save us all a lot having to remember exceptions.Adam Cameron
Tim
03/01/2022, 5:35 PMAdam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
Adam Cameron
Mark Takata (Adobe)
03/01/2022, 5:39 PMAdam Cameron
isObject
returns true
for null
?Adam Cameron
Adam Cameron
Adam Cameron
Mark Takata (Adobe)
03/01/2022, 5:41 PMMark Takata (Adobe)
03/01/2022, 5:41 PMMark Takata (Adobe)
03/01/2022, 5:41 PMMark Takata (Adobe)
03/01/2022, 5:42 PMMark Takata (Adobe)
03/01/2022, 5:42 PMbdw429s
03/01/2022, 5:51 PMisObject( javacast('null','') )
is still returning YES
when passed a null.bdw429s
03/01/2022, 5:51 PMbdw429s
03/01/2022, 5:52 PMbdw429s
03/01/2022, 5:53 PM/**
* returns if object is a CFML object
*
* @param o Object to check
* @return is or not
*/
public static boolean isObject(Object o) {
return isComponent(o)
|| (!isArray(o) && !isQuery(o) && !isSimpleValue(o) && !isStruct(o) && !isUserDefinedFunction(o) && !isXML(o));
}
bdw429s
03/01/2022, 5:54 PMbdw429s
03/01/2022, 5:54 PMbdw429s
03/01/2022, 5:55 PMbdw429s
03/01/2022, 5:57 PMAdam Cameron
we probably scare him off...)So polite of you to say "we" there, Brad.
bdw429s
03/01/2022, 6:02 PMAdam Cameron
Mark Takata (Adobe)
03/01/2022, 6:04 PMJohn Varady
03/01/2022, 6:35 PMAdam Cameron
Adam Cameron
aliaspooryorik