Automatic deref for everything but pointers in asm/emit (#8891)
Fixes #7249
This commit is contained in:
parent
c033ff990a
commit
af1e84f54d
5 changed files with 42 additions and 10 deletions
|
|
@ -2741,12 +2741,12 @@ type
|
|||
when defined(JS):
|
||||
proc add*(x: var string, y: cstring) {.asmNoStackFrame.} =
|
||||
asm """
|
||||
var len = `x`[0].length-1;
|
||||
var len = `x`.length-1;
|
||||
for (var i = 0; i < `y`.length; ++i) {
|
||||
`x`[0][len] = `y`.charCodeAt(i);
|
||||
`x`[len] = `y`.charCodeAt(i);
|
||||
++len;
|
||||
}
|
||||
`x`[0][len] = 0
|
||||
`x`[len] = 0
|
||||
"""
|
||||
proc add*(x: var cstring, y: cstring) {.magic: "AppendStrStr".}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue