Announcement

Collapse
No announcement yet.

[CLOSED] [#393] [1.9.0] StringComparison Issue

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#393] [1.9.0] StringComparison Issue

    I've come across what looks like a bug with the support for string comparisons, in v1.8 the following code fails to compile with the following error:

    using System;
    using Bridge.Html5;
    
    namespace BridgeTest
    {
    
        public class App
        {
            [Ready]
            public static void Main()
            {
                string a = "testa";
                string b = "testa";
                bool result = a.Equals(b, StringComparison.InvariantCultureIgnoreCase);
                Global.Alert(result.ToString());
            }
        }
    }
    error CS0176: Member 'object.Equals(object, object)' cannot be accessed with an instance reference; qualify it with a type name instead
    With the latest code, it now compiles however the generated code is not correct:
    /* global Bridge */
    
    Bridge.define('BridgeTest.App', {
        statics: {
            config: {
                init: function () {
                    Bridge.ready(this.main);
                }
            },
            main: function () {
                var a = "testa";
                var b = "testa";
                var result = Bridge.equals(b, 3);
                Bridge.global.alert(result.toString());
            }
        }
    });
    As you can see variable b is being compared to the StringComparison.InvariantCultureIgnoreCase enum value rather than variable a.

    #2
    Thanks for reporting this defect. I have logged the issue and we will implement a fix right away.

    https://github.com/bridgedotnet/Bridge/issues/393

    We'll keep this thread updated with our progress.

    Comment


      #3
      The issue has been fixed. It will be included in 1.9.0 release.

      Comment


        #4
        Awesome, thanks for the great support guys.

        Comment

        Working...
        X