fix nim js cmp fails at CT (#16473)
This commit is contained in:
parent
4cf605dcf6
commit
3f9a2ebea5
4 changed files with 49 additions and 24 deletions
|
|
@ -340,7 +340,12 @@ proc cmpStrings(a, b: string): int {.asmNoStackFrame, compilerproc.} =
|
|||
"""
|
||||
|
||||
proc cmp(x, y: string): int =
|
||||
return cmpStrings(x, y)
|
||||
when nimvm:
|
||||
if x == y: result = 0
|
||||
elif x < y: result = -1
|
||||
else: result = 1
|
||||
else:
|
||||
result = cmpStrings(x, y)
|
||||
|
||||
proc eqStrings(a, b: string): bool {.asmNoStackFrame, compilerproc.} =
|
||||
asm """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue