[TIMOB-18214] (3_5_X) Checks for additional scalar types

Cherry Pick PR #6497 into 3_5_X

Fixes [TIMOB-18214](https://jira.appcelerator.org/browse/TIMOB-18214)