Fix CopyStr (substr in system.nim) for javascript target
Merge pull request #1485 from def-/js-substr

Fix CopyStr (substr in system.nim) for javascript target