From 6d2fd0c9f17016ee9ae5f8c337445ff958cba2f0 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 26 Feb 2016 23:50:34 +0100 Subject: [PATCH] php codegen: name mangling bugfix --- compiler/jsgen.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 3bbb227454..8f1f8a8320 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 =