CMS-4560 Fix object to JS conversion in scripting.