diff options
-rw-r--r-- | compiler/jsgen.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 3bbb22745..8f1f8a832 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -192,8 +192,9 @@ proc mangleName(s: PSym; target: TTarget): Rope = x.add("HEX" & toHex(ord(c), 2)) inc i result = rope(x) - add(result, "_") - add(result, rope(s.id)) + if s.name.s != "this": + add(result, "_") + add(result, rope(s.id)) s.loc.r = result proc escapeJSString(s: string): string = |