Timob 12159: Backport 3_0_X: TIMOB-11654 

https://jira.appcelerator.org/browse/TIMOB-12159
Test case in https://jira.appcelerator.org/browse/TIMOB-11654