Merge pull request #1551 from pandamicro/develop

Refactor #3985: arguments length check replaced by undefined check