diff options
author | Hans Raaf <hara@oderwat.de> | 2016-03-06 00:59:27 +0100 |
---|---|---|
committer | Hans Raaf <hara@oderwat.de> | 2016-03-06 01:03:00 +0100 |
commit | 8c1dd215ac4f47657db5c26f04c9d2b37aa9980d (patch) | |
tree | 454ba08768fc6418ea6ccffcc3ceb6666e52f803 | |
parent | b02e31e409d032849553089016e77bbdf11afef3 (diff) | |
download | Nim-8c1dd215ac4f47657db5c26f04c9d2b37aa9980d.tar.gz |
Fix for PHP mnewString()
-rw-r--r-- | lib/system/jssys.nim | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim index c96f2f958..1b98883b9 100644 --- a/lib/system/jssys.nim +++ b/lib/system/jssys.nim @@ -263,9 +263,7 @@ proc toJSStr(s: string): cstring {.asmNoStackFrame, compilerproc.} = proc mnewString(len: int): string {.asmNoStackFrame, compilerproc.} = when defined(nimphp): asm """ - $result = array(); - for($i = 0; $i < `len`; $i++) $result[] = chr(0); - return $result; + return str_repeat(chr(0),`len`); """ else: asm """ |