This function has several flaws which I think I've solved. I think that with a little more work I can eliminate it entirely as json_encode() should be used whenever possible.
Fixed several flaws in JHTMLBehavior::_getJSObject:
1) fullScreen was used whenever !is_null($array['fullScreen']) (in otherwords, even if set to false)
2) if $array contained keys 'fullScreen' and 'size', the result was invalid js
3) JSON keys not quoted (possible unexpected behavior)
Removed trailing whitespace
I changed my mind about removing it entirely. There are too many cases of things being passed with the \ prefix. That practice would need to be deprecated first. It could, perhaps, be purged from all Joomla code but there's no way to know if 3rd parties are making use of it.
In any case, it does not affect this patch as the \ behavior is still supported here.
Why would we remove the use of \? The whole reason that method exists is to support data types beyond those that are handled by JSON.
In my opinion, there are better ways to support types such as functions while letting json_encode take care of whatever it possibly can. But I suppose the \ solution is one that has worked well and maybe shouldn't be changed.
Good cleanup. If you can rebase it so that it merges cleanly I'll get it merged in this weekend. Thanks a bunch Elijah.
Sorry, I'm on Japan time. It'll have to wait till Monday.
Merge pull request #1473 from elinw/patch-10
Fix a grammar mistake in a comment
cleanup for merge