summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-02-26 23:50:34 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-02-26 23:50:34 +0100
commit6d2fd0c9f17016ee9ae5f8c337445ff958cba2f0 (patch)
treeaa545c55d52b96326ba7b62358f61824feb2cf82
parent983f6d53cafd1ba88cc91fb221ce7ffb0f1ce53f (diff)
downloadNim-6d2fd0c9f17016ee9ae5f8c337445ff958cba2f0.tar.gz
php codegen: name mangling bugfix
-rw-r--r--compiler/jsgen.nim5
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 =