Dictionary.Key.ToArray changes the direction

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Dictionary.Key.ToArray changes the direction

Postby CyborgDE » Sun Oct 25, 2015 9:30 am

Hello,

the function ToArray changes the direction under javascript (since 5.1) :

Code: Select all

                Dictionary<string, object> test = new Dictionary<string, object>();
                test.Add("sender", "sender");
                test.Add("e", "e");

                var array = test.Keys.ToArray();

Result under windows : sender, e
Result under java : e,sender

Regards,
Uwe

CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Re: Dictionary.Key.ToArray changes the direction

Postby CyborgDE » Sun Oct 25, 2015 12:24 pm

Quick workaround in JSIL.Core.js

Code: Select all

JSIL.ObjectHashCode = function (obj, virtualCall, thisType) {
  var type = typeof obj;

  //if (type === "object" || type == "string") {
    //if (obj.GetHashCode && virtualCall)
  if (type === "object") {
    if (obj.GetHashCode)
      return (obj.GetHashCode() | 0);   
    if (!virtualCall && thisType.__PublicInterface__.prototype.GetHashCode)
      return (thisType.__PublicInterface__.prototype.GetHashCode.call(obj) | 0);   
    return JSIL.HashCodeInternal(obj);
  } else {
    // FIXME: Not an integer. Gross.
    return String(obj);
  }
};

Regards,
Uwe


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 29 guests

 

 

cron