curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler

Home Page:https://h5.rocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

+= string concatenation failing with struct to class property concat

Ali1Jamal opened this issue · comments

Hello
i saw this issues in bridge.net and try to run it on h5 In fact, the problem also exists in h5.
here is the sample :
Expected: Animal Farm
Actual: Animal

using System;
using H5;
using H5.Core;
using static H5.Core.es5;
using static H5.Core.dom;
using Console = System.Console;

namespace h5
{
    public struct Book
    {
        public string Title;
    }
    public class Delivery
    {
        public Book[] Books;
    }
    class Program
    {
        static void Main(string[] args)
        {

            {
                var delivery = new Delivery();
                delivery.Books = new Book[1];
                delivery.Books[0] = new Book();

                delivery.Books[0].Title = "Animal";
                delivery.Books[0].Title += " Farm";

                // Expected: Animal Farm
                // Actual:   Animal
                Console.Log(delivery.Books[0].Title);
            }
        }
    }
}


Is it possible to workaround it with delivery.Books[0].Title = delivery.Books[0].Title + " Farm";?

Is it possible to workaround it with delivery.Books[0].Title = delivery.Books[0].Title + " Farm";?

yes its work.
But the code problem must be solved ....to make h5 more stable.. and to make developers focus on bringing Modern c# features to h5

Is it possible to workaround it with delivery.Books[0].Title = delivery.Books[0].Title + " Farm";?

yes its work.
But the code problem must be solved ....to make h5 more stable.. and to make developers focus on bringing Modern c# features to h5

I am sure it is not single issue with Bridge.Net which should be fixed in H5. Bridge has tons of issues.

Most buggy component for me is still DateTime.

Is it possible to workaround it with delivery.Books[0].Title = delivery.Books[0].Title + " Farm";?

yes its work.
But the code problem must be solved ....to make h5 more stable.. and to make developers focus on bringing Modern c# features to h5

I am sure it is not single issue with Bridge.Net which should be fixed in H5. Bridge has tons of issues.

Most buggy component for me is still DateTime.

yes i search in bridge.net issues to see the clear and important issues then test the code in h5 if the code have issues then i open issues in h5...
I see some complaints about DataTime can you open issues Or give me examples of problems because I haven't tried it before, maybe I can fix some problems or try to reduce them

can you open issues Or give me examples of problems because I haven't tried it before, maybe I can fix some problems or try to reduce them

All my opened issues and not solved by bridge:

https://github.com/bridgedotnet/Bridge/issues/created_by/hardhub

Probably we can copy at least "defect issues" into H5 repo.

Yes you can transfer the problems because they seem important.
I'm actually trying to understand how h5 or bridge.net does some of its components works because many of them are JavaScript codes and get called by c# so its a mess in the bridge.js
I think we should help each other outside github by using whatsapp or telegram until we solve these problems because I don't think one person (@theolivenbaum )is able to solve all bridge.net problems

Yes you can transfer the problems because they seem important.
I'm actually trying to understand how h5 or bridge.net does some of its components works because many of them are JavaScript codes and get called by c# so its a mess in the bridge.js
I think we should help each other outside github by using whatsapp or telegram until we solve these problems because I don't think one person (@theolivenbaum )is able to solve all bridge.net problems

As I know gitter is available https://gitter.im/curiosityai/h5

@Ali1Jamal the easiest is to create a blank h5 project with the code you want to test, and run H5.Compiler from within Visual Studio (or whatever IDE you're using), but targeting your project. As an example (this on VS2022)

image

@Ali1Jamal the easiest is to create a blank h5 project with the code you want to test, and run H5.Compiler from within Visual Studio (or whatever IDE you're using), but targeting your project. As an example (this on VS2022)

image

I have no complaints about test codes .
But thanks for mentioning this.