sonygod / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Incorrect compiled code when calling method with cyrillic parameter. #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Problem:

This code

  factory = new Factory();
  var label1 = factory.CreateLabel(FormTableType.Toolbar);
  var label2 = factory.CreateLabel(FormTableType.фарма);

compiled js

  factory = new SharpKitTestLib.Factory.ctor();
  var label1=factory.CreateLabel$$FormTableType(SharpKitTestLib.FormTableType.Toolbar);
  var label2=factory.CreateLabel(this.SharpKitTestLib.FormTableType.фарма);

Problem in label2. Incorrect compiled code when calling method with cyrillic 
parameter.
Solution in attachment.

Original issue reported on code.google.com by antonkud...@gmail.com on 28 Feb 2012 at 11:27

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

I'm not sure what is the desired behavior in this case, I can see that SharpKit 
has generated the exact name from your code, what would you wish that would 
happen?

Original comment by DanelK...@gmail.com on 29 Feb 2012 at 10:12

GoogleCodeExporter commented 9 years ago
factory doesn't have CreateLabel method.
label1 is compiled correctly, but label2 is wrong.
I think should be compiled
  var label2=factory.CreateLabel$$FormTableType(SharpKitTestLib.FormTableType.фарма);

Original comment by antonkud...@gmail.com on 29 Feb 2012 at 10:39

GoogleCodeExporter commented 9 years ago
You're right, SharpKit's parser wasn't able to parse this line correctly 
because of the cyrillic identifier name. I will check this out, in any case I 
highly recommend against foreign language identifier naming.

Original comment by DanelK...@gmail.com on 29 Feb 2012 at 11:36

GoogleCodeExporter commented 9 years ago

Original comment by yvan.rod...@gmail.com on 12 Jan 2013 at 11:50